function isruninvmware(out errmsg: string): boolean;
begin
result := false;
try
asm
push edx
push ecx
push ebx
mov eax, 'vmxh'
mov ecx, $0a
mov edx, 'vx'
in eax, dx
cmp ebx, 'vmxh'
setz [result]
pop ebx
pop ecx
pop edx
end;
except
on e: exception do
errmsg := e.message;
end;
end;
以上代码摘自 橙子