arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 1808.06216cs.SE
收藏

BinMatch:一种基于语义的混合二进制代码克隆分析方法

BinMatch: A Semantics-based Hybrid Approach on Binary Code Clone Analysis

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

摘要:

二进制代码克隆分析是在软件工程中具有广泛应用的重要技术(例如,剽窃检测、错误检测)。该主题的主要挑战在于语义等效代码转换(例如,优化,混淆),这将极大地改变二进制代码的表示。另一个挑战是检测精度和覆盖范围之间的权衡。不幸的是,现有的技术仍然依赖于无语义的代码特征,这些特征容易受到代码转换的影响。此外,它们仅仅采用静态或动态的方法来检测二进制代码克隆,不能同时实现高准确率和覆盖率。在本文中,我们提出了一个基于语义的混合方法来检测二进制克隆函数。我们执行一个模板二进制函数及其测试用例,并模拟每个目标函数的执行,以便与从该模板函数迁移的运行时信息进行克隆比较。在执行模板函数和仿真目标函数的过程中提取语义签名。最后,从他们的签名中计算相似性分数以测量他们的相似性。我们实现的方法在一个原型系统指定为BinMatch分析IA-32二进制代码在Linux平台上。我们评估BinMatch与八个真实世界的项目编译不同的编译配置和常用的混淆方法,共执行超过1亿对函数比较。实验结果表明,BinMatch算法对语义等价的代码转换具有较好的鲁棒性。此外,它不仅覆盖了克隆分析的所有目标函数,而且与最先进的解决方案相比,提高了检测精度。

英文摘要:

Binary code clone analysis is an important technique which has a wide range of applications in software engineering (e.g., plagiarism detection, bug detection). The main challenge of the topic lies in the semantics-equivalent code transformation (e.g., optimization, obfuscation) which would alter representations of binary code tremendously. Another chal- lenge is the trade-off between detection accuracy and coverage. Unfortunately, existing techniques still rely on semantics-less code features which are susceptible to the code transformation. Besides, they adopt merely either a static or a dynamic approach to detect binary code clones, which cannot achieve high accuracy and coverage simultaneously. In this paper, we propose a semantics-based hybrid approach to detect binary clone functions. We execute a template binary function with its test cases, and emulate the execution of every target function for clone comparison with the runtime information migrated from that template function. The semantic signatures are extracted during the execution of the template function and emulation of the target function. Lastly, a similarity score is calculated from their signatures to measure their likeness. We implement the approach in a prototype system designated as BinMatch which analyzes IA-32 binary code on the Linux platform. We evaluate BinMatch with eight real-world projects compiled with different compilation configurations and commonly-used obfuscation methods, totally performing over 100 million pairs of function comparison. The experimental results show that BinMatch is robust to the semantics-equivalent code transformation. Besides, it not only covers all target functions for clone analysis, but also improves the detection accuracy comparing to the state-of-the-art solutions.

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

↑