jadclipse插件网站: http://jadclipse.sourceforge.net/
一、下载:
下载插件:
下载jadclipse_3.1.0.jar版本,该版本支持eclipse3.1M6以上
下载jadclipse_3.2.0.jar版本,该版本支持eclipse3.2M3和eclipse3.2M4.
下载jadclipse_3.2.2.jar版本,该版本支持eclipse3.2M5以上。
二、安装:
方法1、直接将jadclipse_3.1.0.jar复制到%ECLIPSE_HOME%/plugins目录下。cmd -> % ECLIPSE_HOME% ->eclipse -clean
方法2、使用link方式安装,建立E:/eclipse3.1plugins/jadclipse3.1.0/eclipse/plugins的目录结构,将jadclipse_3.1.0.jar放到plugins目录下面(注:其中E:/eclipse3.1plugins为你自己定义的一个专门放置插件的目录)。再在%ECLIPSE_HOME%/links目录下面建立一个jadclipse3.1.0.link文件(该文件名随便取,保证后缀为。link就OK)。文件里面内容为:path=E://eclipse3.1plugins//jadclipse3.1.0.启动eclipse,打开Window->Preferences->Java->JadClipse,如果没有找到JadClipse,检查插件安装的版本是否与你安装的eclipse版本对应。
我安装的eclipse是:eclipse3.1.2
三、设置参数:
启动eclipse,打开:Window->Preferences->Java->JadClipse.
1、Path to decompiler,这里设置反编译工具jad的全路径名,比如:%JAVA_HOME%/bin/jad.exe.
2、Directory for temporary files,这里设置临时文件路径。至于Window->Preferences->Java->JadClipse目录下的Debug,Directives,Formatting,Misc目录中的参数设置,就不罗嗦。
四、安装完成后,eclipse自动将JadClipse Class File Viewer设置成class文件的缺省打开方式。如果没有默认,可以在Eclipse的Windows——> Perference——>General->Editors->File Associations中修改“*.class”默认关联的编辑器为“JadClipse Class File Viewer”。设置完成后,双击*.class文件,eclipse将自动反编译。
注:对于存在源代码的类,它不会强行反编译,也就是说它还是会用eclipse自带的Class File Viewer查看class文件。
Usage: jad [option(s)]
Options: -a - generate JVM instructions as comments (annotate)
-af - output fully qualified names when annotating
-b - generate redundant braces (braces)
-clear - clear all prefixes, including the default ones
-d
- directory
for output files
-dead - try to decompile dead parts of code (if there are any)
-dis - disassembler only (disassembler)
-f - generate fully qualified names (fullnames)
-ff - output fields before methods (fieldsfirst)
-i - print default initializers for fields (definits)
-l - split strings into pieces of max chars (splitstr)
-lnc - output original line numbers as comments (lnc)
-nl - split strings on newline characters (splitstr)
-noconv - don't convert Java identifiers into valid ones (noconv)
-nocast - don't generate auxiliary casts
-nocode - don't generate the source code for methods
-noctor - suppress the empty constructors
-nodos - turn off check for class files written in DOS mode
-noinner - turn off the support of inner classes
-nolvt - ignore Local Variable Table entries (nolvt)
-nonlb - don't insert a newline before opening brace (nonlb)
-o - overwrite output files without confirmation
-p - send all output to STDOUT (for piping)
-pa - prefix for all packages in generated source files
-pc - prefix for classes with numerical names (default: _cls)
-pe - prefix for unused exception names (default: _ex)
-pf - prefix for fields with numerical names (default: _fld)
-pi - pack imports into one line using .* (packimports)
-pl - prefix for locals with numerical names (default: _lcl)
-pm - prefix for methods with numerical names (default: _mth)
-pp - prefix for method parms with numerical names (default:_prm)
-pv - pack fields with the same types into one line (packfields)
-r - restore package directory structure
-s - output file extension (default: .jad)
-space - output space between keyword (if, while, etc) and expression
-stat - show the total number of processed classes/methods/fields
-t - use spaces for indentation (default: 4)
-t - use tabs instead of spaces for indentation
-v - show method names while decompiling
/**//*
DECOMPILATION REPORT
Decompiled from: D:Program FilesMyEclipse 6.0jrelib t.jar
Total time: 141 ms
Jad reported messages/errors:
Exit status: 1
Caught exceptions:
*/
解决方法:下载Jad,放在jrelib下面,或者设置Jad的全路径名
反编译工具jad简单用法
以下假设jad.exe在c:/java目录下
一、基本用法
Usage: jad [option(s)]
直接输入类文件名,且支持通配符,如下所示。
c:/java/>jad example1.class
c:/java/>jad *.class
结果是将example1.class反编译为example1.jad。将example1.jad改为example1.java即得源
文件。
二、Option -o
不提示,覆盖源文件
三、Option -s
c:/java/>jad -sjava example1.class
反编译结果以.java为扩展名。
四、Option -p
将反编译结果输出到屏幕
c:/java/>jad -p example1.class
将反编译结果重定向到文件
c:/java/>jad -p example1.class>example1.java
五、Option -d
指定反编译的输出文件目录
c:/java/>jad -o -dtest -sjava *.class
异常:The class file version is 49.0<only 45.3 and 46.0 are supported>
解决方法:用UltraEdit-32打开class文件,把第一行第七列的31改为2E,保存再进行反编译.