summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-11-30 20:07:30 -0500
committermidipix <writeonce@midipix.org>2016-11-30 20:07:30 -0500
commit01f3704beb76ac3d8597b7dac2f01d53a5e6e538 (patch)
treeb3e416260f685185513dc3e3edeae7ca8cb86593
parentb6ce09976af9f8fe50846806296d4c2b7fccda10 (diff)
downloadperk-01f3704beb76ac3d8597b7dac2f01d53a5e6e538.tar.bz2
perk-01f3704beb76ac3d8597b7dac2f01d53a5e6e538.tar.xz
struct pe_{raw|meta}_opt_hdr_ldr: member name normalization.
-rw-r--r--include/perk/perk_meta.h4
-rw-r--r--include/perk/perk_structs.h4
-rw-r--r--src/reader/pe_read_optional_header.c10
3 files changed, 9 insertions, 9 deletions
diff --git a/include/perk/perk_meta.h b/include/perk/perk_meta.h
index 4acb5dd..22f8468 100644
--- a/include/perk/perk_meta.h
+++ b/include/perk/perk_meta.h
@@ -120,8 +120,8 @@ struct pe_meta_opt_hdr_img {
};
struct pe_meta_opt_hdr_ldr {
- uint32_t loader_flags;
- uint32_t rva_and_sizes;
+ uint32_t coh_loader_flags;
+ uint32_t coh_rva_and_sizes;
};
struct pe_meta_opt_hdr_dirs {
diff --git a/include/perk/perk_structs.h b/include/perk/perk_structs.h
index c520da3..1503a8a 100644
--- a/include/perk/perk_structs.h
+++ b/include/perk/perk_structs.h
@@ -75,8 +75,8 @@ struct pe_raw_opt_hdr_img {
};
struct pe_raw_opt_hdr_ldr {
- unsigned char loader_flags [0x04];
- unsigned char rva_and_sizes [0x04];
+ unsigned char coh_loader_flags [0x04];
+ unsigned char coh_rva_and_sizes [0x04];
};
struct pe_raw_opt_hdr_dirs {
diff --git a/src/reader/pe_read_optional_header.c b/src/reader/pe_read_optional_header.c
index 148dc2d..22d9321 100644
--- a/src/reader/pe_read_optional_header.c
+++ b/src/reader/pe_read_optional_header.c
@@ -78,20 +78,20 @@ static int pe_read_optional_header_structs(const union pe_raw_opt_hdr * p, struc
m->img.coh_dll_characteristics = pe_read_short(aimg->coh_dll_characteristics);
/* ldr */
- m->ldr.loader_flags = pe_read_long(aldr->loader_flags);
- m->ldr.rva_and_sizes = pe_read_long(aldr->rva_and_sizes);
+ m->ldr.coh_loader_flags = pe_read_long(aldr->coh_loader_flags);
+ m->ldr.coh_rva_and_sizes = pe_read_long(aldr->coh_rva_and_sizes);
/* dirs */
- if (m->ldr.rva_and_sizes > 0x10)
+ if (m->ldr.coh_rva_and_sizes > 0x10)
return PERK_ERR_BAD_IMAGE_TYPE;
- if (m->ldr.rva_and_sizes < 0x10)
+ if (m->ldr.coh_rva_and_sizes < 0x10)
memset(&m->dirs,0,sizeof(m->dirs));
mark = p->opt_hdr_64.export_tbl;
pdir = &m->dirs.export_tbl;
- for (i=0; i<m->ldr.rva_and_sizes; i++) {
+ 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]);
}