arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1906.12029cs.PLcs.LG
收藏

一个基于神经元的程序反编译器

A Neural-based Program Decompiler

UC San Diego(加州大学圣迭戈分校);UC Berkeley(加州大学伯克利分校);Facebook(脸书)

Cheng Fu, Huili Chen, Haolan Liu, Xinyun Chen, Yuandong Tian, Farinaz Koushanfar, Jishen Zhao

摘要:

二进制可执行文件的逆向工程是计算机安全领域的一个关键问题。一方面,恶意方可能从软件产品中恢复可解释的源代码以获得商业优势。另一方面,二进制反编译可以用于代码漏洞分析和恶意软件检测。然而,有效的二进制反编译是具有挑战性的。传统的反编译器具有以下主要局限性:(i)它们仅适用于特定的源-目标语言对,因此对于新的语言任务会招致不期望的开发成本;(ii)它们的输出高级代码不能有效地保持输入二进制的正确功能;(iii)它们的输出程序不能捕获输入的语义,并且反转的程序难以解释。为了解决上述问题,我们提出了Coda,这是第一个端到端的基于神经的代码反编译框架。Coda将反编译任务分解为两个关键阶段:首先,Coda采用了一个指令类型感知编码器和一个树解码器,用于在代码草图生成阶段生成一个带有注意力反馈的抽象语法树(AST)。其次,Coda使用由集成神经误差预测器引导的迭代纠错机来更新代码草图。通过找到一个好的近似候选,然后将其固定为完美,Coda实现了与基线方法相比更优越的性能。我们评估Coda的性能与广泛的实验在各种基准。评估结果表明,Coda在看不见的二进制样本上实现了平均82%的程序恢复准确率,而最先进的反编译器的准确率为0%。此外,Coda优于序列到序列模型的注意力的70\%的程序准确性的保证金。

英文摘要:

Reverse engineering of binary executables is a critical problem in the computer security domain. On the one hand, malicious parties may recover interpretable source codes from the software products to gain commercial advantages. On the other hand, binary decompilation can be leveraged for code vulnerability analysis and malware detection. However, efficient binary decompilation is challenging. Conventional decompilers have the following major limitations: (i) they are only applicable to specific source-target language pair, hence incurs undesired development cost for new language tasks; (ii) their output high-level code cannot effectively preserve the correct functionality of the input binary; (iii) their output program does not capture the semantics of the input and the reversed program is hard to interpret. To address the above problems, we propose Coda, the first end-to-end neural-based framework for code decompilation. Coda decomposes the decompilation task into two key phases: First, Coda employs an instruction type-aware encoder and a tree decoder for generating an abstract syntax tree (AST) with attention feeding during the code sketch generation stage. Second, Coda then updates the code sketch using an iterative error correction machine guided by an ensembled neural error predictor. By finding a good approximate candidate and then fixing it towards perfect, Coda achieves superior performance compared to baseline approaches. We assess Coda's performance with extensive experiments on various benchmarks. Evaluation results show that Coda achieves an average of 82\% program recovery accuracy on unseen binary samples, where the state-of-the-art decompilers yield 0\% accuracy. Furthermore, Coda outperforms the sequence-to-sequence model with attention by a margin of 70\% program accuracy.

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

↑