Unpacking - MoleBox.v2.6. (Extracting Embedded Files) - (ColdFeve
Unpacking - MoleBox.v2.6. (Extracting Embedded Files) - (ColdFeve
By
ColdFever
AoRE team
Abstract:
Unpacking a single executable file packed with MoleBox is a fairly simple
job. However, unpacking one or more embedded files (dll or ocx) from
MoleBox executable is a very nice challenge.
Introduction:
“MoleBox is a runtime exe packer for Windows applications. It bundles the
executable together with the DLL and data files into a single EXE file,
without losing the ability to run the application.” said in their site.
From the picture you can see that you can add all sorts of files.
Part I:
Dumping and fixing the main file
I have used “AVI MPEG WMV RM to MP3 Converter” as a target for this
tutorial.
Since I have written a detailed tutorial on unpacking MoleBox, “MUP
MoleBox Pro 2.6.0.2375”, I will just walkthrough unpacking the main file
in brief. So for more details, read my pervious tutorial.
Load the program in Ollydbg. Push F8 once. Follow what’s in the ESP
register at the dump window. Set a Hardware break point on access for
ESP’s address. Run the program (F9). You should break here
Push F7 twice and you are at the OEP. Write it down. Clear the hardware
break point. Now, either you can run ImpRec and get your RVA address
from it or just find any FF 25 (JMP) and follow it in the dump window. Set
a hardware break point on Write on any of the address and restart the
program (Ctrl+F2).
Run the program (F9). Ignore the first break and run one more time. You
should be here
Go into the highlight call by pressing “Enter”. The second jump is the
magic jump. Write down the address of this jump. Clear your hardware
break point and set a hardware break point on Execution on this jump.
Restart the program (Ctrl+F2).
Run the program (F9). Change the JE to JMP and clear the hardware
break point. Now, set a break point on your OEP. “You did write down,
didn’t you? “
Run the program (F9). You should stop at OEP. Use Ollydbg’s plug-in to
dump the program. Run ImpRec, select the program, type your OEP, and
click “IAT AutoSearch”. Then replace the RVA and the size with the
suggested one, see the following picture for details
Once you change the RVA and the size click on “Get Imports”. Click “Show
Invalid” and cut thunks. Then fix your dump.
Now you should have a working dump file, but with a fatal error L
Part II:
Extracting the missing dll
Load the dump file in Ollydbg. Run the program (F9). When the message
box comes up, pause the program in Ollydbg (F12). Then press Alt+F9 and
click on “OK” at the message box. The program will break in here
Keep pressing F8 until you return from this call. You should be here
Now, we know the program is looking for “QuickTime.ax” filter. Since it is
not in my hard drive, it must be inside the MoleBox file.
Click “OK” and go to the memory (Alt+M). Set a break point on the “.text”
section of “MBX@574@” module. As shown
Also, place another break point on the magic jump
Now, remove the check from “Break on new module” and run the program
(F9). You should break here
Press Ctrl+F9 to stop at the “RETN 0C”. Place another break point on the
“.text” section of “MBX@574@” and run the program (F9). You should
break here
Place a break point on the “RETN” and run the program (F9). When you
stop at the return, place another break point on the “.text” section of
“MBX@574@” and run the program (F9). You should break here
Remove the break point and change “JE” to “JMP” and run the program
(F9). You should break here
Run LordPE and select the program in the parent window. In the child
window look for our module and dump it
Run ImpRec and select our program. Then Click on “Pick DLL”.
However, ImpRec see the image base as 10000000. See the log window
So for the RVA address you need to use 10000000 for the image base. So
RVA = 00D0B000 – 10000000 = F0D0B000
Now if you try to fix your dump you will get this message
So to work around this, click “Save Tree” and open the saved file in
“Notepad”. We need to correct the addresses manually
Address should be like this
Click on “Load Tree” and load the file to ImpRec. Now fix your dump file ☺
Scroll down from the beginning of the section till you see a lot of ‘00’s
So, the size is D32. Enter the correct information
Do not forget to save. Close the directory table and change the image base
Again do not forget to save. Click “OK” to close the file. Then click on
“Rebuild PE” to rebuild our file
After all this, we need to rename the file to “QuickTime.ax” in order for
our main dump file to find it
Greetings:
To all my friends in AoRE Fourm
Tuts4you, ARteam, Snd, CORE, TSRh, and all the cracking groups
To you for taking the time to read this ☺