Constraint-Guided Multi-Agent Decompilation for Binary Recovery

Date:

Constraint-Guided Multi-Agent Decompilation for Executable Binary Recovery

Decompilation, the process of recovering source code from compiled binaries, plays a crucial role in various domains, including security analysis, malware reverse engineering, and maintaining legacy software. Despite its importance, existing decompilers often produce code that either fails to compile or execute correctly, significantly limiting their practical applications. A novel approach has emerged, introducing a multi-agent framework that aims to transform decompiled code into re-executable source code through a technique known as Multi-level Constraint-Guided Decompilation (MCGD).

Overview of the Multi-Agent Framework

The proposed framework utilizes a hierarchical validation pipeline that operates on three distinct constraint levels:

  • Syntactic Correctness: The first level involves parsing the decompiled code to ensure that it adheres to the syntactic rules of the programming language.
  • Compilability: The second level utilizes the GNU Compiler Collection (GCC) to verify that the code can be compiled without errors.
  • Behavioral Equivalence: The final level assesses the functional correctness of the code by generating test cases with the help of large language models (LLMs).

When validation fails at any of these levels, specialized LLM agents are employed to iteratively refine the code using structured error feedback, thereby enhancing the overall quality of the decompiled output.

Performance Evaluation

The effectiveness of this multi-agent framework was evaluated on a dataset comprising 1,641 real-world binaries sourced from ExeBench, utilizing three different decompilers: RetDec, Ghidra, and Angr. The results were promising, achieving a re-executability rate between 84% and 97%, which marks a significant improvement over the baseline outputs of traditional decompilers, with enhancements ranging from 28 to 89 percentage points.

In a comparative analysis with state-of-the-art LLM-based decompilation methods that also leverage the GPT-4o backbone, the proposed framework demonstrated superior performance. Specifically, it achieved an re-executability score of 84.1%, outperforming notable competitors such as:

  • LLM4Decompile: 80.3%
  • SK2Decompile: 73.9%
  • SALT4Decompile: 61.8%

Insights from the Study

An ablation study conducted as part of the research underscored the critical role of execution-based validation. It was found that compile-only approaches yielded a behavioral correctness rate of 0%, despite impressive compilation rates ranging from 91% to 99%. This finding emphasizes the necessity of not only compiling code but also ensuring that it behaves as intended when executed.

Furthermore, the system showcased remarkable efficiency, with over 90% of binaries achieving correctness within just two iterations. The average cost per binary for this process was estimated to be between $0.03 and $0.05, highlighting the framework’s practicality in terms of resource utilization.

Conclusion

The results of this research indicate that constraint-guided agentic refinement is a promising strategy to bridge the gap between raw decompiler output and practically useful source code. This innovative approach not only enhances the re-executability of decompiled binaries but also sets a new standard for future developments in the field of decompilation.

Related AI Insights

Lazarus Omolua
Lazarus Omoluahttps://richlyai.com/blog
My mission is to make sure that people in Africa are not left behind in the global AI revolution. RichlyAI exists to give everyone — students, founders, creators, and businesses — the tools to compete globally.

Subscribe

Popular

More like this
Related

How Business Ops Teams Boost Productivity with Codex

Discover how business operations teams use Codex to streamline documentation, enhance collaboration, and improve decision-making with AI-powered automation...

OpenAI Partners with Malta to Offer ChatGPT Plus Nationwide

OpenAI and Malta team up to provide free ChatGPT Plus access and AI training to all citizens, promoting digital literacy and responsible AI use.

Critical Linux Kernel Flaw Risks SSH Host Key Theft

A critical Linux kernel flaw risks stolen SSH host keys. Learn how to protect your systems and stay secure until patches are widely available.

Top External Hard Drives 2026: Expert Reviews & Buying Guide

Discover the best external hard drives of 2026 with expert reviews. Find top picks for speed, durability, and security to suit all storage needs.