Source-linked AI summary

CHISEL-ing Back Source Code with AI-enabled Iterative Recovery

Varun Kohli, N Raghava, Biplab Sikdar, Dinil Mon Divakaran

arXiv:2608.27981v1cs.CRcs.SE

TL;DR

Traditional decompilers produce pseudo-C that is difficult to read, rarely compilable, and not guaranteed to preserve semantics. CHISEL iteratively improves decompiled code using compiler and coverage-guided-fuzzer feedback, achieving 96.1% RC and 79.8% RE.

  • Problem

    Traditional decompilers produce pseudo-C that is difficult to read, rarely compilable, and not guaranteed to preserve semantics.

    Source: §1 · p. 1
  • Method

    CHISEL iteratively enhances decompilation using compiler and coverage-guided-fuzzer feedback, rich observations, cross-iteration divergence memory, and best-candidate retention.

    Source: §1 · pp. 1–2
  • Results

    96.1% RC and 79.8% RE; CHISEL repairs 26.2% of first-generation failures and performs better than LLM4Decompile and Agent4Decompile.

    Source: §1 · p. 2, §7 · p. 6
  • Takeaways & Limitations

    The decisive gain comes from richer observation rather than more search.

    Source: §7 · p. 6

    I/O sampling is an approximation of functional similarity and does not establish semantic equivalence.

    Source: §6 · p. 6

Abstract

from arXiv · show

Decompilation aims to recover high-level, compilable, and semantically equivalent code from binaries. Traditional decompilers produce pseudo-C that is difficult to read and does not compile, while the recent LLM-assisted approaches generate readable, but semantically incorrect code. LLM-aided iterative recovery is an emerging branch of research, but prior works rely on supplied test suites for semantic recovery. In this work, we present CHISEL, a test suite-free framework to iteratively recover source code from Ghidra-derived pseudo-C. CHISEL uses simple yet effective feedback from a compiler (static analysis) and a coverage-guided fuzzer (differential analysis), augmented by rich observables for grounded divergence detection and feedback, cross-iteration divergence memory, and best candidate retention. We systematically evaluate CHISEL for compilation and semantic recovery, feedback oracle soundness, and iteration overhead on 120 ExeBench functions compiled for the x86-64 architecture, across four optimizations (O0-O3), in both stripped and unstripped variants, using the open-weight Gemma4:31b LLM. CHISEL, with all recommended features, achieves an average of 96.1% re-compilability and 79.8% re-executability rates at an average of 2.1 iterations. Significantly, CHISEL recovers 26% of first-generation execution errors. At the same time, CHISEL feedback oracle falsely accepts only 9.4% candidates. Lastly, CHISEL performs significantly better than two recent prior work on LLM-assisted decompilation.

1 Introduction

CHISEL addresses the difficulty of recovering readable, compilable, semantically faithful source from binaries without assuming native test suites. It uses compiler and coverage-guided-fuzzer feedback to iteratively improve decompilation, achieving high re-compilability and re-executability in its evaluation.

1 Introduction

  • Traditional decompilers such as Ghidra and IDA Pro produce pseudo-C that is difficult to read, rarely compilable, and not guaranteed to preserve semantics; LLM-based approaches include non-iterative and feedback-guided iterative methods.Pseudo-C can contain synthetic types, machine-level artifacts, and ABI scaffolding.Source: §1 · p. 1
  • Prior methods’ reliance on native test suites limits semantic-divergence feedback when reversing binaries of unknown provenance; asymmetric sanitization and symbolic-execution path explosion pose further challenges.In-loop feedback has also typically been limited to compiler errors and return-value divergence.Source: §1 · p. 1
  • CHISEL is a test-suite-free iterative decompiler whose feedback comes from a compiler and coverage-guided fuzzer operating on the original binary.It adds rich observables for grounded differential analysis, cross-iteration divergence memory, and best-candidate retention.Source: §1 · pp. 1–2
  • Its six-arm ablation builds from single-shot generation to the end-to-end design and evaluates recovery, feedback-oracle soundness, and iteration overhead.The axes include re-compilability, re-executability, regression and recovery metrics; false-acceptance and false-rejection; and average iterations.Source: §1 · p. 2
  • Across 120 ExeBench functions, CHISEL reports 96.1% RC, 79.8% RE, 9.4% FA, and 26.2% recovery after first-generation failure, outperforming LLM4Decompile and Agent4Decompile.The evaluation covers x86-64 binaries at O0–O3, both stripped and unstripped, using Gemma4:31b.Source: §1 · p. 2

