问题
我正在试图弄清楚Java applet的类文件在做什么。用记事本或Textpad打开它只会显示出一堆狼吞虎咽的东西。
有没有什么方法可以将它重新组合成一种有点可读的格式,这样我就可以试着找出它在做什么?
- 环境== Windows w / VS 2008已安装。
#1 热门回答(187 赞)
jd-gui是目前最好的反编译器。与尘封的JAD相比,它可以处理Java中的新功能。
#2 热门回答(67 赞)
如果你不介意阅读字节码,javap应该可以正常工作。它是标准JDK安装的一部分。
Usage: javap <options> <classes>...
where options include:
-c Disassemble the code
-classpath <pathlist> Specify where to find user class files
-extdirs <dirs> Override location of installed extensions
-help Print this usage message
-J<flag> Pass <flag> directly to the runtime system
-l Print line number and local variable tables
-public Show only public classes and members
-protected Show protected/public classes and members
-package Show package/protected/public classes
and members (default)
-private Show all classes and members
-s Print internal type signatures
-bootclasspath <pathlist> Override location of class files loaded
by the bootstrap class loader
-verbose Print stack size, number of locals and args for methods
If verifying, print reasons for failure
#3 热门回答(7 赞)
你想要一个java反编译器,你可以使用命令行工具javap
来做到这一点。此外,Java Decompiler HOW-TO描述了如何反编译类文件。