2
2
3
3
#include " NT Funcs.h"
4
4
#include " Symbol Parser.h"
5
+ #include " Tools.h"
5
6
6
7
inline HANDLE g_hRunningEvent = nullptr ;
7
8
inline HANDLE g_hInterruptEvent = nullptr ;
@@ -22,17 +23,17 @@ inline std::shared_future<DWORD> import_handler_wow64_ret;
22
23
#define NT_FUNC_LOCAL (func ) f_##func func
23
24
#define NT_FUNC_CONSTRUCTOR_INIT (func ) this ->func = NATIVE::func
24
25
25
- #define WIN32_FUNC (func ) inline decltype (func)* p##func = nullptr
26
- #define WIN32_FUNC_LOCAL (func ) decltype(func)* p##func
27
- #define WIN32_FUNC_INIT (func, lib ) NATIVE::p##func = ReCa<decltype(func)*>(GetProcAddress(lib, #func));
26
+ #define WIN32_FUNC (func ) inline decltype (func) * p##func = nullptr
27
+ #define WIN32_FUNC_LOCAL (func ) decltype(func) * p##func
28
+ #define WIN32_FUNC_INIT (func, lib ) NATIVE::p##func = ReCa<decltype(func) *>(GetProcAddress(lib, #func));
28
29
#define WIN32_FUNC_CONSTRUCTOR_INIT (func ) this ->p##func = NATIVE::p##func
29
30
30
31
#define K32_FUNC (func ) inline f_##func func = nullptr
31
32
#define K32_FUNC_LOCAL (func ) f_##func func
32
33
#define K32_FUNC_CONSTRUCTOR_INIT (func ) this ->func = NATIVE::func
33
34
34
35
#define WOW64_FUNCTION_POINTER (func ) inline DWORD func##_WOW64 = 0
35
- #define WOW64_FUNCTION_POINTER_LOCAL (func ) DWORD func
36
+ #define WOW64_FUNCTION_POINTER_LOCAL (func ) DWORD func = 0
36
37
#define WOW64_FUNC_CONSTRUCTOR_INIT (func ) this ->func = WOW64::func##_WOW64
37
38
38
39
#define IDX_NTDLL 0
@@ -74,7 +75,9 @@ inline DWORD g_OSBuildNumber = 0;
74
75
#define g_Win10_20H2 19042
75
76
#define g_Win10_21H1 19043
76
77
#define g_Win10_21H2 19044
78
+ #define g_Win10_22H2 19045
77
79
#define g_Win11_21H2 22000
80
+ #define g_Win11_22H2 22621
78
81
79
82
bool IsWin7OrGreater ();
80
83
bool IsWin8OrGreater ();
@@ -113,7 +116,26 @@ DWORD GetOSBuildVersion();
113
116
114
117
namespace NATIVE
115
118
{
119
+ WIN32_FUNC (LoadLibraryA);
120
+ WIN32_FUNC (LoadLibraryW);
121
+ WIN32_FUNC (LoadLibraryExA);
116
122
WIN32_FUNC (LoadLibraryExW);
123
+
124
+ WIN32_FUNC (GetModuleHandleA);
125
+ WIN32_FUNC (GetModuleHandleW);
126
+ WIN32_FUNC (GetModuleHandleExA);
127
+ WIN32_FUNC (GetModuleHandleExW);
128
+
129
+ WIN32_FUNC (GetModuleFileNameA);
130
+ WIN32_FUNC (GetModuleFileNameW);
131
+
132
+ WIN32_FUNC (GetProcAddress);
133
+
134
+ WIN32_FUNC (DisableThreadLibraryCalls);
135
+ WIN32_FUNC (FreeLibrary);
136
+ WIN32_FUNC (FreeLibraryAndExitThread);
137
+ WIN32_FUNC (ExitThread);
138
+
117
139
WIN32_FUNC (GetLastError);
118
140
119
141
NT_FUNC (LdrLoadDll);
@@ -132,6 +154,7 @@ namespace NATIVE
132
154
NT_FUNC (NtQuerySystemInformation);
133
155
NT_FUNC (NtQueryInformationThread);
134
156
157
+ NT_FUNC (LdrGetDllPath);
135
158
NT_FUNC (LdrpPreprocessDllName);
136
159
NT_FUNC (RtlInsertInvertedFunctionTable);
137
160
NT_FUNC (LdrpHandleTlsData);
@@ -145,6 +168,9 @@ namespace NATIVE
145
168
NT_FUNC (RtlFreeHeap);
146
169
147
170
NT_FUNC (RtlAnsiStringToUnicodeString);
171
+ NT_FUNC (RtlUnicodeStringToAnsiString);
172
+ NT_FUNC (RtlCompareUnicodeString);
173
+ NT_FUNC (RtlCompareString);
148
174
149
175
NT_FUNC (RtlRbInsertNodeEx);
150
176
NT_FUNC (RtlRbRemoveNode);
@@ -222,6 +248,7 @@ namespace WOW64
222
248
WOW64_FUNCTION_POINTER (NtQuerySystemInformation);
223
249
WOW64_FUNCTION_POINTER (NtQueryInformationThread);
224
250
251
+ WOW64_FUNCTION_POINTER (LdrGetDllPath);
225
252
WOW64_FUNCTION_POINTER (LdrpPreprocessDllName);
226
253
WOW64_FUNCTION_POINTER (RtlInsertInvertedFunctionTable);
227
254
WOW64_FUNCTION_POINTER (LdrpHandleTlsData);
@@ -235,6 +262,9 @@ namespace WOW64
235
262
WOW64_FUNCTION_POINTER (RtlFreeHeap);
236
263
237
264
WOW64_FUNCTION_POINTER (RtlAnsiStringToUnicodeString);
265
+ WOW64_FUNCTION_POINTER (RtlUnicodeStringToAnsiString);
266
+ WOW64_FUNCTION_POINTER (RtlCompareUnicodeString);
267
+ WOW64_FUNCTION_POINTER (RtlCompareString);
238
268
239
269
WOW64_FUNCTION_POINTER (RtlRbRemoveNode);
240
270
0 commit comments