-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathShellCodeData.h
More file actions
26 lines (22 loc) · 846 Bytes
/
Copy pathShellCodeData.h
File metadata and controls
26 lines (22 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once
#include <windows.h>
// struct to manage manual mapping
#pragma pack(push, 1)
struct ShellcodeData {
typedef BOOL(WINAPI* DllMain)(HINSTANCE, DWORD, LPVOID);
typedef HMODULE(WINAPI* LoadLibraryAPtr)(LPCSTR);
typedef FARPROC(WINAPI* GetProcAddressPtr)(HMODULE, LPCSTR);
void* imageBase; // base address of mapped DLL
LoadLibraryAPtr loadLibraryA; // loadlibrarya address
GetProcAddressPtr getProcAddress; // GetProcAddress address
DllMain dllMain; // DLL entry point
BOOL isRelocated; // reloc status
// import data
PIMAGE_IMPORT_DESCRIPTOR importDirectory;
// reloc data
PIMAGE_BASE_RELOCATION relocationDirectory;
size_t relocationSize;
// NT Headers for reference
PIMAGE_NT_HEADERS ntHeaders;
};
#pragma pack(pop)