mirror of
https://github.com/a0rtega/pafish
synced 2024-11-21 22:01:56 +03:00
Add raw access to NumberOfProcessors detection method
This commit is contained in:
parent
882a67a33e
commit
9f8c035739
@ -133,6 +133,16 @@ int gensandbox_sleep_patched() {
|
||||
else return TRUE;
|
||||
}
|
||||
|
||||
int gensandbox_one_cpu() {
|
||||
DWORD NumberOfProcessors = 0;
|
||||
__asm__ volatile (
|
||||
"mov %%fs:0x18, %%eax;"
|
||||
"mov %%ds:0x30(%%eax), %%eax;"
|
||||
"mov %%ds:0x64(%%eax), %%eax;"
|
||||
: "=a"(NumberOfProcessors));
|
||||
return NumberOfProcessors < 2 ? TRUE : FALSE;
|
||||
}
|
||||
|
||||
int gensandbox_one_cpu_GetSystemInfo() {
|
||||
SYSTEM_INFO siSysInfo;
|
||||
GetSystemInfo(&siSysInfo);
|
||||
|
@ -16,6 +16,8 @@ int gensandbox_drive_size2();
|
||||
|
||||
int gensandbox_sleep_patched();
|
||||
|
||||
int gensandbox_one_cpu();
|
||||
|
||||
int gensandbox_one_cpu_GetSystemInfo();
|
||||
|
||||
#endif
|
||||
|
@ -175,6 +175,14 @@ int main(void)
|
||||
}
|
||||
else print_not_traced();
|
||||
|
||||
printf("[*] Checking if NumberOfProcessors is < 2 via raw access ... ");
|
||||
if (gensandbox_one_cpu() == TRUE) {
|
||||
print_traced();
|
||||
write_log("Sandbox traced by checking if NumberOfProcessors is less than 2 via raw access");
|
||||
write_trace("hi_sandbox_NumberOfProcessors_less_2_raw");
|
||||
}
|
||||
else print_not_traced();
|
||||
|
||||
printf("[*] Checking if NumberOfProcessors is < 2 via GetSystemInfo() ... ");
|
||||
if (gensandbox_one_cpu_GetSystemInfo() == TRUE) {
|
||||
print_traced();
|
||||
|
Loading…
Reference in New Issue
Block a user