#ifndef __PEFILE_H
#define __PEFILE_H

#include "Windas.h"

#define PEFI_IS_LOADED			(1<<0)
#define PEFI_SYMBOLS_LOADED		(1<<1)


typedef struct _PEFI_SECTION
{
	PVOID RawData;
	ULONG RawDataSize;
}PEFI_SECTION, *PPEFI_SECTION;

typedef struct _PE_FILE
{
	PVOID RawData;
	ULONG RawDataSize;
	ULONG Flags;
	PIMAGE_DOS_HEADER DosHeader;
	PIMAGE_NT_HEADERS NtHeaders;
	PIMAGE_FILE_HEADER FileHeader;
	PIMAGE_SECTION_HEADER SectionHeaders;
	STDVECTOR<UCHAR> SymbolData;
}PE_FILE, *PPE_FILE;

VOID FiLoadFile(PPE_FILE File, PVOID RawData, ULONG RawDataSize);
VOID FiWriteFile(PPE_FILE File, STDSTRING CONST& Path);
VOID FILoadSymbols(PPE_FILE File, PVOID PdbFileData);
VOID FiDestroy(PPE_FILE File);

BOOL FiGood(PPE_FILE File);


#endif