JAVA批量反编译——jad

1.先在http://www.varaneckas.com/jad下载jad.exe文件;
2.将jad添加到环境变量;
3.把要反编译的jar要winrar解压到classes目录;
4.执行jad命令进行反编译

例如:将需要反编译的多个文件放在指定路径下。为了方便操作,我将文件放在C盘根目录下的classes文件夹中。打开运行—>输入cmd—>输入cd c:/,将路径指到C盘根路径下。

再输入编译命令,命令:jad -o -r -s java -d src classes/**/*.class

就能在根目录下发现是src的文件夹,里面都是反编译后的java源文件。

jad命令的参数含义如下:
-o:覆盖旧文件,而且不用提示确认。
-r:重新加载生成包结构。
-s (java):定义输出文件的扩展名。jad为默认扩展名,我们反编译后当然是要.java源文件了。
-d:输出文件的目录。src表示反编译后的所有文件都放在src目录下。
classes//*.class:classes是需要反编译的文件夹的名字,整个表示classes目录下的所有class文件。你也可以写成这样/*.class,这表示当前目录及其子目录下所有的class文件(包含所有的子目录)。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
反编译工具jad简单用法 jad 是应用最广泛的java 反编译工具;其本身是命令行工具;其他很多用具是在jad内核的基础上加了一个图形界面;比如我上传的资源、Cavaj Java Decompiler   以下假设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) 对于很多人说jad反编译后中文显示乱码,其实显示的是unicode字符;jad命令中有可以让中文正常显示的 -8 - 将Unicode字符转换为ANSI字符串,如果输出字符串是中文的话一定要加上这个参数才能正确显示。 最常用的反编译指令如下所示: Jad –d c:\\javasource –s .java -8 javatest.class 这条指令将当前目录下的javatest.class反编译javatest.java并保存在c:\\javasource目录里,其中的提示输出为中文,而不是Unicode代码。
java反编译工具jad 1.5.8g支持 jdk1.5,jdk1.6。说明很多记住一个万能的命令基本就够用了。jad -sjava -r -8 -o **\*.class ---------------This is README file for Jad - the fast Java Decompiler.Jad home page: http://www.kpdus.com/jad.htmlCopyright 2001 Pavel Kouznetsov (jad@kpdus.com).0. Please read the disclaimer on the Jad home page.1. Installation.Unzip jad.zip file into any appropriate directory on your hard drive.This will create two files: - an executable file named 'jad.exe' (Windows *) or 'jad' (*n*x) - this README fileNo other setup is required.2. How to use JadTo decompile a single JAVA class file 'example1.class' type the following: jad example1.classThis 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.You can omit .class extension and/or use wildcards in the names ofinput files.Option -s allows to change output file extension: jad -sjava example1.classThis command creates file 'example1.java'. Be careful when usingoptions -o and -sjava together, because Jad can accidentally overwriteyour own source files.Jad uses JAVA class name as an output file name. For example, if classfile 'example1.class' contains JAVA class 'test1' then Jad will createfile 'test1.jad' rather than 'example1.jad'. If you want to specifyyour own output file name use the output redirection: jad -p example1.class > myexm1.javaOption -d allows you to specify another directory for output files,which are created, by default, in the current directory. For example: 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 <

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值