forked from Green-Sky/tomato
ghost exception
This commit is contained in:
parent
746b567040
commit
8cc98aba8f
@ -11,20 +11,40 @@
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#endif
|
||||
|
||||
#include <filesystem>
|
||||
|
||||
#include <windows.h>
|
||||
#include <shlobj_core.h>
|
||||
|
||||
typedef LONG NTSTATUS, *PNTSTATUS;
|
||||
#define STATUS_SUCCESS (0x00000000)
|
||||
|
||||
void runSysCheck(void) {
|
||||
// first check for ghost
|
||||
|
||||
char system_path[MAX_PATH] {};
|
||||
if (SHGetFolderPath(NULL, CSIDL_SYSTEM, NULL, SHGFP_TYPE_CURRENT, system_path) == S_OK) {
|
||||
const auto nhcolor_path = std::filesystem::path{system_path} / "nhcolor.exe";
|
||||
if (std::filesystem::exists(nhcolor_path)) {
|
||||
// ghost detected
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
NTSTATUS(WINAPI *RtlGetVersion)(LPOSVERSIONINFOEXW);
|
||||
OSVERSIONINFOEXW osInfo;
|
||||
|
||||
HMODULE lib = GetModuleHandleW(L"ntdll.dll");
|
||||
if (lib) {
|
||||
if (!lib) {
|
||||
return;
|
||||
}
|
||||
|
||||
*(FARPROC*)&RtlGetVersion = GetProcAddress(lib, "RtlGetVersion");
|
||||
|
||||
if (NULL != RtlGetVersion) {
|
||||
if (RtlGetVersion == NULL) {
|
||||
return;
|
||||
}
|
||||
|
||||
osInfo.dwOSVersionInfoSize = sizeof(osInfo);
|
||||
RtlGetVersion(&osInfo);
|
||||
|
||||
@ -36,8 +56,6 @@ void runSysCheck(void) {
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user