summaryrefslogtreecommitdiffhomepage
path: root/src/reader
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-11-16 18:48:57 -0500
committermidipix <writeonce@midipix.org>2016-11-16 19:32:53 -0500
commit4d1375c67e0e2b91395777d811473beff7f409b2 (patch)
tree9c7247fbce8484f4746b898b53d16800af6614cd /src/reader
parent56cb696f335862a9f9b51b1429014781d61c0034 (diff)
downloadperk-4d1375c67e0e2b91395777d811473beff7f409b2.tar.bz2
perk-4d1375c67e0e2b91395777d811473beff7f409b2.tar.xz
reader: pe_read_section_header(): remove useless optimization.
Diffstat (limited to 'src/reader')
-rw-r--r--src/reader/pe_read_section_header.c33
1 files changed, 12 insertions, 21 deletions
diff --git a/src/reader/pe_read_section_header.c b/src/reader/pe_read_section_header.c
index e56362e..01024d9 100644
--- a/src/reader/pe_read_section_header.c
+++ b/src/reader/pe_read_section_header.c
@@ -16,27 +16,18 @@ int pe_read_section_header(const struct pe_sec_hdr * p, struct pe_meta_sec_hdr *
memset(m,0,sizeof(m->name));
memcpy(m,p,sizeof(p->name));
- m->long_name = 0;
-
- if (PERK_LITTLE_ENDIAN) {
-
- memcpy(&m->virtual_size,&p->virtual_size,sizeof(*p)-sizeof(p->name));
-
- } else {
-
- m->virtual_size = pe_read_long(p->virtual_size);
- m->virtual_addr = pe_read_long(p->virtual_addr);
- m->size_of_raw_data = pe_read_long(p->size_of_raw_data);
- m->ptr_to_raw_data = pe_read_long(p->ptr_to_raw_data);
- m->ptr_to_relocs = pe_read_long(p->ptr_to_relocs);
- m->ptr_to_line_nums = pe_read_long(p->ptr_to_line_nums);
-
- m->num_of_relocs = pe_read_short(p->num_of_relocs);
- m->num_of_line_nums = pe_read_short(p->num_of_line_nums);
-
- m->characteristics = pe_read_long(p->characteristics);
-
- }
+ m->long_name = 0;
+ m->virtual_size = pe_read_long(p->virtual_size);
+ m->virtual_addr = pe_read_long(p->virtual_addr);
+ m->size_of_raw_data = pe_read_long(p->size_of_raw_data);
+ m->ptr_to_raw_data = pe_read_long(p->ptr_to_raw_data);
+ m->ptr_to_relocs = pe_read_long(p->ptr_to_relocs);
+ m->ptr_to_line_nums = pe_read_long(p->ptr_to_line_nums);
+
+ m->num_of_relocs = pe_read_short(p->num_of_relocs);
+ m->num_of_line_nums = pe_read_short(p->num_of_line_nums);
+
+ m->characteristics = pe_read_long(p->characteristics);
return 0;
}