summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-11-30 19:17:23 -0500
committermidipix <writeonce@midipix.org>2016-11-30 19:17:23 -0500
commit12bebb7780b8bef12565337ad4dca4da80b02f79 (patch)
tree5435c3c37c065c64a1bf1372982dddcf4be7d930
parentc34a35179e922620229413cb9eb0f18cfc33076e (diff)
downloadpemagine-12bebb7780b8bef12565337ad4dca4da80b02f79.tar.bz2
pemagine-12bebb7780b8bef12565337ad4dca4da80b02f79.tar.xz
struct pe_raw_coff_file_hdr: member name normalization.
-rw-r--r--include/pemagine/pe_structs.h16
-rw-r--r--src/headers/pe_get_image_coff_hdr_addr.c8
-rw-r--r--src/headers/pe_get_image_section_tbl_addr.c8
3 files changed, 16 insertions, 16 deletions
diff --git a/include/pemagine/pe_structs.h b/include/pemagine/pe_structs.h
index 7ca8a75..93f6815 100644
--- a/include/pemagine/pe_structs.h
+++ b/include/pemagine/pe_structs.h
@@ -29,14 +29,14 @@ struct pe_raw_image_dos_hdr {
struct pe_raw_coff_file_hdr {
- unsigned char signature [0x04]; /* 0x00 */
- unsigned char machine [0x02]; /* 0x04 */
- unsigned char num_of_sections [0x02]; /* 0x06 */
- unsigned char time_date_stamp [0x04]; /* 0x08 */
- unsigned char ptr_to_sym_tbl [0x04]; /* 0x0c */
- unsigned char num_of_syms [0x04]; /* 0x10 */
- unsigned char size_of_opt_hdr [0x02]; /* 0x14 */
- unsigned char characteristics [0x02]; /* 0x16 */
+ unsigned char cfh_signature [0x04]; /* 0x00 */
+ unsigned char cfh_machine [0x02]; /* 0x04 */
+ unsigned char cfh_num_of_sections [0x02]; /* 0x06 */
+ unsigned char cfh_time_date_stamp [0x04]; /* 0x08 */
+ unsigned char cfh_ptr_to_sym_tbl [0x04]; /* 0x0c */
+ unsigned char cfh_num_of_syms [0x04]; /* 0x10 */
+ unsigned char cfh_size_of_opt_hdr [0x02]; /* 0x14 */
+ unsigned char cfh_characteristics [0x02]; /* 0x16 */
};
diff --git a/src/headers/pe_get_image_coff_hdr_addr.c b/src/headers/pe_get_image_coff_hdr_addr.c
index 8da5f8c..a4d6711 100644
--- a/src/headers/pe_get_image_coff_hdr_addr.c
+++ b/src/headers/pe_get_image_coff_hdr_addr.c
@@ -22,9 +22,9 @@ struct pe_raw_coff_file_hdr * pe_get_image_coff_hdr_addr(const void * base)
offset = (uint32_t *)(dos->dos_lfanew);
coff = (struct pe_raw_coff_file_hdr *)pe_va_from_rva(base,*offset);
- return ((coff->signature[0] == 'P')
- && (coff->signature[1] == 'E')
- && (coff->signature[2] == '\0')
- && (coff->signature[3] == '\0'))
+ return ((coff->cfh_signature[0] == 'P')
+ && (coff->cfh_signature[1] == 'E')
+ && (coff->cfh_signature[2] == '\0')
+ && (coff->cfh_signature[3] == '\0'))
? coff : 0;
}
diff --git a/src/headers/pe_get_image_section_tbl_addr.c b/src/headers/pe_get_image_section_tbl_addr.c
index 9fb3969..3eb8188 100644
--- a/src/headers/pe_get_image_section_tbl_addr.c
+++ b/src/headers/pe_get_image_section_tbl_addr.c
@@ -24,8 +24,8 @@ struct pe_raw_sec_hdr * pe_get_image_section_tbl_addr(const void * base)
return 0;
mark = opt->opt_hdr_32.magic;
- mark += coff->size_of_opt_hdr[1] << 8;
- mark += coff->size_of_opt_hdr[0];
+ mark += coff->cfh_size_of_opt_hdr[1] << 8;
+ mark += coff->cfh_size_of_opt_hdr[0];
return (struct pe_raw_sec_hdr *)mark;
}
@@ -47,8 +47,8 @@ struct pe_raw_sec_hdr * pe_get_image_named_section_addr(const void * base, const
if (!(coff = pe_get_image_coff_hdr_addr(base)))
return 0;
- count = coff->num_of_sections[1] << 8;
- count += coff->num_of_sections[0];
+ count = coff->cfh_num_of_sections[1] << 8;
+ count += coff->cfh_num_of_sections[0];
if ((len = pe_impl_strlen_ansi(name)) > 8) {
/* todo: long name support */