function IsDebuggerPresent: BOOL; stdcall; external 'kernel32.dll';
function BoundsCheckerDetected: Boolean;
begin
try
asm
push ebp
mov ebp, 'BCHK'
mov ax, 4
int 3
cmp ax, 4
jne @@softice_detected
mov ax, 0
jmp @@exit
@@softice_detected:
mov ax, 1
@@exit:
pop ebp
end;
except
on E: EExternalException do
begin
result:=False;
end else begin
result:=true;
end;
end;
end;
function SoftIceVXDDetected: Boolean;
begin
try
asm
push esi
push edi
mov ax, $1684
mov bx, $0202
xor di, di
mov es, di
int $2F
mov ax, es
add di,ax
cmp di, 0
jne @@softice_detected
mov ax, 0
jmp @@exit
@@softice_detected:
mov ax, 1
@@exit:
pop edi
pop esi
end;
except
result:=False;
end;
end;
//------------
function WinIceDetected: Boolean;
begin
try
asm
mov ah, $43
int $68
cmp ax, $F386
jz @@winice_detected
mov ax, 0
jmp @@exit
@@winice_detected:
mov ax, 1
@@exit:
end;
except
result:=False;
end;
end;