Lanstree: Cross-Architecture Binary Code Similarity Detection with a Bidirectional Tree-Structured Embedding Model
摘要
Binary code similarity detection (BCSD) is fundamental to various applications, including firmware vulnerability search, code clone detection, and malware code segment identification. Many deep learning models have been proposed to learn code semantics from graph structures. However, most existing methods struggle to capture long-range dependencies in binary code represented by tree structures. To address this issue, this paper proposes Lanstree, a cross-architecture binary code similarity detection framework based on a bidirectional Tree-Transformer. Lanstree performs bottom-up and top-down semantic learning on abstract syntax trees (ASTs), enabling each node to fully aggregate features from its parent and child nodes. It employs a global attention mechanism to obtain a comprehensive representation of the AST and adopts a Siamese architecture to enhance binary code similarity detection performance. We have implemented a prototype of Lanstree, and experimental results demonstrate that Lanstree outperforms previous state-of-the-art BCSD methods.