Unpacking Exe32Pack
Exe32Pack is relatively unused packer in the malware world, but I stumble onto samples occasionally. I wrote an unpacker for it few months back and decided that I might as well give some instructions on how to do it manually.
Load up your target in OllyDbg. What you should be seeing is something like this:
First thing you need to do is hide your presence. Exe32Pack calls IsDebuggerPresent, but in addition to that it seems to do the check inline also, so setting a breakpoint at the IsDebuggerPresent API won’t suffice. Find the debuggerflag from memory, and zero it out. One way to do it is told in here. Other way is to use the OllyHide plugin.
Singlestep a few times to reach the “cmp eax, eax” instruction at offset 00437013. Set a hardware breakpoint (on access, dword) at the address contained in the ESP register. After the hardware breakpoint is in place, press F9 to run free.
When the hardware breakpoint you just set fires, you should be seeing the following:
Singlestep through 3 times (the last instruction before OEP is a “jmp eax”). Dump the image and you’re ready to analyze.
Note: If you failed to hide you presence, you will see garbage code in the OEP which upon execution crash the program. If that is the case, hide yourself better and redo the unpacking :)
March 12th, 2007 at 10:38 am
[…] Read more… Tags: api, breakpoint, malware, occasionally, suffice Posted on Monday, March 12th, 2007 at 3:36 pm and under category News. You can read any responses through the RSS 2.0 feed. You can give a response, or trackback from your site. « No Saving Time in Microsoft DST Patches? Crime and punishment and technology » […]