3 min read

Binary Analysis
Advanced

Reverse Engineering

Reverse engineering is the process of analyzing compiled binaries to understand their functionality without access to source code. This skill is essential for malware analysis, vulnerability research, exploit development, and software security auditing.

Legal Considerations

Reverse engineering is lawful in many jurisdictions for defined purposes, and unlawful in others; the purpose and the means both matter. In the US, 17 U.S.C. §1201 separately prohibits circumventing a technological measure that controls access to a work, so copying a binary to study it and defeating its licence check are not the same act; the security-research exemption is narrow and conditional, and "educational purposes" is not one of its conditions. In the EU, Directive 2009/24/EC Article 6 permits decompilation only to obtain the information needed for interoperability with an independently created program. Work from software you own or have written authorisation to analyse, and check your EULA before starting.

How to Use This Section

Each page stands on its own as reference material, so read the one that matches the problem in front of you rather than working through all eleven in order. Pages 1 to 5 establish the vocabulary the later pages assume: registers and calling conventions, disassembly and string-level reconnaissance, debugger control, assembly idioms, and decompiler output. Pages 6 to 9 cover what changes when the binary is hostile or hostilely packaged: anti-debugging and virtual-machine checks, packed executables, kernel-mode code, and managed runtimes. Pages 10 and 11 change the assumptions rather than the target. AArch64 replaces x86-64 as the instruction set most shipped code actually uses, and Frida replaces the stopped process with one that keeps running while you watch it.

The section assumes you can read C and are comfortable on a command line. Every command is written to run against a binary you own or have signed off on; where a technique executes a sample, the page says so before the command does.

Tooling Across the Section

Tooling recurs across the page set in three groups. IDA Pro, Ghidra, Binary Ninja and radare2 disassemble: they turn machine code into assembly, names and cross-references. To stop a program and read its memory, use x64dbg on Windows, GDB with pwndbg on Linux, or WinDbg for the Windows kernel. Hex-Rays, the Ghidra decompiler, dnSpyEx for .NET, Vineflower for Java and CFR for class files from older JDKs recover a C-like approximation of the original. Pages give the exact invocation where their own task depends on one.

Where Reverse Engineering Applies

  • Malware analysis: understanding what a sample does, and extracting its C2 domains and encryption keys.
  • Vulnerability research: finding memory-safety and logic bugs in closed-source software you are authorised to test.
  • Exploit development: mapping a target's mitigations and code paths so a proof of concept is reliable.
  • Interoperability and licence checks: reading licence-validation and file-format code in order to interoperate with, audit or triage software you hold a licence for, recognising the check rather than defeating it.

Guide Contents