8 BOOL(WINAPI *g_IsWow64Process)(IN HANDLE, OUT
PBOOL) =
nullptr;
9 BOOL(WINAPI *g_Wow64DisableWow64FsRedirection) (OUT PVOID* OldValue) =
nullptr;
10 BOOL(WINAPI *g_Wow64RevertWow64FsRedirection) (IN PVOID OldValue) =
nullptr;
11 BOOL(WINAPI *g_Wow64GetThreadContext)(IN HANDLE hThread, IN OUT PWOW64_CONTEXT
lpContext) =
nullptr;
15 const char kernel32_dll[] =
"kernel32.dll";
30 (*isProcWow64) = FALSE;
32 if (!g_IsWow64Process) {
34 if (!kernelLib)
return FALSE;
36 FARPROC procPtr = GetProcAddress(kernelLib,
"IsWow64Process");
37 if (!procPtr)
return FALSE;
39 g_IsWow64Process = (
BOOL(WINAPI *)(IN HANDLE, OUT
PBOOL))procPtr;
41 if (!g_IsWow64Process) {
44 return g_IsWow64Process(processHandle, isProcWow64);
49 BOOL isScanner32bit = TRUE;
51 isScanner32bit = FALSE;
53 BOOL isScannerWow64 = FALSE;
56 const BOOL isSystem64bit = !isScanner32bit || isScannerWow64;
62 BOOL isProcessWow = FALSE;
89 if (!g_Wow64GetThreadContext) {
91 if (!kernelLib)
return FALSE;
94 if (!procPtr)
return FALSE;
96 g_Wow64GetThreadContext = (
BOOL(WINAPI*)(IN HANDLE, IN OUT PWOW64_CONTEXT))procPtr;
98 return g_Wow64GetThreadContext(hThread,
lpContext);
106 if (!g_Wow64DisableWow64FsRedirection) {
108 if (!kernelLib)
return FALSE;
110 FARPROC procPtr = GetProcAddress(kernelLib,
"Wow64DisableWow64FsRedirection");
111 if (!procPtr)
return FALSE;
113 g_Wow64DisableWow64FsRedirection = (
BOOL(WINAPI *) (OUT PVOID*))procPtr;
115 if (!g_Wow64DisableWow64FsRedirection) {
118 return g_Wow64DisableWow64FsRedirection(OldValue);
123 if (!g_Wow64RevertWow64FsRedirection) {
125 if (!kernelLib)
return FALSE;
127 FARPROC procPtr = GetProcAddress(kernelLib,
"Wow64RevertWow64FsRedirection");
128 if (!procPtr)
return FALSE;
130 g_Wow64RevertWow64FsRedirection = (
BOOL(WINAPI *) (IN PVOID))procPtr;
132 if (!g_Wow64RevertWow64FsRedirection) {
135 return g_Wow64RevertWow64FsRedirection(OldValue);
bool is_process_64bit(IN HANDLE process)
BOOL wow64_disable_fs_redirection(OUT PVOID *OldValue)
BOOL is_process_wow64(IN HANDLE processHandle, OUT BOOL *isProcWow64)
IN OUT PWOW64_CONTEXT lpContext
HMODULE get_kernel32_hndl()
BOOL(CALLBACK *_MiniDumpWriteDump)(HANDLE hProcess
BOOL wow64_get_thread_context(IN HANDLE hThread, IN OUT PWOW64_CONTEXT lpContext)
BOOL wow64_revert_fs_redirection(IN PVOID OldValue)