Kuna: Decompiler Development in the Age of Coding Agents
TL;DR Highlight
An LLM-written decompiler, Kuna, nearly matches IDA Pro on control flow structuring
Who Should Read
A backend or tooling developer curious how to hand a large project to coding agents and improve quality automatically
Core Mechanics
- An LLM wrote nearly all the code
- Kuna is an experimental decompiler that turns binaries back into C code.
- The author says an LLM wrote nearly every line.
- Structuring score is near IDA
- On C programs, Kuna perfectly structures 44.4% of functions (control flow structuring recovers if, loop and switch).
- IDA Pro 9.2 gets 45.7%.
- The secret is an autonomous refinement loop
- The LLM studies cases where it performs worse than IDA Pro.
- It learns by trial and error how other decompilers solve hard problems.
- 20+ angr features reimplemented
- Ghidra and the angr decompiler were also studied in the process.
- This let the LLM reimplement more than 20 fundamental angr features in Kuna.
- Human-led research came first
- Starting automatic refinement required new fundamental metrics and meaningful benchmark data.
- The author says this is not automatic research but research led by humans.
- Only structuring is strong so far
- Types, optimizations, recompilability and variable identification still need work.
- Kuna is a Rust port of NSA's Ghidra reworked to match angr's pipeline.
Community Reactions
- Creator explains the Ghidra origin
- The creator says Kuna started as Ghidra ported to Rust and has changed considerably.
- The Switch layout and some variable simplification in the site screenshot are not Ghidra features.
- Pushback: why not train an LLM to be the decompiler
- One commenter argued compilers can generate unlimited training data.
- The creator replied that this has been tried for two decades with no project beating traditional decompilers on fundamental metrics.
- Interest in agentic naming of functions and variables
- A commenter hoped agents could track data flow and propose names.
- The creator said on DecBench, Codex and Claude given only assembly dominate but have significant recall problems.
How to Apply
- Start a loop with a failure-case set
- Collect 5 cases today where your coding agent does worse than a reference tool.
- Attach the reference output and metric to each and ask the agent to analyze the gap.
- Define a measurable metric first
- Design the metric and benchmark data yourself before handing improvement to an agent.
- Have the agent automatically verify only that the score goes up.
- Use an existing tool as a teacher
- When reimplementing a feature, give the agent input/output examples from a mature open-source version.
- Check the license first.
Try It
# Paste into Claude or Claude Code as is (simplified version of the article's method)
You are an agent improving {{our tool}}. The reference tool is {{reference tool}}.
The metric is {{metric name}}.
Below are cases where our tool scores lower than the reference.
{{failure cases and both outputs}}
Do the following in order.
1. For each case, analyze why the reference does better.
2. Pick one common pattern and propose a fix for our code.
3. Write a test that checks the metric improves after the fix.
Next step: re-measure the score after the fix and repeat with the remaining failures.Terminology
Related Papers
Frostbite: A new CPU architecture discovered, designed and verified by AI
AI agents designed a CPU from scratch, claiming 4.59x perf/W over a traditional core
Restricting AI agents in mobile operating systems platforms from capturing data
Signal now blocks OS-level AI agents from reading its screen on iOS 27 and Android
Actions Speak Louder than Words: Stateful Privacy Sniffing of LLM Agents via Behavioral Covert Channels in Web Interactions
Agents' link choices alone let attackers rebuild user queries at F1 0.89; SOR cuts it to 0.39.
Tracking and Limiting Unsupported Claim Propagation in Multi-Agent LLM Systems: A Provenance-Aware Framework
Passing claims with source, evidence and history kept equivalence at 5 agent stages at 96% versus 31%.
LLM assisted reverse engineering
Pointing an agent at binaries with skills and MD notes made years-long hacks feasible
Metrics-in-the-Loop: Complexity Feedback Reshapes Agent-Written Code
Injecting per-turn complexity reports into coding agents cut code erosion without changing correctness
Why is Gemini 4 Carbon taking so long?
Carbon took nearly an hour on bug fixes that Astra and Opus finished in minutes, mostly from extra unrequested work.
Weight-Space Programming builds neural networks like a 1990s researcher
LLM hand-wrote MNIST weights to 91.3%, using 1990s-style techniques