The decomp.org project
The aim of this project is to implement a decompilation pipeline composed of independent components interacting through well-defined interfaces, as further described in the design documents of the project.
From a high-level perspective, the components of the decompilation pipeline are conceptually grouped into three modules. Firstly, the front-end translates a source language (e.g. x86 assembly) into LLVM IR; a platform-independent low-level intermediate representation. Secondly, the middle-end structures the LLVM IR by identifying high-level control flow primitives (e.g. pre-test loops, 2-way conditionals). Lastly, the back-end translates the structured LLVM IR into a high-level target programming language (e.g. Go).
The following poster summarizes the current capabilities of the decompilation pipeline, using a composition of independent components to translate LLVM IR to Go.
Translate machine code (e.g. x86 assembly) to LLVM IR.
Perform control flow analysis on the LLVM IR to identify high-level control flow primitives (e.g. pre-test loops).
Control flow graph generation tool.
Generate control flow graphs from LLVM IR assembly files (e.g. *.ll -> *.dot)
Control flow recovery tool.
Recover control flow primitives from control flow graphs (e.g. *.dot -> *.json)
Translate structured LLVM IR to a high-level target language (e.g. Go).
Go code generation tool.
Decompile LLVM IR assembly files to Go source code (e.g. *.ll -> *.go)
Go post-processing tool.
Post-process Go source code to make it more idiomatic
The source code and any original content of this repository is hereby released into the public domain.