Exetools  

Go Back   Exetools > General > General Discussion

Notices

Reply
 
Thread Tools Display Modes
  #1  
Old 08-01-2012, 19:45
axl936 axl936 is offline
Friend
 
Join Date: Jul 2004
Posts: 46
Rept. Given: 13
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 0 Times in 0 Posts
axl936 Reputation: 0
Unpack mpress 1.2xx

Hi !
someone have info/tool/tutorial/other to unpack/reverse an executable protect with matcode mpress product ?
Bye
Reply With Quote
  #2  
Old 08-01-2012, 20:17
zementmischer's Avatar
zementmischer zementmischer is offline
Don't mess with concrete
 
Join Date: Mar 2011
Location: Europe
Posts: 216
Rept. Given: 124
Rept. Rcvd 490 Times in 111 Posts
Thanks Given: 13
Thanks Rcvd at 103 Times in 33 Posts
zementmischer Reputation: 400-499 zementmischer Reputation: 400-499 zementmischer Reputation: 400-499 zementmischer Reputation: 400-499 zementmischer Reputation: 400-499
mpress doesn't use any tricks to make unpacking hard.
Hence any tutorial about manual unpacking upx also applies to mpress (just use the ESP trick).
__________________
Real programmers don't read manuals.
Reliance on a reference is a hallmark of the novice and the coward.
Reply With Quote
  #3  
Old 08-01-2012, 20:31
mm10121991 mm10121991 is offline
VIP
 
Join Date: Feb 2011
Posts: 136
Rept. Given: 29
Rept. Rcvd 56 Times in 34 Posts
Thanks Given: 7
Thanks Rcvd at 24 Times in 13 Posts
mm10121991 Reputation: 58
Arrow

as zementmischer said it is like upx
check this tut on tuts4you
PHP Code:
http://tuts4you.com/download.php?view.2227 
but if you want more help post your target and will try to help you
Reply With Quote
The Following User Gave Reputation+1 to mm10121991 For This Useful Post:
axl936 (08-02-2012)
  #4  
Old 08-02-2012, 00:07
giv's Avatar
giv giv is offline
VIP
 
Join Date: Jan 2011
Location: Romania
Posts: 1,663
Rept. Given: 803
Rept. Rcvd 1,283 Times in 561 Posts
Thanks Given: 228
Thanks Rcvd at 567 Times in 241 Posts
giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299
Check this out.

From SunBeam
Quote:
Just a heads-up - from what I tested with latest version, all one needs to do is F7 over first PUSHAD, hardware breakpoint on ESP, on access, then Shift+F9. And you'll land at JMP to OEP T_T.. Reminds me of UPX..
Attached Files
File Type: rar MPRESS.Unpacker.v1.0.Tool-COG.rar (31.4 KB, 94 views)
File Type: txt mpress.txt (250 Bytes, 28 views)
File Type: txt mpress_1.25_oep_finder.txt (503 Bytes, 22 views)
File Type: txt mpress_oep_finder.txt (772 Bytes, 24 views)

Last edited by giv; 08-02-2012 at 00:14.
Reply With Quote
The Following 2 Users Gave Reputation+1 to giv For This Useful Post:
alekine322 (08-08-2012), axl936 (08-02-2012)
  #5  
Old 08-02-2012, 01:28
axl936 axl936 is offline
Friend
 
Join Date: Jul 2004
Posts: 46
Rept. Given: 13
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 0 Times in 0 Posts
axl936 Reputation: 0
Hi !
Many thanks to everyone reply me..
I'm a absolute beginner in exewarez , tracing and patching..

My target is this (the Development version..)

http://www.gearotic.com/downloads.html

Any help is greatly appreciated, and I can learn something ..
Reply With Quote
  #6  
Old 08-02-2012, 03:01
giv's Avatar
giv giv is offline
VIP
 
Join Date: Jan 2011
Location: Romania
Posts: 1,663
Rept. Given: 803
Rept. Rcvd 1,283 Times in 561 Posts
Thanks Given: 228
Thanks Rcvd at 567 Times in 241 Posts
giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299
Here is the OEP.
Just watch the video.
Attached Files
File Type: rar OEP Find Mpress.rar (266.4 KB, 40 views)
Reply With Quote
The Following User Gave Reputation+1 to giv For This Useful Post:
axl936 (08-02-2012)
  #7  
