Disassembly Explained: Reading What a Program Tells the Processor
Disassembly translates a program's machine instructions into assembly language, a notation people can inspect. It lets an analyst read operations such as “load this value” or “jump to another instruction” without having the programmer's original source code.
Machine code is the encoded instruction data a processor executes. Source code is the code a programmer writes; a compiler can translate it into machine code before the program runs.
A disassembler performs the reverse translation at the instruction level. It doesn't promise to recover the original source project, comments, or variable names.
Find Bugs by Throwing Junk at Your Code
Eight bytes, two instructions
Here's a small example for the 32-bit x86 instruction set, one family of instructions that processors understand. It puts 7 in a temporary storage location and adds 3.
Each byte is a group of eight binary digits, meaning zeros and ones. The left column writes those bytes in hexadecimal, a compact number system using 0–9 and A–F.
| Machine bytes | Assembly instruction | Meaning |
|---|---|---|
B8 07 00 00 00 | mov eax, 7 | Put the value 7 into EAX |
83 C0 03 | add eax, 3 | Add 3 to the value in EAX |
EAX is a register, a small storage location inside the processor. After these two instructions run in order, it contains 10.
This is an instruction fragment, not a complete application. The useful transformation is from stored bytes to operations whose effects a person can reason about.
GNU's objdump documentation describes this kind of display: readable instruction names corresponding to the machine instructions in a file.
Reading instructions takes more than translating them
The disassembler needs to know the processor's instruction set and which parts of the file contain code. A file can also hold pictures, text, and other data that aren't instructions at all.
Treat the wrong bytes as code, and a tool may produce an impressive-looking but misleading listing. Starting in the middle of an instruction can also derail the interpretation.
Ghidra, a software-analysis toolkit, follows instruction paths and looks for groups of instructions that perform tasks. Its training guide explains the analysis process and how examiners can correct the resulting view.
The analyst then follows how data moves and what conditions cause the program to choose different paths. Seeing an instruction in a file doesn't prove that the program executed it during a particular incident.
- Try both Arm and RISC-V processors on a single board and compare them yourself.
- Skip the soldering: the header pins arrive already attached.
- Follow the step-by-step tutorial in MicroPython or C at your own pace.
Disassembly and decompilation give different views
A decompiler tries to reconstruct higher-level code, closer to what a programmer might write. A disassembler stays closer to individual processor instructions, as the National Institute of Standards and Technology's code-analysis definition explains.
Neither can reliably restore everything the compiler discarded. Optimization, the compiler's work to improve the program's performance, can rearrange operations or remove unused values entirely.
The GDB debugging manual describes why optimized machine instructions can differ from the original source. A reconstructed program is an interpretation of what remains.
What this contributes to a security investigation
Disassembly can help explain suspicious behavior, locate a programming error, or show how a security check works. It's one tool in reverse engineering, the wider process of studying an existing program to understand its design and behavior.
For malware, software designed to cause harm, some code may be packed: stored in a form that must be unpacked before the useful instructions are visible. A first look at the file might therefore show only the unpacking machinery.
The incident-response organization FIRST discusses that obstacle in its Malware Analysis Framework. Analysts may combine code inspection with controlled observation of a running program.
Knowing the instructions still doesn't guarantee a cure. Understanding how ransomware—malicious software that locks files for payment—scrambles data doesn't automatically provide the secret key, a data value needed to recover it.
Reverse Engineering: How Analysts Work Out What Software Does

CISC: Why One CPU Instruction Can Mean Several Steps

Ilfak Guilfanov: Building IDA and Patching Windows Himself

QUOTE:
"Amateurs hack systems, professionals hack people."
