arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2301.01701cs.CRcs.AIcs.LGcs.SE
收藏

扩展Source Code预训练的语言模型以总结反编译的二进制文件

Extending Source Code Pre-Trained Language Models to Summarise Decompiled Binaries

Delft University of Technology(代尔夫特理工大学);University of California, Davis(加州大学戴维斯分校)

Ali Al-Kaswan, Toufique Ahmed, Maliheh Izadi, Anand Ashok Sawant, Premkumar Devanbu, Arie van Deursen

摘要:

逆向工程二进制文件是理解和分析源代码不可用的程序所必需的。反编译器可以将大部分不可读的二进制文件转换为更可读的类似源代码的表示。然而,逆向工程是耗时的,其中大部分是通过标记的功能与语义信息。虽然反编译代码的自动摘要可以帮助逆向工程师理解和分析二进制文件,但目前的工作主要集中在总结源代码上,并且没有适合此任务的数据集。在这项工作中,我们扩展了大型预训练的源代码语言模型,以总结反编译的二进制函数。此外,我们调查的输入和数据属性对这些模型的性能的影响。我们的方法包括两个主要部分:数据和模型。我们首先构建CAPYBARA,这是一个跨各种编译器优化的214 K反编译函数文档对的数据集。我们通过生成合成数据集和删除重复数据来进一步扩展CAPYBARA。接下来,我们使用CAPYBARA微调CodeT 5基础模型以创建BinT 5。BinT 5在总结源代码、反编译代码和综合剥离反编译代码方面分别获得了60.83、58.82和44.21的最新BLEU-4评分。这表明,这些模型可以成功地扩展到反编译二进制文件。最后,我们发现BinT 5的性能并不严重依赖于数据集大小和编译器优化水平。我们建议未来的研究,以进一步研究转移知识时,较少表达的输入格式,如剥离二进制文件。

英文摘要:

Reverse engineering binaries is required to understand and analyse programs for which the source code is unavailable. Decompilers can transform the largely unreadable binaries into a more readable source code-like representation. However, reverse engineering is time-consuming, much of which is taken up by labelling the functions with semantic information. While the automated summarisation of decompiled code can help Reverse Engineers understand and analyse binaries, current work mainly focuses on summarising source code, and no suitable dataset exists for this task. In this work, we extend large pre-trained language models of source code to summarise decompiled binary functions. Furthermore, we investigate the impact of input and data properties on the performance of such models. Our approach consists of two main components; the data and the model. We first build CAPYBARA, a dataset of 214K decompiled function-documentation pairs across various compiler optimisations. We extend CAPYBARA further by generating synthetic datasets and deduplicating the data. Next, we fine-tune the CodeT5 base model with CAPYBARA to create BinT5. BinT5 achieves the state-of-the-art BLEU-4 score of 60.83, 58.82, and 44.21 for summarising source, decompiled, and synthetically stripped decompiled code, respectively. This indicates that these models can be extended to decompiled binaries successfully. Finally, we found that the performance of BinT5 is not heavily dependent on the dataset size and compiler optimisation level. We recommend future research to further investigate transferring knowledge when working with less expressive input formats such as stripped binaries.

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

↑