Neural code recovery improved by better candidate selection in obfuscated programs
Rethinking Neural Decompilation: Candidate Selection as the Hidden Bottleneck
Cryptography and SecurityArtificial Intelligence
Summary
Understanding and recovering code from confusing, hidden computer programs is important for security but hard to do accurately with AI tools. The authors found that the AI models often already generate the correct code, but picking the best option from many guesses is the main challenge. By testing different ways to choose the best code guess and fine-tuning on a large dataset of tricky programs, they greatly improved the accuracy of the AI’s top choice. This work shows that AI models can handle tough code even when it’s deliberately hidden, contrary to previous beliefs.
What this means in practice
- •For malware analysts: Improve automated recovery of readable code from obfuscated malware to aid faster threat analysis.
- •For software security teams: Enhance tools for auditing and understanding obfuscated software by selecting more accurate decompiled code from AI outputs.
Authors
Felix Mächtle, Gautham Sriram, Manjil Neupane, Nils Loose, Thomas Eisenbarth
Abstract
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.