git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1079 379699f6-c40d-0410-875b-85095c16579ebranch_1_1
parent
ec599fb69b
commit
ea7bac2872
@ -1,106 +1,105 @@ |
|||||||
takes class-files as input and produces something similar to the |
JODE (Java Obfuscator/DEcompiler) |
||||||
original java-File. Of course this can't be perfect: There is no way |
|
||||||
to produce the comments or the names of local variables (except when |
This is a decompiler and optimizer for java I have written in my spare |
||||||
compiled with <code>-g</code>) and there are often more ways to write |
time. It takes class files as input and produces something similar to |
||||||
the same thing. But it does its job quite well.</P> |
the original java file. Of course this can't be perfect: There is no |
||||||
|
way to produce the comments or the names of local variables (except |
||||||
<h2>Quick Test</h2> |
when the java files were compiled with `-g') and there are often more |
||||||
I have now an applet interface to the decompiler. |
ways to write the same thing. But jode does its job quite well. |
||||||
<a href="jode-applet.html">Check it out</a>. |
|
||||||
|
Please note that most software licenses forbid to decompile class |
||||||
<h2>How to get it</h2> |
files. Use this decompiler only, if you have legal rights to |
||||||
<P>You can donwload the files in zip form. |
decompile the class (e.g. on your own code). |
||||||
The <a href="jode_src.zip">sources</a> contain only the |
|
||||||
<code>java</code> files, the <a href="jode_cls.zip">classes</a> |
The features of the decompilers are: |
||||||
contain only the <code>class</code> files. </p> |
|
||||||
|
* Systematic flow analysis, that can decompile almost every java code |
||||||
<p>I also have a <a href="jode.tar.gz">tar.gz file</a> containing only |
without the need of goto (which doesn't exists in java). |
||||||
the <code>RCS</code> directories. This is the form I maintain the |
* Type deduction, that can guess the type of local variables, even if |
||||||
project, but you probably need unix and a few tools to use them.</p> |
it is an interface type that doesn't occur in the bytecode. |
||||||
|
* Handling of inner and anonymous classes. |
||||||
<p>There are also some <a href="snapshot/">snapshots</a> that have new |
* Different indentation styles available. |
||||||
features like inner and anonymous classes. </p> |
* It can decompile itself (194 classes) without a single error. |
||||||
|
* It can decrypt strings on the fly, that were encrypted by an obfuscator. |
||||||
<p><a href=".">Click here</a> to browse the files online. |
|
||||||
</p> |
Known bugs of the decompiler: |
||||||
|
|
||||||
|
- If not all dependent classes can be found, the verifier (which is |
||||||
|
run before decompilation starts) may exit with a type error. You |
||||||
<h2>How to use it</h2> |
can decompile it with --verify=off, but take the warning serious, |
||||||
|
that the types may be incorrect. There's sometimes no way to guess |
||||||
<p>I have some simple step by step pages. There are three |
the right type, if you don't have access the full class hierarchie. |
||||||
possibilities: |
|
||||||
<ul> |
But if you don't have the dependent classes, you can't compile the |
||||||
<li> <a href="jode-useapplet.html"> Using the applet version</a>. |
code again, anyway. |
||||||
This can make problem due to java's security policy, but is the |
|
||||||
simplest way and works on most platforms. |
- There may be situations, where the code doesn't understand complex |
||||||
</li> |
expressions. In this many ugly temporary variables are used, but the |
||||||
<li> If you use Windows, you should look on <a |
code should still be compileable. This does especially happen when |
||||||
href="jode-win.html">this page</a>.</li> |
you compile with `-O' flag and javac has inlined some methods. |
||||||
<li> Unix users should look on <a href="jode-unix.html">this page</a>. |
|
||||||
</ul> |
- Sometimes this program may exit with an Exception or |
||||||
|
produce incorrect code. If it produced incorrect code the |
||||||
<h2>Known bugs</h2> |
code probably can't be compiled, so that the error can be easily spotted. |
||||||
|
If you have one of these problems (they are very rare now), I would |
||||||
<p>There may be situations, where the code doesn't understand complex |
be very interested in a bug report (including the .class file, if |
||||||
expressions. In this many ugly temporary variables are used, but the |
possible).</p> |
||||||
code should still be compileable. This does especially happen when |
|
||||||
you compile with `-O' flag and javac has inlined some methods. </p> |
- Sometimes it generates some GOTO expression and labels. This |
||||||
|
shouldn't happen any more with javac or jikes. But some flow |
||||||
<p>Sometimes this program may exit with an <code>Exception</code> or |
obfuscator likes Zelix Klassmaster may provoke this. In |
||||||
produce incorrect code. Most time the code can't be compiled, so that |
that case you can run the Obfuscator first. |
||||||
it can be easily spotted. If you have one of these problems (except |
|
||||||
those that occur on some of the <code>jode.test</code> files, I would |
|
||||||
be very interested in a bug report (including the <code>class</code> |
|
||||||
file, if possible).</p> |
|
||||||
|
|
||||||
<p>Sometimes it generates some <code>GOTO</code> expression and |
|
||||||
labels. This can't be compiled, but shouldn't happen any more with |
|
||||||
javac or jikes.</p> |
|
||||||
|
|
||||||
<p>It doesn't handle inner and anonymous classes, yet. You can |
|
||||||
decompile them separately, though (use `<code>+$</code>' switch under |
|
||||||
jikes), but there is a bug in javac, so that a final variable is twice |
|
||||||
initialized. If you encounter this problem just remove the doubled |
|
||||||
line by hand. </p> |
|
||||||
|
|
||||||
<p><b>New!</b> The latest <a href="snapshot">snapshot</a> can handle |
|
||||||
inner and anonymous classes.</p> |
|
||||||
|
|
||||||
|
|
||||||
<h2>Why did I wrote it?</h2> |
|
||||||
|
|
||||||
<p>Someday I found <code>guavad</code>, a disassembler for java byte |
|
||||||
code (it does similar things like <code>javap -c</code>). I used |
|
||||||
it on a class file, and found that it was possible to reconstruct the |
|
||||||
original java code. First I did it by hand on some small routines, |
|
||||||
but I soon realized that it was a rather stupid task, and that I could |
|
||||||
write a <a href="../perl/dasm_to_java.perl"><code>perl</code> script</a> |
|
||||||
that does the same. At the end of the next day I had a working |
|
||||||
decompiler.</p> |
|
||||||
|
|
||||||
<p>Now while it was working, it was not easy to use. You had to |
|
||||||
decompile the code first with a disassembler, cut the method, you |
|
||||||
wanted to decompile and then run the perl script on it. So I decided |
|
||||||
to get some information of the class files and do this all |
|
||||||
automatically. I decided to write it in <code>java</code> now, |
|
||||||
because it suited best.</p> |
|
||||||
|
|
||||||
<p>Just for the records: the java code is now more than 50 times |
The features of the obfuscator are: |
||||||
bigger than the original perl script and is still growing.</p> |
* Modular design, you can swap whole classes via the script file. |
||||||
|
* Strong analysis, that optimizes fields, expressions that are known |
||||||
|
to be constant (and reverts the flow obfuscation of Zelix Klassmaster) |
||||||
|
* Can also be used as Optimizer, without any obfuscation at all, it |
||||||
|
will preserve the local variable table and line number table. |
||||||
|
* Many different renaming options, you can also simply add your own. |
||||||
|
|
||||||
<h2>License</h2> |
|
||||||
|
|
||||||
<p>This code is under GNU GPL. That basically means, that you can copy |
PRELIMINARIES: |
||||||
or modify this code, as long as you put all your modification under |
|
||||||
the GPL again. <A HREF="http://www.gnu.org/copyleft/gpl.html"> Look |
|
||||||
here for the complete license</a>.</p> |
|
||||||
|
|
||||||
<hr> |
You need java jdk1.2 or above, and the gnu getopt package. |
||||||
|
|
||||||
<p><A HREF="mailto:Jochen.Hoenicke@Informatik.Uni-Oldenburg.DE"> |
You should also have the jode-x.x.xx.jar file. Read INSTALL how to |
||||||
http://www.informatik.uni-oldenburg.de/~delwi/jode/jode.html</A>, last |
compile it yourself. |
||||||
updated on <em>17-Jun-1999</em>.</p> |
|
||||||
|
|
||||||
</body> |
Jode also works with jdk1.1, you need the sun collection classes and |
||||||
</html> |
swing in that case and you have to compile the jar-file yourself |
||||||
|
|
||||||
|
|
||||||
|
USAGE: |
||||||
|
|
||||||
|
First set the classpath. It should contain the jar file |
||||||
|
jode-x.x.xx.jar, the gnu getopt package and the sun collection package |
||||||
|
for 1.1. For the swingui program you also need swing in you classpath. |
||||||
|
|
||||||
|
You can then decompile a class file with: |
||||||
|
java jode.Decompiler --classpath jarfile1.jar,jarfile2.jar org.package.Class |
||||||
|
|
||||||
|
For a graphical user interface based on swing try: |
||||||
|
java jode.swingui.Main --classpath jarfile1.jar |
||||||
|
|
||||||
|
The obfuscator/deobfuscator can be run with: |
||||||
|
java jode.obfuscator.Main --script obfuscation.script |
||||||
|
|
||||||
|
See XXXX for more information about the script syntax. |
||||||
|
|
||||||
|
HISTORY: |
||||||
|
|
||||||
|
Someday I found guavad, a disassembler for java byte code (it does |
||||||
|
similar things like `javap -c'). I used it on a class file, and found |
||||||
|
that it was possible to reconstruct the original java code. First I |
||||||
|
did it by hand on some small routines, but I soon realized that it was |
||||||
|
a rather stupid task, and that I could write a perl script, that does |
||||||
|
the same. At the end of the next day I had the first working |
||||||
|
decompiler. |
||||||
|
|
||||||
|
Now while it was working, it was not easy to use. You had to |
||||||
|
decompile the code first with a disassembler, cut the method, you |
||||||
|
wanted to decompile and then run the perl script on it. So I decided |
||||||
|
to get some information of the class files and do this all |
||||||
|
automatically. I decided to write it in java now, because it suited |
||||||
|
best. |
||||||
|
Loading…
Reference in new issue