forked from snowie2000/mactype
-
Notifications
You must be signed in to change notification settings - Fork 0
/
dynCodeHelper.h
34 lines (29 loc) · 1001 Bytes
/
dynCodeHelper.h
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
27
28
29
30
31
32
33
34
#include "common.h"
class AutoEnableDynamicCodeGen
{
public:
AutoEnableDynamicCodeGen(bool enable = true);
~AutoEnableDynamicCodeGen();
private:
bool enabled;
typedef
BOOL
(WINAPI *PSET_THREAD_INFORMATION_PROC)(
_In_ HANDLE hThread,
_In_ THREAD_INFORMATION_CLASS ThreadInformationClass,
_In_reads_bytes_(ThreadInformationSize) PVOID ThreadInformation,
_In_ DWORD ThreadInformationSize
);
typedef
BOOL
(WINAPI *PGET_THREAD_INFORMATION_PROC)(
_In_ HANDLE hThread,
_In_ THREAD_INFORMATION_CLASS ThreadInformationClass,
_Out_writes_bytes_(ThreadInformationSize) PVOID ThreadInformation,
_In_ DWORD ThreadInformationSize
);
static PSET_THREAD_INFORMATION_PROC SetThreadInformationProc;
static PGET_THREAD_INFORMATION_PROC GetThreadInformationProc;
static PROCESS_MITIGATION_DYNAMIC_CODE_POLICY processPolicy;
static volatile bool processPolicyObtained;
};