summaryrefslogtreecommitdiffhomepage
path: root/src/output
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2016-11-15 21:46:38 -0500
committermidipix <writeonce@midipix.org>2016-11-15 21:46:38 -0500
commitc3af45f9ccbf4475d77f82512f308b64084f88ae (patch)
tree2320193c37f570bc0c3a53a83131930505f290a2 /src/output
parentad7d42a156fbcfb853d1b3d9f18fdbb2bb29a2a6 (diff)
downloadperk-c3af45f9ccbf4475d77f82512f308b64084f88ae.tar.bz2
perk-c3af45f9ccbf4475d77f82512f308b64084f88ae.tar.xz
pe_output_export_symbols(): code maintenance.
Diffstat (limited to 'src/output')
-rw-r--r--src/output/pe_output_export_symbols.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/output/pe_output_export_symbols.c b/src/output/pe_output_export_symbols.c
index ee48b0e..2319a17 100644
--- a/src/output/pe_output_export_symbols.c
+++ b/src/output/pe_output_export_symbols.c
@@ -36,6 +36,7 @@ int pe_output_export_symbols(
const struct pe_image_meta * m,
FILE * fout)
{
+ char * mark;
uint32_t offset;
uint32_t * symrva;
unsigned i;
@@ -50,13 +51,14 @@ int pe_output_export_symbols(
if ((pretty_header(cctx,fout)) < 0)
return PERK_FILE_ERROR(dctx);
+ mark = m->image.addr;
offset = m->hedata->virtual_addr - m->hedata->ptr_to_raw_data;
- symrva = (uint32_t *)((uintptr_t)m->image.addr + (m->edata.name_ptr_rva - offset));
+ symrva = (uint32_t *)(mark + m->edata.name_ptr_rva - offset);
for (i=0; i<m->edata.num_of_name_ptrs; i++)
if ((pretty_export_item(
cctx,
- (char *)((uintptr_t)m->image.addr + symrva[i] - offset),
+ &mark[symrva[i] - offset],
fout)) < 0)
return PERK_FILE_ERROR(dctx);