Disassembly as Weighted Interval Scheduling with Learned Weights

Antonio Flores-Montoya, Junghee Lim, Adam Seitz, Akshay Sood, Edward Raff, James Holt

Introduction

Binary disassembly—the process of recovering human-readable instructions from raw machine code—is a fundamental prerequisite for reverse engineering, vulnerability analysis, and binary rewriting. Despite its importance, the process remains fraught with challenges, primarily due to the difficulty of distinguishing between executable code and embedded data. This paper introduces a novel approach that re-imagines disassembly as a Weighted Interval Scheduling (WIS) problem. By utilizing linear programming to automatically learn heuristic weights from ground-truth data, the authors present Ddisasm-WIS, a tool that achieves state-of-the-art accuracy across multiple architectures and binary formats.

The Challenges of Modern Disassembly

Disassemblers typically struggle with two main technical hurdles:

  1. Code/Data Interleaving: Modern compilers frequently mix executable instructions with data, such as jump tables or literal pools. Traditional "linear sweep" methods often attempt to interpret data as code, while "recursive disassembly" may fail to identify code reachable only through indirect branches.
  2. The Weight Assignment Problem: To resolve conflicts between potential code and data interpretations, disassemblers rely on dozens of heuristics. Historically, the relative importance (weights) of these heuristics were manually tuned by experts. This manual process is brittle, time-consuming, and difficult to scale across different Instruction Set Architectures (ISAs).

Previous research often framed conflict resolution as a Maximum Weight Independent Set (MWIS) problem. While expressive, MWIS is NP-hard, forcing tools to rely on slow or imprecise greedy approximations.

Methodology: The Ddisasm-WIS Pipeline

The authors propose a three-phase approach to automate and optimize the disassembly process:

1. Candidate Generation

To ensure high coverage, the tool performs an aggressive over-approximation of the binary. It generates a superset of all possible code and data blocks by combining linear sweep and recursive traversal techniques. This ensures that the true instruction sequence is likely contained within the candidate set.

2. Learned Weight Assignment

Instead of manual tuning, the authors treat heuristic weights as variables to be learned. By comparing candidate blocks against binaries with known ground truth, the system generates thousands of linear constraints. For instance, if a known instruction overlaps with a false candidate, a constraint is created requiring the weight of the true block to exceed the weight of the false one. A Linear Programming (LP) solver with soft constraints is then used to find the optimal weight values that satisfy the maximum number of constraints, effectively filtering out noise in the training data.

3. Conflict Resolution via WIS

Because instructions in a binary are essentially intervals on a one-dimensional line of bytes, the authors reduce the selection of the optimal instruction set to a Weighted Interval Scheduling problem. Unlike the NP-hard MWIS, WIS can be solved exactly and efficiently in polynomial time using dynamic programming. The authors argue that while MWIS can model more complex dependencies, the efficiency and exactness of WIS are more than sufficient for the disassembly task.

Evaluation and Results

The study evaluated Ddisasm-WIS using four major public datasets (SOK, Pangine, Jiang, and Assemb) covering x86, x64, ARM32, and AArch64 architectures. The training set included approximately 1,900 binaries, while the validation set spanned tens of thousands of files, including Windows PE binaries to test cross-format generalization.

Key Findings

  • State-of-the-Art Accuracy: Ddisasm-WIS achieved the highest recall across all tested datasets. Most notably, it produced the highest percentage of "perfectly disassembled" binaries. On the SOK x86/x64 dataset, it correctly disassembled 92.8% of binaries perfectly, significantly outperforming industry standards like IDA Pro (69.1%) and Angr (60.3%).
  • Generalization: Weights learned on Linux ELF binaries proved highly effective when applied to Windows PE binaries. This suggests that the underlying features distinguishing code from data are largely consistent across different operating systems and formats.
  • Heuristic Pruning: The LP solver revealed that over 40% of existing heuristics were redundant, assigning them weights of zero. This allowed for a simpler, more efficient disassembler without any loss in accuracy.
  • Performance: Despite the sophisticated weighting phase, the tool remains practical for real-world use. The decomposition of the problem into interval scheduling allows it to solve large disassembly tasks by breaking them into smaller, independent sub-problems.

Limitations and Future Work

While Ddisasm-WIS represents a significant advancement, some limitations remain. The model assumes mutual exclusivity between code and data; while standard, this assumption fails for highly obfuscated binaries where code and data may overlap. Furthermore, the tool's efficacy is bounded by the underlying instruction decoder (Capstone); any errors in the decoder propagate to the candidate generation phase. Future work aims to integrate more advanced statistical analyses to improve performance on stripped x64 binaries and refine the detection of jump table boundaries.

Conclusion

By framing disassembly as a Weighted Interval Scheduling problem and automating weight assignment through Linear Programming, the authors have moved disassembly away from manual heuristics toward a more principled, data-driven approach. Ddisasm-WIS demonstrates that tractability and mathematical optimization can yield superior results to complex, NP-hard modeling in the domain of binary analysis.

Summary updated

BibTeX
@inproceedings{floresmontoya2025disassembly,
  author = {Antonio Flores-Montoya and Junghee Lim and Adam Seitz and Akshay Sood and Edward Raff and James Holt},
  title = {{Disassembly as Weighted Interval Scheduling with Learned Weights}},
  booktitle = {SP},
  year = {2025},
  doi = {10.1109/sp61157.2025.00192},
}
Figure