首页
社区
课程
招聘
PATCH for ASPr2.0 在线翻译完,大家凑着看吧
发表于: 2005-3-29 10:16 4409

PATCH for ASPr2.0 在线翻译完,大家凑着看吧

2005-3-29 10:16
4409
- = ALEX = - Writing INLINE PATCH'a for ASProtect 2.0

The Name: DropToCD.exe
Protection: ASProtect 2.0x Registered-> Alexey Solodovnikov
The Size: 563712 bytes
Tools: OllyDbg 1.10, WinHEX, HIEW
ICQ: 531776 e-mail: alex@kpnemo.ru

The Purpose of my clause is to show a writing inline a patch for popular
and powerful in Present time of protector ASProtect 2.0. Clause basically
raschitana on krjakerov an average A level since it will seem to beginners
very bulky and not clear, many trifling thingsI shall not explain J the
Patch has been written during full research of work of a protector, to explain
Work of each line of a code I shall not be, I give this opportunity to you J,
therefore questions " and Why it is necessary so to do? " To set it is not
necessary, understand J I only I show, how it Did ? I hope it will give a push
for the further studying this protector.

Well perhaps we shall begin... The Principle of work of a patch will be will
conclude in consecutive transfer Managements from a body of a protector on our
code, as a result in the end of all frauds we can To change a code of already
unpacked program. ASProtect has "multilayered" structure, i.e. a part Its code
it is unpacked in the allocated area of memory and there it is carried out.
Therefore the first stage There will be a finding of a point to an input in first
"layer" J. We load our "victim" into a debugger, we put break on VirtualAlloc,
we are thrown out approximately in such place:

00BAF4E3 6A 40 PUSH 40
00BAF4E5 68 00100000 PUSH 1000
00BAF4EA FFB5 04040000 PUSH DWORD PTR [EBP+404]
00BAF4F0 6A 00 PUSH 0
00BAF4F2 FF95 F0030000 CALL DWORD PTR [EBP+3F0]; kernel32. VirtualAlloc
00BAF4F8 8985 CC010000 MOV DWORD PTR [EBP+1CC], EAX
Memory under a code of a body Is allocated. There is one more allocation of memory,
and also unpacking Further A code in the allocated area. All this has put comes to
an end:

00BAF607 68 00000000 PUSH 0
00BAF60C C3 RETN
It is transition to a code in the allocated memory. The code to the address of
00BAF607 is modified by commands Above, namely:

00BAF5CE 8B46 04 MOV EAX, DWORD PTR [ESI+4]
00BAF5D1 03C7 ADD EAX, EDI
00BAF5D3 8985 C7010000 MOV DWORD PTR [EBP+1C7], EAX

First our purpose will be interception of these commands. But here we shall collide
with most gimornym perhaps J Bajty to this iie?eioiaaiu address and raskriptovyvajutsja
multilevel Self-modified kriptorom with dust J all this is necessary to Us has put
"razgrebsti" and To try to write kriptor on the basis of dekriptora. It will be necessary
for us to change commands

