summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/perk/perk.h2
-rw-r--r--include/perk/perk_meta.h6
-rw-r--r--include/perk/perk_structs.h2
-rw-r--r--src/logic/pe_get_image_meta.c4
-rw-r--r--src/reader/pe_read_import_header.c4
5 files changed, 9 insertions, 9 deletions
diff --git a/include/perk/perk.h b/include/perk/perk.h
index a6ef8ec..81d396d 100644
--- a/include/perk/perk.h
+++ b/include/perk/perk.h
@@ -206,7 +206,7 @@ perk_api int pe_read_import_header (const struct pe_import_hdr *, struct pe_me
perk_api int pe_read_coff_symbol (const struct pe_coff_symbol *, struct pe_meta_coff_symbol *,
const struct pe_meta_coff_file_hdr *, void * base);
-perk_api int pe_read_import_lookup (const union pe_import_lookup_item *, struct pe_meta_import_lookup_item *,
+perk_api int pe_read_import_lookup (const union pe_import_lookup *, struct pe_meta_import_lookup *,
uint32_t magic);
#ifdef __cplusplus
diff --git a/include/perk/perk_meta.h b/include/perk/perk_meta.h
index 68e722b..ea55b51 100644
--- a/include/perk/perk_meta.h
+++ b/include/perk/perk_meta.h
@@ -220,7 +220,7 @@ union pe_meta_export_addr_tbl {
/* image: import table entry lookup item */
-struct pe_meta_import_lookup_item {
+struct pe_meta_import_lookup {
union {
uint64_t import_lookup_entry_64;
uint32_t import_lookup_entry_32;
@@ -243,8 +243,8 @@ struct pe_meta_import_hdr {
uint32_t import_addr_tbl_rva;
uint32_t count;
char * name;
- struct pe_meta_import_lookup_item * items;
- union pe_import_lookup_item * aitems;
+ struct pe_meta_import_lookup * items;
+ union pe_import_lookup * aitems;
};
diff --git a/include/perk/perk_structs.h b/include/perk/perk_structs.h
index 64c83b0..1eaf8a7 100644
--- a/include/perk/perk_structs.h
+++ b/include/perk/perk_structs.h
@@ -264,7 +264,7 @@ union pe_raw_export_addr_tbl {
};
-union pe_import_lookup_item {
+union pe_import_lookup {
unsigned char import_lookup_entry_64 [0x08]; /* 0x00 */
unsigned char import_lookup_entry_32 [0x04]; /* 0x00 */
unsigned char hint_name_tbl_rva [0x04]; /* 0x00 */
diff --git a/src/logic/pe_get_image_meta.c b/src/logic/pe_get_image_meta.c
index a722550..0a8de47 100644
--- a/src/logic/pe_get_image_meta.c
+++ b/src/logic/pe_get_image_meta.c
@@ -243,7 +243,7 @@ int pe_get_image_meta(
/* .idata */
struct pe_import_hdr * pidata;
- union pe_import_lookup_item * pitem;
+ union pe_import_lookup * pitem;
i = pe_get_named_section_index(m,".idata");
s = pe_get_block_section_index(m,&m->opt.dirs.import_tbl);
@@ -278,7 +278,7 @@ int pe_get_image_meta(
+ m->idata[i].name_rva - m->hidata->virtual_addr;
if (m->idata[i].import_lookup_tbl_rva)
- m->idata[i].aitems = (union pe_import_lookup_item *)(base + m->hidata->ptr_to_raw_data
+ m->idata[i].aitems = (union pe_import_lookup *)(base + m->hidata->ptr_to_raw_data
+ m->idata[i].import_lookup_tbl_rva - m->hidata->virtual_addr);
/* items */
diff --git a/src/reader/pe_read_import_header.c b/src/reader/pe_read_import_header.c
index 7616cff..e656185 100644
--- a/src/reader/pe_read_import_header.c
+++ b/src/reader/pe_read_import_header.c
@@ -25,8 +25,8 @@ int pe_read_import_header(const struct pe_import_hdr * p, struct pe_meta_import_
}
int pe_read_import_lookup(
- const union pe_import_lookup_item * p,
- struct pe_meta_import_lookup_item * m,
+ const union pe_import_lookup * p,
+ struct pe_meta_import_lookup * m,
uint32_t magic)
{
switch (magic) {