Blame src/reader/pe_read_export_header.c

c0fbae
#include <endian.h>
c0fbae
#include <string.h>
c0fbae
c0fbae
#include <perk/perk.h>
413f56
#include "perk_reader_impl.h"
c0fbae
c0fbae
int pe_read_export_header(const struct pe_export_hdr * p, struct pe_meta_export_hdr * m)
c0fbae
{
c0fbae
	#if (BYTE_ORDER == LITTLE_ENDIAN)
c0fbae
c0fbae
	memcpy(m,p,sizeof(*p));
c0fbae
c0fbae
	#else
c0fbae
c0fbae
	m->export_flags		= pe_read_long(p->export_flags);
c0fbae
	m->time_date_stamp	= pe_read_long(p->time_date_stamp);
c0fbae
c0fbae
	m->major_ver		= pe_read_short(p->major_ver);
c0fbae
	m->minor_ver		= pe_read_short(p->minor_ver);
c0fbae
c0fbae
	m->name_rva		= pe_read_long(p->name_rva);
c0fbae
	m->ordinal_base		= pe_read_long(p->ordinal_base);
c0fbae
	m->addr_tbl_entries	= pe_read_long(p->addr_tbl_entries);
c0fbae
	m->num_of_name_ptrs	= pe_read_long(p->num_of_name_ptrs);
c0fbae
	m->export_addr_tbl_rva	= pe_read_long(p->export_addr_tbl_rva);
c0fbae
	m->name_ptr_rva		= pe_read_long(p->name_ptr_rva);
c0fbae
	m->ordinal_tbl_rva	= pe_read_long(p->ordinal_tbl_rva);
c0fbae
c0fbae
	#endif
c0fbae
c0fbae
	return 0;
b5f7f5
}