CODEFUSE-DEBENCH: An Empirical Study on Readability, Recompilability, and Functionality
This paper introduces DEBENCH, a novel automated framework that evaluates binary decompilers across three orthogonal dimensions—readability, recompilability, and functionality—revealing that current tools suffer from a steep "reusability cliff" where high readability does not guarantee functional correctness and that progress depends more on improving decompiler engines than on larger repair models.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you have a delicious, complex cake (the original software source code). Someone bakes it, packs it into a sealed, unmarked box, and throws away the recipe. This box is the binary file (the machine code).
Now, imagine you hire a "Reverse Engineer" (a decompiler) whose job is to look at the sealed box, guess what ingredients were used, and write down a new recipe (the decompiled code) so you can bake the cake again.
For a long time, people judged these reverse engineers based on one thing: Does the new recipe look pretty? If the words were spelled correctly and the sentences flowed well, they assumed the cake would taste the same.
This paper, CodeFuse-DeBench, argues that looking pretty isn't enough. A recipe can look beautiful but tell you to use salt instead of sugar, resulting in a disaster. The authors built a new testing ground called DEBENCH to check three things:
- Readability: Does the recipe look easy to read?
- Recompilability: Can you actually use this recipe to bake a cake (does the code compile)?
- Functionality: Does the new cake taste exactly like the original?
Here is what they found, using simple analogies:
1. The "Beautiful Lie" (Readability vs. Reality)
The authors tested five famous "Reverse Engineers" (decompilers like IDA, Ghidra, and Angr).
- The Finding: One tool (Angr) produced a recipe that looked incredibly clean and organized. It was easy to read! But when they baked the cake, it tasted wrong. Why? The tool confused "sugar" (signed numbers) with "salt" (unsigned numbers).
- The Lesson: A tool can produce code that looks perfect to a human but is secretly broken. Readability does not guarantee correctness.
2. The "Repair Shop" (Can we fix it?)
Sometimes the recipe is messy or has typos. The authors tried using AI (Large Language Models) to act as a "Repair Shop" to fix the mistakes so the code could be compiled.
- The Finding: The AI was great at fixing typos (syntax errors). But it was terrible at fixing deep structural problems, like getting the wrong type of ingredient (e.g., trying to fix a "pointer" error).
- The Cliff: There is a massive gap between "We fixed the typos and the code compiles" and "The code actually works."
- 65% of the time, the AI could fix the code enough to compile it.
- But only 1.2% of the time did the final result actually behave exactly like the original.
- The Analogy: It's like fixing a car engine so it starts (compiles), but the car still drives backward (functionality fails). The gap between "starts" and "drives right" is huge.
3. Who Should You Hire? (The Engineer vs. The Editor)
The study asked: Is it better to hire a better Reverse Engineer, or a better AI Editor to fix their mistakes?
- The Finding: It matters way more who you hire as the Reverse Engineer.
- Switching from a bad Reverse Engineer to a good one improved the final result by 20 times.
- Switching from a weak AI Editor to a strong AI Editor only improved the result by 1.6 times.
- The Lesson: Don't waste money trying to find a smarter AI to fix bad code. You need a better Reverse Engineer in the first place. The problem is the original translation, not the editing.
4. The "Secret Sauce" (Compiler Choices)
The authors also tested how different "baking settings" (compiler optimizations) affected the results.
- The Finding: The settings that made the recipe look the easiest to read actually made the cake taste the worst.
- Optimization Level 0 (No changes): The recipe looked messy but the cake tasted perfect.
- Optimization Level 3 (Aggressive changes): The recipe looked clean, but the cake was ruined.
- The Lesson: Just because a tool says "This code is optimized and clean" doesn't mean it's safe to use. The "cleanest" looking code was often the most dangerous.
5. The Three Types of Breakage
When the process failed, the authors found three distinct reasons, like three different ways a recipe can go wrong:
- Typos (Fixable): The AI can easily fix these.
- Wrong Ingredients (Hard to fix): The tool guessed the wrong type of variable (like thinking a number is a letter). The AI can patch the code to compile, but the logic is still wrong.
- Missing Magic (Unfixable): Some information is lost forever during the baking process (like specific memory addresses or complex C++ features). No amount of AI editing can bring this back. If the Reverse Engineer didn't capture it, the AI can't invent it.
Summary
The paper concludes that we need to stop judging decompilers just by how "pretty" the code looks. We need to judge them by whether the code actually works.
- The "Reusability Cliff": There is a steep drop-off between code that looks good and code that works.
- The Priority: Engineers should focus on fixing the core decompilers (the Reverse Engineers) to handle complex types and memory correctly, rather than hoping AI editors can magically fix broken logic later.
In short: Don't judge a book by its cover, and don't judge a decompiler by how clean its code looks. You have to run the code to see if it actually works.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.