From 234d23d13af110517ce9e386eb2389ab1a1c1d85 Mon Sep 17 00:00:00 2001 From: midipix Date: Thu, 1 Dec 2016 07:59:15 -0500 Subject: struct pe_raw_sec_hdr: member name normalization. --- include/pemagine/pe_structs.h | 20 ++++++++++---------- src/headers/pe_get_image_section_tbl_addr.c | 2 +- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/pemagine/pe_structs.h b/include/pemagine/pe_structs.h index ad8a7a8..e965b6e 100644 --- a/include/pemagine/pe_structs.h +++ b/include/pemagine/pe_structs.h @@ -230,16 +230,16 @@ struct pe_raw_image_data_dir { struct pe_raw_sec_hdr { - unsigned char name [0x08]; /* 0x00 */ - unsigned char virtual_size [0x04]; /* 0x08 */ - unsigned char virtual_addr [0x04]; /* 0x0c */ - unsigned char size_of_raw_data [0x04]; /* 0x10 */ - unsigned char ptr_to_raw_data [0x04]; /* 0x14 */ - unsigned char ptr_to_relocs [0x04]; /* 0x18 */ - unsigned char ptr_to_line_nums [0x04]; /* 0x1c */ - unsigned char num_of_relocs [0x02]; /* 0x20 */ - unsigned char num_of_line_nums [0x02]; /* 0x22 */ - unsigned char characteristics [0x04]; /* 0x24 */ + unsigned char sh_name [0x08]; /* 0x00 */ + unsigned char sh_virtual_size [0x04]; /* 0x08 */ + unsigned char sh_virtual_addr [0x04]; /* 0x0c */ + unsigned char sh_size_of_raw_data [0x04]; /* 0x10 */ + unsigned char sh_ptr_to_raw_data [0x04]; /* 0x14 */ + unsigned char sh_ptr_to_relocs [0x04]; /* 0x18 */ + unsigned char sh_ptr_to_line_nums [0x04]; /* 0x1c */ + unsigned char sh_num_of_relocs [0x02]; /* 0x20 */ + unsigned char sh_num_of_line_nums [0x02]; /* 0x22 */ + unsigned char sh_characteristics [0x04]; /* 0x24 */ }; diff --git a/src/headers/pe_get_image_section_tbl_addr.c b/src/headers/pe_get_image_section_tbl_addr.c index 92a2f78..98420de 100644 --- a/src/headers/pe_get_image_section_tbl_addr.c +++ b/src/headers/pe_get_image_section_tbl_addr.c @@ -61,7 +61,7 @@ struct pe_raw_sec_hdr * pe_get_image_named_section_addr(const void * base, const ch[pos] = name[pos]; for (; count; hdr++,count--) - if (*(uint64_t *)hdr->name == sname) + if (*(uint64_t *)hdr->sh_name == sname) return hdr; } -- cgit v1.2.3