summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2015-05-26 22:45:48 -0400
committermidipix <writeonce@midipix.org>2016-11-10 23:35:19 -0500
commit664d5b53723342fcad8ba4ded4ae77f57df621ae (patch)
tree23c5aabae7c28a7b432d8dfa0defb2176d9dae13
parent2b71e842c7f9a7a2130e9516ab0f900d41f1fc48 (diff)
downloadperk-664d5b53723342fcad8ba4ded4ae77f57df621ae.tar.bz2
perk-664d5b53723342fcad8ba4ded4ae77f57df621ae.tar.xz
struct pe_raw_image: change the type of addr to void *.
-rw-r--r--include/perk/perk.h2
-rw-r--r--src/main/pe_map_raw_image.c2
-rw-r--r--src/output/pe_output_export_symbols.c4
3 files changed, 4 insertions, 4 deletions
diff --git a/include/perk/perk.h b/include/perk/perk.h
index c6aeed7..c2fbcb8 100644
--- a/include/perk/perk.h
+++ b/include/perk/perk.h
@@ -37,7 +37,7 @@ extern "C" {
#define PERK_MALFORMED_IMAGE 0xA8
struct pe_raw_image {
- char * addr;
+ void * addr;
size_t size;
};
diff --git a/src/main/pe_map_raw_image.c b/src/main/pe_map_raw_image.c
index bf21a9b..caf14b9 100644
--- a/src/main/pe_map_raw_image.c
+++ b/src/main/pe_map_raw_image.c
@@ -21,7 +21,7 @@ int pe_map_raw_image (int fd, const char * fname, int prot, struct pe_raw_image
return errno;
map->size = stat.st_size;
- map->addr = (char *)mmap(0,map->size,prot,MAP_PRIVATE,fd,0);
+ map->addr = mmap(0,map->size,prot,MAP_PRIVATE,fd,0);
if (map->addr == MAP_FAILED) {
map->addr = 0;
diff --git a/src/output/pe_output_export_symbols.c b/src/output/pe_output_export_symbols.c
index 192bca3..099b540 100644
--- a/src/output/pe_output_export_symbols.c
+++ b/src/output/pe_output_export_symbols.c
@@ -15,10 +15,10 @@ int pe_output_export_symbols (const struct pe_image_meta * m, uint32_t flags, FI
if (!m->hedata) return 0;
offset = m->hedata->virtual_addr - m->hedata->ptr_to_raw_data;
- symrva = (uint32_t *)(m->image.addr + (m->edata.name_ptr_rva - offset));
+ symrva = (uint32_t *)((uintptr_t)m->image.addr + (m->edata.name_ptr_rva - offset));
for (i=0; i<m->edata.num_of_name_ptrs; i++)
- fprintf(f,"%s\n",(char *)(m->image.addr + symrva[i] - offset));
+ fprintf(f,"%s\n",(char *)((uintptr_t)m->image.addr + symrva[i] - offset));
return 0;
}