JAD参数
2013-01-14 10:44
176 查看
jad命令选项
分类: JAVA2009-01-12
11:41
/*jadclipse*/Jad v1.5.7f. Copyright 2000 Pavel Kouznetsov (kpdus@yahoo.com).
Usage: jad [option(s)] <filename(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 <dir> - 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<num> - split strings into pieces of max <num> 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 <pfx>- prefix for all packages in generated source files
-pc <pfx>- prefix for classes with numerical names (default: _cls)
-pe <pfx>- prefix for unused exception names (default: _ex)
-pf <pfx>- prefix for fields with numerical names (default: _fld)
-pi<num> - pack imports into one line using .* (packimports)
-pl <pfx>- prefix for locals with numerical names (default: _lcl)
-pm <pfx>- prefix for methods with numerical names (default: _mth)
-pp <pfx>- prefix for method parms with numerical names (default:_prm)
-pv<num> - pack fields with the same types into one line (packfields)
-r - restore package directory structure
-s <ext> - 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<num> - use <num> spaces for indentation (default: 4)
-t - use tabs instead of spaces for indentation
-v - show method names while decompiling
首先,看一下jad的帮助提示 -a - 用JVM字节格式来注解输出 -af - 同 -a,但是注解的时候用全名称 -clear - 清除所有的前缀 -b - 输出多于的括号 (e.g., if(a) { b(); }, default: no) -d <dir> - 指定输出文件的文件目录 -dead -试图反编译代码的dead 部分(default: no) -disass - 不用用字节码的方式反编译 (no JAVA source generated) -f - 输出整个的名字,无论是类还是方法 -ff -输出类的成员在方法之前 (default: after methods) -i - 输出所有的变量的缺省的最初值 -l<num> - 将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 -o -r -sjava -dsrc test.class tree目录下的所有*.class文件 jad -o -r -sjava -dsrc tree/**/*.class unix可以表示为:jad -o -r -sjava -dsrc 'tree/**/*.class' 指定输出文件的名字的话,用以下的转移命令 jad -p example1.class > myexm1.java |
1.5.8g支持 jdk1.5,jdk1.6。
说明很多:记住一个万能的命令基本就够用了。jad -sjava -r -8 -o **\*.class
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即得源文件。
二、用命令行反编译整个目录的方法:使用jad批量反编译
jad -o -r -sjava -d src bin/**/*.class
说明:src: 是反编译后的目录;bin:指 package 目录
将bin里面所有的.class反编译到src下面
部分参数详解:
一、Option -o 不提示,覆盖源文件
二、Option -s 指定反编译结果的扩展名(默认为:
.jad)。
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 指定反编译的输出文件目录(用于指定输出文件的目录-java文件)
c:\java\>jad -o -dtest -sjava *.class
五、Option -r 按*.class的包结构输出文件目录
c:\java\>jad -o -r -dtest -sjava d:/1/**/*.class
将d:\1\文件夹下的.class文件按照原程序的包结构反编译到test目录下。
六、Option -8 将Unicode字符转换为ANSI字符串,如果输出字符串是中文的话一定要加上这个参数才能正确显示。
示例:Jad –d c:\\javasource –s .java -8 javatest.class
这条指令将当前目录下的javatest.class反编译为javatest.java并保存在c:\\javasource目录里,其中的提示输出为中文,而不是Unicode代码。
相关文章推荐
- MyEclipse安装jad.exe (Eclipse启动参数说明)
- j2me(javame)开发找不到MIDlet类。请检查jad文件或用—MIDLET参数指定解决方案
- 无效的过程调用或参数: Mid /inc-freehost-function/FreeHostFunction.asp 错误的原因
- 【WEBI专题】如何实现like的参数传入?
- C# 4.0 新特性dynamic、可选参数、命名参数等
- 关于使用Ext.Ajax.request()异步提交中form参数的问题
- Apache+php+mysql的安装与配置 - 之一(Apache的配置参数篇)
- scst target 的iscsi参数设置(配图)
- 9.Action类接收参数(原生的ServletAPI )
- ctags的使用及相关参数介绍
- SharedPreferences共享参数类
- iOS 多参数 ...NS_REQUIRES_NIL_TERMINATION 的写法
- Cstring转int型问题(error C2664: “atoi”: 不能将参数 1 从“CString”转换为“const char *”))
- 【Struts框架】第一节Action-action接受参数
- Python *与** 参数问题
- HandlerMethodArgumentResolver 自定义封装参数bean
- ejs里面如何判断某个参数是不是已经定义了?直接用会抛异常,直接判断也会。
- Struts2接受参数的几种类型和接受复杂类型参数(list<String>和list<Object>)
- iOS基础之NSTimer 以及通知传递参数
- 增强for与可变参数的函数