Java decompile tool set
2010-12-12 20:00
190 查看
After a long time research on all of the online resources, finally I found the following tools are the most useful tools in Java bytecode decompiling operation:
DJDecompiler
Jad
Javap
JD-GUI
Jode
1. DJDecompiler:(Current verions is 3.11.11.95)
We can get detail information and binary package from http://www.neshkov.com/.
This tool is based on jad, a famous decompiler in J***A reverse-engineering field, DJDecompiler provide an easy-to-use GUI for our end user, if you like command line tools, you can use jad directly instead of this tool, the disadvantage of using this tool is it only supports JDK1.5 and now jad has stopped its developing, that leads to it cannot support the newest Java class file format, such as annotation technology etc.
2. Jad: (Final version is 1.5.8)
This tool is a very famous tool in java reverse engineering field, most of tools are using it as the background engine for decompiling, we can download it from the following URL: http://www.varaneckas.com/jad.
In order to save time for decompiling work for using this tool, here are 2 windows shell scripts for using this tool to decompile a package.
--------------------------------------------------------------------------------------------------------------------------------------------------------
jad_single_jar_decompile.bat
----------------------------------------------
SET SRC_JARNAME=%1
SET CUR_PATH=%cd%
PUSHD %CUR_PATH%
cd %DEC_FOLDER%
if exist %SRC_JARNAME% rd /s/q %DEC_FOLDER%/%SRC_JARNAME%
mkdir %SRC_JARNAME%
cd %SRC_JARNAME%
%J***A_HOME%/bin/jar.exe xf %SRC_FOLDER%/%SRC_JARNAME%.jar
if exist %DES_FOLDER%/%SRC_JARNAME% rd /s/q %DES_FOLDER%/%SRC_JARNAME%
mkdir %DES_FOLDER%/%SRC_JARNAME%
%JAD_HOME%/jad.exe -o -r -d%DES_FOLDER%/%SRC_JARNAME% -sjava %DEC_FOLDER%/%SRC_JARNAME%/**/*.class
REM C:/Java/Decompiler/jad.exe -o -r -dD:/Iris -sjava D:/Private/IrisHubCMServerServer/IrisHubCMServerServer.100914/**/*.class
POPD
--------------------------------------------------------------------------------------------------------------------------------------------------------
Another integrated command line for combining this tool and it can be used to decompile a whole jar file:
--------------------------
@echo off
REM Set environment variables at first and then decompile all of them...
SET J***A_HOME=C:/Java/jdk1.6
SET JAD_HOME=C:/Java/Decompiler
SET SRC_FOLDER=D:/Iris/bin
SET DEC_FOLDER=D:/Iris/dec
SET DES_FOLDER=D:/Iris/src
call single_jar_decompile.bat XXXXX (Name of jar file, .jar is not included).
@echo on
--------------------------------------------------------------------------------------------------------------------------------------------------------
3. javap: this tool is included in jdk package, and it can only be used for decompiling assemble code for java bytecode(class file set), windows shell script is like the following:
------------------------------------------------------------------------
SET CLASSPATH=D:/Iris/dec/XX
javap -private com.xx.collection.SoftHashMap -classpath %CLASSPATH%
------------------------------------------------------------------------
4. JD (current version is 0.3.3)
This is very famous and new tool in J***A reverse-engineering field, and it can decompile the newest java class file even include the sharpest Jdk1.7 file, it has several tools including windows GUI tool and eclipse plugin tool, we can download them from the following URL:
Root URL: http://java.decompiler.free.fr/?q=jdeclipse
Plugin update URL: http://java.decompiler.free.fr/jd-eclipse/update
This tool is the best open source tool compared with the other tools, and its speed is the fastest, it's written by C/C++ and parsing the class file directly, it has no dependency requirement in Java.
5. Jode (Final version is 1.1.2)
This is also a very smart tool in J***A reverse-engineering field, and it has stopped its development, it's written in Java and it has a lot of limitation such as Java package/namespace dependency check or something like this, we can use this tool in 2 ways:
-> Install Jode plugin for Eclipse(only for Eclipse3.0)
Update URL: http://www.technoetic.com/eclipse/update
-> Use jode package in command line: (OS shell scripts)
download Jode URL: http://jode.sourceforge.net/download.php
Windows shell script can be written like this:
java -Djava.ext.dirs=D:/Software/Jode;D:/point/Servers/xxx/lib jode.decompiler.Main --dest D:/Software/Jode/src D:/point/Servers/xx/lib/yy.jar
---------------------------------------------------------------------------------------------------------------------------------------------------
Based on our project's experience, no tool could be perfect during the decompiling process, the best combination and procedure should work like this:
A. First use JD-GUI to get all of the source code of the specified jar file(package).
B. Then create a project with all of the necessary library files(jar files), try to compile the specified java source code, you may find a lot of compiling errors.
C. For some method decompiling cannot succeed issues, try to use jad or DJDecompiler to decompile the specified java class or even the whole jar file, try to compare the specified class method's code and merge them in the best way.
D. For some encoding or charset issue, we'll use the Java bytecode editor tool that will be described in the coming articles.
E. Solve all of the above issues and then you will get the whole source code set finally.
More practice, more experience.
DJDecompiler
Jad
Javap
JD-GUI
Jode
1. DJDecompiler:(Current verions is 3.11.11.95)
We can get detail information and binary package from http://www.neshkov.com/.
This tool is based on jad, a famous decompiler in J***A reverse-engineering field, DJDecompiler provide an easy-to-use GUI for our end user, if you like command line tools, you can use jad directly instead of this tool, the disadvantage of using this tool is it only supports JDK1.5 and now jad has stopped its developing, that leads to it cannot support the newest Java class file format, such as annotation technology etc.
2. Jad: (Final version is 1.5.8)
This tool is a very famous tool in java reverse engineering field, most of tools are using it as the background engine for decompiling, we can download it from the following URL: http://www.varaneckas.com/jad.
In order to save time for decompiling work for using this tool, here are 2 windows shell scripts for using this tool to decompile a package.
--------------------------------------------------------------------------------------------------------------------------------------------------------
jad_single_jar_decompile.bat
----------------------------------------------
SET SRC_JARNAME=%1
SET CUR_PATH=%cd%
PUSHD %CUR_PATH%
cd %DEC_FOLDER%
if exist %SRC_JARNAME% rd /s/q %DEC_FOLDER%/%SRC_JARNAME%
mkdir %SRC_JARNAME%
cd %SRC_JARNAME%
%J***A_HOME%/bin/jar.exe xf %SRC_FOLDER%/%SRC_JARNAME%.jar
if exist %DES_FOLDER%/%SRC_JARNAME% rd /s/q %DES_FOLDER%/%SRC_JARNAME%
mkdir %DES_FOLDER%/%SRC_JARNAME%
%JAD_HOME%/jad.exe -o -r -d%DES_FOLDER%/%SRC_JARNAME% -sjava %DEC_FOLDER%/%SRC_JARNAME%/**/*.class
REM C:/Java/Decompiler/jad.exe -o -r -dD:/Iris -sjava D:/Private/IrisHubCMServerServer/IrisHubCMServerServer.100914/**/*.class
POPD
--------------------------------------------------------------------------------------------------------------------------------------------------------
Another integrated command line for combining this tool and it can be used to decompile a whole jar file:
--------------------------
@echo off
REM Set environment variables at first and then decompile all of them...
SET J***A_HOME=C:/Java/jdk1.6
SET JAD_HOME=C:/Java/Decompiler
SET SRC_FOLDER=D:/Iris/bin
SET DEC_FOLDER=D:/Iris/dec
SET DES_FOLDER=D:/Iris/src
call single_jar_decompile.bat XXXXX (Name of jar file, .jar is not included).
@echo on
--------------------------------------------------------------------------------------------------------------------------------------------------------
3. javap: this tool is included in jdk package, and it can only be used for decompiling assemble code for java bytecode(class file set), windows shell script is like the following:
------------------------------------------------------------------------
SET CLASSPATH=D:/Iris/dec/XX
javap -private com.xx.collection.SoftHashMap -classpath %CLASSPATH%
------------------------------------------------------------------------
4. JD (current version is 0.3.3)
This is very famous and new tool in J***A reverse-engineering field, and it can decompile the newest java class file even include the sharpest Jdk1.7 file, it has several tools including windows GUI tool and eclipse plugin tool, we can download them from the following URL:
Root URL: http://java.decompiler.free.fr/?q=jdeclipse
Plugin update URL: http://java.decompiler.free.fr/jd-eclipse/update
This tool is the best open source tool compared with the other tools, and its speed is the fastest, it's written by C/C++ and parsing the class file directly, it has no dependency requirement in Java.
5. Jode (Final version is 1.1.2)
This is also a very smart tool in J***A reverse-engineering field, and it has stopped its development, it's written in Java and it has a lot of limitation such as Java package/namespace dependency check or something like this, we can use this tool in 2 ways:
-> Install Jode plugin for Eclipse(only for Eclipse3.0)
Update URL: http://www.technoetic.com/eclipse/update
-> Use jode package in command line: (OS shell scripts)
download Jode URL: http://jode.sourceforge.net/download.php
Windows shell script can be written like this:
java -Djava.ext.dirs=D:/Software/Jode;D:/point/Servers/xxx/lib jode.decompiler.Main --dest D:/Software/Jode/src D:/point/Servers/xx/lib/yy.jar
---------------------------------------------------------------------------------------------------------------------------------------------------
Based on our project's experience, no tool could be perfect during the decompiling process, the best combination and procedure should work like this:
A. First use JD-GUI to get all of the source code of the specified jar file(package).
B. Then create a project with all of the necessary library files(jar files), try to compile the specified java source code, you may find a lot of compiling errors.
C. For some method decompiling cannot succeed issues, try to use jad or DJDecompiler to decompile the specified java class or even the whole jar file, try to compare the specified class method's code and merge them in the best way.
D. For some encoding or charset issue, we'll use the Java bytecode editor tool that will be described in the coming articles.
E. Solve all of the above issues and then you will get the whole source code set finally.
More practice, more experience.
相关文章推荐
- Java bytecode edit tool set
- Java_在其他类中调用ToolTipManager的方法,ex.调用ToolTipManager的setInitialDelay()方法
- 动态编译JAVA程序(com.sun.tool.javac)
- java中的TreeSet集合
- java中Map,List与Set的区别 (下) -----better
- java中array list set之间的转换与注意点
- java 深入技术四(Set)
- Java WEB开发时struts标签 显示set内容
- Web Service ERROR: Set JAVA_HOME to the path where the JDK (6.0 or higher) is installed解决方式
- java.sql.SQLException: Before start of result set异常及处理办法
- [Java8 Collection源码+算法+数据结构]-Map+Set(一)
- java中list、set和map 的区别
- How to set field values using Java reflection
- 利用内存分析工具(Memory Analyzer Tool,MAT)分析java项目内存泄露
- java 反射通过set、get 封装到实体Bean
- java学习初探十三之集合—Set详解
- keytool.exe的详解(参数)、命名行生成keystore、java代码生成keystore
- Java中Set的深入研究
- Java 集合类 map set list arraylist hashmap hashtable
- java比较接口Comparable,对象排序存在TreeSet中