22
33#include " NT Funcs.h"
44#include " Symbol Parser.h"
5+ #include " Tools.h"
56
67inline HANDLE g_hRunningEvent = nullptr ;
78inline HANDLE g_hInterruptEvent = nullptr ;
@@ -22,17 +23,17 @@ inline std::shared_future<DWORD> import_handler_wow64_ret;
2223#define NT_FUNC_LOCAL (func ) f_##func func
2324#define NT_FUNC_CONSTRUCTOR_INIT (func ) this ->func = NATIVE::func
2425
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));
2829#define WIN32_FUNC_CONSTRUCTOR_INIT (func ) this ->p##func = NATIVE::p##func
2930
3031#define K32_FUNC (func ) inline f_##func func = nullptr
3132#define K32_FUNC_LOCAL (func ) f_##func func
3233#define K32_FUNC_CONSTRUCTOR_INIT (func ) this ->func = NATIVE::func
3334
3435#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
3637#define WOW64_FUNC_CONSTRUCTOR_INIT (func ) this ->func = WOW64::func##_WOW64
3738
3839#define IDX_NTDLL 0
@@ -74,7 +75,9 @@ inline DWORD g_OSBuildNumber = 0;
7475#define g_Win10_20H2 19042
7576#define g_Win10_21H1 19043
7677#define g_Win10_21H2 19044
78+ #define g_Win10_22H2 19045
7779#define g_Win11_21H2 22000
80+ #define g_Win11_22H2 22621
7881
7982bool IsWin7OrGreater ();
8083bool IsWin8OrGreater ();
@@ -113,7 +116,26 @@ DWORD GetOSBuildVersion();
113116
114117namespace NATIVE
115118{
119+ WIN32_FUNC (LoadLibraryA);
120+ WIN32_FUNC (LoadLibraryW);
121+ WIN32_FUNC (LoadLibraryExA);
116122 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+
117139 WIN32_FUNC (GetLastError);
118140
119141 NT_FUNC (LdrLoadDll);
@@ -132,6 +154,7 @@ namespace NATIVE
132154 NT_FUNC (NtQuerySystemInformation);
133155 NT_FUNC (NtQueryInformationThread);
134156
157+ NT_FUNC (LdrGetDllPath);
135158 NT_FUNC (LdrpPreprocessDllName);
136159 NT_FUNC (RtlInsertInvertedFunctionTable);
137160 NT_FUNC (LdrpHandleTlsData);
@@ -145,6 +168,9 @@ namespace NATIVE
145168 NT_FUNC (RtlFreeHeap);
146169
147170 NT_FUNC (RtlAnsiStringToUnicodeString);
171+ NT_FUNC (RtlUnicodeStringToAnsiString);
172+ NT_FUNC (RtlCompareUnicodeString);
173+ NT_FUNC (RtlCompareString);
148174
149175 NT_FUNC (RtlRbInsertNodeEx);
150176 NT_FUNC (RtlRbRemoveNode);
@@ -222,6 +248,7 @@ namespace WOW64
222248 WOW64_FUNCTION_POINTER (NtQuerySystemInformation);
223249 WOW64_FUNCTION_POINTER (NtQueryInformationThread);
224250
251+ WOW64_FUNCTION_POINTER (LdrGetDllPath);
225252 WOW64_FUNCTION_POINTER (LdrpPreprocessDllName);
226253 WOW64_FUNCTION_POINTER (RtlInsertInvertedFunctionTable);
227254 WOW64_FUNCTION_POINTER (LdrpHandleTlsData);
@@ -235,6 +262,9 @@ namespace WOW64
235262 WOW64_FUNCTION_POINTER (RtlFreeHeap);
236263
237264 WOW64_FUNCTION_POINTER (RtlAnsiStringToUnicodeString);
265+ WOW64_FUNCTION_POINTER (RtlUnicodeStringToAnsiString);
266+ WOW64_FUNCTION_POINTER (RtlCompareUnicodeString);
267+ WOW64_FUNCTION_POINTER (RtlCompareString);
238268
239269 WOW64_FUNCTION_POINTER (RtlRbRemoveNode);
240270
0 commit comments