java jad_Java反编译工具 jad安装及使用的指南

引用

教程

解压下载的压缩包到某路径

打开win10的cmd命令行(按键win+r)

进入到jad.exe所在的路径

输入jad example1.class。之后就会在 example1.class所在路径生成一个example1.jad文件。之后用记事本方式打开该文件,或者将example1.jad改为example1.Java,文件内容不变。

或者输入jad -sJava example1.class,反编译结果以.Java为扩展名。

演示

我的jad.exe和Test.class放在桌面。

c31779f8c2ec770832440be973907252.png

jad常见用法

一、基本用法

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 -o

指定反编译的输出文件目录

c:\Java>jad -o -dtest -sJava *.class

jad详细用法

Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov (jad@kpdus.com).

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)

-lradix- display long integers using the specified radix

-nl - split strings on newline characters (splitstr)

-noconv - don’t convert Java identifiers into valid ones (noconv)

-nocast - don’t generate auxiliary casts

-noclass - don’t convert .class operators

-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

-nofd - don’t disambiguate fields with the same names (nofldis)

-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

-radix- display integers using the specified radix (8, 10, or 16)

-s - output file extension (default: .jad)

-safe - generate additional casts to disambiguate methods/fields

-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

-8 - convert Unicode strings into ANSI strings (ansi)

-& - redirect STDERR to STDOUT

675cd3de3e9e250f5cb2d30650449a9b.png

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、付费专栏及课程。

余额充值