Neural Machine Translation Inspired Binary Code Similarity Comparison beyond Function Pairs
Fei Zuo, Xiaopeng Li, Patrick Young, Lannan Luo, Qiang Zeng, Zhexin Zhang
Abstract
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.
Ask about this paper
Your agent reads all of it.
Lune indexed this paper to the last equation, along with the top-tier papers that cite it. Ask a question and the answer quotes them.
Your agent calls
Luneget_paper_fulltext
Free to start. No credit card required.
Terminal
Install the CLIlune papers fulltext e01f20e5-d1d0-4ed8-a733-becb48955387Cited by top-tier papers42
- Order Matters: Semantic-Aware Neural Networks for Binary Code Similarity DetectionZeping Yu, Rui Cao, Qiyi Tang, Sen Nie et al.AAAI 2020 · 265 citations
- PalmTree: Learning an Assembly Language Model for Instruction EmbeddingXuezixiang Li, Yu Qu, Heng YinCCS 2021 · 139 citations
- jTrans: jump-aware transformer for binary code similarity detectionHao Wang, Wenjie Qu, Gilad Katz, Wenyu Zhu et al.ISSTA 2022 · 139 citations
- CodeCMR: Cross-Modal Retrieval For Function-Level Binary Source Code MatchingZeping Yu, Wenxin Zheng, Jiaqi Wang, Qiyi Tang et al.NeurIPS 2020 · 93 citations
- 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 et al.USENIX Security 2024 · 66 citations
Builds on5
- Neural Network-based Graph Embedding for Cross-Platform Binary Code Similarity DetectionXiaojun Xu, Chang Liu, Qian Feng, Heng Yin et al.CCS 2017 · 682 citations
- Scalable Graph-based Bug Search for Firmware ImagesQian Feng, Rundong Zhou, Chengcheng Xu, Yao Cheng et al.CCS 2016 · 456 citations
- 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 citations
- discovRE: Efficient Cross-Architecture Identification of Bugs in Binary CodeSebastian Eschweiler, Khaled Yakdan, Elmar Gerhards-PadillaNDSS 2016 · 342 citations
- Neural Nets Can Learn Function Type Signatures From BinariesZheng Leong Chua, Shiqi Shen, Prateek Saxena, Zhenkai LiangUSENIX Security 2017 · 175 citations
Related papers
- Can a Deep Learning Model for One Architecture Be Used for Others? Retargeted-Architecture Binary Code AnalysisJunzhe Wang, Matthew Sharp, Chuxiong Wu, Qiang Zeng et al.USENIX Security 2023
- Improving Binary Code Similarity Transformer Models by Semantics-Driven Instruction DeemphasisXiangzhe Xu, Shiwei Feng, Yapeng Ye, Guangyu Shen et al.ISSTA 2023 · 25 citations
- Nova: Generative Language Models for Assembly Code with Hierarchical Attention and Contrastive LearningNan Jiang, Chengxiao Wang, Kevin Liu, Xiangzhe Xu et al.ICLR 2025
- Selective Knowledge Distillation: Fusing LLM Semantic Strengths with DNN Efficiency for Binary Code Similarity DetectionShize Zhou, Peiyu Liu, Lirong Fu, Tong Ye et al.ACL 2026
- RCFG2Vec: Considering Long-Distance Dependency for Binary Code Similarity DetectionWeilong Li, Jintian Lu, Ruizhi Xiao, Pengfei Shao et al.ASE 2024 · 4 citations
