Codeformer: A GNN-Nested Transformer Model for Binary Code Similarity Detection

Guangming Liu,Xin Zhou,Jianmin Pang,Feng Yue,Wenfu Liu,Junchao Wang
DOI: https://doi.org/10.3390/electronics12071722
IF: 2.9
2023-04-05
Electronics
Abstract:Binary code similarity detection is used to calculate the code similarity of a pair of binary functions or files, through a certain calculation method and judgment method. It is a fundamental task in the field of computer binary security. Traditional methods of similarity detection usually use graph matching algorithms, but these methods have poor performance and unsatisfactory effects. Recently, graph neural networks have become an effective method for analyzing graph embeddings in natural language processing. Although these methods are effective, the existing methods still do not sufficiently learn the information of the binary code. To solve this problem, we propose Codeformer, an iterative model of a graph neural network (GNN)-nested Transformer. The model uses a Transformer to obtain an embedding vector of the basic block and uses the GNN to update the embedding vector of each basic block of the control flow graph (CFG). Codeformer iteratively executes basic block embedding to learn abundant global information and finally uses the GNN to aggregate all the basic blocks of a function. We conducted experiments on the OpenSSL, Clamav and Curl datasets. The evaluation results show that our method outperforms the state-of-the-art models.
engineering, electrical & electronic,computer science, information systems,physics, applied
What problem does this paper attempt to address?