基于指令关系图的二进制代码与源代码相似性分析方法
首发时间:2024-01-25
摘要:可执行二进制程序的分析和逆向工程在计算机安全等各个领域具有广泛的应用。以二进制形式进行程序的逆向工程通常被视为一种主要手动和耗时的过程,难以高效地应用于大规模样本集。然而,安全公司通常需要每天分析数千个未知的二进制文件,急需快速和自动化的二进制分析和逆向工程方法。故二进制代码与源代码的相似性分析技术在二进制程序的分析和逆向工程中扮演着重要的角色。目前的方法在提取代码语义方面存在不足,有些方法忽略了部分语义信息,有些方法则包含了冗余的信息。因此,本文提出了一种基于指令关系图的二进制代码和源代码相似性分析方法。该方法从二进制代码和源代码转换为的llvm-ir中生成了包含了指令之间的控制流、数据流和调用流关系的指令关系图。此外,本文还提出了一种基于图神经网络的代码相似性分析模型,通过指令关系图和其粗化后生成全局控制流图提取代码的语义特征,并计算相似度。本文方法在开源数据集codenet上进行了评估,并针对不同编译选项下的二进制代码进行了性能评估。实验结果表明,本文方法在取得了先进的性能。
关键词:
for information in english, please click here
binary-source code similarity comparison
abstract:the analysis and reverse engineering of executable binary programs have extensive applications in various fields, including computer security. reverse engineering programs in binary form are often considered a manual and time-consuming process, making it challenging to efficiently apply them to large sets of samples. however, security companies often need to analyze thousands of unknown binary files daily, necessitating fast and automated methods for binary analysis and reverse engineering. therefore, the similarity analysis of binary code to source code plays a crucial role in the analysis and reverse engineering of binary programs. existing methods have limitations in extracting code semantics, as some methods overlook certain semantic information while others include redundant information. hence, this paper proposes a binary-to-source code similarity analysis method based on llvm. this method generates an instruction relationship graph from llvm-ir, obtained from both binary and source code, capturing the control flow, data flow, and call flow relationships between instructions. additionally, a code similarity analysis model based on graph neural networks is introduced, which extracts semantic features from the code using the instruction relationship graph and a globally pooled control flow graph. the proposed method is evaluated on the open-source dataset codenet and its performance is assessed for different compilation options of binary code. experimental results demonstrate that the proposed method outperforms existing state-of-the-art methods.keywords:reverse engineering, clone detection, intermediate representation, binary code, code matching, deep learning.
keywords:
基金:
论文图表:
引用
导出参考文献
no.****
动态公开评议
共计0人参与
勘误表
基于指令关系图的二进制代码与源代码相似性分析方法
评论
全部评论0/1000