Frequently Asked Questions
This FAQ explains how decomp.me works and how it fits into decompilation workflows.
Overview
What is decomp.me?
decomp.me is an interactive web-based platform where users can collaboratively decompile assembly code snippets by writing matching source code.
It is an open-source project run by volunteers in their free time.
What do you mean by "matching"?
decomp.me is designed for matching decompilation projects, where the goal is to write high-level code (such as C or C++) that compiles to assembly identical to the original.
Achieving a match usually requires the same compiler, assembler, and flags used to build the original binary, as well as carefully written code that produces identical output.
Writing matching code is a skill that takes time and practice, but many people find the process rewarding.
Why does writing matching code matter?
A byte-perfect match ensures the function's behavior (including undefined behavior) is reproduced exactly. Verification becomes simple: either the assembly matches, or it doesn't.
Although symbol names, comments, and other source-level information are usually lost during compilation, matching guarantees the reconstructed function behaves exactly like it does in the original binary.
Using decomp.me
What's a scratch?
A scratch is a workspace for exploring a compiler's codegen, similar to Compiler Explorer.
Each scratch contains the target assembly, input source code, optional context code, and various settings. Most scratches focus on a single function being matched.
Scratches have unique shareable links and can be forked to create independent copies.
How do I create a scratch?
To create a scratch, select the target Platform and paste assembly for a single function into the Target Assembly section of the New Scratch page.
To do this, you will need assembly code in GNU assembly (GAS) syntax. Depending on the target architecture there are a number of tools that can help extract it. Examples include splat and dtk.
Additionally, tools such as objdiff and the decomp-permuter support scratch creation via the site's API.
What's the context for?
The context section typically contains definitions and declarations such as structs, externs, macros, and function prototypes.
It is compiled together with your main code, allowing you to separate functional code from supporting definitions.
The context is also provided to the decompiler to improve type information and decompilation accuracy.
How does decomp.me work?
Your scratch code is sent to the decomp.me server, where it is compiled, disassembled with objdump, and compared against the target assembly.
As you edit code, it is recompiled automatically and the results update in near real time.
The editor displays a score representing how closely the compiled assembly matches the target. The score is calculated by comparing instructions and applying penalties for differences. Lower scores indicate closer matches.
Does decomp.me automatically decompile assembly?
Sometimes.
decomp.me can run the m2c decompiler to generate an initial C approximation of a function. At the time of writing, m2c supports several architectures including MIPS, PowerPC, and ARM.
This output is intended as a starting point and usually requires manual refinement before it will match the original assembly.
Support for additional architectures or decompilers may be added in the future. Contributions are welcome if you'd like to help integrate them.
Workflow
How does decomp.me fit into a decompilation project?
decomp.me is often used as a scratch space for experimenting with individual functions during a decompilation project.
Contributors use it to test ideas, share matching attempts, and ask for help with difficult functions. Once a match is found, the resulting code is usually added back to the project's repository.
It can also be useful for investigating compiler behavior, such as testing different compilers or flags.
Where do I start?
decomp.me is typically used alongside existing decompilation projects.
If you're new, try browsing recent scratches to see how others approach matching and experiment with modifying them.
We hope to make the site more beginner-friendly in the future.
Do I need a decompilation project to use decomp.me?
No. Anyone can create scratches and experiment with matching assembly or exploring compiler behaviour.
Many scratches come from larger decompilation projects, but decomp.me itself is not required to start one.
Can I upload a full binary?
No. decomp.me works with individual functions, not entire binaries. To use it, you will first need to extract assembly for a specific function using a disassembler or other reverse-engineering tools.
The extracted assembly (or a corresponding object file) can then be used to create a scratch.
Collaboration
Why use decomp.me instead of matching locally?
Many people match functions locally using their own toolchains.
decomp.me focuses on collaboration. Scratches can be shared with a link, allowing others to view the target assembly, experiment with changes, and suggest alternative approaches.
This makes it easy to ask for help, compare ideas, and iterate together without requiring everyone to set up the same environment.
Someone sent me a scratch. What do I do?
Any scratch on the site can be edited. If you save changes to a scratch you do not own, your version becomes a fork of the original.
If your fork either achieves a match or improves on the parent scratch, the original scratch will display a banner indicating the improvement or matching solution exists.
Can you help me match a scratch?
You are welcome to ask for help in the #general-decompilation channel of our Discord Server.
Platforms and Compilers
Can you add a preset for a game I'm working on?
Yes. You can request one by opening a GitHub Issue or asking in our Discord Server.
Can I add a compiler for a game I'm working on?
Yes. The compilers used by decomp.me are stored in the compilers repository. After adding the compiler there, it can easily be integrated into decomp.me. See this PR for an example.
Can I add support for a new platform, e.g. PlayStation 3?
Platform support depends on the underlying tools used by decomp.me. To add a platform, you need:
- a working compiler toolchain
- tools for assembling and disassembling code (e.g. GNU as and objdump)
- support in the assembly diffing tools used by decomp.me
If these pieces exist and integrate cleanly, support can usually be added. Most new platforms are contributed by developers already working on decompilation projects for that system.
If you're interested in adding support, feel free to open a GitHub issue or submit a pull request.
Project Info
Can I programmatically access decomp.me data?
We occasionally provide database dumps on request - just ask in our Discord Server. Please do not attempt to scrape the site.
How do I report a bug?
If you encounter a bug, please contact us on our Discord Server or open a GitHub Issue describing how to reproduce it.
Bug-fixing pull requests are always welcome.
What's with the purple frog?
was originally just a temporary placeholder logo. People liked it more than we anticipated, and the purple frog stuck around!