arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1907.01374cs.CR
收藏

一种基于语义的混合二进制代码相似性比较方法

A Semantics-Based Hybrid Approach on Binary Code Similarity Comparison

Yikun Hu, Hui Wang, Yuanyuan Zhang, Bodong Li, Dawu Gu

摘要:

二进制代码相似性比较是一种用于识别二进制程序中相似或相同代码片段的方法。它在软件工程和安全领域中是不可或缺的,有许多重要的应用(例如,剽窃检测、错误检测)。随着智能设备和物联网设备的普及,越来越多的程序被移植到多种架构(例如ARM,MIPS)。也有必要跨体系结构检测类似的二进制代码。这个主题的主要挑战在于由不同的编译设置、代码混淆和不同的指令集体系结构导致的语义等效代码转换。另一个挑战是比较准确性和覆盖范围之间的权衡。不幸的是,现有的方法仍然严重依赖于无语义的代码特征,这些特征容易受到代码转换的影响。此外,它们仅以静态或动态方式执行比较,这不能同时实现高精度和覆盖。在本文中,我们提出了一种基于语义的混合方法来比较二元函数的相似性。我们使用测试用例执行引用函数,然后使用从引用函数迁移的运行时信息仿真每个目标函数的执行。在执行和仿真期间提取语义签名。最后,从签名中计算相似性分数以测量函数的相似性。我们已经实现了该方法在一个原型系统指定为BinMatch和评估它与九个真实的字项目编译不同的编译设置,不同的架构,并与常用的混淆方法,共执行超过100万对功能比较。

英文摘要:

Binary code similarity comparison is a methodology for identifying similar or identical code fragments in binary programs. It is indispensable in fields of software engineering and security, which has many important applications (e.g., plagiarism detection, bug detection). With the widespread of smart and IoT (Internet of Things) devices, an increasing number of programs are ported to multiple architectures (e.g. ARM, MIPS). It becomes necessary to detect similar binary code across architectures as well. The main challenge of this topic lies in the semantics-equivalent code transformation resulting from different compilation settings, code obfuscation, and varied instruction set architectures. Another challenge is the trade-off between comparison accuracy and coverage. Unfortunately, existing methods still heavily rely on semantics-less code features which are susceptible to the code transformation. Additionally, they perform the comparison merely either in a static or in a dynamic manner, which cannot achieve high accuracy and coverage simultaneously. In this paper, we propose a semantics-based hybrid method to compare binary function similarity. We execute the reference function with test cases, then emulate the execution of every target function with the runtime information migrated from the reference function. Semantic signatures are extracted during the execution as well as the emulation. Lastly, similarity scores are calculated from the signatures to measure the likeness of functions. We have implemented the method in a prototype system designated as BinMatch and evaluate it with nine real-word projects compiled with different compilation settings, on variant architectures, and with commonly-used obfuscation methods, totally performing over 100 million pairs of function comparison.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