mirror of
https://github.com/dobin/SuperMega
synced 2026-06-03 01:27:11 +00:00
11 lines
360 B
C
11 lines
360 B
C
// Execution Guardrail: Env Check
|
|
wchar_t envVarName[] = L"USERPROFILE";
|
|
wchar_t tocheck[] = L"C:\\Users\\";
|
|
WCHAR buffer[1024]; // NOTE: Do not make it bigger, or we have a __chkstack() dependency!
|
|
DWORD result = GetEnvironmentVariableW(envVarName, buffer, 1024);
|
|
if (result == 0) {
|
|
return 6;
|
|
}
|
|
if (mystrcmp(buffer, tocheck) != 0) {
|
|
return 6;
|
|
} |