summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-11-30 23:08:42 -0500
committermidipix <writeonce@midipix.org>2016-11-30 23:08:42 -0500
commit0d33f17d7705249d28c30c32878cd1841cf88be4 (patch)
treefad404495919398f46844c342ab7b50ffe95ca78
parenta402c4942040e060c9572efd17759d275826771b (diff)
downloadperk-0d33f17d7705249d28c30c32878cd1841cf88be4.tar.bz2
perk-0d33f17d7705249d28c30c32878cd1841cf88be4.tar.xz
struct pe_{raw|meta}_opt_hdr_dirs: member name normalization.
-rw-r--r--include/perk/perk_meta.h32
-rw-r--r--include/perk/perk_structs.h32
-rw-r--r--src/logic/pe_get_image_meta.c8
-rw-r--r--src/reader/pe_read_optional_header.c2
4 files changed, 37 insertions, 37 deletions
diff --git a/include/perk/perk_meta.h b/include/perk/perk_meta.h
index c83fbfd..06974e2 100644
--- a/include/perk/perk_meta.h
+++ b/include/perk/perk_meta.h
@@ -125,22 +125,22 @@ struct pe_meta_opt_hdr_ldr {
};
struct pe_meta_opt_hdr_dirs {
- struct pe_block export_tbl;
- struct pe_block import_tbl;
- struct pe_block resource_tbl;
- struct pe_block exception_tbl;
- struct pe_block certificate_tbl;
- struct pe_block base_reloc_tbl;
- struct pe_block debug;
- struct pe_block arch;
- struct pe_block global_ptr;
- struct pe_block tls_tbl;
- struct pe_block load_config_tbl;
- struct pe_block bound_import;
- struct pe_block iat;
- struct pe_block delay_import_descriptor;
- struct pe_block clr_runtime_hdr;
- struct pe_block reserved;
+ struct pe_block coh_export_tbl;
+ struct pe_block coh_import_tbl;
+ struct pe_block coh_resource_tbl;
+ struct pe_block coh_exception_tbl;
+ struct pe_block coh_certificate_tbl;
+ struct pe_block coh_base_reloc_tbl;
+ struct pe_block coh_debug;
+ struct pe_block coh_arch;
+ struct pe_block coh_global_ptr;
+ struct pe_block coh_tls_tbl;
+ struct pe_block coh_load_config_tbl;
+ struct pe_block coh_bound_import;
+ struct pe_block coh_iat;
+ struct pe_block coh_delay_import_descriptor;
+ struct pe_block coh_clr_runtime_hdr;
+ struct pe_block coh_reserved;
};
struct pe_meta_opt_hdr_mem_32 {
diff --git a/include/perk/perk_structs.h b/include/perk/perk_structs.h
index 1503a8a..2d7d1de 100644
--- a/include/perk/perk_structs.h
+++ b/include/perk/perk_structs.h
@@ -80,22 +80,22 @@ struct pe_raw_opt_hdr_ldr {
};
struct pe_raw_opt_hdr_dirs {
- unsigned char export_tbl [0x08];
- unsigned char import_tbl [0x08];
- unsigned char resource_tbl [0x08];
- unsigned char exception_tbl [0x08];
- unsigned char certificate_tbl [0x08];
- unsigned char base_reloc_tbl [0x08];
- unsigned char debug [0x08];
- unsigned char arch [0x08];
- unsigned char global_ptr [0x08];
- unsigned char tls_tbl [0x08];
- unsigned char load_config_tbl [0x08];
- unsigned char bound_import [0x08];
- unsigned char iat [0x08];
- unsigned char delay_import_descriptor [0x08];
- unsigned char clr_runtime_hdr [0x08];
- unsigned char reserved [0x08];
+ unsigned char coh_export_tbl [0x08];
+ unsigned char coh_import_tbl [0x08];
+ unsigned char coh_resource_tbl [0x08];
+ unsigned char coh_exception_tbl [0x08];
+ unsigned char coh_certificate_tbl [0x08];
+ unsigned char coh_base_reloc_tbl [0x08];
+ unsigned char coh_debug [0x08];
+ unsigned char coh_arch [0x08];
+ unsigned char coh_global_ptr [0x08];
+ unsigned char coh_tls_tbl [0x08];
+ unsigned char coh_load_config_tbl [0x08];
+ unsigned char coh_bound_import [0x08];
+ unsigned char coh_iat [0x08];
+ unsigned char coh_delay_import_descriptor [0x08];
+ unsigned char coh_clr_runtime_hdr [0x08];
+ unsigned char coh_reserved [0x08];
};
struct pe_raw_data_dirs {
diff --git a/src/logic/pe_get_image_meta.c b/src/logic/pe_get_image_meta.c
index f3c0dac..d329727 100644
--- a/src/logic/pe_get_image_meta.c
+++ b/src/logic/pe_get_image_meta.c
@@ -221,7 +221,7 @@ int pe_get_image_meta(
/* .edata */
i = pe_get_named_section_index(m,".edata");
- s = pe_get_block_section_index(m,&m->opt.dirs.export_tbl);
+ s = pe_get_block_section_index(m,&m->opt.dirs.coh_export_tbl);
if ((i >= 0) && (i != s))
return pe_free_image_meta_impl(
@@ -230,7 +230,7 @@ int pe_get_image_meta(
if (s >= 0) {
m->hedata = &m->sectbl[s];
m->aedata = (struct pe_raw_export_hdr *)(base + m->sectbl[s].ptr_to_raw_data
- + m->opt.dirs.export_tbl.dh_rva - m->sectbl[s].virtual_addr);
+ + m->opt.dirs.coh_export_tbl.dh_rva - m->sectbl[s].virtual_addr);
} else if (i >= 0) {
m->hedata = &m->sectbl[i];
m->aedata = (struct pe_raw_export_hdr *)(base + m->sectbl[i].ptr_to_raw_data);
@@ -246,7 +246,7 @@ int pe_get_image_meta(
union pe_raw_import_lookup * pitem;
i = pe_get_named_section_index(m,".idata");
- s = pe_get_block_section_index(m,&m->opt.dirs.import_tbl);
+ s = pe_get_block_section_index(m,&m->opt.dirs.coh_import_tbl);
if ((i >= 0) && (i != s))
return pe_free_image_meta_impl(
@@ -255,7 +255,7 @@ int pe_get_image_meta(
if (s >= 0) {
m->hidata = &m->sectbl[s];
m->aidata = (struct pe_raw_import_hdr *)(base + m->sectbl[s].ptr_to_raw_data
- + m->opt.dirs.import_tbl.dh_rva - m->sectbl[s].virtual_addr);
+ + m->opt.dirs.coh_import_tbl.dh_rva - m->sectbl[s].virtual_addr);
} else if (i >= 0) {
m->hidata = &m->sectbl[i];
m->aidata = (struct pe_raw_import_hdr *)(base + m->sectbl[i].ptr_to_raw_data);
diff --git a/src/reader/pe_read_optional_header.c b/src/reader/pe_read_optional_header.c
index 1b32d95..0c6c302 100644
--- a/src/reader/pe_read_optional_header.c
+++ b/src/reader/pe_read_optional_header.c
@@ -89,7 +89,7 @@ static int pe_read_optional_header_structs(const union pe_raw_opt_hdr * p, struc
memset(&m->dirs,0,sizeof(m->dirs));
mark = p->opt_hdr_64.export_tbl;
- pdir = &m->dirs.export_tbl;
+ pdir = &m->dirs.coh_export_tbl;
for (i=0; i<m->ldr.coh_rva_and_sizes; i++) {
pdir[i].dh_rva = pe_read_long(&mark[i*8]);