Neural Machine Translation Inspired Binary Code Similarity Comparison beyond Function Pairs
Fei Zuo, Xiaopeng Li, Patrick Young, Lannan Luo, Qiang Zeng, Zhexin Zhang
摘要
Binary code analysis allows analyzing binary code without having access to the corresponding source code. A binary, after disassembly, is expressed in an assembly language. This inspires us to approach binary analysis by leveraging ideas and techniques from Natural Language Processing (NLP), a fruitful area focused on processing text of various natural languages. We notice that binary code analysis and NLP share many analogical topics, such as semantics extraction, classification, and code/text comparison. This work thus borrows ideas from NLP to address two important code similarity comparison problems. (I) Given a pair of basic blocks of different instruction set architectures (ISAs), determining whether their semantics is similar; and (II) given a piece of code of interest, determining if it is contained in another piece of code of a different ISA. The solutions to these two problems have many applications, such as cross-architecture vulnerability discovery and code plagiarism detection. Despite the evident importance of Problem I, existing solutions are either inefficient or imprecise. Inspired by Neural Machine Translation (NMT), which is a new approach that tackles text across natural languages very well, we regard instructions as words and basic blocks as sentences, and propose a novel cross-(assembly)-lingual deep learning approach to solving Problem I, attaining high efficiency and precision. Many solutions have been proposed to determine whether two pieces of code, e.g., functions, are equivalent (called the equivalence problem), which is different from Problem II (called the containment problem). Resolving the cross-architecture code containment problem is a new and more challenging endeavor. Employing our technique for crossarchitecture basic-block comparison, we propose the first solution to Problem II. We implement a prototype system INNEREYE and perform a comprehensive evaluation. A comparison between our approach and existing approaches to Problem I shows that our system outperforms them in terms of accuracy, efficiency and scalability. The case studies applying the system demonstrate that our solution to Problem II is effective. Moreover, this research showcases how to apply ideas and techniques from NLP to largescale binary code analysis.
问 Lune
几分钟读透这篇 Paper,不用再花一下午。
Lune 能读完全文,也能读引用它的顶会 Paper,讲清它的结论、证据和局限,每一点都注明出自哪篇 Paper。不用硬啃,也不靠猜。
已有 42 篇顶会 Paper 引用了它。别等审稿人问起,先弄清它们发现了什么。
脉络
- Code is not Natural Language: Unlock the Power of Semantics-Oriented Graph Representation for Binary Code Similarity Detection 引用了 CodeCMR: Cross-Modal Retrieval For Function-Level Binary Source Code Matching
- Code is not Natural Language: Unlock the Power of Semantics-Oriented Graph Representation for Binary Code Similarity Detection 引用了 Order Matters: Semantic-Aware Neural Networks for Binary Code Similarity Detection
- Code is not Natural Language: Unlock the Power of Semantics-Oriented Graph Representation for Binary Code Similarity Detection 引用了 Asm2Vec: Boosting Static Representation Robustness for Binary Clone Search against Code Obfuscation and Compiler Optimization
- Code is not Natural Language: Unlock the Power of Semantics-Oriented Graph Representation for Binary Code Similarity Detection 引用了 Neural Network-based Graph Embedding for Cross-Platform Binary Code Similarity Detection
- Code is not Natural Language: Unlock the Power of Semantics-Oriented Graph Representation for Binary Code Similarity Detection 引用了 PalmTree: Learning an Assembly Language Model for Instruction Embedding
- Code is not Natural Language: Unlock the Power of Semantics-Oriented Graph Representation for Binary Code Similarity Detection 引用了 jTrans: jump-aware transformer for binary code similarity detection
- Code is not Natural Language: Unlock the Power of Semantics-Oriented Graph Representation for Binary Code Similarity Detection 引用了 Scalable Graph-based Bug Search for Firmware Images
- CodeCMR: Cross-Modal Retrieval For Function-Level Binary Source Code Matching 引用了 Order Matters: Semantic-Aware Neural Networks for Binary Code Similarity Detection
- CodeCMR: Cross-Modal Retrieval For Function-Level Binary Source Code Matching 引用了 Neural Network-based Graph Embedding for Cross-Platform Binary Code Similarity Detection
- Asm2Vec: Boosting Static Representation Robustness for Binary Clone Search against Code Obfuscation and Compiler Optimization 引用了 Neural Network-based Graph Embedding for Cross-Platform Binary Code Similarity Detection
- Asm2Vec: Boosting Static Representation Robustness for Binary Clone Search against Code Obfuscation and Compiler Optimization 引用了 discovRE: Efficient Cross-Architecture Identification of Bugs in Binary Code
- Asm2Vec: Boosting Static Representation Robustness for Binary Clone Search against Code Obfuscation and Compiler Optimization 引用了 Scalable Graph-based Bug Search for Firmware Images
- Neural Network-based Graph Embedding for Cross-Platform Binary Code Similarity Detection 引用了 discovRE: Efficient Cross-Architecture Identification of Bugs in Binary Code
- Neural Network-based Graph Embedding for Cross-Platform Binary Code Similarity Detection 引用了 Scalable Graph-based Bug Search for Firmware Images
- PalmTree: Learning an Assembly Language Model for Instruction Embedding 引用了 Order Matters: Semantic-Aware Neural Networks for Binary Code Similarity Detection
- PalmTree: Learning an Assembly Language Model for Instruction Embedding 引用了 Asm2Vec: Boosting Static Representation Robustness for Binary Clone Search against Code Obfuscation and Compiler Optimization
- PalmTree: Learning an Assembly Language Model for Instruction Embedding 引用了 Neural Network-based Graph Embedding for Cross-Platform Binary Code Similarity Detection
- PalmTree: Learning an Assembly Language Model for Instruction Embedding 引用了 Neural Nets Can Learn Function Type Signatures From Binaries
- jTrans: jump-aware transformer for binary code similarity detection 引用了 Order Matters: Semantic-Aware Neural Networks for Binary Code Similarity Detection
- jTrans: jump-aware transformer for binary code similarity detection 引用了 Asm2Vec: Boosting Static Representation Robustness for Binary Clone Search against Code Obfuscation and Compiler Optimization
- jTrans: jump-aware transformer for binary code similarity detection 引用了 Neural Network-based Graph Embedding for Cross-Platform Binary Code Similarity Detection
- jTrans: jump-aware transformer for binary code similarity detection 引用了 discovRE: Efficient Cross-Architecture Identification of Bugs in Binary Code
- jTrans: jump-aware transformer for binary code similarity detection 引用了 Scalable Graph-based Bug Search for Firmware Images
- Scalable Graph-based Bug Search for Firmware Images 引用了 discovRE: Efficient Cross-Architecture Identification of Bugs in Binary Code
引用它的顶会 Paper42
- Order Matters: Semantic-Aware Neural Networks for Binary Code Similarity DetectionZeping Yu, Rui Cao, Qiyi Tang, Sen Nie 等AAAI 2020 · 265 次引用
- PalmTree: Learning an Assembly Language Model for Instruction EmbeddingXuezixiang Li, Yu Qu, Heng YinCCS 2021 · 139 次引用
- jTrans: jump-aware transformer for binary code similarity detectionHao Wang, Wenjie Qu, Gilad Katz, Wenyu Zhu 等ISSTA 2022 · 139 次引用
- CodeCMR: Cross-Modal Retrieval For Function-Level Binary Source Code MatchingZeping Yu, Wenxin Zheng, Jiaqi Wang, Qiyi Tang 等NeurIPS 2020 · 93 次引用
- Code is not Natural Language: Unlock the Power of Semantics-Oriented Graph Representation for Binary Code Similarity DetectionHaojie He, Xingwei Lin, Ziang Weng, Ruijie Zhao 等USENIX Security 2024 · 66 次引用
它引用的 Paper5
- Neural Network-based Graph Embedding for Cross-Platform Binary Code Similarity DetectionXiaojun Xu, Chang Liu, Qian Feng, Heng Yin 等CCS 2017 · 682 次引用
- Scalable Graph-based Bug Search for Firmware ImagesQian Feng, Rundong Zhou, Chengcheng Xu, Yao Cheng 等CCS 2016 · 456 次引用
- Asm2Vec: Boosting Static Representation Robustness for Binary Clone Search against Code Obfuscation and Compiler OptimizationSteven H. H. Ding, Benjamin C. M. Fung, Philippe CharlandS&P 2019 · 447 次引用
- discovRE: Efficient Cross-Architecture Identification of Bugs in Binary CodeSebastian Eschweiler, Khaled Yakdan, Elmar Gerhards-PadillaNDSS 2016 · 342 次引用
- Neural Nets Can Learn Function Type Signatures From BinariesZheng Leong Chua, Shiqi Shen, Prateek Saxena, Zhenkai LiangUSENIX Security 2017 · 175 次引用
相关 Paper
- Unsupervised Binary Code Translation with Application to Code Clone Detection and Vulnerability DiscoveryIftakhar Ahmad, Lannan LuoEMNLP Findings 2023 · 5 次引用
- Can a Deep Learning Model for One Architecture Be Used for Others? Retargeted-Architecture Binary Code AnalysisJunzhe Wang, Matthew Sharp, Chuxiong Wu, Qiang Zeng 等USENIX Security 2023
- Improving Binary Code Similarity Transformer Models by Semantics-Driven Instruction DeemphasisXiangzhe Xu, Shiwei Feng, Yapeng Ye, Guangyu Shen 等ISSTA 2023 · 25 次引用
- Nova: Generative Language Models for Assembly Code with Hierarchical Attention and Contrastive LearningNan Jiang, Chengxiao Wang, Kevin Liu, Xiangzhe Xu 等ICLR 2025
- Selective Knowledge Distillation: Fusing LLM Semantic Strengths with DNN Efficiency for Binary Code Similarity DetectionShize Zhou, Peiyu Liu, Lirong Fu, Tong Ye 等ACL 2026
