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

1比1还是1比n函数内联对二进制相似性分析的影响

1-to-1 or 1-to-n? Investigating the effect of function inlining on binary similarity analysis

Ang Jia, Ming Fan, Wuxia Jin, Xi Xu, Zhaohui Zhou, Qiyi Tang, Sen Nie, Shi Wu, Ting Liu

摘要:

二进制相似性分析对于许多代码重用相关问题至关重要,并且“1对1”机制被广泛应用,其中二进制文件中的一个函数与源文件或二进制文件中的一个函数进行匹配。然而,我们发现,由于函数内联的存在,函数映射是一个更复杂的“1-to-n”甚至“n-to-n”问题。在本文中,我们研究了函数内联对二进制相似性分析的影响。我们首先构建了4个面向内联的数据集,用于4个相似性分析任务,包括代码搜索,OSS重用检测,漏洞检测和补丁存在测试。然后,我们进一步研究了函数内联的程度,现有的工作在函数内联下的性能,以及现有的内联模拟策略的有效性。结果表明,函数内联的比例可以达到近70%,而现有的大多数工作忽略了它,并使用“1对1”的机制。这些不匹配导致代码搜索期间性能损失30%,漏洞检测期间性能损失40%。此外,现有的两种内联模拟策略只能恢复60%的内联函数。我们发现,内联通常是累积的优化时,增加。提出了条件内联和增量内联的方法来设计低成本、高覆盖率的内联模拟策略。

英文摘要:

Binary similarity analysis is critical to many code-reuse-related issues and "1-to-1" mechanism is widely applied, where one function in a binary file is matched against one function in a source file or binary file. However, we discover that function mapping is a more complex problem of "1-to-n" or even "n-to-n" due to the existence of function inlining. In this paper, we investigate the effect of function inlining on binary similarity analysis. We first construct 4 inlining-oriented datasets for four similarity analysis tasks, including code search, OSS reuse detection, vulnerability detection, and patch presence test. Then, we further study the extent of function inlining, the performance of existing works under function inlining, and the effectiveness of existing inlining-simulation strategies. Results show that the proportion of function inlining can reach nearly 70%, while most existing works neglect it and use "1-to-1" mechanism. The mismatches cause a 30% loss in performance during code search and a 40% loss during vulnerability detection. Moreover, two existing inlining-simulation strategies can only recover 60% of the inlined functions. We discover that inlining is usually cumulative when optimization increases. Conditional inlining and incremental inlining are suggested to design low-cost and high-coverage inlining-simulation strategies.

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

↑