Skip to content

Commit

Permalink
Merge pull request #64 from LordNoteworthy/Noteworthy
Browse files Browse the repository at this point in the history
memory space check
  • Loading branch information
Noteworthy authored Oct 20, 2016
2 parents be97732 + 156c384 commit be43914
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ Please, if you encounter any of the anti-analysis tricks which you have seen in

### Human Interaction [Anti-Sandbox]
- Mouse movement
- Total Physical memory (GlobalMemoryStatusEx)
- Mouse (Single click / Double click) (todo)
- DialogBox (todo)
- Scrolling (todo)
Expand Down
1 change: 1 addition & 0 deletions al-khaser/Al-khaser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ int main(void)
exec_check(&disk_size_wmi, TEXT("Checking hard disk size using WMI: "));
exec_check(&setupdi_diskdrive, TEXT("Checking SetupDi_diskdrive: "));
exec_check(&mouse_movement, TEXT("Checking mouse movement: "));
exec_check(&memory_space, TEXT("Checking memory space using GlobalMemoryStatusEx: "));

///* VirtualBox Detection */
print_category(TEXT("VirtualBox Detection"));
Expand Down
16 changes: 16 additions & 0 deletions al-khaser/Anti VM/Generic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,4 +340,20 @@ BOOL mouse_movement() {

else
return FALSE;
}

/*
Check if the machine have enough memory space, usually VM get a small ammount,
one reason if because several VMs are running on the same servers so they can run
more tasks at the same time.
*/
BOOL memory_space()
{
DWORDLONG ullMinRam = (1024LL * (1024LL * (1024LL * 1LL))); // 1GB
MEMORYSTATUSEX statex = {0};

statex.dwLength = sizeof(statex);
GlobalMemoryStatusEx(&statex);

return (statex.ullTotalPhys < ullMinRam) ? TRUE : FALSE;
}
3 changes: 2 additions & 1 deletion al-khaser/Anti VM/Generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ BOOL str_trick();
BOOL number_cores_wmi();
BOOL disk_size_wmi();
BOOL setupdi_diskdrive();
BOOL mouse_movement();
BOOL mouse_movement();
BOOL memory_space();

0 comments on commit be43914

Please sign in to comment.