diff --git a/pafish/cpu.c b/pafish/cpu.c index 8ecae79..fc8eca4 100644 --- a/pafish/cpu.c +++ b/pafish/cpu.c @@ -137,17 +137,19 @@ void cpu_write_brand(char * brand) { } int cpu_known_vm_vendors() { - const int count = 4; + const int count = 6; int i; - char cpu_vendor[13]; + char cpu_hv_vendor[13]; string strs[count]; - strs[0] = "KVMKVMKVMKVM"; - strs[1] = "Microsoft Hv"; - strs[2] = "VMwareVMware"; - strs[3] = "XenVMMXenVMM"; - cpu_write_vendor(cpu_vendor); + strs[0] = "KVMKVMKVMKVM"; /* KVM */ + strs[1] = "Microsoft Hv"; /* Microsoft Hyper-V or Windows Virtual PC */ + strs[2] = "VMwareVMware"; /* VMware */ + strs[3] = "XenVMMXenVMM"; /* Xen */ + strs[4] = "prl hyperv "; /* Parallels */ + strs[5] = "VBoxVBoxVBox"; /* VirtualBox */ + cpu_write_hv_vendor(cpu_hv_vendor); for (i = 0; i < count; i++) { - if (!memcmp(cpu_vendor, strs[i], 12)) return TRUE; + if (!memcmp(cpu_hv_vendor, strs[i], 12)) return TRUE; } return FALSE; } diff --git a/pafish/main.c b/pafish/main.c index e2f4e1c..f84c222 100644 --- a/pafish/main.c +++ b/pafish/main.c @@ -107,10 +107,10 @@ int main(void) exec_check("Checking hypervisor bit in cpuid feature bits", &cpu_hv, "CPU VM traced by checking hypervisor bit in cpuid feature bits", "hi_CPU_VM_hypervisor_bit"); - exec_check("Checking cpuid vendor for known VM vendors", + exec_check("Checking cpuid hypervisor vendor for known VM vendors", &cpu_known_vm_vendors, - "CPU VM traced by checking cpuid vendor for known VM vendors", - "hi_CPU_VM_vendor_name"); + "CPU VM traced by checking cpuid hypervisor vendor for known VM vendors", + "hi_CPU_VM_hv_vendor_name"); /* Generic sandbox detection tricks */ print_check_group("Generic sandbox detection");