00BAF5D1 03C7 ADD EAX, EDI
00BAF5D3 8985 C7010000 MOV DWORD PTR [EBP+1C7], EAX
Which borrow 8 bytes. (it is wonderful, two dword'a J). We put brjak on access to the
address of 00BAF5D1 We Restart a program. Works the first brjak.

00BAF110 8B11 MOV EDX, DWORD PTR [ECX]
00BAF112 0F87 05000000 JA DropToCD.00BAF11D
00BAF118 56 PUSH ESI
00BAF119 0FBFDE MOVSX EBX, SI
00BAF11C 5E POP ESI
00BAF11D 81C2 955CCB48 ADD EDX, 48CB5C95
00BAF123 81C2 AA010A65 ADD EDX, 650A01AA

There is a code with dust Further, separate from dust, we look what registers are used for
reading Byte and their updatings. ECX to us specifies just on 00BAF5D1 we Clear a code of
dust it is received:

00BAF110 8B11 MOV EDX, DWORD PTR [ECX]
00BAF11D 81C2 955CCB48 ADD EDX, 48CB5C95
00BAF123 81C2 AA010A65 ADD EDX, 650A01AA
00BAF12D 81F2 9BB14005 XOR EDX, 540B19B
00BAF133 8911 MOV DWORD PTR [ECX], EDX

Displacement from the base address of ours 0
Further the cycle reduces the address on 4. We search for the subsequent blocks as, as a
result we receive such Data interesting to us:

00BAF17E FF3417 PUSH DWORD PTR [EDI+EDX]
00BAF181 59 POP ECX
00BAF185 81F1 3019EC7F XOR ECX, 7FEC1930
00BAF18B 81E9 A9895312 SUB ECX, 125389A9
00BAF196 81E9 2E4B3923 SUB ECX, 23394B2E
00BAF1A1 51 PUSH ECX
00BAF1A5 8F043A POP DWORD PTR [EDX+EDI]

Displacement from base our address-3

00BAF24A 8B11 MOV EDX, DWORD PTR [ECX]
00BAF253 81C2 4FD9BD37 ADD EDX, 37BDD94F
00BAF273 81EA DCC82536 SUB EDX, 3625C8DC
00BAF286 81EA E5BD7147 SUB EDX, 4771BDE5
00BAF28E 8911 MOV DWORD PTR [ECX], EDX

Displacement from the base address of ours 0

00BAF2F3 8B37 MOV ESI, DWORD PTR [EDI]
00BAF2F7 81C6 B3DCB81A ADD ESI, 1AB8DCB3
00BAF2FF 81EE 70B26659 SUB ESI, 5966B270
00BAF315 81C6 E949B84D ADD ESI, 4DB849E9
00BAF320 56 PUSH ESI
00BAF326 8F07 POP DWORD PTR [EDI]

Displacement from base our address-1

00BAF3B7 FF340F PUSH DWORD PTR [EDI+ECX]
00BAF3C0 5A POP EDX
00BAF3C1 81EA DED7DD07 SUB EDX, 7DDD7DE
00BAF3CC 81F2 BFBDEE44 XOR EDX, 44EEBDBF
00BAF3E2 81F2 8C2C3158 XOR EDX, 58312C8C
00BAF3E8 52 PUSH EDX
00BAF3EE 8F0439 POP DWORD PTR [ECX+EDI]

Displacement from base our address-1
Well all. More blocks are not present. We shall do now kriptor, on the basis of dekriptora. Here it is necessary to be
Close very much J For the beginning we shall make dekriptor, the main thing that all worked, well and then already and
kriptor. Initial data are necessary to us. We take them at the rate of 8 bytes + ours 8 + 8. What for so-oc J
I especially algo did not dig, but next bajty is interconnected with each other ? Therefore, we allocate such:

00BAF5C9 87 14 0D 6C FF CE 82 A7 39 93 90 24 47 59 C8 B0
00BAF5D9 81 02 E2 27 85 90 C8 B0

The Allocated font specifies those bajty which we shall change (base). Well now all this
Kindly we write, I wrote on delfi, I do not know why J for convenience navena ?

var bytes:array [0..23] of byte =
($087, $014, $00D, $06C, $0FF, $0CE, $082, $0A7, $039, $093, $090, $024, $047, $059, $0C8, $0B0, $081,
$002, $0E2, $027, $085, $090, $0C8, $0B0);
procedure decr ();
asm
push eax
push ebx
push ecx
lea ebx, bytes [20]
mov ecx, 5
@loop1:
mov eax, [ebx]
add eax, 48CB5C95h
add eax, 650A01AAh
xor eax, 540B19Bh
mov [ebx], eax
sub ebx, 4
dec ecx
jnz @loop1
//////////
add ebx, 20
mov ecx, 5
@loop2:
mov eax, [ebx-3]
xor eax, 7FEC1930h
sub eax, 125389A9h
sub eax, 23394B2Eh
mov [ebx-3], eax
sub ebx, 4
dec ecx
jnz @loop2
//////////
add ebx, 20
mov ecx, 5
@loop3:
mov eax, [ebx]
add eax, 37BDD94Fh
sub eax, 3625C8DCh
sub eax, 4771BDE5h
mov [ebx], eax
sub ebx, 4
dec ecx
jnz @loop3
//////////
add ebx, 20
mov ecx, 5
@loop4:
mov eax, [ebx-1]
add eax, 1AB8DCB3h
sub eax, 5966B270h
add eax, 4DB849E9h
mov [ebx-1], eax
sub ebx, 4
dec ecx
jnz @loop4
//////////
add ebx, 20
mov ecx, 5
@loop5:
mov eax, [ebx-1]
sub eax, 7DDD7DEh
xor eax, 44EEBDBFh
4 at ALEX, 2005
xor eax, 58312C8Ch
mov [ebx-1], eax
sub ebx, 4
dec ecx
jnz @loop5
pop ecx
pop ebx
pop eax
end;

We Check work of the given code, and what we see? Works J on an output we shall receive:

00BAF5C9 89 43 08 5F 5E 8B 46 04 03 C7 89 85 C7 01 00 00
00BAF5D9 8B 55 5B 8B 85 C7 01 00
Game J Now Has gone write kriptor, all is done on the contrary:

var bytes:array [0..23] of byte =
($089, $043, $008, $05F, $05E, $08B, $046, $004, $003, $0C7, $089, $085, $0C7, $001, $000, $000, $08B,
$055, $05B, $08B, $085, $0C7, $001, $000);
procedure decr ();
asm
push eax
push ebx
push ecx
lea ebx, bytes [4]
mov ecx, 4
@loop5:
mov eax, [ebx-1]
xor eax, 58312C8Ch
xor eax, 44EEBDBFh
add eax, 7DDD7DEh
mov [ebx-1], eax
add ebx, 4
dec ecx
jnz @loop5
//////////
sub ebx, 16
mov ecx, 4
@loop4:
mov eax, [ebx-1]
sub eax, 4DB849E9h
add eax, 5966B270h
sub eax, 1AB8DCB3h
mov [ebx-1], eax
add ebx, 4
dec ecx
jnz @loop4
//////////
sub ebx, 16
mov ecx, 4
@loop3:
mov eax, [ebx]
add eax, 4771BDE5h
add eax, 3625C8DCh
sub eax, 37BDD94Fh
mov [ebx], eax
add ebx, 4
dec ecx
jnz @loop3
//////////
sub ebx, 16
mov ecx, 4
@loop2:
mov eax, [ebx-3]
add eax, 23394B2Eh
add eax, 125389A9h
5 at ALEX, 2005
xor eax, 7FEC1930h
mov [ebx-3], eax
add ebx, 4
dec ecx
jnz @loop2
//////////
sub ebx, 16
mov ecx, 4
@loop1:
mov eax, [ebx]
xor eax, 540B19Bh
sub eax, 48CB5C95h
sub eax, 650A01AAh
mov [ebx], eax
add ebx, 4
dec ecx
jnz @loop1
pop ecx
pop ebx
pop eax
end;

Strangely enough, our problem works J Now to find an empty seat under our patch. Basically
It in the end of a file ? Happened at me, that the place did not suffice, it was necessary
to increase the size of a file,And accordingly to forward values in PE Header'a, well and
then accordingly to restore Former value to keep integrity of an initial file. The beginning
of a patch will be on offset 89668, RVA = 00BD2668 Now to this address we shall write for
the beginning those commands, which We "shall jam":

00BD2668 03C7 ADD EAX, EDI
00BD266A 8985 C7010000 MOV DWORD PTR [EBP+1C7], EAX
To transfer management from a body aspra, we shall be as follows:

00BAF5D1 BA 6826BD00 MOV EDX, 00BD2668
00BAF5D6 FFD2 CALL EDX
00BAF5D8 90 NOP
I have chosen Register EDX from those reasons, that it free, since following for these commands
A command:

00BAF5D9 8B55 5B MOV EDX, DWORD PTR [EBP+5B]

Now we insert into ours kriptor sequence of byte BA 68 26 BD 00 FF D2 90. Kriptuem,
We compare with initial bajtami and it turns out, that it is necessary to change such sequence

Byte: 92 30 E6 4D 3A 9B 57 13 83 we Correct this business in the program ?

00BAF5D1 92 30 E6 4D 3A 9B 57 13 83

We Start, we check, all is normal dekriptonulos J Have gone further, we pass further on
To a code, again allocation of memory under following "layer", but so wanted to me, we shall place the
A code to such address:

010D00F3 68 00800000 PUSH 8000
010D00F8 6A 00 PUSH 0
010D00FA 50 PUSH EAX
010D00FB FF95 7D294400 CALL DWORD PTR [EBP+44297D]; kernel32. VirtualFree
010D0107 50 PUSH EAX
010D0108 C3 RETN
6 at ALEX, 2005

This code is from the base address (the address of the allocated memory of first "layer") on 0F3 Such
The structure was kept still with raneshnih versions aspra. We shall transfer management, having replaced
Commands:

010D00F3 68 00800000 PUSH 8000
010D00F8 6A 00 PUSH 0
On

010D00F3 B9 8B26BD00 MOV ECX, 0BD268B
010D00F8 FFD1 CALL ECX
We Come back again to the first piece of a patch and it is finished it:

00BD2668 03C7 ADD EAX, EDI
00BD266A 8985 C7010000 MOV DWORD PTR [EBP+1C7], EAX
00BD2670 83C2 23 ADD EDX, 22
00BD2673 C680 F3000000 B9 MOV BYTE PTR [EAX+F3], 0B9
00BD267A 8990 F4000000 MOV DWORD PTR [EAX+F4], EDX
00BD2680 66:C780 F8000000 FFD1 MOV WORD PTR [EAX+F8], 0D1FF
00BD2689 C3 RETN

I shall a little comment: EDX-contains the address of the beginning of our patch, EAX-contains the address
The beginnings allocated memories of first "layer". ADD EDX, 22 will already specify the second piece
Our patch. We shall add the changed commands and we shall continue to investigate further a code aspra ? code:
00BD268A 5B POP EBX
00BD268B 68 00800000 PUSH 8000
00BD2690 6A 00 PUSH 0
00BD2692 FFE3 JMP EBX
We Go further ? the similar code Is found still:

010D03D7 68 00800000 PUSH 8000
010D03DC 6A 00 PUSH 0
010D03DE 50 PUSH EAX
010D03DF FF95 7D294400 CALL DWORD PTR [EBP+44297D]; kernel32. VirtualFree
propatchim this code:

00BD268A 5B POP EBX
00BD268B 68 00800000 PUSH 8000
00BD2690 6A 00 PUSH 0
00BD2692 83C1 23 ADD ECX, 23
00BD2695 C683 DD020000 B9 MOV BYTE PTR DS: [EBX+2DD], 0B9
00BD269C 898B DE020000 MOV DWORD PTR DS: [EBX+2DE], ECX
00BD26A2 66:C783 E2020000 00D1 MOV WORD PTR DS: [EBX+2E2], 0D100
00BD26AB FFE3 JMP EBX

Now it is necessary to move further, namely to find a place where there is a check on CRC a file. Is
This place thus: we put brjak on MapViewOfFileEx. First time will work not there where it is necessary
At me J, it can be peeped, the second operation where it is necessary. It is possible to be convinced Of it:
7 at ALEX, 2005
The Code of a call of this API looks as follows:

010B7EDC 50 PUSH EAX
010B7EDD A1 E4870C01 MOV EAX, DWORD PTR [10C87E4]
010B7EE2 8B40 08 MOV EAX, DWORD PTR [EAX+8]
010B7EE5 FFD0 CALL EAX
010B7EE7 8945 F0 MOV DWORD PTR [EBP-10], EAX
010B7EEA 8B45 F0 MOV EAX, DWORD PTR [EBP-10]
010B7EED 8B58 3C MOV EBX, DWORD PTR [EAX+3C]

Commands marked fat we shall replace with the :

010B7EE7 BA E326BD00 MOV EDX, 0BD26E3
010B7EEC FFD2 CALL EDX
010B7EEE 90 NOP
010B7EEF 90 NOP

Remains to us only patchit, but here there is one chesspiece, the code of the next site of our code will be
To be carried out neskolkoraz, it is connected by that a code to the address of 010D03D7 (sm above)
It is carried out some times, therefore it is necessary to consider and write down it in what-string variable,
Whether the code before was carried out. All this has put looks so:

00BD26AD 5B POP EBX
00BD26AE 68 00800000 PUSH 8000
00BD26B3 6A 00 PUSH 0
00BD26B5 53 PUSH EBX
00BD26B6 8079 FC 00 CMP BYTE PTR DS: [ECX-4], 0
00BD26BA 74 2D JE SHORT 00BD26E9
00BD26BC 4B DEC EBX
00BD26BD 813B 45F08B58 CMP DWORD PTR DS: [EBX], 588BF045
00BD26C3 ^75 F7 JNZ SHORT DropToCD.00BD26BC
00BD26C5 C643 FC BA MOV BYTE PTR DS: [EBX-4], 0BA
00BD26C9 C641 FC 00 MOV BYTE PTR DS: [ECX-4], 0
00BD26CD 83C1 3F ADD ECX, 3F
00BD26D0 894B FD MOV DWORD PTR DS: [EBX-3], ECX
00BD26D3 C743 01 FFD29090 MOV DWORD PTR DS: [EBX+1], 9090D2FF

The Sense is those: we restore the jammed commands, there is a cycle of search on signaturke a call Further
MapViewOfFileEx the next adapter on a trace a code of our patch ? If now Also is written
poprobyvat even to start such code (well certainly with the small amendment) when it will be caused
MapViewOfFileEx we can notice, that all code of our patch has simply disappeared J It is one more
The feature of uncle Solodovnikova which has appeared in the second version of the child to clear bajty on
To border of section J. It is necessary for us to find a place where this all business is cleared.
We put brjak on access On what-string address of our patch, we are thrown out in such place:

010A27C4 F3:AB REP STOS DWORD PTR ES: [EDI]
010A27C6 89D1 MOV ECX, EDX
010A27C8 83E1 03 AND ECX, 3
010A27CB F3:AA REP STOS BYTE PTR ES: [EDI]
010A27CD 5F POP EDI
010A27CE C3 RETN
Further:

010A58D0 33C9 XOR ECX, ECX
010A58D2 E8 D9CEFFFF CALL 010A27B0
010A58D7 C3 RETN
And at last:

010B9FAE 8B15 F0870C01 MOV EDX, DWORD PTR [10C87F0]
8 at ALEX, 2005
010B9FB4 0302 ADD EAX, DWORD PTR [EDX]
010B9FB6 BA 00100000 MOV EDX, 1000
010B9FBB E8 10B9FEFF CALL 010A58D0
010B9FC0 EB 0A JMP SHORT 010B9FCC
Simply it is necessary that CALL 010A58D0 it was not carried out. We finish our piece of a patch:

00BD26DA 43 INC EBX
00BD26DB 813B 0302BA00 CMP DWORD PTR DS: [EBX], 00BA0203
00BD26E1 ^75 F7 JNZ SHORT DropToCD.00BD26DA
00BD26E3 66:C743 07 EB0F MOV WORD PTR DS: [EBX+7], 0FEB
00BD26E9 5B POP EBX
00BD26EA FFE3 JMP EBX
We shall restore Now CRC. Here we shall go on small cunning, namely semuliruem
Work MapViewOfFileEx. For the beginning we should restore bajty which we have changed since in
The further there is check CRC of this site:

00BD26EC 8945 F0 MOV DWORD PTR SS: [EBP-10], EAX
00BD26EF 58 POP EAX
00BD26F0 C740 F9 8945F08B MOV DWORD PTR DS: [EAX-7], 8BF04589
00BD26F7 C740 FD 45F08B58 MOV DWORD PTR DS: [EAX-3], 588BF045
00BD26FE C640 01 3C MOV BYTE PTR DS: [EAX+1], 3C
00BD2702 83E8 04 SUB EAX, 4
00BD2705 8942 FC MOV DWORD PTR DS: [EDX-4], EAX

Then we place the address of return in certain "variable" EDX-4, it is useful to us. Now itself
Emulation.. The Principle is those: we shall allocate a piece of memory in size with size EXE a file, we shall write down there all A file, we shall correct necessary bajty which we have originally changed, and as the day off
Parameter MapViewOfFileEx we shall transfer the address to allocated memory J So the size of our file
563 712 bytes or 89A00h. We shall allocate memory through VirtualAlloc which we shall borrow at
Most aspra J (the very first code with which clause has begun). To the address of 00BAF831 the address Lays
API. We finish patchik ?

00BD2708 60 PUSHAD
00BD2709 BB 009A0800 MOV EBX, 89A00
00BD270E 6A 04 PUSH 4
00BD2710 68 00100000 PUSH 1000
00BD2715 53 PUSH EBX
00BD2716 6A 00 PUSH 0
00BD2718 B8 31F8BA00 MOV EAX, DropToCD.00BAF831
00BD271D FF10 CALL DWORD PTR DS: [EAX]
We Throw data from one allocated piece of memory in ours:

00BD271F 33D2 XOR EDX, EDX
00BD2721 8B75 F0 MOV ESI, DWORD PTR SS: [EBP-10]
00BD2724 8BF8 MOV EDI, EAX
00BD2726 8BCB MOV ECX, EBX
00BD2728 F3:A4 REP MOVS BYTE PTR ES: [EDI], BYTE PTR DS: [ESI]

First of all we restore those bajty which have been originally changed ?

00BD272A C780 D1650600 39939024 MOV DWORD PTR DS: [EAX+665D1], 24909339
00BD2734 C780 D5650600 4759C8B0 MOV DWORD PTR DS: [EAX+665D5], B0C85947
00BD273E C680 D9650600 81 MOV BYTE PTR DS: [EAX+665D9], 81

It is necessary for us to restore two bajty which we have changed that it was not carried out Further
Procedure of clearing of memory where there is our patch, otherwise, will be calculated
Incorrectly CRC and the program simply will fall:

00BD2745 8945 F0 MOV DWORD PTR SS: [EBP-10], EAX
9 at ALEX, 2005
00BD2748 61 POPAD
00BD2749 8B42 FC MOV EAX, DWORD PTR DS: [EDX-4]
00BD274C 40 INC EAX
00BD274D 8138 0302BA00 CMP DWORD PTR DS: [EAX], 00BA0203
00BD2753 ^75 F7 JNZ SHORT DropToCD.00BD274C
00BD2755 66:C740 07 E810 MOV WORD PTR DS: [EAX+7], 10E8
Now we can check up, whether is correct we though did the patch, we finish it:

00BD275B FF62 FC JMP DWORD PTR DS: [EDX-4]

We liberate a program, and " about, a miracle! " It was started J Now directly propatchivaem
Already program. Protection of the program is constructed on API aspra, well to us and it is better J Is
Some ways to find these calls API, but the most good and cognitive, it to be passed on
To all code Aspra, that I also have made, here I shall not describe it, the call "necessary" api goes here:

010BB980 50 PUSH EAX
010BB981 8B47 04 MOV EAX, DWORD PTR DS: [EDI+4]
010BB984 FFD0 CALL EAX

We should be transferred all as parameter of this function the address to a line, type on whom
zaregistrirovanna also there will be happiness J BUT it is necessary to translate time for 7 days we shall tell forward, that The trial has disappeared, and at us appears mesaga, type the trial is ended also a program comes to the end. It is necessary to find This business and to correct. All this has put is checked here:

010B5483 803C24 00 CMP BYTE PTR SS: [ESP], 0
010B5487 0F85 8C000000 JNZ 010B5519
010B548D 807C24 65 00 CMP BYTE PTR SS: [ESP+65], 0
010B5492 75 07 JNZ SHORT 010B549B
010B5494 807C24 64 00 CMP BYTE PTR SS: [ESP+64], 0
010B5499 74 65 JE SHORT 010B5500
010B549B 807C24 65 00 CMP BYTE PTR SS: [ESP+65], 0
010B54A0 75 10 JNZ SHORT 010B54B2
010B54A2 66:837C24 40 00 CMP WORD PTR SS: [ESP+40], 0
010B54A8 75 1A JNZ SHORT 010B54C4
010B54AA 66:837C24 3C 00 CMP WORD PTR SS: [ESP+3C], 0
010B54B0 74 12 JE SHORT 010B54C4
010B54B2 8B5424 6D MOV EDX, DWORD PTR SS: [ESP+6D]
010B54B6 8B8424 85000000 MOV EAX, DWORD PTR SS: [ESP+85]
010B54BD E8 06FFFFFF CALL 010B53C8
010B54C2 EB 55 JMP SHORT 010B5519

Allocated has shown a call mesagi. It is easy to guess, that it is necessary to correct conditional transition on
To 010B5487 address on unconditional and all will be good. Well, we finish our patch:

00BD275B 48 DEC EAX
00BD275C 8138 0F858C00 CMP DWORD PTR DS: [EAX], 008C850F
00BD2762 ^75 F7 JNZ SHORT DropToCD.00BD275B
00BD2764 66:C700 90E9 MOV WORD PTR DS: [EAX], 0E990

Further we should search for a code during which moment of performance the program will be already completely
Is unpacked and caused API aspr'a. poissledovav a code aspra, I have found such remarkable
A beautiful code:

010BBF5C 68 95190BC3 PUSH C30B1995
010BBF61 68 5C4A0000 PUSH 4A5C
010BBF66 68 FC740100 PUSH 174FC
010BBF6B 68 00D00200 PUSH 2D000
010BBF70 FF35 D4940C01 PUSH DWORD PTR DS: [10C94D4]
010BBF76 E8 01000000 CALL 010BBF7C
10 at ALEX, 2005
Where C30B1995 a certain constant which is various in different zaprotekchennyh programs. We shall search for it
And patchit further a code:

00BD2769 40 INC EAX
00BD276A 8138 95190BC3 CMP DWORD PTR DS: [EAX], C30B1995
00BD2770 ^75 F7 JNZ SHORT DropToCD.00BD2769
00BD2772 C640 FF BA MOV BYTE PTR DS: [EAX-1], 0BA
00BD2776 8BDA MOV EBX, EDX
00BD2778 81C3 B7000000 ADD EBX, 0B7
00BD277E 8918 MOV DWORD PTR DS: [EAX], EBX
00BD2780 66:C740 04 FFD2 MOV WORD PTR DS: [EAX+4], 0D2FF
All anything to start a program, but again we shall notice, that our all patch will get into (oh this Malt
J), and it is done 2 times in such places:

010BB4D0 8B15 F0870C01 MOV EDX, DWORD PTR DS: [10C87F0]
010BB4D6 0302 ADD EAX, DWORD PTR DS: [EDX]
010BB4D8 BA 00100000 MOV EDX, 1000
010BB4DD E8 DAC6FFFF CALL 010B7BBC

And

010BA42D 8B15 F0870C01 MOV EDX, DWORD PTR DS: [10C87F0]
010BA433 0302 ADD EAX, DWORD PTR DS: [EDX]
010BA435 BA 00100000 MOV EDX, 1000
010BA43A E8 7DD7FFFF CALL 010B7BBC
Having replaced command MOV EDX, 1000 on MOV EDX, 00 our patch will not get into. Well, we finish patchik:

00BD2786 48 DEC EAX
00BD2787 8138 0302BA00 CMP DWORD PTR DS: [EAX], 00BA0203
00BD278D ^75 F7 JNZ SHORT DropToCD.00BD2786
00BD278F C640 04 00 MOV BYTE PTR DS: [EAX+4], 0
00BD2793 48 DEC EAX
00BD2794 8138 0302BA00 CMP DWORD PTR DS: [EAX], 00BA0203
00BD279A ^75 F7 JNZ SHORT DropToCD.00BD2793
00BD279C C640 04 00 MOV BYTE PTR DS: [EAX+4], 0
00BD27A0 FF62 FC JMP DWORD PTR DS: [EDX-4]

We Go further ? It is necessary to restore commands jammed, to restore bajty, which patchili
Above, that CRC it was not broke, well and to make so that the program it has already been registered:

00BD27A3 5A POP EDX
00BD27A4 C742 F9 6895190B MOV DWORD PTR DS: [EDX-7], 0B199568
00BD27AB C742 FD C3685C4A MOV DWORD PTR DS: [EDX-3], 4A5C68C3
00BD27B2 83EA 07 SUB EDX, 7
00BD27B5 8BC2 MOV EAX, EDX
00BD27B7 48 DEC EAX
00BD27B8 8138 0302BA00 CMP DWORD PTR DS: [EAX], 00BA0203
00BD27BE ^75 F7 JNZ SHORT DropToCD.00BD27B7
00BD27C0 C640 04 10 MOV BYTE PTR DS: [EAX+4], 10
00BD27C4 48 DEC EAX
00BD27C5 8138 0302BA00 CMP DWORD PTR DS: [EAX], 00BA0203
00BD27CB ^75 F7 JNZ SHORT DropToCD.00BD27C4
00BD27CD C640 04 10 MOV BYTE PTR DS: [EAX+4], 10

Well and itself propatchivanie works API:

00BD27D1 E8 0B000000 CALL DropToCD.00BD27E1
00BD27D6 2D 3D 20 41 4C 45 58 20 3D 2D 00 - = ALEX = -
00BD27E1 58 POP EAX; DropToCD.00BD27D6
11 at ALEX, 2005
00BD27E2 A3 0C934F00 MOV DWORD PTR DS: [4F930C], EAX
00BD27E7 C605 18934F00 01 MOV BYTE PTR DS: [4F9318], 1
00BD27EE FFE2 JMP EDX

We liberate the program, we come in About and it is visible:
WE ARE PLEASED!!! J 12 at ALEX, 2005

The Appendix:
00BD2668 03C7 ADD EAX, EDI
00BD266A 8985 C7010000 MOV DWORD PTR SS: [EBP+1C7], EAX
00BD2670 83C2 22 ADD EDX, 22
00BD2673 C680 F3000000 B9 MOV BYTE PTR DS: [EAX+F3], 0B9
00BD267A 8990 F4000000 MOV DWORD PTR DS: [EAX+F4], EDX
00BD2680 66:C780 F8000000 FFD1 MOV WORD PTR DS: [EAX+F8], 0D1FF
00BD2689 C3 RETN
00BD268A 5B POP EBX
00BD268B 68 00800000 PUSH 8000
00BD2690 6A 00 PUSH 0
00BD2692 83C1 23 ADD ECX, 23
00BD2695 C683 DD020000 B9 MOV BYTE PTR DS: [EBX+2DD], 0B9
00BD269C 898B DE020000 MOV DWORD PTR DS: [EBX+2DE], ECX
00BD26A2 66:C783 E2020000 FFD1 MOV WORD PTR DS: [EBX+2E2], 0D1FF
00BD26AB FFE3 JMP EBX
00BD26AD 5B POP EBX
00BD26AE 68 00800000 PUSH 8000
00BD26B3 6A 00 PUSH 0
00BD26B5 53 PUSH EBX
00BD26B6 8079 FC 00 CMP BYTE PTR DS: [ECX-4], 0
00BD26BA 74 2D JE SHORT DropToCD.00BD26E9
00BD26BC 4B DEC EBX
00BD26BD 813B 45F08B58 CMP DWORD PTR DS: [EBX], 588BF045
00BD26C3 ^75 F7 JNZ SHORT DropToCD.00BD26BC
00BD26C5 C643 FC BA MOV BYTE PTR DS: [EBX-4], 0BA
00BD26C9 C641 FC 00 MOV BYTE PTR DS: [ECX-4], 0
00BD26CD 83C1 3F ADD ECX, 3F
00BD26D0 894B FD MOV DWORD PTR DS: [EBX-3], ECX
00BD26D3 C743 01 FFD29090 MOV DWORD PTR DS: [EBX+1], 9090D2FF
00BD26DA 43 INC EBX
00BD26DB 813B 0302BA00 CMP DWORD PTR DS: [EBX], 00BA0203
00BD26E1 ^75 F7 JNZ SHORT DropToCD.00BD26DA
00BD26E3 66:C743 07 EB0F MOV WORD PTR DS: [EBX+7], 0FEB
00BD26E9 5B POP EBX
00BD26EA FFE3 JMP EBX
00BD26EC 8945 F0 MOV DWORD PTR SS: [EBP-10], EAX
00BD26EF 58 POP EAX
00BD26F0 C740 F9 8945F08B MOV DWORD PTR DS: [EAX-7], 8BF04589
00BD26F7 C740 FD 45F08B58 MOV DWORD PTR DS: [EAX-3], 588BF045
00BD26FE C640 01 3C MOV BYTE PTR DS: [EAX+1], 3C
00BD2702 83E8 04 SUB EAX, 4
00BD2705 8942 FC MOV DWORD PTR DS: [EDX-4], EAX
00BD2708 60 PUSHAD
00BD2709 BB 009A0800 MOV EBX, 89A00
00BD270E 6A 04 PUSH 4
00BD2710 68 00100000 PUSH 1000
00BD2715 53 PUSH EBX
00BD2716 6A 00 PUSH 0
00BD2718 B8 31F8BA00 MOV EAX, DropToCD.00BAF831
00BD271D FF10 CALL DWORD PTR DS: [EAX]
00BD271F 33D2 XOR EDX, EDX
00BD2721 8B75 F0 MOV ESI, DWORD PTR SS: [EBP-10]
00BD2724 8BF8 MOV EDI, EAX
00BD2726 8BCB MOV ECX, EBX
00BD2728 F3:A4 REP MOVS BYTE PTR ES: [EDI], BYTE PTR DS: [ESI]
00BD272A C780 D1650600 39939024 MOV DWORD PTR DS: [EAX+665D1], 24909339
00BD2734 C780 D5650600 4759C8B0 MOV DWORD PTR DS: [EAX+665D5], B0C85947
00BD273E C680 D9650600 81 MOV BYTE PTR DS: [EAX+665D9], 81
00BD2745 8945 F0 MOV DWORD PTR SS: [EBP-10], EAX
00BD2748 61 POPAD
00BD2749 8B42 FC MOV EAX, DWORD PTR DS: [EDX-4]
00BD274C 40 INC EAX
00BD274D 8138 0302BA00 CMP DWORD PTR DS: [EAX], 00BA0203
00BD2753 ^75 F7 JNZ SHORT DropToCD.00BD274C
00BD2755 66:C740 07 E810 MOV WORD PTR DS: [EAX+7], 10E8
00BD275B 48 DEC EAX
00BD275C 8138 0F858C00 CMP DWORD PTR DS: [EAX], 008C850F
13 at ALEX, 2005
00BD2762 ^75 F7 JNZ SHORT DropToCD.00BD275B
00BD2764 66:C700 90E9 MOV WORD PTR DS: [EAX], 0E990
00BD2769 40 INC EAX
00BD276A 8138 95190BC3 CMP DWORD PTR DS: [EAX], C30B1995
00BD2770 ^75 F7 JNZ SHORT DropToCD.00BD2769
00BD2772 C640 FF BA MOV BYTE PTR DS: [EAX-1], 0BA
00BD2776 8BDA MOV EBX, EDX
00BD2778 81C3 B7000000 ADD EBX, 0B7
00BD277E 8918 MOV DWORD PTR DS: [EAX], EBX
00BD2780 66:C740 04 FFD2 MOV WORD PTR DS: [EAX+4], 0D2FF
00BD2786 48 DEC EAX
00BD2787 8138 0302BA00 CMP DWORD PTR DS: [EAX], 00BA0203
00BD278D ^75 F7 JNZ SHORT DropToCD.00BD2786
00BD278F C640 04 00 MOV BYTE PTR DS: [EAX+4], 0
00BD2793 48 DEC EAX
00BD2794 8138 0302BA00 CMP DWORD PTR DS: [EAX], 00BA0203
00BD279A ^75 F7 JNZ SHORT DropToCD.00BD2793
00BD279C C640 04 00 MOV BYTE PTR DS: [EAX+4], 0
00BD27A0 FF62 FC JMP DWORD PTR DS: [EDX-4]
00BD27A3 5A POP EDX
00BD27A4 C742 F9 6895190B MOV DWORD PTR DS: [EDX-7], 0B199568
00BD27AB C742 FD C3685C4A MOV DWORD PTR DS: [EDX-3], 4A5C68C3
00BD27B2 83EA 07 SUB EDX, 7
00BD27B5 8BC2 MOV EAX, EDX
00BD27B7 48 DEC EAX
00BD27B8 8138 0302BA00 CMP DWORD PTR DS: [EAX], 00BA0203
00BD27BE ^75 F7 JNZ SHORT DropToCD.00BD27B7
00BD27C0 C640 04 10 MOV BYTE PTR DS: [EAX+4], 10
00BD27C4 48 DEC EAX
00BD27C5 8138 0302BA00 CMP DWORD PTR DS: [EAX], 00BA0203
00BD27CB ^75 F7 JNZ SHORT DropToCD.00BD27C4
00BD27CD C640 04 10 MOV BYTE PTR DS: [EAX+4], 10
00BD27D1 E8 0B000000 CALL DropToCD.00BD27E1
00BD27D6 2D 3D20414C SUB EAX, 4C41203D
00BD27DB 45 INC EBP
00BD27DC 58 POP EAX
00BD27DD 203D 2D0058A3 AND BYTE PTR DS: [A358002D], BH
00BD27E3 0C 93 OR AL, 93
00BD27E5 4F DEC EDI
00BD27E6 00C6 ADD DH, AL
00BD27E8 05 18934F00 ADD EAX, DropToCD.004F9318
00BD27ED 01FF ADD EDI, EDI
00BD27EF ^E2 90 LOOPD SHORT DropToCD.00BD2781

The Initial code kriptora. It is written on Delphi7:
http: // awawa.nm.ru/aspr2.0_crypt_src.rar
DropToCD v3.05:
http: // awawa.nm.ru/dtcv.exe

[培训]科锐逆向工程师培训第53期2025年7月8日开班!

收藏
免费 0
支持
分享
最新回复 (3)
雪    币: 898
活跃值: (4054)
能力值: ( LV9,RANK:3410 )
在线值:
发帖
回帖
粉丝
2
这样看比较乱
兄弟费点时间整理一下
2005-3-29 10:43
0
雪    币: 427
活跃值: (412)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
3
论坛有英文版
2005-3-29 11:24
0
雪    币: 707
活跃值: (1922)
能力值: ( LV9,RANK:250 )
在线值:
发帖
回帖
粉丝
4
最初由 鸡蛋壳 发布
论坛有英文版


有就转过来,是exetoos吗?害的我忙活半天,臭蛋蛋,
2005-3-29 11:27
0
游客
登录 | 注册 方可回帖
返回