Blame src/output/pe_output_export_symbols.c

c0fbae
#include <stdint.h>
c0fbae
#include <stdlib.h>
c0fbae
#include <stdio.h>
c0fbae
#include <string.h>
c0fbae
#include <errno.h>
c0fbae
c0fbae
#include <perk/perk.h>
c0fbae
c0fbae
int pe_output_export_symbols (const struct pe_image_meta * m, uint32_t flags, FILE * f)
c0fbae
{
c0fbae
	uint32_t 	offset;
c0fbae
	uint32_t *	symrva;
c0fbae
	int		i;
c0fbae
c0fbae
	if (!m->hedata) return 0;
c0fbae
c0fbae
	offset	= m->hedata->virtual_addr - m->hedata->ptr_to_raw_data;
c0fbae
	symrva	= (uint32_t *)(m->image.addr + (m->edata.name_ptr_rva - offset));
c0fbae
c0fbae
	for (i=0; i<m->edata.num_of_name_ptrs; i++)
c0fbae
		fprintf(f,"%s\n",(char *)(m->image.addr + symrva[i] - offset));
c0fbae
c0fbae
	return 0;
c0fbae
}