#pragma once 

#include <Windows.h>

typedef enum
{
	APP_TYPE_UNKNOWN,
	APP_TYPE_DESKTOP,
	APP_TYPE_STORE
}APP_TYPE;

typedef struct
{
	LPVOID	lpBufIN;
	LPVOID  lpBufOUT;
} IPC_PARAMS, *PIPC_PARAMS;

typedef struct
{
	HANDLE hProcess;
	PIPC_PARAMS pIPC;
} THREAD_PARAMS, *PTHREAD_PARAMS;


int  loader_alloc_exe_mem(HANDLE hProcess, LPVOID *lpProcMem, LPVOID *lpRemoteProcMem, DWORD dwMemSize);
int  loader_build_exports(LPVOID lpProcMem, LPDWORD *lpExport);
BOOL loader_build_iat(PIMAGE_NT_HEADERS peHeader, LPVOID lpBaseAddr);
int	 loader_copy_sections(LPVOID lpProcMem, LPVOID lpFileData, IMAGE_DOS_HEADER *pDos, IMAGE_NT_HEADERS *pPE);
int	 loader_inject_proc(int pid, PIPC_PARAMS *pIPC);
int  loader_map_exe(HANDLE hProcess, PCHAR lpFileData, LPVOID *lpEntryPoint);
int  loader_protect_sections(HANDLE hProcess, LPVOID lpRemoteMem, IMAGE_DOS_HEADER *pDos, IMAGE_NT_HEADERS *pPE);
int  loader_reloc_exe(LPVOID lpProcMem, PIMAGE_NT_HEADERS pPE);

