Subscribe to the RSS feed in case you are interested in updates
Here is quick overview of one possible way to solve the Hack.lu 2009 crackme (reversing challenge) with the classical JZ/JNZ method (hence the 1998 reference).
Disclaimer : If you are used to reversing software, you can skip this post, there is nothing new for you to glimpse here. This is one way to solve this crackme, of course you could try to reverse engineer the serial generation algorithm. In reality, if you'd use a serial system like this in a shareware type of application nobody would bother to do so.
Although there are no classical packer signatures to be detected (PEid, ExeInfoPE), looking at the results of entropy tests it is clear that the sample is compressed/crypted in some way or another. Entropy being the measure for randomness/chaos.
Examples :
- AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA has an entropy of 0
- ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwx has an entropy of 96,04%
Entropy measurement of crackme.exe
There are several ways to measure whether a binary (or parts of it) are compressed/encrypted, I happen to use gynvaels' excellent tool ENT (not to be confused by a similar entropy measurement tool) as it offers several advantages such as mapping to .code and .data section of a PE file. As we can see above the entropy of the code section (Green) is that of normal code, the data section is high on entropy at the very end of it.
Luckily for us it doesn't use stolen bytes or more advanced methods to hinder dumping from memory while the sample decrypted/decompressed itself.
So we proceed with
- Loading the sample in Ollydbg - Wait until it hits OEP
- Dump the process using Ollydump
- fix import table
- Search for "serial"
- Look for branching code
- Patch branching code from JZ to JNZ
Patching the Jump Zero to a Jump Not Zero instruction
This is it
Posted by Thierry Zoller