jad反编译成java,Jad java反编译指令

Jad是一个Java反编译器,能够将.class文件反编译为.java源代码。本文档详细介绍了Jad的安装、使用方法和命令行选项。用户可以通过解压jad.zip文件开始安装,然后使用jad命令来反编译单个或多个class文件,输出文件可指定扩展名、输出目录等。Jad还支持内部类、匿名类,以及各种输出格式和选项的自定义,如注释字节码、输出冗余括号等。
摘要由CSDN通过智能技术生成

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+

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
JAD本身是一个命令行工具,没有图形界面,我之前上传的Cavaj Java Decompiler就是以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   命令行选择的列表   -a - 用JVM字节格式来注解输出   -af - 同 -a,但是注解的时候用全名称   -clear - 清除所有的前缀   -b - 输出多于的括号 (e.g., if(a) { b(); }, default: no)   -d   - 指定输出文件的文件目录   -dead -试图反编译代码的dead 部分(default: no)   -disass - 不用用字节码的方式反编译 (no JAVA source generated)   -f - 输出整个的名字,无论是类还是方法   -ff -输出类的员在方法之前 (default: after methods)   -i - 输出所有的变量的缺省的最初值   -l - 将strings分割指定数目的块的字符 (default: no)   -lnc - 将输出文件用行号来注解 (default: no)   -nl - 分割strings用新行字符 newline character (default: no)   -nodos -不要去检查class文件是否以dos方式写 (CR before NL, default: check)   -nocast - 不要生辅助文件   -nocode -不要生方法的源代码   -noconv - 不要转换java的定义符 (default: do)   -noctor - 不允许空的构造器存在   -noinner -关掉对内部类的支持 (default: turn on)   -nolvt - 忽略局部变量的表信息   -nonlb - 不要输出一个新行在打开一个括号之前 (default: do)   -o - 无需确认直接覆盖输出 (default: no)   -p - 发送反编译代码到标准输出 STDOUT (e.g., for piping) 很多人困扰,反编译之后中文显示乱码问题,其实显示的不是乱码,是unicode字符。 -8 - 将Unicode字符转换为ANSI字符串,如果输出字符串是中文的话一定要加上这个参数才能正确显示。 最常用的反编译指令如下所示: Jad –d D:\javasource –s .java -8 javatest.class 这条指令将当前目录下的javatest.class反编译javatest.java并保存在D:\javasource目录里,其中的提示输出为中文,而不是Unicode代码。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值