AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

try ... except

Ein Thema von MCQ · begonnen am 14. Feb 2006 · letzter Beitrag vom 21. Feb 2006
 
MCQ

Registriert seit: 14. Jan 2004
Ort: Dessau
80 Beiträge
 
#14

Re: try ... except

  Alt 14. Feb 2006, 22:15
hier mal der komplette source

Delphi-Quellcode:
library test;

uses
// dialogs,sysutils,
  windows;

const
 IMAGEBASE = $00400000;
 CRC = $4808181C;
{$R *.res}


procedure CheckSerial(serial:Pchar);
begin
if Serial='MCQs Debugger-Protectionthen
MessageBox(0,'Gültige Serial - aber darum gings hier ja auch nicht ;)','',MB_ICONINFORMATION)
else
MessageBox(0,'ungültige Serial','Fehler',MB_ICONERROR)
end;


exports CheckSerial;



procedure ForceException;stdcall;
var start,ende,dw:DWORD;
    err:boolean;
begin
err:=false;
start:=GetTickCount;
try
 asm
  int 3 // <-- BreakPoint für Debugger
 end
except
 err:=true;
end;
ende:=GetTickCount;
if (start-ende>10) or not err then ExitProcess(0); // wenn Debugger angesprungen oder timeout dann ExitProcess
end;


procedure AntiBP;
label weiter;
var mycrc:DWORD;
begin
 asm
(*
  EAX - Start
  EBX - Länge
  ECX - Zähler
  EDX - CRC
*)

  push eax
  push ebx
  push ecx
  push edx
  mov eax,IMAGEBASE
  add eax,$3C
  mov eax,[eax]
  add eax, IMAGEBASE
  mov ebx, [eax+$1C] // Size of Code
  mov eax, [eax+$2C] // Base of Code
  add eax, IMAGEBASE
  xor ecx, ecx
  xor edx, edx
  weiter:
  xor edx,[eax+ecx]
  inc ecx
  cmp ecx,ebx
  jnz weiter
// int 3
  mov mycrc,edx
  cmp edx,crc
  push 100
  call sleep
  pop edx
  pop ecx
  pop ebx
  pop eax
  jz AntiBP
  mov eax,offset ExitProcess
  call eax
  end;
// showmessage(inttohex(mycrc,8));
  ExitProcess(0);
end;

procedure AntiAttach;
var pProc:Pointer;
    tmp:DWORD;
begin
pProc:=GetProcAddress(LoadLibrary('ntdll.dll'),'DbgUiRemoteBreakin');
VirtualProtect(pProc,1,PAGE_EXECUTE_READWRITE,tmp);
asm
 push eax
  mov eax,pProc
  mov [eax],$006A
  mov [eax+2],$B8
  mov [eax+3], offset ExitProcess
  mov [eax+7], $D0FF
 pop eax
end;
VirtualProtect(pProc,1,tmp,tmp);
end;


label SetAPIHook;
var tmp:DWORD;
begin
 asm
  push eax
  push ebx
  mov eax,IMAGEBASE
  add eax,$3C
  mov eax,[eax]
  add eax,IMAGEBASE
  add eax,$28
  mov eax,[eax]
  add eax,IMAGEBASE
  mov bl,[eax]
  xor bl,$23
  add bl,$11
  test bl,bl
  jnz SetAPIHook
  mov eax,offset ExitProcess
  push 0
  call eax // ExitProcess(0);
  SetAPIHook:
  pop ebx
  pop eax
  call AntiAttach
  call ForceException
 end;
BeginThread(nil,0,@AntiBP,nil,0,tmp);
end.
Bis auf die Funktion ForceException funtioniert es auch wunderbar
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:32 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz