From c0fbae7a40c662ae77f59f5f919cd6b88e38a85d Mon Sep 17 00:00:00 2001 From: midipix Date: Sat, 2 May 2015 10:05:51 -0400 Subject: initial commit. --- src/output/pe_output_export_symbols.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/output/pe_output_export_symbols.c (limited to 'src/output/pe_output_export_symbols.c') diff --git a/src/output/pe_output_export_symbols.c b/src/output/pe_output_export_symbols.c new file mode 100644 index 0000000..192bca3 --- /dev/null +++ b/src/output/pe_output_export_symbols.c @@ -0,0 +1,24 @@ +#include +#include +#include +#include +#include + +#include + +int pe_output_export_symbols (const struct pe_image_meta * m, uint32_t flags, FILE * f) +{ + uint32_t offset; + uint32_t * symrva; + int i; + + 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)); + + for (i=0; iedata.num_of_name_ptrs; i++) + fprintf(f,"%s\n",(char *)(m->image.addr + symrva[i] - offset)); + + return 0; +} -- cgit v1.2.3