summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-12-01 08:29:34 -0500
committermidipix <writeonce@midipix.org>2016-12-01 08:29:34 -0500
commitf845bd25e705125bb60762f9ac43fba1aaef1cdc (patch)
tree72bfc66d208e6835978bc6357c0a3b9b85ab3a7c
parent44d09635402c850ef7174626c119e1200eb7099a (diff)
downloadperk-f845bd25e705125bb60762f9ac43fba1aaef1cdc.tar.bz2
perk-f845bd25e705125bb60762f9ac43fba1aaef1cdc.tar.xz
{union|struct} pe_{raw|meta}_import_lookup: member name normalization.
-rw-r--r--include/perk/perk_meta.h14
-rw-r--r--include/perk/perk_structs.h8
-rw-r--r--src/logic/pe_get_image_meta.c14
-rw-r--r--src/output/pe_output_import_libraries.c4
-rw-r--r--src/reader/pe_read_import_header.c4
5 files changed, 22 insertions, 22 deletions
diff --git a/include/perk/perk_meta.h b/include/perk/perk_meta.h
index 26c811e..55d5fc4 100644
--- a/include/perk/perk_meta.h
+++ b/include/perk/perk_meta.h
@@ -222,15 +222,15 @@ union pe_meta_export_addr_tbl {
/* image: import table entry lookup item */
struct pe_meta_import_lookup {
union {
- uint64_t import_lookup_entry_64;
- uint32_t import_lookup_entry_32;
- uint32_t hint_name_tbl_rva;
- uint16_t ordinal_number;
+ uint64_t ii_import_lookup_entry_64;
+ uint32_t ii_import_lookup_entry_32;
+ uint32_t ii_hint_name_tbl_rva;
+ uint16_t ii_ordinal_number;
} u;
- uint32_t flags;
- uint16_t hint;
- char * name;
+ uint32_t ii_flags;
+ uint16_t ii_hint;
+ char * ii_name;
};
diff --git a/include/perk/perk_structs.h b/include/perk/perk_structs.h
index 28ac5a7..deb3adb 100644
--- a/include/perk/perk_structs.h
+++ b/include/perk/perk_structs.h
@@ -265,10 +265,10 @@ union pe_raw_export_addr_tbl {
union pe_raw_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 */
- unsigned char ordinal_number [0x02]; /* 0x00 */
+ unsigned char ii_import_lookup_entry_64 [0x08]; /* 0x00 */
+ unsigned char ii_import_lookup_entry_32 [0x04]; /* 0x00 */
+ unsigned char ii_hint_name_tbl_rva [0x04]; /* 0x00 */
+ unsigned char ii_ordinal_number [0x02]; /* 0x00 */
};
diff --git a/src/logic/pe_get_image_meta.c b/src/logic/pe_get_image_meta.c
index 9353ac4..7e0bbf2 100644
--- a/src/logic/pe_get_image_meta.c
+++ b/src/logic/pe_get_image_meta.c
@@ -287,9 +287,9 @@ int pe_get_image_meta(
if (m->idata[i].import_lookup_tbl_rva) {
pitem = m->idata[i].aitems;
- hint = (uint32_t *)pitem->hint_name_tbl_rva;
+ hint = (uint32_t *)pitem->ii_hint_name_tbl_rva;
- for (; *hint; hint=(uint32_t *)((++pitem)->hint_name_tbl_rva))
+ for (; *hint; hint=(uint32_t *)((++pitem)->ii_hint_name_tbl_rva))
m->idata[i].count++;
if (!(m->idata[i].items = calloc(m->idata[i].count,sizeof(*(m->idata[i].items)))))
@@ -307,20 +307,20 @@ int pe_get_image_meta(
switch (m->opt.oh_std.coh_magic) {
case PE_MAGIC_PE32:
- m->idata[i].items[j].flags = m->idata[i].items[j].u.import_lookup_entry_32;
+ m->idata[i].items[j].ii_flags = m->idata[i].items[j].u.ii_import_lookup_entry_32;
break;
case PE_MAGIC_PE32_PLUS:
- m->idata[i].items[j].flags = (m->idata[i].items[j].u.import_lookup_entry_64 >> 32);
+ m->idata[i].items[j].ii_flags = (m->idata[i].items[j].u.ii_import_lookup_entry_64 >> 32);
break;
}
- if (!m->idata[i].items[j].flags) {
+ if (!m->idata[i].items[j].ii_flags) {
struct pe_raw_hint_name_entry * pentry =
(struct pe_raw_hint_name_entry *)(base + m->hidata->sh_ptr_to_raw_data
- + m->idata[i].items[j].u.hint_name_tbl_rva - m->hidata->sh_virtual_addr);
+ + m->idata[i].items[j].u.ii_hint_name_tbl_rva - m->hidata->sh_virtual_addr);
- m->idata[i].items[j].name = (char *)pentry->name;
+ m->idata[i].items[j].ii_name = (char *)pentry->name;
}
}
}
diff --git a/src/output/pe_output_import_libraries.c b/src/output/pe_output_import_libraries.c
index 54b7b48..cf96005 100644
--- a/src/output/pe_output_import_libraries.c
+++ b/src/output/pe_output_import_libraries.c
@@ -65,10 +65,10 @@ int pe_output_import_libraries(
if (cctx->fmtflags & PERK_OUTPUT_IMPORT_SYMS)
for (j=0; j<m->idata[i].count; j++)
- if (m->idata[i].items[j].name)
+ if (m->idata[i].items[j].ii_name)
if ((pretty_implib_item(
cctx,
- m->idata[i].items[j].name,
+ m->idata[i].items[j].ii_name,
fout)) < 0)
return PERK_FILE_ERROR(dctx);
}
diff --git a/src/reader/pe_read_import_header.c b/src/reader/pe_read_import_header.c
index 624313b..ef2a4f1 100644
--- a/src/reader/pe_read_import_header.c
+++ b/src/reader/pe_read_import_header.c
@@ -31,11 +31,11 @@ int pe_read_import_lookup(
{
switch (magic) {
case PE_MAGIC_PE32:
- m->u.import_lookup_entry_64 = pe_read_long(p->import_lookup_entry_32);
+ m->u.ii_import_lookup_entry_64 = pe_read_long(p->ii_import_lookup_entry_32);
return 0;
case PE_MAGIC_PE32_PLUS:
- m->u.import_lookup_entry_64 = pe_read_quad(p->import_lookup_entry_64);
+ m->u.ii_import_lookup_entry_64 = pe_read_quad(p->ii_import_lookup_entry_64);
return 0;
default: