/* While checking the dmi string infomation, just checking the product serial key should be enough, as this will always have a VMware specific string when running under VMware hypervisor.  */
int vmware_platform(void)
/* While checking the dmi string infomation, just checking the product serial key should be enough, as this will always have a VMware specific string when running under VMware hypervisor.  */
int vmware_platform(void)
{
	if (cpu_has_hypervisor) {
		unsigned int eax, ebx, ecx, edx;
		char hyper_vendor_id[13];
		cpuid(CPUID_VMWARE_INFO_LEAF, &eax, &ebx, &ecx, &edx);
		memcpy(hyper_vendor_id + 0, &ebx, 4);
		memcpy(hyper_vendor_id + 4, &ecx, 4);
		memcpy(hyper_vendor_id + 8, &edx, 4);
		hyper_vendor_id[12] = '\0';
		if (!strcmp(hyper_vendor_id, "VMwareVMware"))
			return 1;
	} else if (dmi_available && dmi_name_in_serial("VMware") &&
		   __vmware_platform())
		return 1;
	return 0;
}