![]() |
|
|
|
#1
|
|||
|
|||
|
for the location of your oep and the place of your stolen, look at the k option on toolbar, double click on the last address you see there, if there is no address, then the place for oep and stolen is right above where you are, provided there is no anyalsis has been done,if anyalsis is done then remove anyalsis by right clicking on the cpu pane and selecting anyalsis->remove anyalsis; option.
Last edited by britedream; 03-24-2004 at 11:39. |
|
#2
|
|||
|
|||
|
Britedream,
Thank you for your patience and assistance. I appreciate it very much! Ok, part of this is my fault... since I am new to assembly on IA32. Looking at the beginning of unpacked programs I see a pattern of how a program is executed [normally] This is what I learned: PUSH EBP MOV EBP,ESP PUSH -1 PUSH some value PUSH some value MOVE EAX, DWORD PTR FS:[0] PUSH EAX MOV DWORD PTR FS:[0],ESP SUB ESP,58 PUSH EBX PUSH ESI PUSH EDI MOV DWORD PTR SS:[EBP-18],ESP CALL ..... Kernal32.Get.Version I have confimed that since version DVDIdle Pro 3.22 and up, there are 45 bytes of "00" (where stolen bytes go). Do these need to be filled completely (ALL 45)? Looking in the STACK window (K), there is nothing in the stack window... so the bytes go above the address where the CTRL+F11 trace stops. I looked at Raider's tutorial regarding Tag & Rename 3.06, and your tutorial Britedream: concepts by britedream. If I read you correctly you have 3 tutorials? I found one with the help of Ferrari's post (Thanks). Following your one tutorial that I have "concepts", it is a bit difficult to follow because I'm trying to implement them with an unknown (dvdidle pro). So trying to combine what I saw in dvdi_olly3.jpg in my earlier post: I should have something like: PUSH EBP MOV EBP,ESP PUSH -1 PUSH 425FA0 PUSH 41EF40 MOVE EAX, DWORD PTR FS:[0] PUSH EAX SUB ESP,EDX MOV DWORD PTR SS:[ESP],EAX MOV DWORD PTR FS:[0],ESP SUB ESP,68 PUSH EBX PUSH ESI PUSH EDI MOV DWORD PTR SS:[EBP-18],ESP ----------------------------------- CALL ..... Kernal32.Get.Version This is not correct....but I'm trying my best to get it together. P.S. I say NO to analyzing with Olly with AsProtect programs as per Raider's Tutorial with Tag & Rename... Last edited by Maltese; 03-24-2004 at 13:05. |
|
#3
|
|||
|
|||
|
I will download the target and look at it.
|
|
#4
|
|||
|
|||
|
Explanation of the stolen bytes
Malt,
Hope this info helps you and makes sense When you start working on recovering stolen bytes you've to know some assembly and a basic knowlegde how the startup code from some compilers looks like Asprotect tries to hide the stolenbytes with the use of some garbage code and emulating stolenbytes If you know which compiler is used it will make your recovering of the stolen bytes much more easy, also knowing how many stolenbytes to recover will help you I don't know fore sure but it looks like asprotect has some "templates" for the compilers thas are most used (delphi, visual c++, etc..) For your app the compiler is ms visual c++ 6.0 . asprotect "hides" the stolenbytes for a c++ 6.0 app with garbarge code and emulating the stolenbytes. Remember that for each app garbage code and stolenbytes are different!!! Ok lets look to your trace log 00986A2A Main MOV DWORD PTR SS:[ESP],EBP 00986A2E Main MOV EBP,ESP ; EBP=0012FFC0 00986A30 Main PUSH -1 ; ESP=0012FFBC 00986A32 Main PUSH 425FA0 ; ESP=0012FFB8 00986A37 Main PUSH 41EF40 ; ESP=0012FFB4 00986A3C Main MOV EAX,DWORD PTR FS:[0] ; EAX=0098548C 00986A42 Main JMP SHORT 00986A45 00986A45 Main LEA ESP,DWORD PTR SS:[ESP-15] ; ESP=0012FF9F 00986A49 Main ADD WORD PTR DS:[986A52],0E57B ; FL=CP 00986A52 Main JMP SHORT 00986A56 00986A56 Main LEA ESP,DWORD PTR SS:[ESP+EDX+11] ; ESP=801102B4 00986A5A Main SUB ESP,EDX ; FL=O, ESP=0012FFB0 00986A5C Main XOR WORD PTR DS:[986A66],0A641 ; FL=P 00986A65 Main JMP SHORT 00986A6A 00986A6A Main MOV DWORD PTR SS:[ESP],EAX 00986A6E Main MOV DWORD PTR FS:[0],ESP 00986A75 Main SUB ESP,68 ; FL=PA, ESP=0012FF48 00986A78 Main JMP SHORT 00986A7B 00986A7B Main LEA ESP,DWORD PTR SS:[ESP-15] ; ESP=0012FF33 00986A7F Main ADD WORD PTR DS:[986A88],0E57B ; FL=CP 00986A88 Main JMP SHORT 00986A8C 00986A8C Main LEA ESP,DWORD PTR SS:[ESP+EDX+11] ; ESP=80110248 00986A90 Main SUB ESP,EDX ; FL=PO, ESP=0012FF44 00986A92 Main XOR WORD PTR DS:[986A9C],0A641 ; FL=P 00986A9B Main JMP SHORT 00986AA0 00986AA0 Main MOV DWORD PTR SS:[ESP],EBX 00986AA4 Main JMP SHORT 00986AA7 00986AA7 Main LEA ESP,DWORD PTR SS:[ESP-15] ; ESP=0012FF2F 00986AAB Main ADD WORD PTR DS:[986AB4],0E57B ; FL=CP 00986AB4 Main JMP SHORT 00986AB8 00986AB8 Main LEA ESP,DWORD PTR SS:[ESP+EDX+11] ; ESP=80110244 00986ABC Main SUB ESP,EDX ; FL=O, ESP=0012FF40 00986ABE Main XOR WORD PTR DS:[986AC8],0A641 ; FL=P 00986AC7 Main JMP SHORT 00986ACC 00986ACC Main MOV DWORD PTR SS:[ESP],ESI 00986AD0 Main JMP SHORT 00986AD3 00986AD3 Main LEA ESP,DWORD PTR SS:[ESP-15] ; ESP=0012FF2B 00986AD7 Main ADD WORD PTR DS:[986AE0],0E57B ; FL=CP 00986AE0 Main JMP SHORT 00986AE4 00986AE4 Main LEA ESP,DWORD PTR SS:[ESP+EDX+11] ; ESP=80110240 00986AE8 Main SUB ESP,EDX ; FL=PAO, ESP=0012FF3C 00986AEA Main XOR WORD PTR DS:[986AF4],0A641 ; FL=P 00986AF3 Main JMP SHORT 00986AF8 00986AF8 Main MOV DWORD PTR SS:[ESP],EDI 00986AFC Main MOV DWORD PTR SS:[EBP-18],ESP 00986AFF Main XOR EBX,EBX ; FL=PZ, EBX=00000000 00986B01 Main MOV DWORD PTR SS:[EBP-4],EBX 00986B04 Main PUSH 2 ; ESP=0012FF38 [Garbage Code] When you found the ebp==esp look down in your trace log for paterns of instructions In you trace log we see a patern like LEA ESP, ADD WORD PTR DS: JMP LEA ESP Sub ESP,EDX XOR Word PTR JMP If we Remove the Patern of your trace we have the following instructions remaining 00986A2A Main MOV DWORD PTR SS:[ESP],EBP 00986A2E Main MOV EBP,ESP ; EBP=0012FFC0 ==This is the hint for the stolen bytes ebp=esp 00986A30 Main PUSH -1 ; ESP=0012FFBC 00986A32 Main PUSH 425FA0 ; ESP=0012FFB8 00986A37 Main PUSH 41EF40 ; ESP=0012FFB4 00986A3C Main MOV EAX,DWORD PTR FS:[0] ; EAX=0098548C 00986A42 Main JMP SHORT 00986A45 00986A6A Main MOV DWORD PTR SS:[ESP],EAX 00986A6E Main MOV DWORD PTR FS:[0],ESP 00986A75 Main SUB ESP,68 ; FL=PA, ESP=0012FF48 00986A78 Main JMP SHORT 00986A7B 00986AA0 Main MOV DWORD PTR SS:[ESP],EBX 00986AA4 Main JMP SHORT 00986AA7 00986ACC Main MOV DWORD PTR SS:[ESP],ESI 00986AD0 Main JMP SHORT 00986AD3 00986AF8 Main MOV DWORD PTR SS:[ESP],EDI 00986AFC Main MOV DWORD PTR SS:[EBP-18],ESP 00986AFF Main XOR EBX,EBX ; FL=PZ, EBX=00000000 00986B01 Main MOV DWORD PTR SS:[EBP-4],EBX 00986B04 Main PUSH 2 ; ESP=0012FF38 [Emulating Stolen Bytes] Remember that Asprotect emulates instructions look at the first line 00986A2A Main MOV DWORD PTR SS:[ESP],EBP If you know some assembly you know that ths instructions is the same as a Push Ebp Knowing this and applying this to the trace log and removing the JMP instructions and comments our trace looks like this 00986A2A Main Push EBP 00986A2E Main MOV EBP,ESP 00986A30 Main PUSH -1 00986A32 Main PUSH 425FA0 00986A37 Main PUSH 41EF40 00986A3C Main MOV EAX,DWORD PTR FS:[0] 00986A6A Main Push EAX 00986A6E Main MOV DWORD PTR FS:[0],ESP 00986A75 Main SUB ESP,68 00986AA0 Main Push EBX 00986ACC Main Push ESI 00986AF8 Main Push EDI 00986AFC Main MOV DWORD PTR SS:[EBP-18],ESP 00986AFF Main XOR EBX,EBX 00986B01 Main MOV DWORD PTR SS:[EBP-4],EBX 00986B04 Main PUSH 2 And that are your stolenbytes Hope this make sense for you Regards Lownoise |
|
#5
|
|||
|
|||
|
0041EFE6 55 PUSH EBP
0041EFE7 8BEC MOV EBP,ESP 0041EFE9 6A FF PUSH -1 0041EFEB 68 A05F4200 PUSH DVDIdleP.00425FA0 0041EFF0 68 40EF4100 PUSH DVDIdleP.0041EF40 ; JMP to MSVCRT._except_handler3 0041EFF5 64:A1 00000000 MOV EAX,DWORD PTR FS:[0] 0041EFFB 50 PUSH EAX 0041EFFC 64:8925 0000000>MOV DWORD PTR FS:[0],ESP 0041F003 83EC 68 SUB ESP,68 0041F006 53 PUSH EBX 0041F007 56 PUSH ESI 0041F008 57 PUSH EDI 0041F009 8965 E8 MOV DWORD PTR SS:[EBP-18],ESP 0041F00C 33DB XOR EBX,EBX 0041F00E 895D FC MOV DWORD PTR SS:[EBP-4],EBX 0041F011 6A 02 PUSH 2 this is the correct stolen. |
|
#6
|
|||
|
|||
|
for the stack everything follow my tut. except 12ffbc == 00000000 instead of ffffffff, but if you folllow the code ,it was there but just over written by:
mov dword ptr ss:[ebp-4],ebx; the ebp== 12ffc0 if you substract 4 from it, you will end up at 12ffbc, where ebx with value of 0 moved to it. learn to use the stack with the trace, not the trace alone. sorry I relied on lownoise first finding and it was wrong. Last edited by britedream; 03-24-2004 at 16:14. |
|
#7
|
|||
|
|||
|
Hmm, lots of imports the aspr2 plugin can't handle on this one...
|
|
#8
|
|||
|
|||
|
Thank You both Lownoise & Britedream.
So now I understand why the PEiD shows compiler. I must see how a normal program compiled with that particular brand compiler has it's startup code. Got it. Since there is nothing in the "K" (STACK) window, I do not need a JMP I just fill in the 45 blank "00" bytes with the stolen bytes. Got it. I apologize...when I learned to crack on the Apple ][e (Don't laugh... I know you are ) *Hey my Algebra teacher got me started. A Push was a push. After looking at another tutorial I saw that MOV DWORD PTR SS:[ESP+number],EBP is the same as PUSH EBP. This is my failure. Now I know.Thank you everyone for your patience... and willingness to help. I am using Imprec now. I tried setting size to 1000 and only found 2 instances where dissasemble/hex said no data. I have to go to work... I look at it with Imprec later today after work. I'll share with you what I find out. Thanks again everyone! -Malt Last edited by Maltese; 03-24-2004 at 20:48. |
|
#9
|
|||
|
|||
|
To svensk
the target runs on this iat: there are only two exceptions, if you fix the first one you are registered, the second is to correct the stack.(I haven't test the program but it runs fine). Last edited by britedream; 03-24-2004 at 22:16. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| ASProtect SKE unpacking | TempoMat | General Discussion | 10 | 08-24-2016 17:48 |
| need help unpacking ASProtect | Fade | General Discussion | 8 | 05-25-2011 22:12 |
| Unpacking asprotect | britedream | General Discussion | 7 | 09-01-2004 01:46 |