NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

Disassembling Obfuscated Executables with LLM

Huanyao Rong, Yue Duan, Hang Zhang, XiaoFeng Wang, Hongbo Chen, Shengchen Duan, Shen WangarXiv 2024 · DOI

Abstract

Disassembling obfuscated binaries is a critical challenge in security analysis, particularly when "junk bytes" cause traditional tools to misalign. This paper presents DISASLLM, a hybrid disassembly framework that leverages a fine-tuned Llama 3 model to identify valid instruction boundaries. By treating disassembly as a semantic classification task and employing bidirectional context, DISASLLM achieves a 40% improvement in recovering code hidden by obfuscation compared to state-of-the-art methods.

Introduction

Before a security researcher can analyze a suspicious file, they must perform disassembly: translating raw machine code into human-readable assembly instructions. This is notoriously difficult for variable-length instruction sets like x86. Malware authors exploit this by inserting "junk bytes"—meaningless data placed where a disassembler expects code. This causes tools to "misalign," turning valid code into a nonsensical stream of instructions. While humans can often spot these errors because the resulting code lacks semantic coherence, automated tools often lack the deep understanding required to distinguish between functional code and garbage.

Comparison of traditional disassembly (left) vs. DISASLLM's corrected output (right) identifying junk bytes (db).

Methodology

The authors introduce DISASLLM, which combines traditional disassembly algorithms with the semantic "intuition" of a Large Language Model (LLM).

The Model Architecture

The core of the system is a Llama 3 (8B) model. To optimize it for disassembly, the researchers used LLM2Vec to transform the generative "decoder" model into a bidirectional "encoder" model. This allows the model to analyze the context both before and after a specific instruction, which is vital for identifying boundary errors.

The Hybrid Strategy

Instead of disassembling the entire file with the LLM—which would be computationally prohibitive—DISASLLM follows a multi-stage workflow:

  1. Initial Guess: Standard linear and recursive disassembly create an initial graph.
  2. Semantic Auditing: The system uses the LLM to audit this graph. For any given instruction, it gathers a "neighborhood" of up to 32 related instructions via Breadth-First Search (BFS).
  3. Classification and Fixing: The LLM classifies each instruction as "valid" or "invalid." If an error is found, the tool triggers "Reverse Infilling" and "Forward Infilling" to resynchronize the disassembly and bridge the gap created by junk bytes.
The DISASLLM workflow, integrating initial disassembly with an LLM-based checking and fixing loop.

Evaluation and Results

DISASLLM was trained on AnghaBench, a dataset of 1 million compilable C functions, and evaluated against real-world projects like curl and OpenSSL obfuscated with OLLVM.

The tool significantly outperformed existing state-of-the-art tools like DeepDi, Angr, and Ddisasm:

  • Junk Byte Resilience: In difficult "junk" regions, DISASLLM achieved an F1 score of approximately 0.90, compared to DeepDi’s 0.52.
  • Boundary Detection: The model showed a 40% improvement in correctly identifying the first valid instruction following a block of junk bytes.
  • Precision: DISASLLM maintained high precision (0.98+), ensuring minimal "noise" for human analysts by rarely misidentifying junk as valid code.

Discussion and Limitations

The success of DISASLLM stems from treating assembly code as a natural language where context is king. By providing the LLM with a control-flow "neighborhood," the model gains the context needed to understand program logic.

However, several limitations remain. The main drawback is performance; DISASLLM processes 110–180 bytes per second, making it suitable for targeted analysis rather than bulk scanning. Additionally, techniques like "instruction-in-immediate" can still bypass the current model, and the tool does not currently handle self-modifying or packed code. Future work will focus on optimizing batching for increased speed and expanding the model's capability to recognize more advanced anti-disassembly techniques.

Summary updated

BibTeX
@misc{rong2024disassembling,
  author = {Huanyao Rong and Yue Duan and Hang Zhang and XiaoFeng Wang and Hongbo Chen and Shengchen Duan and Shen Wang},
  title = {{Disassembling Obfuscated Executables with LLM}},
  year = {2024},
  eprint = {2407.08924},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/2407.08924},
}
Figure