{"id":13745697,"url":"https://github.com/decomp/decomp","last_synced_at":"2025-04-05T12:06:38.040Z","repository":{"id":20916193,"uuid":"24204065","full_name":"decomp/decomp","owner":"decomp","description":"Components of a decompilation pipeline.","archived":false,"fork":false,"pushed_at":"2023-02-26T05:04:03.000Z","size":674,"stargazers_count":475,"open_issues_count":11,"forks_count":30,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-03-29T11:09:53.539Z","etag":null,"topics":["binary-analysis","compositional-decompilation","decompilation","decompilation-pipeline","decompiler","go","golang","llvm","llvm-ir","reverse-engineering"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"unlicense","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/decomp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-09-18T20:33:09.000Z","updated_at":"2025-03-20T17:03:36.000Z","dependencies_parsed_at":"2022-08-26T18:51:45.359Z","dependency_job_id":"82fffbf1-0793-4ce5-9564-f9855d5ab8c4","html_url":"https://github.com/decomp/decomp","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decomp%2Fdecomp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decomp%2Fdecomp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decomp%2Fdecomp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/decomp%2Fdecomp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/decomp","download_url":"https://codeload.github.com/decomp/decomp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247332605,"owners_count":20921853,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["binary-analysis","compositional-decompilation","decompilation","decompilation-pipeline","decompiler","go","golang","llvm","llvm-ir","reverse-engineering"],"created_at":"2024-08-03T06:00:34.816Z","updated_at":"2025-04-05T12:06:38.018Z","avatar_url":"https://github.com/decomp.png","language":"Go","readme":"# The decomp project\n\n[![Build Status](https://travis-ci.org/decomp/decomp.svg?branch=master)](https://travis-ci.org/decomp/decomp)\n[![Coverage Status](https://coveralls.io/repos/github/decomp/decomp/badge.svg?branch=master)](https://coveralls.io/github/decomp/decomp?branch=master)\n[![GoDoc](https://godoc.org/github.com/decomp/decomp?status.svg)](https://godoc.org/github.com/decomp/decomp)\n\nThe 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](https://github.com/decomp/doc) of the project.\n\n## Installation\n\n```bash\ngit clone https://github.com/decomp/decomp\ncd decomp\ngo install -v ./...\n```\n\n## Usage\n\nSee example usage at [examples/demo](examples/demo), and [this comment](https://github.com/decomp/decomp/issues/218#issuecomment-548506064) for further details.\n\n## Decompilation pipeline\n\nFrom a high-level perspective, the components of the decompilation pipeline are conceptually grouped into three modules. Firstly, the [front-end](#front-end) translates a source language (e.g. x86 assembly) into [LLVM IR](http://llvm.org/docs/LangRef.html); a platform-independent low-level intermediate representation. Secondly, the [middle-end](#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](#back-end) translates the structured LLVM IR into a high-level target programming language (e.g. [Go](https://golang.org/)).\n\nThe following poster summarizes the current capabilities of the decompilation pipeline, using a composition of independent components to translate LLVM IR to Go.\n\n[![Poster: Compositional Decompilation](https://raw.githubusercontent.com/decomp/doc/master/poster/poster.png)](https://raw.githubusercontent.com/decomp/doc/master/poster/poster.pdf)\n\n### Front-end\n\nTranslate machine code (e.g. x86 assembly) to LLVM IR.\n\n[Third-party front-end components](front-end.md).\n\n### Middle-end\n\nPerform control flow analysis on the LLVM IR to identify high-level control flow primitives (e.g. pre-test loops).\n\n#### ll2dot\n\nhttps://godoc.org/github.com/decomp/decomp/cmd/ll2dot\n\nControl flow graph generation tool.\n\n\u003e Generate control flow graphs from LLVM IR assembly (*.ll -\u003e *.dot).\n\n#### restructure\n\nhttps://godoc.org/github.com/decomp/decomp/cmd/restructure\n\nControl flow recovery tool.\n\n\u003e Recover control flow primitives from control flow graphs (*.dot -\u003e *.json).\n\n### Back-end\n\nTranslate structured LLVM IR to a high-level target language (e.g. Go).\n\n#### ll2go\n\nhttps://godoc.org/github.com/decomp/decomp/cmd/ll2go\n\nGo code generation tool.\n\n\u003e Decompile LLVM IR assembly to Go source code (*.ll -\u003e *.go).\n\n#### go-post\n\nhttps://godoc.org/github.com/decomp/decomp/cmd/go-post\n\nGo post-processing tool.\n\n\u003e Post-process Go source code to make it more idiomatic (*.go -\u003e *.go).\n\n## Release history\n\n### Version 0.2 (2018-01-30)\n\nPrimary focus of version 0.2: *project-wide compilation speed*.\n\n*Developing decompilation components should be fun.*\n\nThere seem to be an inverse correlation between depending on a huge C++ library and having fun developing decompilation components.\n\nVersion 0.2 of the decompilation pipeline strives to resolve this issue by leveraging an [LLVM IR library](https://github.com/llir/llvm) written in pure Go. Prior to this release, project-wide compilation could take several hours to complete. Now, they complete in less than 1 minute -- the established *hard limit* for all future releases.\n\n### Version 0.1 (2015-04-21)\n\nInitial release.\n\nPrimary focus of version 0.1: *compositional decompilation*.\n\n*Decompilers should be composable and open source.*\n\nA decompilation pipeline should be composed of individual components, each with a single purpose and well-defined input and output.\n\nVersion 0.1 of the decomp project explores the feasibility of composing a decompilation pipeline from independent components, and the potential of exposing those components to the end-user.\n\nFor further background, refer to the [Compositional Decompilation using LLVM IR](https://github.com/decomp/doc/raw/master/report/compositional_decompilation/compositional_decompilation.pdf) design document.\n\n## Roadmap\n\n### Version 0.3 (to be released)\n\nPrimary focus of version 0.3: *type-aware binary lifting*.\n\n*Decompilers rely on high-quality binary lifting.*\n\nThe quality of the output IR of the binary lifting front-end fundamentally determines the quality of the output of the entire decompilation pipeline.\n\nVersion 0.3 aims to improve the quality of the output LLVM IR by implementing a type-aware binary lifting front-end.\n\n### Version 0.4 (to be released)\n\nPrimary focus of version 0.4: *control flow analysis*.\n\n*Decompilers should recover high-level control flow primitives.*\n\nOne of the primary differences between low-level assembly and high-level source code is the use of high-level control flow primitives; e.g. 1-way, 2-way and n-way conditionals (`if`, `if-else` and `switch`), pre- and post-test loops (`while` and `do-while`).\n\nVersion 0.4 seeks to recover high-level control flow primitives using robust control flow analysis algorithms.\n\n### Version 0.5 (to be released)\n\nPrimary focus of version 0.5: *fault tolerance*.\n\n*Decompilers should be robust.*\n\nDecompilation components should respond well to unexpected states and incomplete analysis.\n\nVersion 0.5 focuses on stability, and seeks to stress test the decompilation pipeline using semi-real world software (see the [challenge issue series](https://github.com/decomp/decomp/labels/challenge)).\n\n### Version 0.6 (to be released)\n\nPrimary focus of version 0.6: *data flow analysis*.\n\n### Version 0.7 (to be released)\n\nPrimary focus of version 0.7: *type analysis*.\n","funding_links":[],"categories":["Decompilation Pipeline"],"sub_categories":["General"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecomp%2Fdecomp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdecomp%2Fdecomp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdecomp%2Fdecomp/lists"}