计算机科学
源代码
程序设计语言
编译程序
二进制数
二进制代码
系统代码
理论计算机科学
算法
解码方法
算术
低密度奇偶校验码
数学
作者
Zhongtang Zhang,Shengli Liu,Qichao Yang,Shichen Guo
标识
DOI:10.1109/imcec51613.2021.9482032
摘要
With the development of open source projects, a large number of open source codes will be reused in binary software, and bugs in source codes will also be introduced into binary codes. In order to detect the reused open source codes in binary codes, it is sometimes necessary to compare and analyze the similarity between source codes and binary codes. One of the main challenge is that the compilation process can generate different binary code representations for the same source code, such as different compiler versions, compilation optimization options and target architectures, which greatly increases the difficulty of semantic similarity detection between source code and binary code. In order to solve the influence of the compilation process on the comparison of semantic similarity of codes, this paper transforms the source code and binary code into LLVM intermediate representation (LLVM IR), which is a universal intermediate representation independent of source code and binary code. We carry out semantic feature extraction and embedding training on LLVM IR based on natural language processing model. Experimental results show that LLVM IR eliminates the influence of compilation on the syntax differences between source code and binary code, and the semantic features of code are well represented and preserved.
科研通智能强力驱动
Strongly Powered by AbleSci AI