2 Related Work

Prior LLM-assisted decompilers either generate code without behavioral feedback or use iterative feedback that commonly depends on supplied tests; CHISEL instead derives compiler and differential feedback from the original binary without a supplied suite.

2 Related Work

  • LLM4Decompile [18], Nova, and Idioms generate code without behavioral feedback, while DeGPT uses multi-role edits guarded by static symbolic checks.Source: §2 · p. 2
  • DecLLM combines compiler repair, test-seeded AFL++ divergence feedback, and candidate sanitization, while PCodeTrans [7] uses official tests and breakpoint-matched differential tracing.The paper characterizes sanitizing only generated code, unlike the original, as unfaithful decompilation.Source: §2 · p. 2
  • Agent4Decompile [20] checks syntax, compilation, and execution through three agent tiers but assumes supplied test cases; prior work generally has limited observable coverage except PCodeTrans [7].Source: §2 · p. 2
  • CHISEL uses compiler and type-aware coverage-guided fuzzing feedback without supplied tests, plus rich observables, cross-iteration divergence memory, and best-candidate retention.Its differential analysis observes return values, output buffers, stdout, exit codes, timeouts, and crashes.Source: §2 · p. 2

3 Proposed Framework: Chisel

Chisel iteratively refines Ghidra pseudo-C into compilable, behaviorally similar C without a supplied test suite. It combines compiler and differential-fuzzer feedback with richer observability, divergence memory, and best-candidate retention.

3.1 Iterative Enhancement Algorithm

  • Each round prompts the LLM for one candidate, uses compiler diagnostics to guide compilability, and applies differential fuzzing to find inputs that expose behavior divergence.If neither oracle flags an issue, the candidate is returned as recovered source.Source: §3.1 · p. 3
  • Differential fuzzing mines inputs with coverage-guided entropic libFuzzer from type-aware signature-derived seeds, then samples accumulated divergences as feedback within capped feedback budgets.At most d_c compilation errors and d_f divergences are passed directly; remaining counts are summarized to stay within token budgets.Source: §3.1 · p. 3
  • Chisel’s observe feature compares rich outputs and signals, memory replays deduplicated divergences across iterations, and retain_best returns the best-performing candidate.Observables include return values, output buffers, stdout, timeouts, exit codes, and crashes; pointer results are compared by content rather than raw address.Source: §3.1 · p. 3

3.2 Prompts and Parameters

  • The self-contained prompt first includes task instructions and pseudo-C, then appends the previous candidate and available feedback in later rounds; runs use K=5, temperature 0, reasoning off, and O0 analysis.Each round tests against 200 type-aware seeds and 2,000 libFuzzer-mined inputs with a 2-CPU-second per-input timeout; feedback caps are d_c=5 and d_f=10.Source: §3.2 · pp. 3–4

4 Experimental Setup

The experiments assess CHISEL through incremental ablations on a test-suite-free iteration harness, using held-out tests to evaluate recovery, oracle soundness, and overhead. The setup covers 120 ExeBench functions and compares CHISEL with two prior approaches.

4.1 Hardware, Software, and Dataset

  • Experiments use 120 ExeBench functions compiled for x86-64 at O0–O3, in stripped and unstripped variants.The functions were selected from 150 longest real-world functions based on availability of at least 200 functional test cases; each selected function has 46–265 lines of code. Runs use an x86-64 Linux host with four NVIDIA H200 GPUs, Gemma4:31b3 at int-4 quantization, Ghidra, gcc -c, and libFuzzer.Source: §4.1 · p. 4

4.2 Experiments and Evaluation Metrics

  • A six-arm incremental ablation evaluates recovery, feedback-oracle soundness, and iteration overhead, with the final arm representing the complete CHISEL framework.Metrics are scored on the loop’s final returned candidate against a held-out test suite; compilation requires building, and re-execution requires matching the original on every suite input. The measures include compile and re-execution rates, recovery from initial failures, oracle false acceptance and rejection, regressions, and mean iterations.Source: §4.2 · p. 4

4.3 Baselines

  • The baselines are LLM4Decompile-9B-v2 [18] and Agent4Decompile [20], evaluated without test-suite access during iterations.Agent4Decompile uses Gemma4:31 to align the harness comparison; both baselines use Ghidra and their specified prompts and input formats. DecLLM and PCodeTrans [7] are excluded because their code is not public.Source: §4.3 · p. 5

5 Results

Results show CHISEL outperforming the reported prior-work baselines, with recovery and soundness varying across optimization and stripping conditions. Ablations indicate that differential feedback, rich observation, divergence memory, and candidate retention each contribute to recovery or soundness.

