Java decompile tool set

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 JAVA 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%
%JAVA_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 JAVA_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 JAVA 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 JAVA 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.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值