Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ Please, if you encounter any of the anti-analysis tricks which you have seen in
- SMBIOS string checks (VMWare)
- SMBIOS string checks (Qemu)
- SMBIOS number of tables (Qemu, VirtualBox)
- ACPI string checks (WAET table)
- ACPI string checks (VirtualBox)
- ACPI string checks (VMWare)
- ACPI string checks (Qemu)
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 @@ -214,6 +214,7 @@ int main(int argc, char* argv[])
exec_check(&registry_services_disk_enum, TEXT("Checking Services\\Disk\\Enum entries for VM strings "));
exec_check(&registry_disk_enum, TEXT("Checking Enum\\IDE and Enum\\SCSI entries for VM strings "));
exec_check(&number_SMBIOS_tables, TEXT("Checking SMBIOS tables "));
exec_check(&firmware_ACPI_WAET, TEXT("Checking if ACPI WAET table is present "));
}

/* VirtualBox Detection */
Expand Down
50 changes: 50 additions & 0 deletions al-khaser/AntiVM/Generic.cpp
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -2044,3 +2044,53 @@ BOOL number_SMBIOS_tables()
}
return result;
}

/*
Check for Windows ACPI Emulated devices Table (WAET)
https://download.microsoft.com/download/7/E/7/7E7662CF-CBEA-470B-A97E-CE7CE0D98DC2/WAET.docx
*/
BOOL firmware_ACPI_WAET()
{
BOOL result = FALSE;

PDWORD tableNames = static_cast<PDWORD>(malloc(4096));

if (tableNames) {
SecureZeroMemory(tableNames, 4096);
DWORD tableSize = enum_system_firmware_tables(static_cast<DWORD>('ACPI'), tableNames, 4096);

// API not available
if (tableSize == -1)
return FALSE;

DWORD tableCount = tableSize / 4;
if (tableSize < 4 || tableCount == 0)
{
result = TRUE;
}
else
{
for (DWORD i = 0; i < tableCount; i++)
{
DWORD tableSize = 0;
PBYTE table = get_system_firmware(static_cast<DWORD>('ACPI'), tableNames[i], &tableSize);

if (table) {

PBYTE waetString = (PBYTE)"WAET";
size_t StringLen = 4;

if (find_str_in_data(waetString, StringLen, table, tableSize))
{
result = TRUE;
}

free(table);
}
}
}

free(tableNames);
}
return result;
}
3 changes: 2 additions & 1 deletion al-khaser/AntiVM/Generic.h
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,5 @@ BOOL cim_voltagesensor_wmi();
BOOL pirated_windows();
BOOL registry_services_disk_enum();
BOOL registry_disk_enum();
BOOL number_SMBIOS_tables();
BOOL number_SMBIOS_tables();
BOOL firmware_ACPI_WAET();