This is README file for Jad - the fast Java Decompiler.
Jad home page: http://www.kpdus.com/jad.html
Copyright 2001 Pavel Kouznetsov (jad@kpdus.com).
0. Please read the disclaimer on the Jad home page.
请在JAD主页阅读此免责声明;
1. Installation.
安装.
Unzip jad.zip file into any appropriate directory on your hard drive.
解压缩jad.zip到任意合适硬盘文件夹下。
This will create two files:
创建两个文件夹:
- an executable file named 'jad.exe' (Windows *) 可执行文件
or 'jad' (*n*x)
- this README file
No other setup is required.
不需要其他的设置
2. How to use Jad
怎么样使用JAD
To decompile a single JAVA class file 'example1.class'
type the following:
下面介绍反编译一个简单的class文件
jad example1.class
This command creates file 'example1.jad' in the current directory.
If such file already exists Jad asks whether you want to overwrite it or not.
Option -o permits overwriting without a confirmation.
这个指令在当前文件夹下创建'example1.jad'的文件
如果这样的文件已经存在,JAD会询问是否对此文件进行重写。
选项-o 允许重写不需要进行确认。
You can omit .class extension and/or use wildcards in the names of
input files.
对于输入文件名你可以省略 .class扩展或者利用通配符
Option -s allows to change output file extension:
选项 -s允许改变输出文件扩展:
jad -sjava example1.class
This command creates file 'example1.java'. Be careful when using
options -o and -sjava together, because Jad can accidentally overwrite
your own source files.
这个指令创建'example1.java'文件。特别注意当你同时使用-o和-s选项时,因为JAD会偶然重写你的资源文件。
Jad uses JAVA class name as an output file name. For example, if class
file 'example1.class' contains JAVA class 'test1' then Jad will create
file 'test1.jad' rather than 'example1.jad'. If you want to specify
your own output file name use the output redirection:
JAD利用JAVA类的名字作为输出文件的名字。例如,如果'example1.class'文件中包含JAVA类'test1',Jad会创建文件名字为'test1.jad'而不是'example1.jad'。如果你想要指定具体输出文件名字可以使用输出重定向指令:
jad -p example1.class > myexm1.java
Option -d allows you to specify another directory for output files,
which are created, by default, in the current directory. For example:
选项-d允许你为输出文件指定另外一个文件夹,此文件夹默认在当前文件夹下创建。
jad -o -dtest -sjava *.class
(or jad -o -d test -s java *.class, which has the same effect)
此指令和上一指令有同样的作用。
This command decompiles all .class files in the current directory
and places all output files with extension .java into directory 'test'.
这个指令反编译所有的class字节码文件并且把所有输出文件名添加.java扩展名然后放置在当前文件夹下的test文件夹下。
If you want to decompile the whole tree of JAVA classes,
use the following command:
如果你想反编译整个树型class字节码文件,请利用下面的指令:
jad -o -r -sjava -dsrc tree/**/*.class
This command decompiles all .class files located in all
subdirectories of 'tree' and creates output files in subdirectories
of 'src' according to package names of classes. For example, if file
'src/a/b/c.class' contains class 'c' from package 'a.b', then
output file will have a name 'src/a/b/c.java'.
这个指令反编译src所有树型子文件夹下所有class文件并且根据字节码文件的路径命名输出文件名字。 例如'src/a/b/c.class'包含字节码文件c,输出文件c.java就在'src/a/b/c.java'
Note the use of the "two stars" wildcard ('**') in the previous
command. It is handled by Jad rather than the command shell, so on
UNIX the last argument should be single-quoted:
请前一条指令中的注意两个星('**')的通配符,它被JAD处理,并不是指令脚本,所以在UNIX系统中后一个参数应该是使用单引号的
jad -o -r -sjava -dsrc 'tree/**/*.class'
In a case you want to check the accuracy of the decompilation or just
curious, there is an option -a which tells Jad to annotate the output
with JAVA Virtual Machine bytecodes.
万一你想要检查反编译的准确性或者仅仅是出于好奇,-a选项可以使Jad注释JAVA虚拟机输出的字节码。
Jad supports the inner and anonymous classes.
When Jad expands wildcards in the input file names,
it automatically skips matching inner classes.
On UNIX Jad skips inner classes if there is more than
one class specified in the command line.
Jad looks for inner classes in the directory of their top-level
container class.
Jad支持内部类和匿名类。当Jad输入文件名字中扩展通配符,它会自动的跳过匹配内部类。在UNIX 如果在指令中超过一个指定的类Jad 会跳过内部类。
3. List of the command-line options.
列举命令行指令
Jad accepts the following options:
Jad接受以下操作指令
-a - annotate the output with JVM bytecodes (default: off)
注释虚拟机输出的字节码(默认:关闭)
-af - same as -a, but output fully qualified names when annotating
和-a指令一致,注释时输出完全限定名称
-clear - clear all prefixes, including the default ones (can be abbreviated as -cl)
清楚所有的前缀 包括默认的(可以被简写成 -cl)
-b - output redundant braces (e.g., if(a) { b(); }, default: off)
输出多余的括号
-d
创建输出文件夹(需要的时候被创建)
-dead - try to decompile dead parts of code (if any) (default: off)
尝试反编译死亡的部分代码
-disass - disassemble method bytecodes (no JAVA source generated)
-f - output fully qualified names for classes/fields/methods (default: off)
输出类 属性 方法 的完全限定名
-ff - output class fields before methods (default: after methods)
在属性之前输出方法
-i - output default initializers for all non-final fields
输出所有非final字段
-l - split strings into pieces of maximum chars (default: off)
将字符串分割成最大的字符
-lnc - annotate the output with line numbers (default: off)
注释输出带有行号
-lradix - display long integers using the specified radix (8, 10 or 16)
使用指定基数显示长整数
-nl - split strings on newline character (default: off)
换行符分割字符串
-nocast - don't generate auxiliary casts
不生成辅助代码
-nocode - don't generate the source code for methods
不产生方法的源代码
-noconv - don't convert Java identifiers (default: convert)
不转化java标识符
-noctor - suppress the empty constructors
禁止空参构造
-nodos - do not check for class files written in DOS mode (CR before NL, default: check)
不检查DOS模式下的字节码文件
-nofd - don't disambiguate fields with the same names by adding signatures to their names (default: do)
-noinner - turn off the support of inner classes (default: on)
-nolvt - ignore Local Variable Table information
忽略本地变量表格信息
-nonlb - don't output a newline before opening brace (default: do)
大括号之前不输出换行符
-o - overwrite output files without confirmation (default: off)
重写输出文件不需要确认
-p - send decompiled code to STDOUT (e.g., for piping)
-pi - pack imports into one line after imports (default: 3)
-pv - pack fields with identical types into one line (default: off)
-pa - prefix for all packages in generated source files
-pc - prefix for classes with numerical names (default: _cls)
-pf - prefix for fields with numerical names (default: _fld)
-pe - prefix for unused exception names (default: _ex)
-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)
-r - restore package directory structrure
保存文件夹结构
-radix - display integers using the specified radix (8, 10 or 16)
使用指定的进制显示整数
-s - output file extension (by default '.jad')
输出文件名扩展
-safe - generate additional casts to disambiguate methods/fields (default: off)
产生额外的转换消除方法和字段的分歧
-space - output space between keyword (if/for/while/etc) and expression (default: off)
在关键字(if/for/while/etc)后输出空格键
-stat - display the total number of processed classes/methods/fields
显示处理的总数 类/方法/字段
-t - use tabs instead of spaces for indentation
利用tab代替空格键缩进
-t - use spaces for indentation (default: 4)
利用空格键缩进
-v - display method names being decompiled
显示已经反编译的方法名字
-8 - convert UNICODE strings into 8-bit strings
using the current ANSI code page (Win32 only)
-& - redirect STDERR to STDOUT (Win32 only)
重定向标准对象输出
All single-word options have three formats:
所有的单字符选项的3种格式:
-o - 'reverses' value of an option
选项值得反置
-o+ - set value to 'true' or 'on'
设置参数“true”or"on"
-o- - set value to 'false' or 'off'
设置参数“false”or "off"
You can specify the options you want to be set by default in the environment variable
JAD_OPTIONS.
你可以在JAD_OPTIONS环境中指定默认值选项
For example:
例如:
JAD_OPTIONS=-ff+ -nonlb+ -t+ -space+