Contents

Cracking rendariaka's packedcrackmev1.0

This crackme is packed unlike the previous ones. We’ll be unpacking it manually as an exercise. The crackme is rendariaka’s packedcrackmev1.0

PropertyValue
LanguageC/C++
PlatformWindows
Difficulty2.0
Quality4.0
Archx86

First run

Enter serial number:

Entering the incorrect serial causes it to exit.

Initial static analysis

As by the name suggests, this crackme is packed.

+-----------------------------------------------------------------+
|+-------------------------------------------------------------+-+|
||                         Data                                | ||
|+-------------------------------------------------------------+^+|
+---------------------------------------------------------------+-+
                                                                |
                                                                |
                                             Tiny bit of code---+

This is proved again by IDA Pro.

According to Detect It Easy, the build information is:

PropertyValue
protectorExe Shield(1.3RC)[-]
protectorYoda’s Crypter(1.3)[-]
compilerMinGW(-)[-]
linkerGNU linker Id (GNU Binutils)(2.56*)[Console32, console]

I’ve identified that the protector is Yoda's Crypter 1.3, as the Nauz File Detector gave only that and it’s unlikely this was packed twice.

propertyvaluevaluevaluevaluevaluevalue
name.text.data.rdata.bss.idatayC
entropy7.9937.8984.400n/a4.7917.883
file-ratio (99.54%)93.68 %0.23 %3.25 %n/a0.93 %1.45 %
raw-address0x000004000x00032C000x00032E000x000000000x00034A000x00035200
raw-size (219774 bytes)0x00032800 (206848 bytes)0x00000200 (512 bytes)0x00001C00 (7168 bytes)0x00000000 (0 bytes)0x00000800 (2048 bytes)0x00000C7E (3198 bytes)
virtual-address0x004010000x004340000x004350000x004370000x0043C0000x0043D000
virtual-size (242956 bytes)0x000326E0 (206560 bytes)0x00000140 (320 bytes)0x00001A70 (6768 bytes)0x00004AA0 (19104 bytes)0x000007DC (2012 bytes)0x00002000 (8192 bytes)
entry-point-----0x0003D060
characteristics0xE00000600xC00000400xC00000400xC00000800xC00000400xE00000E0
writablexxxxxx
executablex----x
shareable------
discardable------
initialized-dataxxx-xx
uninitialized-data---x-x
unreadable------
self-modifyingx----x
virtualized---x--
filen/an/an/an/an/an/a

The sections .text and .yC look to be most of interest as they are marked as self-modifying.

Dumping

To figure out where the unpacked exe is, we can use tiny tracer, which nicely logs all the api calls of interest. I’ll make a mental note to make a x32dbg version of this if I get the chance.

3d060;section: [yC]
...
1013;section: [.text]
...

We can see here that execution moves over to the .text section, which confirms what we knew earlier as this section takes up most of the binary, yet is full of seemingly random data.

When I dump this section when the serial is asked for, it doesn’t contain the MZ header, but IDA Pro does recognise some of the code. Therefore, this is effectively a partial unpacker, as the binary itself is overwritten in memory instead of creating a new one.

To dump the whole binary, the following sections need to be dumped:

AddressSizeInfo
0040000000001000packedv1.0.exe
0040100000033000“.text”
0043400000001000“.data”
0043500000002000“.rdata”
0043700000005000“.bss”
0043C00000001000“.idata”
0043D00000002000“yC”

We’ll simply use Scylla to dump the process.

Analysing dump

Using the string “Enter serial number: \n”, finding the responsible function is quite easy.

           +-----+
           |Print|
           +--+--+
              |
        +-----v----+
        |Read input|
        |transform |
        +-----+----+
              |
        +-----v----+
        |Compare to|
        | 72436h   |
        +---+--+---+
            |  |
+-------+   |  |   +-------+
|Failure|<--+  +-->|Success|
+-------+          +-------+

On a wild guess, let’s try just entering 0x72436 and see what happens.

Success

Enter serial number:
468022
Serial number is correct!

This was an interesting crackme, even if simple apart from figuring out how to correctly dump it.