summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/pemagine/pe_structs.h22
-rw-r--r--src/exports/pe_enum_image_exports.c10
-rw-r--r--src/exports/pe_get_export_symbol_info.c14
3 files changed, 23 insertions, 23 deletions
diff --git a/include/pemagine/pe_structs.h b/include/pemagine/pe_structs.h
index e965b6e..17e5676 100644
--- a/include/pemagine/pe_structs.h
+++ b/include/pemagine/pe_structs.h
@@ -244,17 +244,17 @@ struct pe_raw_sec_hdr {
struct pe_raw_export_hdr {
- unsigned char export_flags [0x04]; /* 0x00 */
- unsigned char time_date_stamp [0x04]; /* 0x04 */
- unsigned char major_ver [0x02]; /* 0x08 */
- unsigned char minor_ver [0x02]; /* 0x0a */
- unsigned char name_rva [0x04]; /* 0x0c */
- unsigned char ordinal_base [0x04]; /* 0x10 */
- unsigned char addr_tbl_entries [0x04]; /* 0x14 */
- unsigned char num_of_name_ptrs [0x04]; /* 0x18 */
- unsigned char export_addr_tbl_rva [0x04]; /* 0x1c */
- unsigned char name_ptr_rva [0x04]; /* 0x20 */
- unsigned char ordinal_tbl_rva [0x04]; /* 0x24 */
+ unsigned char eh_export_flags [0x04]; /* 0x00 */
+ unsigned char eh_time_date_stamp [0x04]; /* 0x04 */
+ unsigned char eh_major_ver [0x02]; /* 0x08 */
+ unsigned char eh_minor_ver [0x02]; /* 0x0a */
+ unsigned char eh_name_rva [0x04]; /* 0x0c */
+ unsigned char eh_ordinal_base [0x04]; /* 0x10 */
+ unsigned char eh_addr_tbl_entries [0x04]; /* 0x14 */
+ unsigned char eh_num_of_name_ptrs [0x04]; /* 0x18 */
+ unsigned char eh_export_addr_tbl_rva [0x04]; /* 0x1c */
+ unsigned char eh_name_ptr_rva [0x04]; /* 0x20 */
+ unsigned char eh_ordinal_tbl_rva [0x04]; /* 0x24 */
};
diff --git a/src/exports/pe_enum_image_exports.c b/src/exports/pe_enum_image_exports.c
index 695a358..42db1cd 100644
--- a/src/exports/pe_enum_image_exports.c
+++ b/src/exports/pe_enum_image_exports.c
@@ -29,20 +29,20 @@ int pe_enum_image_exports(
return -1;
}
- offset = (uint32_t *)(exp_hdr->export_addr_tbl_rva);
+ offset = (uint32_t *)(exp_hdr->eh_export_addr_tbl_rva);
fn_addr = (uint32_t *)pe_va_from_rva(base,*offset);
- offset = (uint32_t *)(exp_hdr->name_ptr_rva);
+ offset = (uint32_t *)(exp_hdr->eh_name_ptr_rva);
fn_names = (uint32_t *)pe_va_from_rva(base,*offset);
- offset = (uint32_t *)(exp_hdr->ordinal_tbl_rva);
+ offset = (uint32_t *)(exp_hdr->eh_ordinal_tbl_rva);
fn_ordinals = (uint16_t *)pe_va_from_rva(base,*offset);
if ((ret = callback(base,exp_hdr,0,PE_CALLBACK_REASON_INIT,ctx)) <= 0)
return ret;
- count = (uint32_t *)exp_hdr->num_of_name_ptrs;
- sym->ordinal_base = (uint32_t *)exp_hdr->ordinal_base;
+ count = (uint32_t *)exp_hdr->eh_num_of_name_ptrs;
+ sym->ordinal_base = (uint32_t *)exp_hdr->eh_ordinal_base;
for (idx=0; idx<*count; idx++) {
offset = (uint32_t *)pe_va_from_rva(fn_names,idx*sizeof(uint32_t));
diff --git a/src/exports/pe_get_export_symbol_info.c b/src/exports/pe_get_export_symbol_info.c
index d5aa60f..fee44f9 100644
--- a/src/exports/pe_get_export_symbol_info.c
+++ b/src/exports/pe_get_export_symbol_info.c
@@ -57,22 +57,22 @@ int pe_get_export_symbol_info(
return -1;
sec_addr_cap = pe_va_from_rva(exp_hdr,sec_size);
- rva_offset = (uint32_t *)(exp_hdr->export_addr_tbl_rva);
+ rva_offset = (uint32_t *)(exp_hdr->eh_export_addr_tbl_rva);
fn_addr = (uint32_t *)pe_va_from_rva(base,*rva_offset);
- rva_offset = (uint32_t *)(exp_hdr->name_ptr_rva);
+ rva_offset = (uint32_t *)(exp_hdr->eh_name_ptr_rva);
fn_names = (uint32_t *)pe_va_from_rva(base,*rva_offset);
- rva_offset = (uint32_t *)(exp_hdr->ordinal_tbl_rva);
+ rva_offset = (uint32_t *)(exp_hdr->eh_ordinal_tbl_rva);
fn_ordinals = (uint16_t *)pe_va_from_rva(base,*rva_offset);
- addr_entries = (uint32_t *)exp_hdr->addr_tbl_entries;
- name_entries = (uint32_t *)exp_hdr->num_of_name_ptrs;
+ addr_entries = (uint32_t *)exp_hdr->eh_addr_tbl_entries;
+ name_entries = (uint32_t *)exp_hdr->eh_num_of_name_ptrs;
/* by ordinal? */
if ((intptr_t)name < 0x10000) {
- sym->ordinal_base = (uint32_t *)exp_hdr->ordinal_base;
+ sym->ordinal_base = (uint32_t *)exp_hdr->eh_ordinal_base;
/* the array is zero-based, but ordinals are normally one-based... */
if (((intptr_t)name - *sym->ordinal_base + 1) > *addr_entries)
@@ -113,7 +113,7 @@ int pe_get_export_symbol_info(
}
if (match == len) {
- sym->ordinal_base = (uint32_t *)exp_hdr->ordinal_base;
+ sym->ordinal_base = (uint32_t *)exp_hdr->eh_ordinal_base;
sym->ordinal = (uint16_t *)pe_va_from_rva(fn_ordinals,idx*sizeof(uint16_t));
rva_offset = (uint32_t *)pe_va_from_rva(fn_addr,(*sym->ordinal)*sizeof(uint32_t));