Recover and compare code
glaurung decompile
Render experimental pseudocode for one or more functions.
use it for
Use --db to apply project names. --all and --vas support batch work, but one function is easier to inspect against its disassembly.
Run glaurung decompile --help on your installed version before putting the command in a script.
Glaurung is still pre-1.0.
- input
- A native binary and, optionally, one function name or VA. A project can supply analyst names and types.
- output
- Experimental pseudocode in plain, C-like, or DecBench form.
- mode
- read only. The examples leave the input unchanged.
command shape
syntax
$ glaurung decompile PATH [--func NAME|VA] [--style plain|c|decbench]
The installed parser is authoritative: glaurung decompile --help
run it
examples
Render main as C-like pseudocode
One function is small enough to compare line by line with disassembly.
run
$ glaurung decompile samples/binaries/platforms/linux/amd64/export/native/clang/debug/hello-c-clang-debug --func main --style c output
fn main {
// x86-64 prologue: save rbp
rsp = (rsp - 32);
local_8 = arg0;
local_10 = arg1;
var0 = printf@plt("Hello, World from C!\n");
local_14 = 0;
local_18 = 0;
while (1) {
if (((%sf ^ %of) == 0)) {
break;
}
var2 = strlen@plt(*&[ret+var1*8]);
local_14 = (local_14 + var2);
local_18 = (local_18 + 1);
}
print_sum(local_14);
static_function();
return;
} captured 2026-08-31, shortened.
Read the result: The loop and calls are useful leads. The temporary variables and reconstructed condition show why you still need the instructions beside this output.
Apply analyst names and types
Project annotations change presentation, not the underlying bytes.
run
$ glaurung decompile samples/binaries/platforms/linux/amd64/export/native/clang/debug/hello-c-clang-debug --func 0x1150 --style c --db hello.glaurung output
fn main {
rsp = (rsp - 32);
local_8 = arg0;
local_10 = arg1;
var0 = printf@plt("Hello, World from C!\n");
while (1) {
if (((%sf ^ %of) == 0)) break;
var2 = strlen@plt(*&[ret+var1*8]);
local_14 = (local_14 + var2);
}
print_sum((unsigned long)((unsigned int)(local_14)));
static_function();
return;
} captured with a fresh project, shortened.
Read the result: The project supplies main and print_sum, but it does not repair every temporary or condition. Compare the output with disasm before accepting a type or control-flow claim.
used above
important options
These are the flags used by the examples. Run glaurung decompile --help for the complete parser help.
before you rely on it
checks
- Pseudocode can be wrong. Check important claims against disassembly and runtime behavior.
keep working