ghost exception
Some checks are pending
ContinuousDelivery / linux-ubuntu (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Waiting to run
ContinuousDelivery / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Waiting to run
ContinuousDelivery / windows (push) Waiting to run
ContinuousDelivery / windows-asan (push) Waiting to run
ContinuousDelivery / dumpsyms (push) Blocked by required conditions
ContinuousDelivery / release (push) Blocked by required conditions
ContinuousIntegration / linux (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:arm64-v8a vcpkg_toolkit:arm64-android]) (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:armeabi-v7a vcpkg_toolkit:arm-neon-android]) (push) Waiting to run
ContinuousIntegration / android (map[ndk_abi:x86_64 vcpkg_toolkit:x64-android]) (push) Waiting to run
ContinuousIntegration / macos (push) Waiting to run
ContinuousIntegration / windows (push) Waiting to run

This commit is contained in:
Green Sky 2025-03-12 12:54:20 +01:00
parent 746b567040
commit 8cc98aba8f
No known key found for this signature in database
GPG Key ID: DBE05085D874AB4A

View File

@ -11,31 +11,49 @@
#define WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN
#endif #endif
#include <filesystem>
#include <windows.h> #include <windows.h>
#include <shlobj_core.h>
typedef LONG NTSTATUS, *PNTSTATUS; typedef LONG NTSTATUS, *PNTSTATUS;
#define STATUS_SUCCESS (0x00000000) #define STATUS_SUCCESS (0x00000000)
void runSysCheck(void) { 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); NTSTATUS(WINAPI *RtlGetVersion)(LPOSVERSIONINFOEXW);
OSVERSIONINFOEXW osInfo; OSVERSIONINFOEXW osInfo;
HMODULE lib = GetModuleHandleW(L"ntdll.dll"); HMODULE lib = GetModuleHandleW(L"ntdll.dll");
if (lib) { if (!lib) {
*(FARPROC*)&RtlGetVersion = GetProcAddress(lib, "RtlGetVersion"); return;
}
if (NULL != RtlGetVersion) { *(FARPROC*)&RtlGetVersion = GetProcAddress(lib, "RtlGetVersion");
osInfo.dwOSVersionInfoSize = sizeof(osInfo);
RtlGetVersion(&osInfo);
// check if (RtlGetVersion == NULL) {
if ( return;
osInfo.dwBuildNumber >= 26000 // canary versions of 11 24H2 included }
) {
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Unsupported System", "Your version of windows is too new and endangers the privacy of all involved.", nullptr); osInfo.dwOSVersionInfoSize = sizeof(osInfo);
exit(0); RtlGetVersion(&osInfo);
}
} // check
if (
osInfo.dwBuildNumber >= 26000 // canary versions of 11 24H2 included
) {
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Unsupported System", "Your version of windows is too new and endangers the privacy of all involved.", nullptr);
exit(0);
} }
} }