Abstract
Memory dependence analysis, or alias analysis, is a critical component of binary security auditing and reverse engineering. Traditional methods struggle with the inherent complexities of stripped binaries and indirect memory accesses. This paper introduces NeuDep, a novel neural framework that addresses the "memory aliasing" problem by pretraining on dynamic execution traces to learn value flows. NeuDep achieves 1.5x better precision and 3.5x faster performance than current state-of-the-art tools, demonstrating high robustness even against obfuscated code.
Introduction
In binary analysis, determining whether two instructions access the same memory location—a problem known as memory aliasing—is fundamental for tasks ranging from vulnerability detection to malware analysis. However, several factors make this task notoriously difficult. Modern software relies heavily on complex pointer arithmetic and indirect jumps, which are hard to track statically. Furthermore, commercial binaries are often "stripped," removing essential metadata like variable names and types.
Existing solutions typically face a sharp tradeoff: static analysis tools are often overly conservative, leading to high false-positive rates, while dynamic analysis tools are slow and limited by the execution paths they can cover. NeuDep bridges this gap by using a hybrid machine-learning approach that learns from dynamic behavior to improve static inference.
Methodology: Bridging the Static-Dynamic Divide
NeuDep introduces a two-stage workflow designed to capture the deep semantics of assembly instructions.
Multi-Modal Pretraining
The core of NeuDep is a multi-modal pretraining phase using a Masked Language Modeling (MLM) approach, similar to BERT. The model is fed three distinct types of data: static assembly code, dynamic execution traces (register values), and spatial memory addresses. By masking portions of these traces and requiring the model to predict the missing values, NeuDep is forced to learn the underlying logic of how instructions manipulate memory and registers.
Data Generation and Curriculum Learning
To ensure high-quality training data, the researchers developed a custom "forced execution" engine. This engine uses branch flipping to drive programs down diverse execution paths, exposing the model to a wide variety of memory access patterns. Training follows a curriculum learning strategy, starting with simple, short code sequences and gradually increasing complexity to help the model master the compositional effects of multiple instructions.
Key Insights: Learning from Execution Traces
The primary innovation of NeuDep is the use of dynamic traces as a "teacher" for static analysis. By observing actual value flows during pretraining, the model develops an intuition for pointer behavior that purely static tools lack.
Furthermore, by incorporating instruction memory addresses, the model becomes "address-aware," allowing it to handle position-independent code (RIP-relative addressing) and understand the spatial layout of the program. This allows NeuDep to distinguish between different memory regions, such as the stack, heap, and global data segments, with high accuracy.
Experimental Evaluation
NeuDep was evaluated against a massive dataset comprising 41 open-source projects, including OpenSSL, Binutils, and Bash. To test its robustness, the code was compiled using both GCC and Clang across four optimization levels (O0-O3) and subjected to various obfuscation passes, such as control-flow flattening.
To prove its generalizability, the researchers conducted a zero-shot evaluation on entirely unseen projects like Nginx and Lynx. In these tests, NeuDep consistently outperformed existing neural and traditional tools.
Results and Performance
- Superior Precision: NeuDep detected 1.5x more true dependencies than DeepVSA (the previous neural state-of-the-art) and maintained significantly lower false-positive rates than industry-standard tools like Ghidra.
- High Efficiency: The model is 3.5x faster than Ghidra and orders of magnitude faster than symbolic execution engines like Angr, which frequently time out on complex binary structures.
- Robustness to Obfuscation: Unlike tools dependent on DWARF debug information, NeuDep remains accurate even when the mapping between source and machine code is intentionally obscured.
Conclusion and Future Work
NeuDep represents a significant advancement in binary memory dependence analysis. By effectively "distilling" dynamic execution knowledge into a static inference model, it provides a powerful tool for security researchers. While the current implementation is focused on x86-64 and intra-procedural analysis, future iterations aim to expand to other architectures like ARM and incorporate full inter-procedural tracking to map pointer dependencies across entire programs.
Summary updated