summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/perk/perk_meta.h16
-rw-r--r--include/perk/perk_structs.h16
-rw-r--r--src/info/pe_get_image_abi.c2
-rw-r--r--src/logic/pe_get_image_meta.c4
-rw-r--r--src/reader/pe_read_optional_header.c20
5 files changed, 29 insertions, 29 deletions
diff --git a/include/perk/perk_meta.h b/include/perk/perk_meta.h
index 1f2c2cf..3ba97aa 100644
--- a/include/perk/perk_meta.h
+++ b/include/perk/perk_meta.h
@@ -86,14 +86,14 @@ struct pe_meta_coff_file_hdr {
/* image optional header */
struct pe_meta_opt_hdr_std {
- uint16_t magic;
- uint8_t major_linker_ver;
- uint8_t minor_linker_ver;
- uint32_t size_of_code;
- uint32_t size_of_initialized_data;
- uint32_t size_of_uninitialized_data;
- uint32_t entry_point;
- uint32_t base_of_code;
+ uint16_t coh_magic;
+ uint8_t coh_major_linker_ver;
+ uint8_t coh_minor_linker_ver;
+ uint32_t coh_size_of_code;
+ uint32_t coh_size_of_inited_data;
+ uint32_t coh_size_of_uninited_data;
+ uint32_t coh_entry_point;
+ uint32_t coh_base_of_code;
};
struct pe_meta_opt_hdr_vers {
diff --git a/include/perk/perk_structs.h b/include/perk/perk_structs.h
index 692c4ab..b81f831 100644
--- a/include/perk/perk_structs.h
+++ b/include/perk/perk_structs.h
@@ -41,14 +41,14 @@ struct pe_raw_coff_file_hdr {
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 */
- unsigned char size_of_code [0x04]; /* 0x04 */
- unsigned char size_of_initialized_data [0x04]; /* 0x08 */
- unsigned char size_of_uninitialized_data [0x04]; /* 0x0c */
- unsigned char entry_point [0x04]; /* 0x10 */
- unsigned char base_of_code [0x04]; /* 0x14 */
+ unsigned char coh_magic [0x02]; /* 0x00 */
+ unsigned char coh_major_linker_ver [0x01]; /* 0x02 */
+ unsigned char coh_minor_linker_ver [0x01]; /* 0x03 */
+ unsigned char coh_size_of_code [0x04]; /* 0x04 */
+ unsigned char coh_size_of_inited_data [0x04]; /* 0x08 */
+ unsigned char coh_size_of_uninited_data [0x04]; /* 0x0c */
+ unsigned char coh_entry_point [0x04]; /* 0x10 */
+ unsigned char coh_base_of_code [0x04]; /* 0x14 */
};
struct pe_raw_opt_hdr_align {
diff --git a/src/info/pe_get_image_abi.c b/src/info/pe_get_image_abi.c
index 0c13276..665469a 100644
--- a/src/info/pe_get_image_abi.c
+++ b/src/info/pe_get_image_abi.c
@@ -19,7 +19,7 @@ int pe_get_image_abi(const struct pe_image_meta * m, struct pe_info_string * inf
{
int abi;
- switch (m->opt.std.magic) {
+ switch (m->opt.std.coh_magic) {
case PE_MAGIC_PE32:
abi = PE_ABI_PE32;
break;
diff --git a/src/logic/pe_get_image_meta.c b/src/logic/pe_get_image_meta.c
index bb461ff..8d0747e 100644
--- a/src/logic/pe_get_image_meta.c
+++ b/src/logic/pe_get_image_meta.c
@@ -301,11 +301,11 @@ int pe_get_image_meta(
if ((ret = pe_read_import_lookup(
&(m->idata[i].aitems[j]),
&(m->idata[i].items[j]),
- m->opt.std.magic)))
+ m->opt.std.coh_magic)))
return pe_free_image_meta_impl(
m,PERK_CUSTOM_ERROR(dctx,ret));
- switch (m->opt.std.magic) {
+ switch (m->opt.std.coh_magic) {
case PE_MAGIC_PE32:
m->idata[i].items[j].flags = m->idata[i].items[j].u.import_lookup_entry_32;
break;
diff --git a/src/reader/pe_read_optional_header.c b/src/reader/pe_read_optional_header.c
index 5ece6a3..b32dd6f 100644
--- a/src/reader/pe_read_optional_header.c
+++ b/src/reader/pe_read_optional_header.c
@@ -22,9 +22,9 @@ static int pe_read_optional_header_structs(const union pe_raw_opt_hdr * p, struc
struct pe_raw_opt_hdr_img * aimg;
struct pe_raw_opt_hdr_ldr * aldr;
- m->std.magic = pe_read_short(p->opt_hdr_32.magic);
+ m->std.coh_magic = pe_read_short(p->opt_hdr_32.magic);
- switch (m->std.magic) {
+ switch (m->std.coh_magic) {
case PE_MAGIC_PE32:
astd = (struct pe_raw_opt_hdr_std *)p;
avers = (struct pe_raw_opt_hdr_vers *)&p->opt_hdr_32.major_os_ver;
@@ -46,14 +46,14 @@ static int pe_read_optional_header_structs(const union pe_raw_opt_hdr * p, struc
}
/* std */
- m->std.major_linker_ver = astd->major_linker_ver[0];
- m->std.minor_linker_ver = astd->minor_linker_ver[0];
+ m->std.coh_major_linker_ver = astd->coh_major_linker_ver[0];
+ m->std.coh_minor_linker_ver = astd->coh_minor_linker_ver[0];
- m->std.size_of_code = pe_read_long(astd->size_of_code);
- m->std.size_of_initialized_data = pe_read_long(astd->size_of_initialized_data);
- m->std.size_of_uninitialized_data = pe_read_long(astd->size_of_uninitialized_data);
- m->std.entry_point = pe_read_long(astd->entry_point);
- m->std.base_of_code = pe_read_long(astd->base_of_code);
+ m->std.coh_size_of_code = pe_read_long(astd->coh_size_of_code);
+ m->std.coh_size_of_inited_data = pe_read_long(astd->coh_size_of_inited_data);
+ m->std.coh_size_of_uninited_data = pe_read_long(astd->coh_size_of_uninited_data);
+ m->std.coh_entry_point = pe_read_long(astd->coh_entry_point);
+ m->std.coh_base_of_code = pe_read_long(astd->coh_base_of_code);
/* vers */
m->vers.major_os_ver = pe_read_short(avers->major_os_ver);
@@ -106,7 +106,7 @@ int pe_read_optional_header(const union pe_raw_opt_hdr * p, struct pe_meta_opt_h
if ((ret = pe_read_optional_header_structs(p,m)))
return ret;
- switch (m->std.magic) {
+ switch (m->std.coh_magic) {
case PE_MAGIC_PE32:
m->mem.base_of_data = pe_read_long(p->opt_hdr_32.base_of_data);
m->mem.image_base = pe_read_long(p->opt_hdr_32.image_base);