diff options
author | midipix <writeonce@midipix.org> | 2016-12-01 08:09:09 -0500 |
---|---|---|
committer | midipix <writeonce@midipix.org> | 2016-12-01 08:09:09 -0500 |
commit | 560637679904e16dbc1c6b899a4dd55a77e7bb33 (patch) | |
tree | ac47d0be16a08e264c6bba7d3f426e681f98b9b9 /src/exports | |
parent | 234d23d13af110517ce9e386eb2389ab1a1c1d85 (diff) | |
download | pemagine-560637679904e16dbc1c6b899a4dd55a77e7bb33.tar.bz2 pemagine-560637679904e16dbc1c6b899a4dd55a77e7bb33.tar.xz |
struct pe_raw_export_hdr: member name normalization.
Diffstat (limited to 'src/exports')
-rw-r--r-- | src/exports/pe_enum_image_exports.c | 10 | ||||
-rw-r--r-- | src/exports/pe_get_export_symbol_info.c | 14 |
2 files changed, 12 insertions, 12 deletions
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)); |