您现在的位置:首页 >> 硬件系统 >> 硬件系统 >> 内容

Delphi中嵌入汇编检测是否在虚拟机里运行

时间:2011/9/3 15:18:25 点击:

  核心提示:function IsVMwarePresent(): LongBool; stdcall; begin Result := False;{$IFDEF CPU386} try asm mov eax...
function IsVMwarePresent(): LongBool; stdcall; 
begin 
  Result := False; 
 {$IFDEF CPU386} 
  try 
    asm 
            mov     eax, 564D5868h 
            mov     ebx, 00000000h 
            mov     ecx, 0000000Ah 
            mov     edx, 00005658h 
            in      eax, dx 
            cmp     ebx, 564D5868h 
            jne     @@exit 
            mov     Result, True 
    @@exit: 
    end; 
  except 
    Result := False; 
  end; 
{$ENDIF} 
end;

作者:网络 来源:转载
共有评论 0相关评论
发表我的评论
  • 大名:
  • 内容:
  • 盒子文章(www.2ccc.com) © 2024 版权所有 All Rights Reserved.
  • 沪ICP备05001939号