Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI Reference

Usage

pvm-decompiler [OPTIONS] <file.pvm>

The tool takes one PVM binary file as input and writes the result to stdout. Progress and diagnostic messages go to stderr.

Options

FlagDescription
(no flags)Emit structured pseudo-code (default mode)
-v, --verboseShow CFG, dataflow, and structural analysis alongside pseudo-code
--debugShow raw decoded instructions and all diagnostics
--llvmEmit LLVM IR instead of pseudo-code
--decompileFull LLVM pipeline: lift to IR, then decompile to C code
--refinePass output through an LLM to improve variable names (requires OPENROUTER_API_KEY)
--backend=XChoose decompilation backend (used with --decompile)
-V, --versionShow version
-h, --helpShow help

Backends

Used with --decompile to select the C code generation backend:

ValueDescription
builtinBuilt-in backend, no dependencies needed
retdecUses RetDec decompiler
rellicUses Rellic (Trail of Bits)
rellic-dockerUses Rellic via Docker container
llvm-cbeUses LLVM C Backend Emitter

Environment Variables

VariableDescription
OPENROUTER_API_KEYAPI key for LLM refinement (--refine flag)

Examples

# Basic decompilation
pvm-decompiler program.pvm

# See raw instructions
pvm-decompiler --debug program.pvm

# Verbose analysis + pseudo-code
pvm-decompiler --verbose program.pvm

# LLVM IR output
pvm-decompiler --llvm program.pvm

# C code via builtin backend
pvm-decompiler --decompile --backend=builtin program.pvm

# Pseudo-code with LLM-improved names
pvm-decompiler --refine program.pvm

# C code with LLM-improved names
pvm-decompiler --decompile --refine program.pvm

Exit Codes

CodeMeaning
0Success
1Error (invalid input, decode failure, etc.)