summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-11-16 18:39:18 -0500
committermidipix <writeonce@midipix.org>2016-11-16 19:32:53 -0500
commitc10b3d48aa382125f11bdb06810786cfafe8d9ae (patch)
tree158ddefe40e82484c5d1f0946d20e53c69aca01d
parentd2a31a13b405ac9347f46846962c166a3c4c2246 (diff)
downloadperk-c10b3d48aa382125f11bdb06810786cfafe8d9ae.tar.bz2
perk-c10b3d48aa382125f11bdb06810786cfafe8d9ae.tar.xz
reader: pe_read_coff_header(): remove useless optimization.
-rw-r--r--src/reader/pe_read_coff_header.c30
1 files changed, 11 insertions, 19 deletions
diff --git a/src/reader/pe_read_coff_header.c b/src/reader/pe_read_coff_header.c
index 24d47ba..b6e125f 100644
--- a/src/reader/pe_read_coff_header.c
+++ b/src/reader/pe_read_coff_header.c
@@ -16,28 +16,20 @@ int pe_read_coff_header(const struct pe_coff_file_hdr * p, struct pe_meta_coff_f
|| p->signature[2] || p->signature[3])
return PERK_ERR_BAD_COFF_HEADER;
- if (PERK_LITTLE_ENDIAN) {
+ m->signature[0] = p->signature[0];
+ m->signature[1] = p->signature[1];
+ m->signature[2] = p->signature[2];
+ m->signature[3] = p->signature[3];
- memcpy(m,p,sizeof(*p));
+ m->machine = pe_read_short(p->machine);
+ m->num_of_sections = pe_read_short(p->num_of_sections);
- } else {
+ m->time_date_stamp = pe_read_long(p->time_date_stamp);
+ m->ptr_to_sym_tbl = pe_read_long(p->ptr_to_sym_tbl);
+ m->num_of_syms = pe_read_long(p->num_of_syms);
- m->signature[0] = p->signature[0];
- m->signature[1] = p->signature[1];
- m->signature[2] = p->signature[2];
- m->signature[3] = p->signature[3];
-
- m->machine = pe_read_short(p->machine);
- m->num_of_sections = pe_read_short(p->num_of_sections);
-
- m->time_date_stamp = pe_read_long(p->time_date_stamp);
- m->ptr_to_sym_tbl = pe_read_long(p->ptr_to_sym_tbl);
- m->num_of_syms = pe_read_long(p->num_of_syms);
-
- m->size_of_opt_hdr = pe_read_short(p->size_of_opt_hdr);
- m->characteristics = pe_read_short(p->characteristics);
-
- }
+ m->size_of_opt_hdr = pe_read_short(p->size_of_opt_hdr);
+ m->characteristics = pe_read_short(p->characteristics);
return 0;
}