Autor: DjH | 19.10.2007 |
begin
//0F 8C 01 02 00 00 8B 86 84 A3 02 00 85 C0 EB 31 8B 86 E8 A4 02 00 8B 96 F0 A4 02 00
maxL := 7; //in array is declared max value 128...
rasd[1] := $0F; rawd[1] := $0F;
rasd[2] := $8C; rawd[2] := $8C;
rasd[3] := $01; rawd[3] := $01;
rasd[4] := $02; rawd[4] := $07;
rasd[5] := $00; rawd[5] := $00;
rasd[6] := $00; rawd[6] := $00;
rasd[7] := $8B; rawd[7] := $8B;
//rasd=search byte, rawd=byte to replace(write)
end;
for j := 1 to FileSeek (FlHandle, 0, 2) do
begin
l:=1;
m:=1;
FileSeek (FlHandle, n, 0); //Seek the offset "addres" from Begin (0)
FileRead (FlHandle, Bfr, 1); //Actually byte to bfr
lopS:
if bfr = rasd[l] then
//Compare with „search for“ byte
begin
if l = maxl then //if all „search for“ bytes are equals
begin
SetDlgItemText(mwnd, id_process, Pchar(GetText + #13#10 + 'Bytes at address ' + inttohex(n,2) + ' equals to the "find data"! Now Replacing...')); ScrollText;
//id_proces = Memo :), process info
goto lopR;
end else
begin
FileSeek (FlHandle, (n + l), 0);
FileRead (FlHandle, Bfr, 1);
inc (l);
goto lopS;
end;
end;
goto end2;
lopR:
if m = (maxl + 1) then
begin
SetDlgItemText(mwnd, id_process, Pchar(GetText + #13#10 + 'Bytes at address ' + inttohex(n,2) + ' sucessfully patched!')); ScrollText;
Inc(HowManyCrkd);
Inc(CrkdProc);
goto end2;
end else
begin
FileSeek (FlHandle, (n - 1 + m), 0);
FileWrite(FlHandle, rawd[m], 1);
inc (m);
goto lopR;
end;
end2:
inc(n);
end;
//Created by DjH's BTP4C v0.5
MaxL := 16;
rasd[1] := $F7; rawd[1] := $F7;
rasd[2] := $F3; rawd[2] := $F3;
rasd[3] := $35; rawd[3] := $35;
rasd[4] := $86; rawd[4] := $86;
rasd[5] := $14; rawd[5] := $14;
rasd[6] := $00; rawd[6] := $00;
rasd[7] := $00; rawd[7] := $00;
rasd[8] := $75; rawd[8] := $90;
rasd[9] := $1E; rawd[9] := $90;
rasd[10] := $6A; rawd[10] := $6A;
rasd[11] := $00; rawd[11] := $00;
rasd[12] := $68; rawd[12] := $68;
rasd[13] := $CC; rawd[13] := $CC;
rasd[14] := $30; rawd[14] := $30;
rasd[15] := $40; rawd[15] := $40;
rasd[16] := $00; rawd[16] := $00;
Když odstraníme veškeré zbytečnosti (ovládání oken, různé deklarace a procedury), zbude nám asi toto:
procedure Declare;
begin
if o= 1 then
begin
//Created by DjH's BTP4C v0.5
MaxL := 16;
rasd[1] := $F7; rawd[1] := $F7;
rasd[2] := $F3; rawd[2] := $F3;
rasd[3] := $35; rawd[3] := $35;
rasd[4] := $86; rawd[4] := $86;
rasd[5] := $14; rawd[5] := $14;
rasd[6] := $00; rawd[6] := $00;
rasd[7] := $00; rawd[7] := $00;
rasd[8] := $75; rawd[8] := $90;
rasd[9] := $1E; rawd[9] := $90;
rasd[10] := $6A; rawd[10] := $6A;
rasd[11] := $00; rawd[11] := $00;
rasd[12] := $68; rawd[12] := $68;
rasd[13] := $CC; rawd[13] := $CC;
rasd[14] := $30; rawd[14] := $30;
rasd[15] := $40; rawd[15] := $40;
rasd[16] := $00; rawd[16] := $00;
end;
end;
function CrackIt: string; //Search and Replace engine, Delphi Code, by DjH2oo7
label lopS;//loop in search...
label lopR;//loop in replace...
label end2;//jmp
begin
HowManyCrkd := 0;
j:=0;
n:=1; //WE CAN'NT USE "J", I DON'T KNOW
WHY??!!!
for j := 1 to FileSeek (FlHandle, 0, 2) do
begin
l:=1;
m:=1;
FileSeek (FlHandle, n, 0); //Seek the offset "addres" from Begin (0)
FileRead (FlHandle, Bfr, 1);
lopS:
if bfr = rasd[l] then
begin
if l = maxl then
begin
SetDlgItemText(mwnd, id_process, Pchar(GetText + #13#10 + 'Bytes at address ' + inttohex(n,2) + ' equals to the "find data"! Now Replacing...')); ScrollText;
goto lopR;
end else
begin
FileSeek (FlHandle, (n + l), 0);
FileRead (FlHandle, Bfr, 1);
inc (l);
goto lopS;
end;
end;
goto end2;
lopR:
if m = (maxl + 1) then
begin
SetDlgItemText(mwnd, id_process, Pchar(GetText + #13#10 + 'Bytes at address ' + inttohex(n,2) + ' sucessfully
patched!')); ScrollText;
Inc(HowManyCrkd);
Inc(CrkdProc);
goto end2;
end else
begin
FileSeek (FlHandle, (n - 1 + m), 0);
FileWrite(FlHandle, rawd[m], 1);
inc (m);
goto lopR;
end;
end2:
inc(n);
end;
SetDlgItemText(mwnd, id_process, Pchar(GetText + #13#10 + 'Cracked ' + inttostr(HowManyCrkd) + ' same procedures!')); ScrollText;
end;
//#########################################################################//
function GetInfo: string;
begin
crkdproc:=0; //Kolik bylo cracknuto procedur...porovna se to s tim, kolik jich cracknuto melo byt a pokud se sobe cisla rovnaji (tedy bylo vsechno cracknuto), crack vy\hodnoti akci za uspesnou :), nekdy je i vsak mozne, ze se crackne procedur vice (je jich deklarovano 3 a cracknou se 4, proc? Protoze treba kusu kodu jako je deklarace 2 muze byt v programu vice... nekdy to muze byt umysl, nekdy vsak ne...)
if not FileExists(FlName) then
begin
SetDlgItemText(mwnd, id_process, Pchar(GetText + #13#10 + 'File ' + FlName + ' not found, please, find it manually ;)')); ScrollText;
OpenDlg;
FlName:=Opn.lpstrFile;
SetDlgItemText(mwnd, id_process, Pchar(GetText + #13#10 + 'File ' + FlName + #13#10 + '[LOADED]')); ScrollText;
begin
IsBkuped; //Kontrola, jestli je zaskrtly CheckBox pro zalohovani
//---------------------------------------------------\\
FlHandle := FileOpen (FlName, fmOpenReadWrite); //nyni oteverme soubor a zjistime jeho handle
//---------------------------------------------------\\
for o := 1 to nop do //nop je "number of procedures" :), tudiz kolik procedur se mam
cracknout, je to deklarovano uplne dole :)
begin
Declare; //Deklarovani bytu pro "search" a pro "write"
CrackIt; //Spusteni s&r enginu, cracknuti
end;
//---------------------------------------------------\\
FileClose(FlHandle); //zavreni handle, souboru
//---------------------------------------------------\\
end;
SetDlgItemText(mwnd, id_process, Pchar(GetText + #13#10 + '[JOB COMPLETED]'));
if (crkdproc >= nop) then
begin
SetDlgItemText(mwnd, id_process, Pchar(GetText + #13#10 + inttostr(crkdproc) + ' procedures cracked of ' +
inttostr(nop) + #13#10 + '[:' + product + ':] sucessfully cracked!! ;)')); ScrollText;
MessageBox(mwnd,pchar(product + ' sucessfully cracked ;)'), pchar('Cracked ;)'), 0);
end else
begin
SetDlgItemText(mwnd, id_process, Pchar(GetText + #13#10 + product + ' - ERROR! ' + inttostr(crkdproc) + ' procedures cracked of ' + inttostr(nop) + '!! (Maybe yet cracked, or you cracking update (or other) version)'));
ScrollText;
MessageBox(mwnd,pchar(product + ' - ERROR! ' + inttostr(crkdproc) + ' procedures cracked of ' + inttostr(nop) + '!! (Maybe yet cracked, or you cracking update (or other) version)'), pchar('NOT Cracked !!'), 0);
end;
end else
//To same, akorat ze patch zjisti, ze program (v tomto pripade CMe) je ve stejne slozce jako je patch, tudiz nemusime nic hledat a okamzite se crackuje :)
begin
SetDlgItemText(mwnd, id_process, Pchar(GetText + #13#10 + 'File ' + FlName + #13#10 + '[LOADED]')); ScrollText;
begin
IsBkuped;
//---------------------------------------------------\\
FlHandle := FileOpen (FlName, fmOpenReadWrite);
//---------------------------------------------------\\
for o := 1 to nop do
begin
Declare;
CrackIt;
end;
//---------------------------------------------------\\
FileClose(FlHandle);
//---------------------------------------------------\\
end;
SetDlgItemText(mwnd, id_process, Pchar(GetText + #13#10 + '[CRACKED]'));
if (crkdproc >= nop) then
begin
SetDlgItemText(mwnd, id_process, Pchar(GetText + #13#10 + product + ' sucessfully cracked ;)')); ScrollText;
MessageBox(mwnd,pchar(product + ' sucessfully cracked ;)'), pchar('Cracked ;)'), 0);
end else
begin
SetDlgItemText(mwnd, id_process, Pchar(GetText + #13#10 + product + ' - ERROR! NOTHING CRACKED! (Maybe yet cracked)')); ScrollText;
MessageBox(mwnd,pchar(product + ' - ERROR! NOTHING CRACKED! (Maybe yet cracked)'), pchar('NOT Cracked !!'), 0);
end;
end;
end;