HAVOK
December 14th, 2005, 17:20
Very interesting
So, we wonder: if it would exist such a debugger, able to run backwards as the cracker wishes, and also able to emulate the IDT, debug registers, etc until the last CPU-related feature - the one in the article is not but let's suppose it exists. How can a protectionist beat this beast?.
Hmm.. it seems hard to find a way one can easily code. I think the following ones would work:
1. Heavy loops, decryption and self-modifying code will make the debugger to store huge amounts of information in order to trace back. Allocating/freeing memory also helps in this process.
2. Computations with the registers will always be faster if not emulated. So, we can measure the elapsed time and compare it to a threshold. All the time-consuming tricks of (1) can be used with only the registers. This could be beaten with clever emulation of those instructions reading the timestamp counter and performance registers (rdpm, rdtsc, ...).
3. Anti-disassembler and code obfuscation. It's pointless to go back in a code you don't understand. One could use Virtual Machines or metamorphism as execryptor does

.
And here ends my list.
So, if i'm not wrong, the list of reliable available tricks is reduced to use the same tricks anti-cracking protections are heading to. Tricks based on time-consuming problems, somewhat related with mathematical problems (metamorphism is related to some pretty hard group-theory problem used in crypto, for example). Not ellegant and clever tricks any longer.
Personally, i find reversing this stuff very boring.
Regards,
Havok.