Ablation

  • Differential fuzzing raised RE to 79.3% and recovered 7.5% of compiled-but-incorrect first generations; observe halved FA from 17.6% to 9.4%.Memory raised Pass over +observe, while best-candidate retention increased mean suite pass-rate from 50.9% to 52% compared with the previous arm.Source: §5 · p. 5, Figure 2 · p. 5

Soundness and residual errors

  • FA is 16.4% on stripped binaries versus 1.7% on unstripped, and residual 9.4% FA is dominated by signature-recovery errors, predominantly in stripped samples.Because candidates are tested against their recovered signatures, argument mis-recovery can pass the differential oracle yet fail the original-signature suite; the differential oracle also covers divergences outside that suite, while FR approaches 45% with a behavioral oracle and falls with optimization.Source: §5 · pp. 5–6, Table 4 · p. 6, Table 5 · p. 6

Comparison with baselines

  • LLM4Decompile-9B-v2 achieves 17% RE versus 73.0% for CHISEL’s LLM-only Gemma arm; CHISEL also outperforms A4D at lower iteration cost.The comparison uses the same 120 functions and test suite.Source: Table 6 · p. 6, §5 · p. 6

Results across optimizations and stripping conditions

  • CHISEL re-executes 86.7% of unstripped and 72.9% of stripped functions on average; RE falls from 93.3% to 80.8% and 78.3% to 68.3% from O0 to O3, respectively.The passage reports that R_exec and R_tot confirm that the iterative loop repairs a growing share of the re-execution gap.Source: §5 · p. 6, Table 4 · p. 6, Table 5 · p. 6

6 Limitations, Risks and Ethics

The study is limited by decompiler and evaluation assumptions, constrained model settings, and possible dataset contamination; its reverse-engineering ideas could also be misused for unauthorized activity.

6 Limitations, Risks and Ethics

  • Signature recovery from stripped binaries remains difficult; experiments used deterministic 0-temperature, non-reasoning settings, though higher temperatures and reasoning may improve generation and feedback response.The authors suggest that more creative generation, critical thinking, and better responses to feedback may aid recovery.Source: §6 · p. 6
  • Using Ghidra pseudo-C as ground truth leaves decompiler resilience unevaluated, while I/O sampling only approximates functional similarity and cannot establish semantic equivalence.Source: §6 · p. 6
  • Because ExeBench may overlap LLM training data, future work could use newer datasets such as [14].Source: §6 · p. 6
  • The authors warn that the work could be adopted by threat actors for unauthorized activities and urge ethical use.Source: §6 · p. 6

7 Conclusion

Chisel is a test suite-free iterative decompiler that combines compiler-based static analysis and coverage-guided differential fuzzing with richer feedback and recovery mechanisms. On a 120-function ExeBench subset, it achieved 96.1% RC and 79.8% RE, and outperformed the compared LLM-assisted decompilers on reported outcomes.

7 Conclusion

  • Chisel achieved 96.1% RC and 79.8% RE, repaired 26.2% of first-generation failures, and cut FA from 17.6% to 9.4% versus return-only differential fuzzing.The evaluation used 120 ExeBench functions compiled for x86-64 at four optimization levels, with stripped and unstripped variants.Source: §7 · p. 6
  • On the same subset, Chisel’s RE was 79.8% versus 17.0% for LLM4Decompile-9B-v2, and it outperformed Agent4Decompile on RE, FA, and overhead under the same LLM and test-suite assumptions.Source: §7 · p. 6
  • Chisel is a test suite-free iterative decompiler combining compiler-based static analysis and coverage-guided differential fuzzing, augmented with rich observables, cross-iteration divergence memory, and best-candidate recovery.Source: §7 · p. 6
  • The results identify richer observation, rather than more search, as the decisive gain and highlight the feedback harness as an important lever alongside the LLM.Source: §7 · p. 6

A Generative AI Usage

The authors used generative AI for manuscript language, verified plotting code, and prototype code, while reporting that experiments and results came from their own pipeline and that they reviewed the AI-assisted code.

  • Generative AI tools Claude and Gemini helped improve manuscript language, generate verified plotting code, and write prototype code.Source: A Generative AI Usage · p. 7
  • The authors produced experiments, datasets, and numerical results through their own pipeline, regenerated figures and tables from raw outputs, and reviewed AI-assisted code while taking responsibility for the work’s accuracy, originality, and integrity.Source: A Generative AI Usage · p. 7
Loading 2608.27981v1…