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

Java反编译器多样性及其在元反编译中的应用

Java Decompiler Diversity and its Application to Meta-decompilation

Nicolas Harrand, César Soto-Valero, Martin Monperrus, Benoit Baudry

摘要:

在从Java源代码编译为字节码的过程中,某些信息会不可逆转地丢失。换句话说,Java代码的编译和反编译是不对称的。因此,旨在从字节码生成源代码的反编译依赖于重建丢失信息的策略。不同的Java反编译器使用不同的策略来实现正确的反编译。在这项工作中,我们假设字节码可以被反编译的不同方式对反编译器产生的源代码的质量有直接的影响。在本文中,我们评估的策略8 Java反编译器的三个质量指标:语法正确性,语法失真和语义等价模输入。我们的研究结果表明,没有一个现代的反编译器是能够正确地处理各种字节码结构来自现实世界的程序。在这项研究中排名最高的反编译器产生语法正确,语义等价的代码输出分别为84%,78%,在我们的数据集中的类。我们的研究结果表明,每个反编译器正确地处理一组不同的字节码类。我们提出了一个新的反编译器称为Arlecchino,利用现有的反编译器的多样性。为此,我们根据编译错误将部分反编译合并到一个新的反编译中。Arlecchino处理了37.6%以前没有反编译器处理的字节码类。我们公布了这个新的字节码反编译器的源代码。

英文摘要:

During compilation from Java source code to bytecode, some information is irreversibly lost. In other words, compilation and decompilation of Java code is not symmetric. Consequently, decompilation, which aims at producing source code from bytecode, relies on strategies to reconstruct the information that has been lost. Different Java decompilers use distinct strategies to achieve proper decompilation. In this work, we hypothesize that the diverse ways in which bytecode can be decompiled has a direct impact on the quality of the source code produced by decompilers. In this paper, we assess the strategies of eight Java decompilers with respect to three quality indicators: syntactic correctness, syntactic distortion and semantic equivalence modulo inputs. Our results show that no single modern decompiler is able to correctly handle the variety of bytecode structures coming from real-world programs. The highest ranking decompiler in this study produces syntactically correct, and semantically equivalent code output for 84%, respectively 78%, of the classes in our dataset. Our results demonstrate that each decompiler correctly handles a different set of bytecode classes. We propose a new decompiler called Arlecchino that leverages the diversity of existing decompilers. To do so, we merge partial decompilation into a new one based on compilation errors. Arlecchino handles 37.6% of bytecode classes that were previously handled by no decompiler. We publish the sources of this new bytecode decompiler.

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

↑