- BOOL IsWow64ProcessEx(HANDLE hProcess)
- {
-
- bool isX86 = false;
- #ifndef _WIN64
- isX86 = GetProcAddress(GetModuleHandle(TEXT("ntdll")), "NtWow64DebuggerCall") == nullptr ? TRUE : FALSE;
- #endif
- if (isX86)
- return FALSE;
-
-
- typedef BOOL(WINAPI *ISWOW64PROCESS)(HANDLE, PBOOL);
- ISWOW64PROCESS fnIsWow64Process;
- BOOL isWow64 = TRUE;
- fnIsWow64Process = (ISWOW64PROCESS)GetProcAddress(GetModuleHandle(TEXT("kernel32")), "IsWow64Process");
- if (fnIsWow64Process != nullptr)
- fnIsWow64Process(hProcess, &isWow64);
- return !isWow64;
- }
先用OpenProcess打开目标进程,再把句柄传进去就OK了。
http://blog.csdn.net/aqtata/article/details/18361209
判断指定进程是否为x64的方法(在ntdll判断某个x64函数是否存在)
原文:http://www.cnblogs.com/findumars/p/5277576.html