summaryrefslogtreecommitdiff
path: root/src/logic
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-11-29 19:30:23 -0500
committermidipix <writeonce@midipix.org>2016-11-10 23:35:29 -0500
commit7d4d3d88474a3ca002d2649094b92de63f184691 (patch)
tree64d9a30ccc1b0b1b96b43a8d946d5b0332c7d5e2 /src/logic
parenta02166cbb8f11a7c422f2069a4f4b0fe03b11a17 (diff)
downloadperk-7d4d3d88474a3ca002d2649094b92de63f184691.tar.bz2
perk-7d4d3d88474a3ca002d2649094b92de63f184691.tar.xz
perk_structs.h: rewrite cleanly; redefine pe_import_lookup_item as a union.
Diffstat (limited to 'src/logic')
-rw-r--r--src/logic/pe_get_image_meta.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/logic/pe_get_image_meta.c b/src/logic/pe_get_image_meta.c
index 9dd0481..6d90b37 100644
--- a/src/logic/pe_get_image_meta.c
+++ b/src/logic/pe_get_image_meta.c
@@ -105,7 +105,7 @@ int pe_get_image_meta(const struct pe_raw_image * image, struct pe_image_meta **
/* .idata */
struct pe_import_hdr * pidata;
- struct pe_import_lookup_item * pitem;
+ union pe_import_lookup_item * pitem;
i = pe_get_named_section_index(m,".idata");
s = pe_get_block_section_index(m,&m->opt.dirs.import_tbl);
@@ -137,13 +137,13 @@ int pe_get_image_meta(const struct pe_raw_image * image, struct pe_image_meta **
+ m->idata[i].name_rva - m->hidata->virtual_addr;
if (m->idata[i].import_lookup_tbl_rva)
- m->idata[i].aitems = (struct pe_import_lookup_item *)(base + m->hidata->ptr_to_raw_data
+ m->idata[i].aitems = (union pe_import_lookup_item *)(base + m->hidata->ptr_to_raw_data
+ m->idata[i].import_lookup_tbl_rva - m->hidata->virtual_addr);
/* items */
m->idata[i].count = 0;
if (m->idata[i].import_lookup_tbl_rva) {
- for (pitem=m->idata[i].aitems; *(uint32_t *)pitem->u.hint_name_tbl_rva; pitem++)
+ for (pitem=m->idata[i].aitems; *(uint32_t *)pitem->hint_name_tbl_rva; pitem++)
m->idata[i].count++;
if (!(m->idata[i].items = calloc(m->idata[i].count,sizeof(*(m->idata[i].items)))))