读书人

myeclipse反编译插件装配和JAVA反编译

发布时间: 2012-07-23 09:42:19 作者: rapoo

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

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

?

    安装插件第一步,不说了
? ?myeclipse反编译插件装配和JAVA反编译工具??
? 2.?出现如下name输入:JD-Eclipse。网站输入:?http://java.decompiler.free.fr/jd-eclipse/update

?myeclipse反编译插件装配和JAVA反编译工具
?主要就是这两部了,其他的很简单了。你懂的!内存太小了,会出现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)

读书人网 >Eclipse开发

热点推荐