Programmer-friendly Decompiled Java

Nomair A. Naeem, L. Hendren
{"title":"Programmer-friendly Decompiled Java","authors":"Nomair A. Naeem, L. Hendren","doi":"10.1109/ICPC.2006.40","DOIUrl":null,"url":null,"abstract":"Java decompilers convert Java class files to Java source. Java class files may be created by a number of different tools including standard Java compilers, compilers for other languages such as AspectJ, or other tools such as optimizers or obfuscators. There are two kinds of Java decompilers, Javac-specific decompilers that assume that the class file was created by a standard Javac compiler and tool-independent decompilers that can decompile arbitrary class files, independent of the tool that created the class files. Typically Javac-specific decompilers produce more readable code, but they fail to decompile many class files produced by other tools. This paper tackles the problem of how to make a tool-independent decompiler, Dava, produce Java source code that is programmer-friendly. In past work it has been shown that Dava can decompile arbitrary class files, but often the output, although correct, is very different from what a programmer would write and is hard to understand. Furthermore, tools like obfuscators intentionally confuse the class files and this also leads to confusing decompiled source files. Given that Dava already produces correct Java abstract syntax trees (ASTs) for arbitrary class files, we provide a new back-end for Dava. The back-end rewrites the ASTs to semantically equivalent ASTs that correspond to code that is easier for programmers to understand. Our new back-end includes a new AST traversal framework, a set of simple pattern-based transformations, a structure-based data flow analysis framework and a collection of more advanced AST transformations that use flow analysis information. We include several illustrative examples including the use of advanced transformations to clean up obfuscated code","PeriodicalId":377450,"journal":{"name":"14th IEEE International Conference on Program Comprehension (ICPC'06)","volume":"87 1 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2006-06-14","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"25","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"14th IEEE International Conference on Program Comprehension (ICPC'06)","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1109/ICPC.2006.40","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 25

Abstract

Java decompilers convert Java class files to Java source. Java class files may be created by a number of different tools including standard Java compilers, compilers for other languages such as AspectJ, or other tools such as optimizers or obfuscators. There are two kinds of Java decompilers, Javac-specific decompilers that assume that the class file was created by a standard Javac compiler and tool-independent decompilers that can decompile arbitrary class files, independent of the tool that created the class files. Typically Javac-specific decompilers produce more readable code, but they fail to decompile many class files produced by other tools. This paper tackles the problem of how to make a tool-independent decompiler, Dava, produce Java source code that is programmer-friendly. In past work it has been shown that Dava can decompile arbitrary class files, but often the output, although correct, is very different from what a programmer would write and is hard to understand. Furthermore, tools like obfuscators intentionally confuse the class files and this also leads to confusing decompiled source files. Given that Dava already produces correct Java abstract syntax trees (ASTs) for arbitrary class files, we provide a new back-end for Dava. The back-end rewrites the ASTs to semantically equivalent ASTs that correspond to code that is easier for programmers to understand. Our new back-end includes a new AST traversal framework, a set of simple pattern-based transformations, a structure-based data flow analysis framework and a collection of more advanced AST transformations that use flow analysis information. We include several illustrative examples including the use of advanced transformations to clean up obfuscated code
程序员友好的反编译Java
Java反编译器将Java类文件转换为Java源文件。Java类文件可以由许多不同的工具创建,包括标准Java编译器、其他语言的编译器(如AspectJ)或其他工具(如优化器或混淆器)。有两种Java反编译器:一种是特定于Java的反编译器,它假定类文件是由标准Javac编译器创建的;另一种是独立于工具的反编译器,它可以反编译任意的类文件,而不依赖于创建类文件的工具。通常,特定于java的反编译器会生成更具可读性的代码,但它们无法反编译其他工具生成的许多类文件。本文解决的问题是如何使工具独立的反编译器Dava生成对程序员友好的Java源代码。在过去的工作中已经证明,Dava可以反编译任意的类文件,但是通常输出虽然正确,但与程序员编写的内容非常不同,并且很难理解。此外,像obfuscators这样的工具会故意混淆类文件,这也会导致混淆反编译的源文件。鉴于Dava已经为任意类文件生成了正确的Java抽象语法树(ast),我们为Dava提供了一个新的后端。后端将ast重写为语义上等价的ast,这些ast对应于程序员更容易理解的代码。我们的新后端包括一个新的AST遍历框架、一组简单的基于模式的转换、一个基于结构的数据流分析框架和一组使用流分析信息的更高级的AST转换。我们包括几个说明性的例子,包括使用高级转换来清理混淆的代码
本文章由计算机程序翻译,如有差异,请以英文原文为准。
求助全文
约1分钟内获得全文 求助全文
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:604180095
Book学术官方微信