summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-11-19 14:49:53 -0500
committermidipix <writeonce@midipix.org>2016-11-19 14:49:53 -0500
commitfad23f9ed823120339761ffd251f2b1b2c3b2e45 (patch)
tree5c3d7cd2ff06b0b419cd04285889b65020c93818
parent945985cb313ada34d002423fbedfdebebcd22edc (diff)
downloadpemagine-fad23f9ed823120339761ffd251f2b1b2c3b2e45.tar.bz2
pemagine-fad23f9ed823120339761ffd251f2b1b2c3b2e45.tar.xz
PE format: union pe_opt_hdr [and friends] --> union pe_raw_opt_hdr.
-rw-r--r--include/pemagine/pe_structs.h22
-rw-r--r--include/pemagine/pemagine.h2
-rw-r--r--src/headers/pe_get_image_data_dirs_addr.c2
-rw-r--r--src/headers/pe_get_image_entry_point_addr.c2
-rw-r--r--src/headers/pe_get_image_opt_hdr_addr.c4
-rw-r--r--src/headers/pe_get_image_section_tbl_addr.c2
-rw-r--r--src/meta/pe_get_image_stack_heap_info.c2
7 files changed, 18 insertions, 18 deletions
diff --git a/include/pemagine/pe_structs.h b/include/pemagine/pe_structs.h
index 9bc8aee..3ad8f9d 100644
--- a/include/pemagine/pe_structs.h
+++ b/include/pemagine/pe_structs.h
@@ -40,7 +40,7 @@ struct pe_raw_coff_file_hdr {
};
-struct pe_opt_hdr_std {
+struct pe_raw_opt_hdr_std {
unsigned char magic [0x02]; /* 0x00 */
unsigned char major_linker_ver [0x01]; /* 0x02 */
unsigned char minor_linker_ver [0x01]; /* 0x03 */
@@ -51,12 +51,12 @@ struct pe_opt_hdr_std {
unsigned char base_of_code [0x04]; /* 0x14 */
};
-struct pe_opt_hdr_align {
+struct pe_raw_opt_hdr_align {
unsigned char section_align [0x04]; /* 0x20 */
unsigned char file_align [0x04]; /* 0x24 */
};
-struct pe_opt_hdr_vers {
+struct pe_raw_opt_hdr_vers {
unsigned char major_os_ver [0x02]; /* 0x28 */
unsigned char minor_os_ver [0x02]; /* 0x2a */
unsigned char major_image_ver [0x02]; /* 0x2c */
@@ -66,7 +66,7 @@ struct pe_opt_hdr_vers {
unsigned char win32_ver [0x04]; /* 0x34 */
};
-struct pe_opt_hdr_img {
+struct pe_raw_opt_hdr_img {
unsigned char size_of_image [0x04]; /* 0x38 */
unsigned char size_of_headers [0x04]; /* 0x3c */
unsigned char checksum [0x04]; /* 0x40 */
@@ -74,12 +74,12 @@ struct pe_opt_hdr_img {
unsigned char dll_characteristics [0x02]; /* 0x46 */
};
-struct pe_opt_hdr_ldr {
+struct pe_raw_opt_hdr_ldr {
unsigned char loader_flags [0x04];
unsigned char rva_and_sizes [0x04];
};
-struct pe_opt_hdr_dirs {
+struct pe_raw_opt_hdr_dirs {
unsigned char export_tbl [0x08];
unsigned char import_tbl [0x08];
unsigned char resource_tbl [0x08];
@@ -118,7 +118,7 @@ struct pe_data_dirs {
unsigned char reserved [0x08];
};
-struct pe_opt_hdr_32 {
+struct pe_raw_opt_hdr_32 {
unsigned char magic [0x02]; /* 0x00 */
unsigned char major_linker_ver [0x01]; /* 0x02 */
unsigned char minor_linker_ver [0x01]; /* 0x03 */
@@ -168,7 +168,7 @@ struct pe_opt_hdr_32 {
};
-struct pe_opt_hdr_64 {
+struct pe_raw_opt_hdr_64 {
unsigned char magic [0x02]; /* 0x00 */
unsigned char major_linker_ver [0x01]; /* 0x02 */
unsigned char minor_linker_ver [0x01]; /* 0x03 */
@@ -217,9 +217,9 @@ struct pe_opt_hdr_64 {
};
-union pe_opt_hdr {
- struct pe_opt_hdr_32 opt_hdr_32;
- struct pe_opt_hdr_64 opt_hdr_64;
+union pe_raw_opt_hdr {
+ struct pe_raw_opt_hdr_32 opt_hdr_32;
+ struct pe_raw_opt_hdr_64 opt_hdr_64;
};
diff --git a/include/pemagine/pemagine.h b/include/pemagine/pemagine.h
index bc3e4dc..47eb96a 100644
--- a/include/pemagine/pemagine.h
+++ b/include/pemagine/pemagine.h
@@ -154,7 +154,7 @@ typedef int pe_enum_image_import_hdrs_callback(
/* library functions */
pe_api struct pe_raw_image_dos_hdr * pe_get_image_dos_hdr_addr (const void * base);
pe_api struct pe_raw_coff_file_hdr * pe_get_image_coff_hdr_addr (const void * base);
-pe_api union pe_opt_hdr * pe_get_image_opt_hdr_addr (const void * base);
+pe_api union pe_raw_opt_hdr * pe_get_image_opt_hdr_addr (const void * base);
pe_api struct pe_data_dirs * pe_get_image_data_dirs_addr (const void * base);
pe_api struct pe_sec_hdr * pe_get_image_section_tbl_addr (const void * base);
pe_api struct pe_sec_hdr * pe_get_image_named_section_addr (const void * base, const char * name);
diff --git a/src/headers/pe_get_image_data_dirs_addr.c b/src/headers/pe_get_image_data_dirs_addr.c
index d0167c0..1edbdd3 100644
--- a/src/headers/pe_get_image_data_dirs_addr.c
+++ b/src/headers/pe_get_image_data_dirs_addr.c
@@ -13,7 +13,7 @@ pe_api
struct pe_data_dirs * pe_get_image_data_dirs_addr(const void * base)
{
uint16_t * magic;
- union pe_opt_hdr * hdr;
+ union pe_raw_opt_hdr * hdr;
if (!(hdr = pe_get_image_opt_hdr_addr(base)))
return 0;
diff --git a/src/headers/pe_get_image_entry_point_addr.c b/src/headers/pe_get_image_entry_point_addr.c
index 5869633..6f7bc90 100644
--- a/src/headers/pe_get_image_entry_point_addr.c
+++ b/src/headers/pe_get_image_entry_point_addr.c
@@ -14,7 +14,7 @@ pe_api
void * pe_get_image_entry_point_addr(const void * base)
{
uint16_t * magic;
- union pe_opt_hdr * hdr;
+ union pe_raw_opt_hdr * hdr;
uint32_t * rva;
if (!(hdr = pe_get_image_opt_hdr_addr(base)))
diff --git a/src/headers/pe_get_image_opt_hdr_addr.c b/src/headers/pe_get_image_opt_hdr_addr.c
index df3ec63..d784aed 100644
--- a/src/headers/pe_get_image_opt_hdr_addr.c
+++ b/src/headers/pe_get_image_opt_hdr_addr.c
@@ -9,12 +9,12 @@
#include <pemagine/pemagine.h>
pe_api
-union pe_opt_hdr * pe_get_image_opt_hdr_addr(const void * base)
+union pe_raw_opt_hdr * pe_get_image_opt_hdr_addr(const void * base)
{
struct pe_raw_coff_file_hdr * coff;
if (!(coff = pe_get_image_coff_hdr_addr(base)))
return 0;
else
- return (union pe_opt_hdr *)pe_va_from_rva(coff, sizeof(*coff));
+ return (union pe_raw_opt_hdr *)pe_va_from_rva(coff, sizeof(*coff));
}
diff --git a/src/headers/pe_get_image_section_tbl_addr.c b/src/headers/pe_get_image_section_tbl_addr.c
index 52e24d0..bbab5a2 100644
--- a/src/headers/pe_get_image_section_tbl_addr.c
+++ b/src/headers/pe_get_image_section_tbl_addr.c
@@ -14,7 +14,7 @@ pe_api
struct pe_sec_hdr * pe_get_image_section_tbl_addr (const void * base)
{
struct pe_raw_coff_file_hdr * coff;
- union pe_opt_hdr * opt;
+ union pe_raw_opt_hdr * opt;
if (!(coff = pe_get_image_coff_hdr_addr(base)))
return 0;
diff --git a/src/meta/pe_get_image_stack_heap_info.c b/src/meta/pe_get_image_stack_heap_info.c
index ec1aba9..922682d 100644
--- a/src/meta/pe_get_image_stack_heap_info.c
+++ b/src/meta/pe_get_image_stack_heap_info.c
@@ -13,7 +13,7 @@ pe_api
int pe_get_image_stack_heap_info(const void * base, struct pe_stack_heap_info * stack_heap_info)
{
uint16_t * magic;
- union pe_opt_hdr * hdr;
+ union pe_raw_opt_hdr * hdr;
if (!(hdr = pe_get_image_opt_hdr_addr(base)))
return 0;