Old 08-02-2012, 09:40
RedBlkJck RedBlkJck is offline
Family
 
Join Date: Oct 2011
Posts: 99
Rept. Given: 64
Rept. Rcvd 80 Times in 43 Posts
Thanks Given: 25
Thanks Rcvd at 11 Times in 9 Posts
RedBlkJck Reputation: 80
Quote:
Originally Posted by axl936 View Post
Hi !
Many thanks to everyone reply me..
I'm a absolute beginner in exewarez , tracing and patching..

My target is this (the Development version..)

http://www.gearotic.com/downloads.html

Any help is greatly appreciated, and I can learn something ..
This was the target that was just discusssed for a user on tuts4you.
..http://forum.tuts4you.com/topic/29562-i-have-a-rogue-program-i-cant-figure-out-what-it-is/

Your dumps will not run without some tweaking because all the code sections are located in .mpress1 unpacked. This causes an r6002 error msg for your dumps. You must patch the header check for .rdata or remap/rebuild the pe header mpress sections back .text .rdata .data. If you can't get access to the post let me know. - jack
Reply With Quote
The Following User Gave Reputation+1 to RedBlkJck For This Useful Post:
giv (08-02-2012)
  #8  
Old 08-02-2012, 15:24
axl936 axl936 is offline
Friend
 
Join Date: Jul 2004
Posts: 46
Rept. Given: 13
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 0 Times in 0 Posts
axl936 Reputation: 0
Quote:
Originally Posted by RedBlkJck View Post
This was the target that was just discusssed for a user on tuts4you.
..http://forum.tuts4you.com/topic/29562-i-have-a-rogue-program-i-cant-figure-out-what-it-is/

Your dumps will not run without some tweaking because all the code sections are located in .mpress1 unpacked. This causes an r6002 error msg for your dumps. You must patch the header check for .rdata or remap/rebuild the pe header mpress sections back .text .rdata .data. If you can't get access to the post let me know. - jack
Hi
effectively i can't access to the post..

@zementmischer
Thanks for the work done, but I'd like to understand how you did it ..
Can you explain me ?
Reply With Quote
  #9  
Old 08-02-2012, 03:18
zementmischer's Avatar
zementmischer zementmischer is offline
Don't mess with concrete
 
Join Date: Mar 2011
Location: Europe
Posts: 216
Rept. Given: 124
Rept. Rcvd 490 Times in 111 Posts
Thanks Given: 13
Thanks Rcvd at 103 Times in 33 Posts
zementmischer Reputation: 400-499 zementmischer Reputation: 400-499 zementmischer Reputation: 400-499 zementmischer Reputation: 400-499 zementmischer Reputation: 400-499
And here's the unpacked exe:
hxxp://www.mediafire.com/download.php?g30hjuz8jdgkzlc

unpacking was a lil' bit harder than expected due to a darn R6002 exception
__________________
Real programmers don't read manuals.
Reliance on a reference is a hallmark of the novice and the coward.
Reply With Quote
The Following User Gave Reputation+1 to zementmischer For This Useful Post:
axl936 (08-02-2012)
  #10  
Old 08-02-2012, 04:52
axl936 axl936 is offline
Friend
 
Join Date: Jul 2004
Posts: 46
Rept. Given: 13
Rept. Rcvd 0 Times in 0 Posts
Thanks Given: 0
Thanks Rcvd at 0 Times in 0 Posts
axl936 Reputation: 0
Hi !
WOW !!
not one, but 2, SUPER RAPID solutions !!

I would give the award ex-aequo to both.. giv and zementmischer

many thanks again..

now i can try to "cure" him !!
Can I get help if I need it?
Bye
Axel
Reply With Quote
  #11  
Old 08-02-2012, 06:10
zementmischer's Avatar
zementmischer zementmischer is offline
Don't mess with concrete
 
Join Date: Mar 2011
Location: Europe
Posts: 216
Rept. Given: 124
Rept. Rcvd 490 Times in 111 Posts
Thanks Given: 13
Thanks Rcvd at 103 Times in 33 Posts
zementmischer Reputation: 400-499 zementmischer Reputation: 400-499 zementmischer Reputation: 400-499 zementmischer Reputation: 400-499 zementmischer Reputation: 400-499
Wow, choosing a target that depends on a digitally signed license is probably the most sophisticated way to start rce'ing
I guess the best way to break its protection would be to generate your own public/private key pair using MS' CSP and replace the public key BLOB inside the exe (resource id 163) with your own one.
Use the private key to code a simple keygen (you'll also need it to RE the license file format - but from what I saw the format isn't too complicated)
The main advantage of this approach is that you can crack future versions by just replacing its BLOB resource with your own one.
You'll quickly find the license handler if you look for references to CryptAcquireContextW, CryptImportKey and CryptDecrypt.
__________________
Real programmers don't read manuals.
Reliance on a reference is a hallmark of the novice and the coward.
Reply With Quote
  #12  
