-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAntiSandbox.cpp
More file actions
44 lines (36 loc) · 1.14 KB
/
AntiSandbox.cpp
File metadata and controls
44 lines (36 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "AntiSandbox.hpp"
bool AntiSandbox::IsLowResources() {
MEMORYSTATUSEX statex;
statex.dwLength = sizeof(statex);
if (!GlobalMemoryStatusEx(&statex)) return false;
float ramGB = static_cast<float>(statex.ullTotalPhys) / (1024.0f * 1024.0f * 1024.0f);
return ramGB < 4.0f;
}
bool AntiSandbox::IsSingleCore() {
SYSTEM_INFO sysInfo;
GetSystemInfo(&sysInfo);
return sysInfo.dwNumberOfProcessors < 2;
}
bool AntiSandbox::IsVirtualMachine() {
const std::string_view artifacts[] = {
"C:\\windows\\System32\\Drivers\\VBoxMouse.sys",
"C:\\windows\\System32\\Drivers\\vmmouse.sys",
"C:\\windows\\System32\\Drivers\\vmhgfs.sys"
};
for (const auto& path : artifacts) {
if (std::filesystem::exists(path)) {
return true;
}
}
return false;
}
void AntiSandbox::ExecuteHeavyDelay(long long iterations) {
double dummy = 0.0;
for (long long i = 0; i < iterations; ++i) {
dummy += std::sin(i) * std::cos(i);
dummy = std::sqrt(std::abs(dummy + 1.0));
}
if (dummy == 0.0001) {
std::cout << "Algo impossível aconteceu";
}
}