文章目录
- 下载
- 反编译
- 其他
- 官网地址
- 命令参数
反编译是有些应用场景的。
方法也不只一种。
1、jad.exe实现反编译。
2、阿里arthas监控工具带。
3、idea直接打开.class文件就是反编译(是不是很方便)。
这里只说jad.exe这种。
下载
官网下载地址(这是jad158g.win版本):
https://varaneckas.com/jad/jad158g.win.zip
解压,放到文件夹中,可以放到java同目录,便于寻找。
然后配置环境变量。path中添加jad.exe所在的文件路径即可。
如: D:\Program Files\jad\jad158g.win
反编译
打开cmd,输入:jad 看是否有正确返回
反编译:jad ./demo.class
会在同目录生成demo.jad(注:扩展名默认是.jad)
可以通过-s(-s - output file extension (default: .jad))指定扩展名。
jad -sjava ./demo.class
注: 不要用-sJava(网上看有写作大写的Java的,是不对的)。
其他
官网地址
https://varaneckas.com/jad/
选最上面的版本就行,个人选的是这个。
Jad 1.5.8g for Windows 9x/NT/2000 on Intel platform (238600 bytes).
命令参数
直接复制一份了,也不翻译,就是为了看着方便。
PS C:\Users\PC\Desktop> jad
Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov (jad@kpdus.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)-lradix<num>- 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 <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-radix<num>- display integers using the specified radix (8, 10, or 16)-s <ext> - 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<num> - use <num> 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