//------------------------------------------------------------------
構(gòu)建一個(gè)函數(shù),使用了匯編語言啊,嘿嘿!
// -------------------開始-----------------------------------------
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; 
//------------------form http://blog.csdn.net/laoli----------------------------------------------------------
//---------------------------測(cè)試一下-----------------------------------------------------------------------------------
rocedure TForm1.FormCreate(Sender: TObject);
begin
 if  IsVMwarePresent then
     ShowMessage('你運(yùn)行在虛擬機(jī)')
     else
      ShowMessage('正常運(yùn)行')
      end;
//---------------------------------------------------------------------------------------------------------------------------
//----------------先保存---------按F9,運(yùn)行,暈!有提示信息.不理!再按F9,:正常運(yùn)行',哈哈!
新聞熱點(diǎn)
疑難解答
圖片精選
網(wǎng)友關(guān)注