Old 08-02-2012, 11:07
zementmischer's Avatar
zementmischer zementmischer is offline
Don't mess with concrete
 
Join Date: Mar 2011
Location: Europe
Posts: 216
Rept. Given: 124
Rept. Rcvd 490 Times in 111 Posts
Thanks Given: 13
Thanks Rcvd at 103 Times in 33 Posts
zementmischer Reputation: 400-499 zementmischer Reputation: 400-499 zementmischer Reputation: 400-499 zementmischer Reputation: 400-499 zementmischer Reputation: 400-499
@axl936: Here's a link to an already patched version (proof-of-concept).
I did create my own RSA key pair, replaced the private key of the target with my own one and used my public key to make a valid license.
Btw. my first guess regarding DSA was a lil' bit wrong - the target actually uses an RSA cipher with 1024bit.

@RedBlkJck: I opted for the first method - splitting sections and rebuilding the PE image is a far more time consuming task than setting a hwbp at the section flags inside the PE header
Attached Files
File Type: txt GearoticMotion_patched.txt (53 Bytes, 20 views)
__________________
Real programmers don't read manuals.
Reliance on a reference is a hallmark of the novice and the coward.
Reply With Quote
  #13  
Old 08-02-2012, 12:08
RedBlkJck RedBlkJck is offline
Family
 
Join Date: Oct 2011
Posts: 99
Rept. Given: 64
Rept. Rcvd 80 Times in 43 Posts
Thanks Given: 25
Thanks Rcvd at 11 Times in 9 Posts
RedBlkJck Reputation: 80
@zementmischer I hear ya. I spent a little time looking to rebuild it. The packer code start point has been the end of the text section in my testing with other mpress files. IE betwen the 2 JMPs routines, packer code. I was looking for some patterns to identify it easier. Sometimes there is a pointer of the amount of bytes to the next section from the .text section. mpress2 is all packer code can be removed. You can easily see where the resource mapping was moved from the original code. But it isn't as convenient as UPX including a copy of the original PE section. Anyway here is my mapping of my dump for this target if you are interested.

Name VirtSize VirtAddr SizeRaw PtrRaw Flags Pointing Directories
-------------------------------------------------------------------------------------------
.text 001E3000h 00401000h 001E2200h 00000200h E00000E0h
.rdata 00063000h 005E4000h 00062000h 001E2400h 40000040h Delay Import Descriptor
.data 00009000h 00647000h 00009000h 00244400h C0000040h
.rsrc 005A0000h 00650000h 0059F200h 0024D400h C0000040h Resource Table
.ImpFix 00005000h 00BF0000h 00004400h 007EC600h C0000040h Import Table

Last edited by RedBlkJck; 08-02-2012 at 12:12. Reason: add on
Reply With Quote
  #14  
Old 08-02-2012, 15:27
giv's Avatar
giv giv is offline
VIP
 
Join Date: Jan 2011
Location: Romania
Posts: 1,663
Rept. Given: 803
Rept. Rcvd 1,283 Times in 561 Posts
Thanks Given: 228
Thanks Rcvd at 567 Times in 241 Posts
giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299 giv Reputation: 1100-1299
I thought to make a loader....but your sollution was excelent.
Reply With Quote
The Following User Gave Reputation+1 to giv For This Useful Post:
zementmischer (08-03-2012)
  #15  
Old 08-02-2012, 23:24
WilliamElts WilliamElts is offline
VIP
 
Join Date: Aug 2011
Posts: 120
Rept. Given: 58
Rept. Rcvd 152 Times in 71 Posts
Thanks Given: 25
Thanks Rcvd at 6 Times in 2 Posts
WilliamElts Reputation: 100-199 WilliamElts Reputation: 100-199
If the application is written on .NET, you can use de4dot version 1.9.0 to deobfuscate.
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



All times are GMT +8. The time now is 19:32.


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