Reverse engineering obfuscated binaries is a core task in malware analysis and software security auditing. While neural decompilers based on Large Language Models (LLMs) have improved the readability and functional fidelity of recovered code over heuristic tools such as Ghidra and IDA Pro, a substantial gap remains between best-sample performance and practical single-output accuracy, particularly under code obfuscation. We study this gap through the lens of candidate generation and candidate selection. Using the LLM4Decompile architecture, we show that ground-truth tokens lie within the model's top-five next-token predictions in 95.6% of positions on average and that multi-sample decoding reaches a pass@100 of 93% on HumanEval-Decompile, indicating that correct reconstructions are typically already present in the model's sampling space. We then evaluate a generate-then-select pipeline that ranks 100 candidates per input with text-, syntax-, embedding-, consensus-, and likelihood-based selectors. Negative perplexity emerges as the strongest static selector on HumanEval-Decompile (73.3% pass@1), while execution-guided selection nearly closes the oracle gap on ExeBench (86.3% pass@1). Combined with one epoch of fine-tuning on our newly released ExeBench-Obfuscated dataset containing 362,647 obfuscated OLLVM samples, the same pipeline increases the pass@1 rate for obfuscated binaries to 88.8%, directly contradicting prior claims that released LLM4Decompile checkpoints are unsuitable for obfuscated inputs.
Figures & tables
Figure 1: Overview of our pipeline. The LLM generates a pool of N candidates from Ghidra pseudo-code or assembly, a selector ranks them and the chosen candidate is validated against unit tests.
ID
Input
Benchmark
Model
C1
Ghidra pseudo-code
HumanEval-Decompile
LLM4Decompile-Ref-9B-v2
C2
Assembly
HumanEval-Decompile
LLM4Decompile-End-6.7B-v1.5
C3
Ghidra pseudo-code
ExeBench
LLM4Decompile-Ref-9B-v2
C4
Assembly
ExeBench
LLM4Decompile-End-6.7B-v1.5
Table 1: Experimental configurations following the original LLM4Decompile input representations, benchmark family, and model variants.
Config
Input
Benchmark
Model
Rank = 1
≤ 5
≤ 10
Mean
C1
Ghidra
HumanEval
9B-v2
80.9%
93.7%
95.6%
15.8
C2
ASM
HumanEval
6.7B-v1.5
87.5%
97.2%
97.9%
5.5
C3
Ghidra
ExeBench
9B-v2
87.3%
97.1%
98.1%
6.2
C4
ASM
ExeBench
6.7B-v1.5
82.2%
94.5%
96.2%
10.1
Avg.
–
–
–
84.5%
95.6%
97.0%
9.4
Table 2: RQ1: Token rank analysis across configurations. For each configuration, we report the percentage of tokens where the correct token appears at rank 1 (exact top prediction), within the top 5, and within the top 10.
Token Category
C1
C2
C3
C4
Avg
Identifiers
77.9%
72.9%
83.9%
70.3%
76.3%
Structural
88.8%
86.1%
90.4%
88.5%
88.5%
Operators
86.6%
85.9%
90.3%
86.7%
87.4%
Keywords
75.5%
73.7%
74.8%
71.2%
73.8%
Literals
91.5%
76.4%
92.6%
90.7%
87.8%
Table 3: RQ1: Token rank analysis by syntactic category. Rank = 1 (%) for grouped AST node types across configurations. Identifiers and keywords are consistently the hardest categories, while structural tokens and operators are near-perfectly predicted.
Figure 2: Oracle pass rate versus candidate pool size k . Curves saturate around k∈[60,80] , motivating our choice of N=100 .
Selector
C1
C2
C3
C4
Avg.
Oracle
92.7±1.0
80.4±0.6
86.8±0.6
75.7±1.6
83.9
Execution-Guided
70.8±0.4
51.8±0.9
86.3±0.8
75.4±1.6
71.1
Neg. Perplexity
73.3±0.5
55.0±1.2
70.4±2.0
65.1±2.8
66.0
MBR Consensus
71.6±0.5
51.9±0.7
72.5±1.2
62.3±2.2
64.6
Majority Vote a
71.2±0.4
51.5±0.6
72.2±1.4
61.5±2.5
64.1
Majority Vote b
71.0±0.5
51.5±1.0
72.2±1.7
61.6±2.6
64.1
Table 4: RQ2: Average pass@1 by selector across five seeds on a pool of N=100 candidates per input. Oracle is the upper bound that picks any passing candidate. Avg. is the unweighted mean over C1–C4; per-seed standard deviations are reported per configuration.
Setting
Pass@1
Compile
Levenshtein
CodeBLEU
Original + Perplexity
58.1%
88.0%
38.4%
35.9%
Fine-tuned + Perplexity
77.1%
94.7%
54.4%
44.4%
Original + Execution-guided
79.5%
88.0%
39.8%
36.2%
Fine-tuned + Execution-guided
88.8%
94.7%
55.0%
44.6%
Table 5: RQ3: Obfuscated decompilation results with perplexity and execution-guided selection over a 100-candidate pool per input. Original is the off-the-shelf LLM4Decompile-Ref-9B-v2 ; Fine-tuned is the same checkpoint after training one epoch on ExeBench-Obfuscated .
Group
Original
Fine-tuned
Δ
n
By obfuscation class
bcf
77.3%
90.6%
+13.3pp
233
fla
78.8%
86.1%
+7.2pp
208
fla+split
77.7%
90.8%
+13.1pp
251
sub
83.1%
87.7%
+4.5pp
308
By optimization level
Table 6: RQ3: Pass@1 of the original and fine-tuned model with execution guided selection, broken down by obfuscation class and by optimization level. All values are pass@1 percentages.
Appendix figures & tables1 asset
Supplementary material from the paper’s appendix.
Appendix
Figure 3: Recovered versions of toggle_obf from Ghidra, the off-the-shelf LLM4Decompile-Ref-9B-v2 model, and the fine-tuned RQ3 model with the generate-then-select configuration ( N=100 , perplexity selection).
Decompilers are useful tools used in reverse engineering to understand compiled source code. Reconstructing source code from compiled binaries is a challenging task, because high-level syntax, identifiers, and custom data types are generally lost as the compiler translates human-readable code to low-level machine code. Deterministic decompilers are useful tools for binary analysis, but can struggle to infer idiomatic syntax and identifier names. Generative AI models are a natural fit for reconstructing high-level syntax, identifiers, and types, but they can still suffer by hallucinating improper programming constructs and semantics. Instead of attempting to improve neural decompilers with more data and more training, we argue that compiler feedback can be used to dramatically improve the semantic correctness of neural decompiler outputs via search. Our system, Decaf (DECompilation with Automated Feedback), raises the neural decompilation rate from 26.0% on ExeBench to 83.9% on the Real -O2 split without sacrificing similarity to the original source code. We also find our automatic feedback methodology is highly effective for improving weaker neural decompilation models.
Alexander Shypula, Osbert Bastani, Edward Schwartz
University of Pennsylvania Philadelphia, Pennsylvania 19104 · Carnegie Mellon University Pittsburgh, Pennsylvania 15213
Malware analysts often inspect compiled binaries through decompiled pseudo-C, when source code is unavailable. Recent work suggests that large language models (LLMs) can assist this process by classifying decompiled code as benign or malicious, but existing pipelines typically rely on a single decompiler view. We argue that this assumption is fragile: decompilers are lossy heuristic tools, and different decompilers can expose different artefacts of the same binary. We curate a benchmark of benign utilities and malicious programs spanning a range of threat behaviors. Each sample is compiled and decompiled with both Ghidra and RetDec, yielding matched pseudo-C views. Across a range of LLMs from major model families, we find that providing both decompiler views improves malicious-class F1, mainly by increasing recall on malicious samples. Agreement analyses further show that Ghidra and RetDec make partially different errors, supporting the view that decompiler outputs provide complementary evidence. Our results suggest that multi-decompiler prompting is a simple, training-free way to improve LLM-based malware triage in practical settings.
Code decompilation analysis is a fundamental yet challenging task in malware reverse engineering, particularly due to the pervasive use of sophisticated obfuscation techniques. Although recent large language models (LLMs) have shown promise in translating low-level representations into high-level source code, most existing approaches rely on generic code pretraining and lack adaptation to malicious software. We propose LLM4CodeRE, a domain-adaptive LLM framework for bidirectional code reverse engineering that supports both assembly-to-source decompilation and source-to-assembly translation within a unified model. To enable effective task adaptation, we introduce two complementary fine-tuning strategies: (i) a Multi-Adapter approach for task-specific syntactic and semantic alignment, and (ii) a Seq2Seq Unified approach using task-conditioned prefixes to enforce end-to-end generation constraints. Experimental results demonstrate that LLM4CodeRE outperforms existing decompilation tools and general-purpose code models, achieving robust bidirectional generalization.