Kuna: Building a Competitive C Decompiler Through Autonomous AI Research

Zion Basque (Assistant Professor · University of Georgia)

[un]prompted II 2026 — The AI Security Practitioner Conference · Day 2 · Stage 2

Overview

In a groundbreaking presentation at [un]prompted II, Dr. Zion Basque, an assistant professor at the University of Georgia, unveiled Kuna, a novel decompiler whose development was largely orchestrated by an autonomous AI agent. This talk addresses a critical gap in the capabilities of Large Language Models (LLMs) when confronting closed-source binaries: their significant inability to find vulnerabilities compared to their prowess with source code. Dr. Basque's research highlights that this deficiency stems not from the LLMs themselves, but from the inherent flaws and limitations of existing decompilation technologies.

Watch on YouTube

Visual summary for Kuna: Building a Competitive C Decompiler Through Autonomous AI Research by Zion Basque
Visual summary for Kuna: Building a Competitive C Decompiler Through Autonomous AI Research by Zion Basque

Key moments

  1. 0:00 Introduction: LLMs struggle with binary analysis
  2. 2:00 Decompiler quality limits LLM binary vulnerability finding
  3. 6:00 Autonomous AI research process for decompiler improvement
  4. 8:30 Kuna surpasses state-of-the-art decompilers in accuracy
  5. 11:50 Demo: Kuna's superior switch statement decompilation vs. IDA
  6. 15:00 Agent comparison: Kuna's speed for malware reverse engineering
  7. 19:00 Future challenge: Forcing LLMs to make foundational changes
  8. 20:20 Q&A: Kuna's potential for Rust binary decompilation

Kuna: Building a Competitive C Decompiler Through Autonomous AI Research

Speakers: Zion Basque, Assistant Professor, University of Georgia

Conference: [un]prompted II

YouTube: https://www.youtube.com/watch?v=CQ1Pvkk-B0U

Overview

In a groundbreaking presentation at [un]prompted II, Dr. Zion Basque, an assistant professor at the University of Georgia, unveiled Kuna, a novel decompiler whose development was largely orchestrated by an autonomous AI agent. This talk addresses a critical gap in the capabilities of Large Language Models (LLMs) when confronting closed-source binaries: their significant inability to find vulnerabilities compared to their prowess with source code. Dr. Basque's research highlights that this deficiency stems not from the LLMs themselves, but from the inherent flaws and limitations of existing decompilation technologies.

Kuna represents a paradigm shift in decompiler development, demonstrating that AI agents can not only significantly improve the quality and speed of decompilation but also autonomously rediscover and implement complex algorithms previously developed by human researchers over decades. The project, funded in part by the Air Force Research Lab, illustrates a powerful new methodology for advancing reverse engineering tools, potentially revolutionizing how security researchers and defenders approach binary analysis and vulnerability discovery in critical infrastructure and proprietary software.

The implications of Kuna extend far beyond mere performance improvements. By enabling LLMs to effectively analyze binary code, Kuna opens the door for automated vulnerability research in areas previously considered intractable for AI, such as embedded systems, medical devices, and automotive software. This research underscores both the immense potential and the pressing need for more robust binary analysis tools in an increasingly software-dependent world.

Background

▶ Watch: Introduction: LLMs struggle with binary analysis (0:00)

The proliferation of software vulnerabilities across all sectors presents a formidable challenge, with LLMs proving remarkably adept at identifying and even fixing bugs in open-source projects like Google Chrome and the Linux kernel. However, this capability dramatically diminishes when LLMs are tasked with analyzing closed-source binaries. Dr. Basque initiated his talk by illustrating this stark disparity with a compelling study: when presented with Nginx source code containing 14 known vulnerabilities from a DARPA AICC competition, LLMs successfully identified and fixed all 14. When given the stripped binary version of the same software, even with access to a high-end commercial decompiler (costing upwards of $10,000 annually), the LLMs' success rate plummeted to 5 out of 14 vulnerabilities. Using the widely adopted open-source decompiler, Ghidra, the success rate dropped further to a mere 1 out of 14.

This precipitous drop, as Dr. Basque emphasized, is not a failing of the LLMs themselves but a direct consequence of the poor quality of current decompilers. Decompilers, designed to translate machine code back into human-readable source code, often produce highly obfuscated, unstructured, and incorrect output. A common example shown was a simple C switch statement compiled with standard optimizations. When decompiled by a leading commercial tool like IDA Pro, the elegant switch structure was replaced by pages of nested if statements and goto jumps, making the code longer, harder to understand, and fundamentally altering its control flow. Such outputs are effectively unusable for intelligent agents, which rely on well-structured, semantically accurate code to perform their analysis.

