Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 03-23-2004, 11:26
Maltese
 
Posts: n/a
Tried unpacking DVDIdle Pro - AsProtect

I'm pretty new to cracking on Intel machines...

I went thru Tag & Rename tutorial and everything worked perfectly.

However, I tried to apply the same concept with DVDIdle Pro.

Running Ollydbg, I loaded in DVDIdle Pro 3.38 and answered NO to analyzing.
Hit F9 and received an exception.
Pressed SHITF+F9 - 26 times until I reached the following:

see pic: dvdi_olly2.jpg

I set a bp at the RETN

Pressed SHIFT+F9 one more time.

Pressed ALT+M and right clicked DVDIdle code -> Break on memory access.
Hit CTRL+F11 to run a trace

I ended up here (see pic): dvdi_olly1.jpg

From here nothing looked the same...nothing was on the stack.

I tried VIEW->TRACE, HIGHLIGHT EPB (show ESP enabled with log command on)

This is what I saw (missing bytes?) see pic: dvdi_olly.jpg

If these are the missing bytes...where do I put them? There are quite a bit of "00" above the address shown in pic: dvdi_olly1.jpg

Any help would be appreciated...

-Malt
Attached Images
File Type: jpg dvdi_olly2.jpg (37.0 KB, 58 views)
File Type: jpg dvdi_olly1.jpg (111.1 KB, 51 views)
File Type: jpg dvdi_olly.jpg (59.5 KB, 57 views)
Reply With Quote
  #2  
Old 03-23-2004, 16:10
lownoise
 
Posts: n/a
Great Job

Hi Maltese,

Well first i want to congratz you with your first post which is way above the first post of other members on this forum

you have indeed found the right stolen bytes which you showed in dvdi_olly.jpg. Again you are right you have to put the stolen bytes on the zero's in picture dvdi_olly1.jpg. I took a quick look at the 3.39 version and that have 45 stolen bytes. I assume that the 3.38 version regarding your trace will have 38 stolen bytes (you'll have to count the zero bytes)

PUSH EBP
MOV EBP,ESP
PUSH -1
PUSH 425FA0
PUSH 41EF10
MOV 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

Regards, Lownoise
Reply With Quote
  #3  
Old 03-23-2004, 20:10
Maltese
 
Posts: n/a
Thank you lownoise for the kind response.

I installed version 3.39 DVDIdle Pro and followed the same steps as the original post.

When I performed View-Trace (SHOW ESP & LOG COMMAND)

This is what I saw (see pic): dvdi_olly3.jpg

Unfortunately the AsProtect tutorial does not go indepth as to how many bytes and which exact ones are the stolen ones.

***EDITED*** removed reference to picture #4 since it was incorrect...to not hog up space on server


If this was a mistake, how do I make sense of what is stolen and what is not?

Thanks,

-Malt
Attached Images
File Type: jpg dvdi_olly3.jpg (155.5 KB, 37 views)

Last edited by Maltese; 03-24-2004 at 13:02.
Reply With Quote
  #4  
Old 03-24-2004, 01:20
ferrari
 
Posts: n/a
Quote:
Originally Posted by Maltese
Unfortunately the AsProtect tutorial does not go indepth as to how many bytes and which exact ones are the stolen ones.
-Malt
Hi,
Did u read britedreams tutorial on stolen bytes. One of them is here.
http://www.exetools.com/forum/showthread.php?t=3654&page=1

Very nice tuts

Regards,
Reply With Quote
  #5  
Old 03-24-2004, 07:54
Maltese
 
Posts: n/a
Thanks,

I dl'd the tut by Britedream. Please let me try to figure this one out first. If I need help I hope I can ask. But I need to learn this...just giving the answer won't help me in the future...

Looking at the tut now.

Thanks again!

-Malt
Reply With Quote
  #6  
Old 03-24-2004, 10:36
Maltese
 
Posts: n/a
Alright,

I looked through the Tutorial from BriteDream regarding ASProtect and understanding stolen bytes and trying to apply it to DVDIdle Pro 3.39

I noticed right off the bat that 3.38 is different than 3.39. PEiD .7b reports the same protection for both versions.

After the CTRL+11 trace in Ollydbg, I can see that I need to fill 45 bytes (above the bp from trace). Confirmed by lownoise.

