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,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);
@ -35,8 +55,6 @@ void runSysCheck(void) {
SDL_ShowSimpleMessageBox(SDL_MESSAGEBOX_ERROR, "Unsupported System", "Your version of windows is too new and endangers the privacy of all involved.", nullptr);
exit(0);
}
}
}
}
#else