The underlying reason for this persistent inadequacy lies in the NP-hard problems inherent in decompilation. These are complex, nested graph problems that have challenged researchers for over 30 years, leading to slow progress despite significant effort. Existing state-of-the-art decompilers, such as Ghidra (estimated 20 years of development), Angr (10 years, including Dr. Basque's PhD work), and IDA Pro (developed since the 1990s), represent decades of human ingenuity but still struggle to perfectly reconstruct source code, particularly in the presence of compiler optimizations. The central question posed by Dr. Basque was whether AI agents could overcome these long-standing challenges and autonomously develop a superior decompiler.

Key Findings

▶ Watch: Autonomous AI research process for decompiler improvement (6:00)

The central and most significant finding of Dr. Basque's research is the successful development of Kuna, an AI-driven decompiler that demonstrably outperforms established, human-engineered state-of-the-art decompilers in terms of source code reconstruction accuracy and operational efficiency. Developed autonomously by an LLM agent over a period of just five months, Kuna achieved remarkable results on a dataset of 34,000 diverse C samples (including servers, command-line tools, and firmware).

Specifically, Kuna surpassed IDA Pro, the long-standing leader in commercial decompilation, in its ability to perfectly reconstruct the original source code. While IDA Pro achieved perfect reconstruction on approximately 50% of the samples by various exactness metrics (control flow, types), Kuna exceeded this benchmark. Starting from a base equivalent to Ghidra, Kuna exhibited a 37% improvement in accuracy within the five-month development cycle, eventually "edging out IDA." This rapid advancement challenges the traditional, decades-long development cycles of conventional decompilers.

Beyond accuracy, Kuna also demonstrated significant improvements in speed and resource efficiency for LLM-driven binary analysis. In a direct comparison, an LLM agent using Kuna to reverse engineer Windows malware from crackmes.one ("End of the World Binary") completed the task 47% faster and used 77% fewer tokens (1.2 million vs. 5.4 million) compared to an agent using IDA Pro MCP (Multi-Core Processor). This translates to substantial cost savings and accelerated analysis workflows for automated security tasks.

The LLM responsible for Kuna's development autonomously "rediscovered" and implemented several key decompiler algorithms, such as the early returns algorithm for correct switch statement structuring and a novel parallelization algorithm that dramatically speeds up decompilation of large binaries. It also developed its own "random unpacker" and continuously integrated hundreds of micro-improvements, leading to a "two times type hacker C improvement" over its base. While many of these were incremental, the cumulative effect was profound, indicating the LLM's capacity for continuous, self-directed improvement by synthesizing knowledge from a vast corpus of decompiler research (over 150 papers).

Technical Deep Dive

▶ Watch: Demo: Kuna's superior switch statement decompilation vs. IDA (11:50)

The development of Kuna was a two-step process meticulously designed to enable autonomous AI research in decompilation. The core idea was to create an environment where an LLM could iteratively improve a decompiler and objectively measure its progress.

Step 1: Building an Agent-Friendly Base

The initial phase involved constructing a robust and easily modifiable decompiler base. Dr. Basque started by leveraging two existing projects:

  1. Ghidra: The National Security Agency's open-source decompiler, comprising approximately 200,000 lines of C++ code for its core.
  2. Angr: The scientific state-of-the-art decompiler, which Dr. Basque contributed to significantly during his PhD.

The LLM was tasked with taking inspiration from Angr's scientific advancements and applying them to Ghidra's structure, while simultaneously porting the entire C++ codebase to Rust. This monumental task, converting 200,000 lines of C++ to 350,000 lines of Rust, was completed in just two weeks at a cost of $12,000 in tokens. The choice of Rust was strategic: its strong type system and memory safety features allow agents to "crash in a compiler before they're actually crashing in runtime," providing earlier and clearer feedback for iterative development. This Rust-based codebase formed the initial "agent base" for Kuna.

Step 2: Autonomous Improvement Loop

With the foundational codebase in place, the true innovation began: an autonomous feedback loop designed to drive continuous improvement without human intervention.

  1. Data Set Generation: A massive dataset was curated, consisting of at least 30,000 (later 34,000) C samples. These samples were diverse, including servers, command-line tools, router firmware, and drone firmware, ensuring broad applicability. For each sample, the original source code and its compiled binary were available.
  2. Decompilation and Output Generation: Kuna (the Rust-based decompiler) processed these binaries, generating thousands of decompiled outputs.
  3. Deterministic Scoring Algorithm: A critical component was the development of a deterministic scoring algorithm, publicly documented at deckbench.com. This algorithm precisely computes the "distance to the source code," essentially quantifying how many edits are required to transform the decompiled output back into the original source code. This provides an objective, measurable metric for decompiler quality.
  4. AI Agent Refinement: The scores, along with the corresponding samples and their decompiled outputs, were fed to a chosen LLM (e.g., GPT or Claude). The LLM's directive was simple: "take the scores, look at the samples, make it better, fix it, targeted edits, do this." The goal was to reduce the edit distance to zero. The LLM would then propose changes (akin to Pull Requests, or PRs) to the Kuna codebase.

This loop ran autonomously for five months. An illustrative example involved a snippet of source code with a switch statement. Kuna's initial Rust output might show two "edits away" from the source due to incorrect control flow (e.g., equal signs instead of return statements). The LLM, seeing this score across many samples, would identify the pattern. It then "rediscovered" and implemented the early returns algorithm, a known technique in decompilation for correctly structuring merged returns from compilers, reducing the edit distance for that specific pattern to zero.

LLM's "Research" Process and Discoveries:

The LLM's development process was akin to an accelerated research cycle:

  • Knowledge Synthesis: It "read" over 150 papers from 30 years of decompilation research, citing them in its own internal reasoning. It then implemented better versions of algorithms described in these papers.
  • Knowledge Distillation: It observed the outputs of other decompilers like Ghidra, Angr, Hex-Rays, and Binja, and attempted to infer their underlying algorithms, effectively "distilling knowledge" from competitors.
  • Novel Feature Invention: Over 300 features were integrated, with 217 claimed by the LLM as its own inventions. These included:
  • A novel parallelization algorithm that allowed mpengine.dll (an 18MB Windows binary with 35,000 functions) to be fully decompiled in just 2 minutes using 12 cores, a task that typically takes major decompilers 30 minutes.
  • An internal "random unpacker" that it started using on various decompiled artifacts.
  • Algorithms for better bounds checks on array types.
  • Improved type reconstruction to create meaningful structs.

While many of these were described as "micro improvements" or "local maxima" rather than fundamental breakthroughs, their cumulative effect was a decompiler that significantly surpassed established tools in both quality and speed. The ongoing challenge, as Dr. Basque noted, is to guide LLMs toward making foundational changes rather than just optimizing existing paradigms.

Demo / Proof of Concept

▶ Watch: Agent comparison: Kuna's speed for malware reverse engineering (15:00)

Dr. Basque provided three compelling demonstrations showcasing Kuna's capabilities and the impact of the LLM's autonomous development.

Demo 1: format Binary - Quality Comparison

The first demo focused on a small ELF binary called format, a program Dr. Basque was intimately familiar with from his prior research.

  • Kuna CLI: Decompiling format via the command-line interface was instantaneous, producing clean, readable C code.
  • Kuna WebAssembly: A remarkable feature demonstrated was Kuna running entirely in a web browser using WebAssembly. Without any server interaction, the same format binary was loaded, and Kuna produced identical, high-quality C output directly within the browser, highlighting its portability and lightweight nature.
  • IDA Pro Comparison: Dr. Basque then contrasted Kuna's output with that of IDA Pro on the same format binary. As previously described in the background, IDA's output for a simple switch statement was a convoluted mess of nested if statements and goto jumps. The loop structure was incorrectly identified as an infinite loop. In stark contrast, Kuna correctly reconstructed the full switch statement and the accurate loop structure. This particular algorithm for correct switch statement structuring was one that Dr. Basque had previously developed and published, and the LLM had autonomously "rediscovered and incited us on" to implement it in the Rust-based Kuna.

Demo 2: mpengine.dll - Speed and Parallelization

The second demo highlighted Kuna's speed and its LLM-developed parallelization capabilities using mpengine.dll, a large 18MB Windows binary containing 35,000 functions.

  • Challenge: Decompiling such a large binary typically takes major decompilers around 30 minutes.
  • Kuna's Performance: Dr. Basque initiated Kuna's multi-process decompilation on 12 cores. The progress bar showed rapid advancement, and after an initial estimation fluctuation, the entire binary, including an additional pass for type reconstruction and struct creation, was fully decompiled in approximately 2 minutes in real-time. The output consisted of numerous C, H, and ASM files, ready for agent consumption. This demonstrated the significant speedup achieved by the LLM's novel parallelization algorithm.

Demo 3: LLM Agents on Malware - Efficiency for Automated Analysis

The final demonstration illustrated the practical benefits of Kuna for automated security analysis by LLM agents.

  • Scenario: A 5x speed recording showed two LLM agents racing to reverse engineer a challenging Windows malware sample called "End of the World Binary" from crackmes.one. One agent used Kuna, and the other used IDA Pro MCP (Multi-Core Processor).
  • Results: The agent utilizing Kuna finished the reverse engineering task significantly faster. Quantitatively, the Kuna-powered agent completed the task 47% faster and consumed 77% fewer tokens (1.2 million tokens vs. 5.4 million tokens) compared to the IDA Pro MCP agent.
  • Attribution: Dr. Basque attributed these efficiency gains to two key features implemented by the LLM: Kuna's multi-process text-based output and the LLM's autonomously developed "random unpacker," which it used on random decompiler artifacts. This demo clearly showed that Kuna's improved quality and speed directly translate into more efficient and cost-effective automated binary analysis.

Defensive Implications

▶ Watch: Q&A: Kuna's potential for Rust binary decompilation (20:20)

The development of Kuna and the demonstration of its capabilities carry significant implications for the field of cybersecurity, particularly for defenders. While improved decompilation is a boon for reverse engineering, its autonomous development by AI presents a double-edged sword.

Firstly, Kuna's superior accuracy and speed mean that LLMs can now more effectively find vulnerabilities in closed-source binaries. This includes critical software in medical devices, automotive systems, industrial control systems, and other embedded platforms that often lack source code and are challenging to analyze. What was once a difficult, human-intensive task is now becoming increasingly accessible to automated AI agents. Defenders of such systems must recognize that their attack surface has potentially broadened, as sophisticated AI tools can now penetrate the obscurity provided by compiled code with greater ease.

Secondly, the dramatic reduction in token consumption and analysis time makes large-scale automated binary analysis economically viable for LLM agents. This means defenders can deploy AI agents to perform more thorough and continuous vulnerability assessments on their proprietary software and firmware, identifying weaknesses before adversaries exploit them. The ability to decompile 35,000 functions in minutes, as demonstrated with mpengine.dll, enables comprehensive scanning of large codebases that would be prohibitively time-consuming with traditional tools.

Furthermore, Kuna's ability to run entirely in WebAssembly suggests new possibilities for secure, client-side binary analysis, potentially enabling researchers to analyze sensitive binaries without uploading them to remote servers. This could be particularly valuable in environments with strict data sovereignty requirements.

However, the autonomous nature of Kuna's development also implies that offensive actors could leverage similar AI-driven methodologies to create highly effective exploit development tools. Defenders must stay abreast of these advancements and invest in proactive strategies, including adopting advanced binary analysis platforms like REA (which now integrates Kuna) and continuously testing their deployed binaries against the capabilities of these emerging AI-powered reverse engineering tools. The talk serves as a clear warning and a call to action: the era of AI-driven binary vulnerability discovery is here, and defenders must adapt rapidly.

Key Takeaways

  • LLMs struggle with binary analysis: While powerful for source code, LLMs are severely hampered in binary vulnerability discovery due to the poor quality of existing decompilers, which often produce unreadable and incorrect code.
  • Autonomous AI can build competitive decompilers: Kuna demonstrates that an LLM agent, operating autonomously over five months, can develop a decompiler that surpasses the accuracy and speed of decades-old, human-engineered state-of-the-art tools like IDA Pro and Ghidra.
  • Significant efficiency gains for AI agents: Kuna enables LLM agents to reverse engineer malware 47% faster and with 77% fewer tokens, making automated binary analysis more cost-effective and scalable.
  • AI can rediscover and invent algorithms: The LLM behind Kuna autonomously rediscovered complex decompiler algorithms (e.g., early returns for switch statements) and invented novel features like a parallelization engine and an unpacker.
  • Micro-improvements drive current AI progress: While impressive, most of Kuna's advancements stem from hundreds of "micro-improvements" and effective synthesis of existing research, rather than fundamental, foundational breakthroughs in decompilation theory.
  • Future direction: foundational changes through formalization: The next frontier for AI in decompilation involves guiding LLMs towards foundational changes by leveraging formalization and robust modeling, moving beyond local optima to achieve truly disruptive advancements.

About the Speaker(s)

Dr. Zion Basque is an Assistant Professor at the University of Georgia, where his research primarily focuses on reverse engineering, decompilation, and understanding how people interact with unfamiliar programs. His work often delves into the intricacies of binary analysis and the challenges of translating machine code back into human-readable forms. Dr. Basque's research presented in this talk was partially funded during his tenure as a visiting research faculty at the Air Force Research Lab, underscoring the practical and national security relevance of his work in advancing AI-driven security technologies.

Reviews

  • Heather Calloway (CISO) — MUST SEE ★★★★★

→ Top-rated talks at [un]prompted II 2026 — The AI Security Practitioner Conference

All talks from [un]prompted II 2026 — The AI Security Practitioner Conference