In my post above is a picture of VIEW->RUN TRACE (dvdi_olly3.jpg).

Everytime I see stolen bytes (in RUN TRACE) tutorials, it seems that PUSH EBX is first. In this case it does not appear to be PUSH EBX, but MOV EBP,ESP

I tried to continue figuring the rest of the code to fill 45 bytes exactly, I ended up with 1 byte left at 00 which needs filled.

I did this starting at location: 41EFE6

0041EFE6 8BEC MOV EBP,ESP
0041EFE8 6A FF PUSH -1
0041EFEA 68 A05F4200 PUSH DVDIdleP.00425FA0
0041EFEF 68 40EF4100 PUSH DVDIdleP.0041EF40
0041EFF4 2BE2 SUB ESP,EDX
0041EFF6 890424 MOV DWORD PTR SS:[ESP],EAX
0041EFF9 64:8925 00000000 MOV DWORD PTR FS:[0],ESP
0041F000 83EC 68 SUB ESP,68
0041F003 2BE2 SUB ESP,EDX
0041F005 891C24 MOV DWORD PTR SS:[ESP],EBX
0041F008 2BE2 SUB ESP,EDX
0041F00A 893424 MOV DWORD PTR SS:[ESP],ESI
0041F00D 2BE2 SUB ESP,EDX
0041F00F 893C24 MOV DWORD PTR SS:[ESP],EDI
0041F012 00 <===


Basically I started with MOV EBP,ESP
ommited JMP, LEA, ADD, XOR

How do you determine where the stolen bytes end?

Any ideas lownoise? I wanted to try this on my own before the answer was provided.

Thanks for taking the time to help me!

-Malt
Reply With Quote
  #7  
Old 03-24-2004, 10:55
Maltese
 
Posts: n/a
Britedream,

So it should always start with push EBP?

Also if I have 45 bytes with 00, which represents where the stolen bytes go, they should all be filled correct?
Reply With Quote
  #8  
Old 03-24-2004, 10:59
britedream britedream is offline
Friend
 
Join Date: Jun 2002
Posts: 436
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 7 Times in 7 Posts
britedream Reputation: 0
for all the startup code that has mov ebp,esp , yes; your hint to the start of the stolen is the first encounter of ebp== esp, which is the second byte of your stolen, so push ebp should be the first.

Last edited by britedream; 03-24-2004 at 11:19.
Reply With Quote
  #9  
Old 03-24-2004, 11:05
britedream britedream is offline
Friend
 
Join Date: Jun 2002
Posts: 436
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 7 Times in 7 Posts
britedream Reputation: 0
now for the end of your stolen,please read all my three tut, regarding this. you should pay attention to the address pushed to the stack ,which either be a return address or address that you are at, from which you can determine the last of your stolen.(please look lownoise post, it has the correct stolen bytes).

note:
what you see in the trace is the excution of your stolen bytes, and sometimes part of the code after the stolen , inside the asprotect, so don't copy all you see in the trace as stolen. learn from my three tut how you determine that.

Last edited by britedream; 03-24-2004 at 11:38.
Reply With Quote
  #10  
Old 03-24-2004, 11:29
britedream britedream is offline
Friend
 
Join Date: Jun 2002
Posts: 436
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 7 Times in 7 Posts
britedream Reputation: 0
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.
Reply With Quote
  #11  
Old 03-24-2004, 12:59
Maltese
 
Posts: n/a
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.
Reply With Quote
  #12  
Old 03-24-2004, 15:14
britedream britedream is offline
Friend
 
Join Date: Jun 2002
Posts: 436
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 7 Times in 7 Posts
britedream Reputation: 0
I will download the target and look at it.
Reply With Quote
  #13  
Old 03-24-2004, 15:42
lownoise
 
Posts: n/a
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
Reply With Quote
  #14  
Old 03-24-2004, 15:53
britedream britedream is offline
Friend
 
Join Date: Jun 2002
Posts: 436
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 7 Times in 7 Posts
britedream Reputation: 0
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.
Reply With Quote
  #15  
Old 03-24-2004, 16:06
britedream britedream is offline
Friend
 
Join Date: Jun 2002
Posts: 436
Rept. Given: 0
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 7 Times in 7 Posts
britedream Reputation: 0
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.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


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


All times are GMT +8. The time now is 13:06.


Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX, chessgod101
( 1998 - 2024 )