16 lessons3 h 10 min

Reverse Engineering: Static Analysis

Reverse engineering, often written RE or shortened to rev, is working out what a program does when all you have is the compiled binary. No source, no comments, no documentation: only the instructions the compiler left behind. It is how malware gets understood, how vulnerabilities get found in software nobody will show you the code for, and how a CTF challenge that prints "Wrong!" gets turned into a flag.

This course teaches the static half of that skill: understanding a binary by reading it, without running it. We start with the standard command-line tools, move to a decompiler, and spend most of the course learning to read what the decompiler gives back, because its output is a rough guess at the original C and never the real thing. By the end you should be able to open an unfamiliar binary, find the part that matters, and explain what it does.

Course Layout

The course builds from small, cooperative programs up to ones that give you very little to work with:

  1. Foundations. What static analysis is, with a first binary taken apart from the command line. Then what compiling throws away, so decompiler output stops being a surprise, and setting up Ghidra.
  2. Reading Decompilation. The core of the course. Rebuilding control flow, recovering data and types, following functions and calls, and using strings and constants as landmarks.
  3. Harder Targets. What changes when the binary is stripped of its names, statically linked with its whole C library, obfuscated on purpose, written in another language, or built to resist analysis.
  4. Challenges. Four crackmes, starting with a serial key and getting less cooperative each time, up to a small virtual machine.

Work through Foundations and Reading Decompilation in order. The Harder Targets lessons stand on their own, so take them as you need them.

Follow along with the binaries
Lessons that take a program apart come with a download holding that program. Run the same commands on your own machine as you read. Reverse engineering is learned by doing it, and your output should match the lesson's.

Toolchain

The first lessons need nothing beyond file, strings and objdump, which ship with binutils on nearly every Linux system. After that the course uses Ghidra, a free and open-source decompiler; Orienting Ghidra covers installing it and finding your way around.

Two guides on this site cover tools the course leans on without teaching: the GDB Guide and the Radare2 Guide. Running a program under a debugger is dynamic analysis, which is its own subject, but it is often the quickest way to check something you worked out by reading.

You should be able to read C and basic assembly.
Decompiled code is C, and when the decompiler gets it wrong, the assembly underneath is the only source of truth. You do not need to be fluent in either, but pointers, structs, the stack, and instructions like mov, cmp and call should be familiar. If they are not, C Programming and Assembly 101 come first.

What to Expect

Reverse engineering is slow, and being stuck is a normal part of it. Nobody reads a binary from the first instruction to the last. You find a foothold, such as a string or a library call, and work outward from it, naming things as you come to understand them. The lessons here show that process on real programs, so that being stuck on your own target feels familiar and not like failure.