summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-05-06 09:40:26 -0400
committermidipix <writeonce@midipix.org>2016-11-10 23:35:44 -0500
commitff23632ddaf5f3acc893f110cbd4eabb72b75de0 (patch)
tree7d96c42ec5e51b4fb83f975c706660582a8f2fe7
parentcc6bfcbad73f113ed1c82771fdacf66ab0d5ffc9 (diff)
downloadperk-ff23632ddaf5f3acc893f110cbd4eabb72b75de0.tar.bz2
perk-ff23632ddaf5f3acc893f110cbd4eabb72b75de0.tar.xz
pe_read_import_header(): integrate runtime little endian test.
-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;