Author: http://www.cnblogs.com/open-coder/p/3763170.html

With some external tools, we could crack a Java program without any difficult. For some big Java program that obfuscates it’s byte code, we could even restore it’s source code with a little effort.

1) With JD-GUI, you could review java source code from .jar file:


In JD-GUI, we could search class (with full package name), review Uni-code constat string. But it is a older tool that could not catch the latest Java features.

2) Remapping obfuscated class in Jar file

Maybe you already notice that the package names and class names display like a, b, c. Because some one obfuscated this Jar file, the readable symbol replaced by confusion single characters. Such exported source code even will make eclipse confusion, and cause a lots of compiling error need to solve. One way to handle such problem is remapping those classes. You could do this with d2j-jar-remap.
d2j-jar-remap -f -c init.txt -o a-deobf.jar a.jar
init.txt is the configure that remap rules:
# rename class to some unique name!
c a/a/a/q/i=C1_i
c a/a/a/q/g=C2_g
c a/a/a/q/c=C3_c
c a/a/a/q/d=C4_d
c a/a/a/q/b=C5_b
c a/a/a/q/e=C6_e
Then, you open the new jar file with JD-GUI:
 
With such a remapping process, we could avoid some many compile errors in Eclipse, and save a lots of time for us. 

3) Export .java with some tools

a) JAD (Good at handling inner classes)

    jad -sjava example.class                                                                  # de-compile single file
    jad -o -r -sjava -dsrc tree/**/*.class                                                # de-compile a whole folder

b) JD-GUI (a bit old tool, some latest Java 7 features missing)

c) procyon (Java 7 required, latest java features provided)
   java -jar procyon-decompiler-0.5.24.jar AutoCloseableExample.class     # de-compile single file
   java -jar procyon-decompiler.jar -jar myJar.jar -o out                          # de-compile a whole jar

d) cfr (much latest tool, not so good as procyon but better than JAD and JD-GUI for some features)
   java -jar cfr_0_59.jar SwitchTest.class                                               # de-compile single file
   java -jar cfr_0_61.jar java7_jar.jar --outputdir D:/Java/tmp                 # de-compile a whole jar

A package with all tools included could be download from here.

4) Refrence

http://53873039oycg.iteye.com/blog/2015192
http://blog.csdn.net/fireofjava/article/details/8586799
http://blog.sina.com.cn/s/blog_437ff56b010166qb.html
https://code.google.com/p/dex2jar/wiki/DeObfuscateJarWithDexTool

How to Effectively crack .JAR Files?的更多相关文章

  1. jeesite部署到Tomcat后,无法访问,cannot be resolved in either web.xml or the jar files deployed with this application

    HTTP Status 500 - /WEB-INF/views/modules/sys/sysLogin.jsp (line: 3, column: 0) The absolute uri: htt ...

  2. 异常:The absolute uri: http://www.springframework.org/security/tags cannot be resolved in either web.xml or the jar files deployed with this application

    The absolute uri: http://www.springframework.org/security/tags cannot be resolved in either web.xml ...

  3. http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed wit

    异常:The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the j ...

  4. The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application问题解决方案参考

    错误信息:The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the ...

  5. maven jstl The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

    maven jstl 报错 HTTP Status 500 – Internal Server Error Type Exception Report Message The absolute uri ...

  6. exception http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

      http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed w ...

  7. The absolute uri: [http://java.sun.com/jsp/jstl/core] cannot be resolved in either web.xml or the jar files deployed with this application] with root cause异常处理及解释

    1.问题描述: 在web的jsp文件中想用jstl这个标准库,在运行的时候很自然的引用jar包如下: <dependency> <groupId>javax.servlet.j ...

  8. exception The absolute uri: [http://java.sun.com/jsp/jstl/core] cannot be resolved in either web.xml or the jar files deployed with this application

        1.情景展示 eclipse,运行web项目时,报错信息如下: The absolute uri: [http://java.sun.com/jsp/jstl/core] cannot be ...

  9. org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

    编程中遇到:org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot ...

随机推荐

  1. cf1043D. Mysterious Crime(枚举)

    题意 题目链接 给出\(m\)个长度为\(n\)的排列,问有多少连续公共子串 \(m \leqslant 10, n \leqslant 10^5\) Sol 非常naive的一道题然而交了3遍才过( ...

  2. 005hystrix.stream信息聚合Turbine

    1.POM配置 和普通Spring Boot工程相比,仅仅添加了Turbine和Spring Boot Starter Actuator依赖 <dependencies> <!--添 ...

  3. 使用Idea搭建Spring Boot环境

    1.基本安装配置 IntelliJ IDEA搭建SpringBoot的小Demo SpringBoot+IDEA+Maven快速入门 2.

  4. QT5.3.1 Quick 开发(二) 项目类型的选择

    作为一个转行QT开发的新手,面对基于QML的开发时候 看到很多的项目类型感到很困惑,不知道应该怎么选择.如图: 经过研究发现QT widgets Application.QtQuick Applica ...

  5. centOS 7 简单设置(虚拟机)

    1.修改主机名 hostnamectl set-hostname 2.ssh连接慢的问题解决 vim /etc/ssh/sshd_config UseDNS=no GSSAPIAuthenticati ...

  6. Service Discovery in WCF 4.0 – Part 2 z

    Service Discovery in WCF 4.0 – Part 2 In the previous post I discussed about the basic usage of WCF ...

  7. linux下清空文件的几种方式以及对比

    : > filename> filenamecat /dev/null > filename上面这3种方式,能将文件清空,而且文件大小为0而下面两种方式,会让文件中存在空格,导致大小 ...

  8. VMware安装VMware tool后mount /dev/cdrom /mnt成功挂载含rpm包的镜像

    安装虚拟机后如果不安装vmware tool使用mount /dev/cdrom /mnt可以成功挂在含rpm包的镜像,但是安装VMware tool后挂在后/mnt中是错误的内容.查了半天后无果,自 ...

  9. Java实现的有道云笔记图片批量下载工具

    有朋友问我每天哪里找时间写这么多文章. 作为一个程序员,当然要善于利用各种工具提高自己做事情的效率了.如果没有现成的工具,就得自己造. 我写文章一般是在云笔记里编辑,完成之后直接复制粘贴到自媒体平台. ...

  10. 200. Number of Islands + 695. Max Area of Island

    Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surro ...