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

学习在优化的二进制文件中查找库函数的用法

Learning to Find Usages of Library Functions in Optimized Binaries

Toufique Ahmed, Premkumar Devanbu, Anand Ashok Sawant

摘要:

许多软件,无论是善意的还是恶意的,都只作为二进制文件分发,没有源代码。在没有源代码的情况下,理解二进制文件的行为可能非常具有挑战性,特别是在更高级别的编译器优化下编译时。这些优化可以将可理解的、“自然的”源结构转换成完全无法识别的东西。逆向工程二进制文件,特别是那些被怀疑是恶意的或犯有知识产权盗窃罪的二进制文件,是重要而耗时的任务。人们对将二进制文件“反编译”为更自然的源代码以帮助进行逆向工程的工具非常感兴趣。反编译包括几个需要的步骤,包括重新创建源语言结构、变量名,甚至可能还有注释。创建二进制文件的一个核心步骤是使用内联等步骤优化函数调用。从优化的二进制文件中恢复这些(可能是内联的)函数调用是大多数最先进的反编译器工具尝试完成的一项基本任务,但执行得不是很好。在本文中,我们评估了一种用于恢复优化的函数调用问题的监督学习方法。我们利用开源软件,并开发了一个自动标记方案,以生成一个相当大的二进制数据集,这些数据集标记有实际的函数用法。我们通过预训练步骤来增强这个大但有限的标记数据集,该步骤从更大的未标记数据集中学习反编译的代码统计数据。因此,增强,我们学习的标签模型可以与现有的反编译工具,Ghidra,实现显着提高性能的函数调用恢复,特别是在更高层次的优化。

英文摘要:

Much software, whether beneficent or malevolent, is distributed only as binaries, sans source code. Absent source code, understanding binaries' behavior can be quite challenging, especially when compiled under higher levels of compiler optimization. These optimizations can transform comprehensible, "natural" source constructions into something entirely unrecognizable. Reverse engineering binaries, especially those suspected of being malevolent or guilty of intellectual property theft, are important and time-consuming tasks. There is a great deal of interest in tools to "decompile" binaries back into more natural source code to aid reverse engineering. Decompilation involves several desirable steps, including recreating source-language constructions, variable names, and perhaps even comments. One central step in creating binaries is optimizing function calls, using steps such as inlining. Recovering these (possibly inlined) function calls from optimized binaries is an essential task that most state-of-the-art decompiler tools try to do but do not perform very well. In this paper, we evaluate a supervised learning approach to the problem of recovering optimized function calls. We leverage open-source software and develop an automated labeling scheme to generate a reasonably large dataset of binaries labeled with actual function usages. We augment this large but limited labeled dataset with a pre-training step, which learns the decompiled code statistics from a much larger unlabeled dataset. Thus augmented, our learned labeling model can be combined with an existing decompilation tool, Ghidra, to achieve substantially improved performance in function call recovery, especially at higher levels of optimization.

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

↑