2 ms·
Writing down a high-level version of the assembly instructions in C is one of the best tricks when reverse engineering disassembled code. When I started trying
by teolandon 9y ago
Writing down a high-level version of the assembly instructions in C is one of the best tricks when reverse engineering disassembled code.
When I started trying to interpret assembly instructions by keeping track of the registers, stack, and branches, but that ended up being way too much bookkeeping and didn't really give any more insight on what the code actually does.
Keeping a text file of C code though and adding lines as you go through the instructions is really fitting and practical. C is abstract enough to not care about most bookkeeping of registers and stack management, and branches can be written in nice nested if-else blocks that are familiar to most programmers and provide a visual structure that is compact and practical. On the other hand, C is low enough to deal with memory addresses almost directly, allowing you to easily transcribe any address arithmetic that happens, and if you're familiar with what stucts get compiled into, you can very nicely spot them in disassembled code and keep your high-level reverse engineered code structured and nice.
Very nice guide and a very good starting point in reverse engineering, especially if you have at least some experience with assembly.