ORPHANWARE RECOVERY
Home/Guides/Disassembly vs decompilation

Disassembly vs decompilation: what is the difference?

Disassembly translates a program's machine code into assembly language, one processor instruction at a time. Decompilation goes a step further and tries to rebuild higher level code, usually something that reads like C, with functions, loops, conditions, and variables. Disassembly is more exact but low level and slow to read; decompilation is far easier to read but is an interpretation, not a transcript. Neither gives back the original source, because compilation discards the comments, most names, and the types the programmer wrote. A recovery that a business can use goes past both: the decompiled draft is rebuilt into readable source, compiled, and tested against the program you still run.

Last updated

The short version

A compiled program is a file of machine instructions for a specific processor. Both techniques start from that file and work backward, but they stop at different places.

  • Disassembly stops at assembly language: the processor's own instructions written as readable mnemonics such as mov, add, and jmp. It stays close to what the processor actually executes.
  • Decompilation keeps going to a high level language: it groups instructions into functions, recognizes loops and conditions, and invents variable names so the logic can be read as code.
  • Neither one produces the original project. What comes back is a reading of the binary, not the files the developer had.

What disassembly produces

A disassembler translates machine language into assembly language, the inverse of what an assembler does, and its output is formatted for people to read rather than to be fed back into an assembler (Wikipedia: Disassembler). A familiar example is the GNU objdump tool, whose -d option displays the assembler mnemonics for the machine instructions in a file, limited to the sections expected to contain instructions (GNU Binutils: objdump).

The strength of disassembly is accuracy. Because it aims at the assembly closest to what actually executes, disassembled code is normally more accurate than decompiled code, but also lower level and less abstract (Wikipedia: Disassembler). The cost is readability. A routine that a developer wrote in ten lines can become a page of register moves and jumps, and following it takes someone who reads assembly for the specific processor involved.

What decompilation produces

A decompiler translates an executable back into high level source code, reconstructing representations that resemble languages such as C (Wikipedia: Decompiler). Commercial tools describe the same relationship from the other side: Hex-Rays says its IDA decompilers take the result of the disassembly process and turn it into readable C-like pseudocode (Hex-Rays: IDA decompilers).

That relationship matters. Decompilation is built on top of disassembly, not instead of it. A decompiler first loads the file and finds basic facts such as the processor architecture and entry point, then disassembles instructions into an intermediate form, then recognizes common instruction patterns and lifts them into higher level operations (Wikipedia: Decompiler). The same reference gives a small example: the x86 sequence cdq, xor eax, edx, sub eax, edx computes an absolute value and can be expressed as eax := abs(eax). Multiply that by every routine in a program and you have the difference between a listing you decode and a listing you read.

What neither one can give back

Compilation generally discards source level information such as variable names, comments, types, and parts of the original program structure, so a decompiler usually cannot reproduce the original source exactly (Wikipedia: Decompiler). Disassembly has the same limit at a lower level: comments and named constants in the original are usually removed when the program is built, so the disassembly lacks them and is harder to interpret than the annotated original (Wikipedia: Disassembler).

How much survives depends on the platform. Executables that carry detailed metadata, such as Java and .NET programs, keep class structures and method signatures and are easier to reverse, while files stripped of that context are harder (Wikipedia: Decompiler). Older Windows platforms sit in between, and the VB6 guide and Delphi guide walk through what each one leaves inside the EXE. The general rule is covered in the guide to what you actually get back: logic and behavior are recoverable, the human layer is not.

Why both are harder than they sound

Even the first step is not mechanical. It is not always possible to tell executable code from data inside a binary, programs can jump to addresses computed at run time, processors with variable width instructions can allow more than one valid disassembly of the same bytes, and packing, encryption, or obfuscation has to be undone before meaningful analysis can begin (Wikipedia: Disassembler). Every one of those problems carries forward into decompilation, because the decompiler is reading the disassembly underneath.

That is why output from either kind of tool needs checking. A listing is an interpretation of the binary, and nothing in the listing itself proves that code rebuilt from it behaves like the original.

The tools usually do both

In practice the line between the two is drawn inside one tool. Ghidra, the reverse engineering framework maintained by the NSA Research Directorate, lists disassembly, assembly, decompilation, graphing, and scripting among its capabilities and supports many processor instruction sets and executable formats (Ghidra on GitHub). Analysts move between the decompiled view, to understand what a routine is for, and the disassembly, to confirm exactly what it does when the decompiled view is unclear.

Where each fits in a recovery

For an owner, the useful question is not which technique is better. It is what has to happen after both have run. Neither a disassembly listing nor raw decompiler output is something a developer can pick up and maintain, which is why the homepage describes the deliverable as readable source structured the way a developer would write it, and says plainly that it is not raw decompiler output.

The pipeline uses four stages. Reconnaissance inventories the program and gives an honest feasibility verdict first. Decompilation, done with Ghidra, produces a first draft of the logic: functions, data structures, and control flow. Reconstruction rebuilds that draft into clean, readable source with meaningful names and normal structure, then compiles it. Differential verification runs the rebuild and the original side by side across thousands of generated test cases and compares the outputs exactly; any divergence is found, fixed, and retested. The binary recovery guide walks each stage, and the differential testing guide explains what zero divergence does and does not prove.

The measured record on the homepage comes from that pipeline: 9 of 9 C and C++ test targets recovered to compilable source, with 0 behavioral divergences in final differential testing, including a hostile build compiled with aggressive optimization, link time optimization, and stripped symbols. Those are C and C++ targets; other platforms start with a recon verdict on the specific program before anything is promised.

Orphanware Recovery is operated by Josiah Wilson, who directs every engagement and signs off on every result. The decompilation, reconstruction, and testing pipeline is carried out by AI agents under his direction.

A note on legality

Whether you disassemble or decompile does not change the legal questions; both are forms of reverse engineering. Work is only done on binaries you own or have the right to reverse engineer. The guide to decompiling legality covers the questions owners usually ask. This page is general information, not legal advice; for a specific license or situation, ask a lawyer.

What to do next

If you have a program with no source and are trying to judge whether either technique can help, start by collecting what you can without changing the working machine: the executable, its DLLs and installer, configuration and data files, and sample output that shows what correct behavior looks like. The intake checklist lists the rest. Please do not attach the binary to your first email; after an initial reply, the transfer is arranged.

If you are not sure what your program was built with or whether recovery is realistic at all, that is exactly what the Recon Report answers, for a fixed $45, before any larger commitment. See pricing for the tiers, or start from the Orphanware Recovery home page.

Start with a $45 Recon Report

An honest verdict on whether your program can be recovered, what it does, and what a full recovery would take. Fixed price, delivery in about 3 days.