myeclipse反编译插件安装和JAVA反编译工具

很多情况下我们想知道源码,但是又木有源码的情况下怎么办呢?不急,这里提供一个很好的工具,和myeclipse的反编译JAVA插件的安装。安装过程如下:

 

  1. 安装插件第一步,不说了
    安装第一步
  

  2.
 出现如下name输入:JD-Eclipse。网站输入:
 http://java.decompiler.free.fr/jd-eclipse/update


 
输入插件地址

 主要就是这两部了,其他的很简单了。你懂的!内存太小了,会出现JVM奔溃的情况,那赶紧换个内存吧,现在内存都是白菜价了。附件是JD-GUI和eclipse的jd反编译插件,插件中把features和plugins里的文件全部copy到eclipse对应的安装目录即可。jd-gui这个工具很强大,直接运行exe文件即可,然后点击打开jar文件或者class文件的目录即可反编译出java文件。

jd-gui直接是图像界面的反编译工具,可以打开jar包也可以打开目录,然后点击File-save source或者File-save all souces就可以得到所有的反编译得到的java文件。但是这里会出现前面加上一些注释在第几行,往往这个都是错误的。所以这里你可以使用jad158g.win.zip解压后,把jad.ext放到path环境变量中。然后可以就可以使用jad命令来反编译class文件了。这里举简单的例子:
jad example1.class   //这里得到的后缀名为jad所以不经常使用
jad -sjava example1.class  //这样就可以得到后缀明为java的java文件了这个名称默认是class文件的名称
jad -p example1.class > myexm1.java  这样你可以改变反编译得到的java文件的名称

jad -o -dtest -sjava *.class //这个可以编译test目录下所有的class文件

也可以写成这样jad -o -d test -s java *.class

上面只能反编译test目录下的class文件,不能反编译test目录下所有的子目录的class文件。要这种效果,可以使用下面命令

jad -o -r -sjava -dsrc 'tree/**/*.class'

这样就可以反编译tree目录下所有的class文件了。得到的结果放到src目录下。

jad还有下面这些可以用的变量:

 -a       - annotate the output with JVM bytecodes (default: off)

   -af      - same as -a, but output fully qualified names when annotating

   -clear   - clear all prefixes, including the default ones (can be abbreviated as -cl)

   -b       - output redundant braces (e.g., if(a) { b(); }, default: off)

   -d <dir> - directory for output files (will be created when necessary)

   -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

   -l<num>  - split strings into pieces of maximum <num> chars (default: off)

   -lnc     - annotate the output with line numbers (default: off)

   -lradix<num> - 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)

   -noctor  - suppress the empty constructors

   -nodos   - do not check for class files written in DOS mode (CR before NL, default: check)

   -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<num> - pack imports into one line after <num> imports (default: 3)

   -pv<num> - pack fields with identical types into one line (default: off)

   -pa <pfx>- prefix for all packages in generated source files

   -pc <pfx>- prefix for classes with numerical names (default: _cls)

   -pf <pfx>- prefix for fields with numerical names (default: _fld)

   -pe <pfx>- prefix for unused exception names (default: _ex)

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

   -r       - restore package directory structrure

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

   -s <ext> - 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)

   -stat    - display the total number of processed classes/methods/fields

   -t       - use tabs instead of spaces for indentation

   -t<num>  - use <num> 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)

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
1、本附件包含两个反编译工具、下载解压后有两个文件夹,一个叫做MyEclipse内部反编译,另一个叫做MyEclipse外部反编译。 2、先说外部反编译、这个比较简单、直接打开文件夹、解压里面的文件jd-gui-0.3.3.windows.zip 会得到一个jd-gui.exe应用程序、直接点开即可使用、进入后左上角有个打开文件的按钮、你可以选择你想要打开的class文件或者jar包、右侧会出现相对应的java文件。 3、内部反编译即是MyEclipse插件、下载后里面有两个文件net.sf.jadclipse_3.3.0.jar和jad158g.win.zip,第二个先不用管它。 第一步、我们把第一个jar文件复制到D:\MyEclipse\eclipse\plugins的目录下。 第二步、重启MyEclipse,如果插件安装成功的话在 Windows——>Perference——>Java下面应该会多出一个JadClipse目录。 第三步、我们把第二个文件解压、得到一个jad.exe文件、我们可以把这个文件放在我们想放的任何位置、例如:D:\123\abc这个路径下。随后我们只要在Windows——>Perference——>Java——>JadClipse下设置path to decompiler为jad.exe的全路径,即刚刚你存放的位置。如:D:\123\abc\jad.exe 第四步、如果存在中文反编译的问题则点击Window > Preferences > Java > JadClipse > Misc,将Convert Unicode strings into ANSI strings选项打勾。 经过以上配置、当你再在MyEclipse中打开class文件时、显示的即是java文件。你可以自己选择查看的方式。是从MyEclipse内部查看还是外部查看。希望对你有用。 (注:我用的是MyEclipse6.0版本、别的版本没有测试)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值