Abstract
For reverse engineering related security domains, such as vulnerability detection, malware analysis, and binary hardening, disassembly is crucial yet challenging. The fundamental challenge of disassembly is to identify instruction and function boundaries. Classic approaches rely on file-format assumptions and architecture-specific heuristics to guess the boundaries, resulting in incomplete and incorrect disassembly, especially when the binary is obfuscated. Recent advancements of disassembly have demonstrated that deep learning can improve both the accuracy and efficiency of disassembly. In this paper, we propose Disa, a new learning-based disassembly approach that uses the information of superset instructions over the multi-head self-attention to learn the instructions' correlations, thus being able to infer function entry-points and instruction boundaries. Disa can further identify instructions relevant to memory block boundaries to facilitate an advanced block-memory model based value-set analysis for an accurate control flow graph (CFG) generation. Our experiments show that Disa outperforms prior deep-learning disassembly approaches in function entry-point identification, especially achieving 9.1% and 13.2% F1-score improvement on binaries respectively obfuscated by the disassembly desynchronization technique and popular source-level obfuscator. By achieving an 18.5% improvement in the memory block precision, Disa generates more accurate CFGs with a 4.4% reduction in Average Indirect Call Targets (AICT) compared with the state-of-the-art heuristic-based approach.
Introduction
Disassembly is the foundational step for reverse engineering, vulnerability detection, and malware analysis. However, translating raw binary back into readable assembly is notoriously difficult. Compilers strip away helpful metadata (like symbols), and malicious actors use obfuscation techniques—like inserting junk bytes to desynchronize the disassembler—to actively break analysis tools like IDA Pro or Ghidra.
To make matters worse, building an accurate Control Flow Graph (CFG) requires resolving "indirect calls" (jumps to addresses calculated at runtime). Resolving these requires knowing the boundaries of memory blocks (where specific data structures begin and end). Traditional tools rely on rigid, conservative heuristics to guess these boundaries, leading to bloated and inaccurate CFGs. While recent deep learning tools have improved basic instruction boundary detection, they often miss high-level context or fail to address the crucial problem of memory block boundary identification.
Methodology: The Disa Framework
Disa bridges the gap between high-level static analysis and deep learning using a hybrid approach that leverages the semantic richness of "superset instructions."
The Disa pipeline consists of four primary stages:
- Superset Disassembly: Instead of guessing instruction starts, Disa decodes bytes at every possible offset to create a "superset" of all possible overlapping instructions.
- Transformer-Based Encoding: This superset is fed into a multi-head self-attention model. The model learns contextual correlations between instructions to filter noise and identify the "true" instruction path.
- Multi-Task Learning: Disa performs three distinct classification tasks:
- T1: Function entry-point identification.
- T2: True instruction identification.
- T3: Memory block boundary identification, classifying whether an instruction manipulates a block-boundary data element (a "BRel" instruction).
- Boundary-Targeted Value Tracking (bVTR): Predicted BRel instructions are translated into usable memory block boundaries via a post-classification static analysis step. These boundaries feed into a Block-based Points-to Analysis (BPA) system to resolve indirect calls.
Evaluation and Datasets
The authors evaluated Disa across a massive and diverse set of binaries to ensure robustness across architectures and obfuscation methods.
The evaluation utilized four primary dataset categories:
- Standard Non-obfuscated (SN): SPEC CPU 2006/2017 and BAP corpora compiled with GCC, Clang, ICC, and MSVC.
- Real-world (SR): 76 standard binaries including complex optimization edge-cases from BinTuner.
- Obfuscated (SO): Binaries protected by Obfuscator-LLVM, desync-cc, tigress, VMProtect, and Themida. Ground truth was established using dynamic instrumentation (Intel Pin).
- Memory Block Dataset (SP): Binutils and coreutils used for training Task 3, with DWARF debug information serving as ground truth.
Key Results
- Obfuscation Resilience: Disa significantly outperformed state-of-the-art ML disassemblers like XDA and DeepDi. It achieved a 9.1% F1-score improvement on binaries obfuscated with desync-cc and a 13.2% improvement on tigress-obfuscated binaries.
- Memory Block Precision: Disa's memory block generation outperformed traditional heuristic-based BPA by 18.5% in precision and 16.1% in F1-score.
- CFG Accuracy: By providing superior memory blocks to the points-to analysis, Disa achieved a 4.4% reduction in Average Indirect Call Targets (AICT), indicating a much tighter and more accurate CFG.
- Efficiency: Disa remains highly scalable, processing binaries faster than XDA and Ghidra, and maintaining competitiveness with industry-standard tools like IDA Pro.
Conclusion and Future Work
Disa demonstrates that context-aware deep learning, when combined with traditional static analysis, can overcome significant hurdles in binary disassembly. By reframing memory block identification as an ML problem, Disa provides a more precise foundation for CFG recovery.
However, limitations remain. Disa cannot analyze dynamically generated or runtime-decrypted code (e.g., packed sections in VMProtect). Future work involves integrating dynamic analysis to handle packed code and extending the model to better predict global memory block boundaries. Additionally, exploring the performance of specialized Transformer models against generalized Large Language Models (LLMs) presents a promising research avenue.
Summary updated