summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/reader/pe_read_import_header.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/reader/pe_read_import_header.c b/src/reader/pe_read_import_header.c
index 14dbf39..645a375 100644
--- a/src/reader/pe_read_import_header.c
+++ b/src/reader/pe_read_import_header.c
@@ -4,27 +4,27 @@
/* Released under GPLv2 and GPLv3; see COPYING.PERK. */
/***************************************************************/
-#include <endian.h>
#include <string.h>
#include <perk/perk.h>
+#include "perk_endian_impl.h"
#include "perk_reader_impl.h"
int pe_read_import_header(const struct pe_import_hdr * p, struct pe_meta_import_hdr * m)
{
- #if (BYTE_ORDER == LITTLE_ENDIAN)
+ if (PERK_LITTLE_ENDIAN) {
- memcpy(m,p,sizeof(*p));
+ memcpy(m,p,sizeof(*p));
- #else
+ } else {
- m->import_lookup_tbl_rva = pe_read_long(p->import_lookup_tbl_rva);
- m->time_date_stamp = pe_read_long(p->time_date_stamp);
- m->forwarder_chain = pe_read_long(p->forwarder_chain);
- m->name_rva = pe_read_long(p->name_rva);
- m->import_addr_tbl_rva = pe_read_long(p->import_addr_tbl_rva);
+ m->import_lookup_tbl_rva = pe_read_long(p->import_lookup_tbl_rva);
+ m->time_date_stamp = pe_read_long(p->time_date_stamp);
+ m->forwarder_chain = pe_read_long(p->forwarder_chain);
+ m->name_rva = pe_read_long(p->name_rva);
+ m->import_addr_tbl_rva = pe_read_long(p->import_addr_tbl_rva);
- #endif
+ }
m->name = 0;
m->aitems = 0;