Einzelnen Beitrag anzeigen

Benutzerbild von ErazerZ
ErazerZ

Registriert seit: 27. Mai 2005
Ort: Baden
315 Beiträge
 
Delphi 2007 Enterprise
 
#10

Re: Kopierschutz einer Anwendung

  Alt 21. Nov 2006, 15:59
Zitat von pap80b:
Habe es selbst nicht getestet, ist aber eventuell einen Versuch wert.

function VMware: 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;

Quelle: http://www.buha.info/board/showthread.php?p=301232
Delphi-Quellcode:
{
  Orginal code by Gobo
}

function IsVirtualMachine: Boolean;
var
  Temp: Array[0..5] of Byte;
  TempB: Byte;
begin
  asm
    sidt Temp
    mov bh, byte ptr [Temp + 5]
    mov TempB, bh
  end;
  case TempB of
    $ff, $e8:
      Result := True;
    else
      Result := False;
  end;
end;
  Mit Zitat antworten Zitat