diff options
-rw-r--r-- | include/perk/perk_meta.h | 4 | ||||
-rw-r--r-- | src/logic/pe_get_image_meta.c | 6 | ||||
-rw-r--r-- | src/reader/pe_read_optional_header.c | 4 |
3 files changed, 7 insertions, 7 deletions
diff --git a/include/perk/perk_meta.h b/include/perk/perk_meta.h index 22f8468..c83fbfd 100644 --- a/include/perk/perk_meta.h +++ b/include/perk/perk_meta.h @@ -40,8 +40,8 @@ enum pe_framework { /* generic block info / image directory header */ struct pe_block { - uint32_t rva; - uint32_t size; + uint32_t dh_rva; + uint32_t dh_size; }; diff --git a/src/logic/pe_get_image_meta.c b/src/logic/pe_get_image_meta.c index 8d0747e..f3c0dac 100644 --- a/src/logic/pe_get_image_meta.c +++ b/src/logic/pe_get_image_meta.c @@ -52,7 +52,7 @@ int pe_get_block_section_index(const struct pe_image_meta * m, const struct pe_b low = m->sectbl[i].virtual_addr; high = low + m->sectbl[i].virtual_size; - if ((block->rva >= low) && (block->rva + block->size <= high)) + if ((block->dh_rva >= low) && (block->dh_rva + block->dh_size <= high)) return i; } @@ -230,7 +230,7 @@ int pe_get_image_meta( if (s >= 0) { m->hedata = &m->sectbl[s]; m->aedata = (struct pe_raw_export_hdr *)(base + m->sectbl[s].ptr_to_raw_data - + m->opt.dirs.export_tbl.rva - m->sectbl[s].virtual_addr); + + m->opt.dirs.export_tbl.dh_rva - m->sectbl[s].virtual_addr); } else if (i >= 0) { m->hedata = &m->sectbl[i]; m->aedata = (struct pe_raw_export_hdr *)(base + m->sectbl[i].ptr_to_raw_data); @@ -255,7 +255,7 @@ int pe_get_image_meta( if (s >= 0) { m->hidata = &m->sectbl[s]; m->aidata = (struct pe_raw_import_hdr *)(base + m->sectbl[s].ptr_to_raw_data - + m->opt.dirs.import_tbl.rva - m->sectbl[s].virtual_addr); + + m->opt.dirs.import_tbl.dh_rva - m->sectbl[s].virtual_addr); } else if (i >= 0) { m->hidata = &m->sectbl[i]; m->aidata = (struct pe_raw_import_hdr *)(base + m->sectbl[i].ptr_to_raw_data); diff --git a/src/reader/pe_read_optional_header.c b/src/reader/pe_read_optional_header.c index 22d9321..1b32d95 100644 --- a/src/reader/pe_read_optional_header.c +++ b/src/reader/pe_read_optional_header.c @@ -92,8 +92,8 @@ static int pe_read_optional_header_structs(const union pe_raw_opt_hdr * p, struc pdir = &m->dirs.export_tbl; for (i=0; i<m->ldr.coh_rva_and_sizes; i++) { - pdir[i].rva = pe_read_long(&mark[i*8]); - pdir[i].size = pe_read_long(&mark[i*8+4]); + pdir[i].dh_rva = pe_read_long(&mark[i*8]); + pdir[i].dh_size = pe_read_long(&mark[i*8+4]); } return 0; |