![]() |
|
Homepage
Jode |
Using the DecompilerAfter you have downloaded the necessary packages, put them into your CLASSPATH:
There is also a batch file for windows and a script file for unix, that you can use. Adapt the CLASSPATH in the file and put it to a convenient location. jar -xvf jode-xxx.jar bin/jode.bat resp. bin/jode Command Line InterfaceThe most powerful way to start JODE's decompiler is the command line interface. Some people don't like long command lines; they should go to the next section.Start the class jode.decompiler.Main with the options. The following command will give a complete list of the available commands: java jode.decompiler.Main --help AWT InterfaceThe AWT Interface looks exactly like the applet. In fact the applet uses the AWT Interface. You start it after setting the CLASSPATH (see above), withjava jode.decompiler.WindowIn the classpath line you can enter a number of jar files, zip files and directories separated by comma(,). Then enter the dot(.) separated name of the class you want to decompile. Press the start button and the decompiled class should
appear. You can save it via the save button.
Swing InterfaceFor the swing interface you need java version 1.2 or the separately available swing package (see download page. You can invoke it like this:java jode.swingui.Main --classpath classes.jarThe swing interface will show the package hierarchie of all classes in the classpath on the left side. You can now select a class and the decompiled code will appear on the right side. Via the menu, you may change the classpath or switch between package hierarchie tree and class inheritence tree. The swing interface is very useful to browse through class files if you don't have the source code. You can also use it to trace bugs in library code. It is not meant to generate java files and so you won't find a save option there. Java InterfaceIf you want to integrate JODE into your own java program, you can use thejode.decompiler.Decompile class. Note that
the GPL only allows you to integrate JODE into GPL programs.
Please contact me if, so I can put you on my link
page and keep you informed about new releases.You may use this stripped down jar archive containing all necessery classes. Using the ObfuscatorTo use the obfuscator you should first create a script file, say myproject.jos. Then you can invoke the obfuscator with:java jode.obfuscator.Main myproject.jos The script file should contain the following options: First select the classpath. You should include everything in the
classpath that you need to run your application. This also includes
the system class files (Sun puts them into classpath = "c:\\jdk1.2\\jre\\lib\\rt.jar","d:\\project\\java", "ftp://www.myorg.org/pub/classlib.jar" Specify where you want the obfuscated classes to go. I recommend to write them directly into a zip file, but you can also give a directory. dest = "obfuscated.zip" You can make JODE write its translation table. This table can be used later to undo the name obfuscation, or you can look there to decrypt exceptions you may get. revtable = "translat.tbl" Select what you want to strip. There are several possibilities, which can be separated by comma(,):
strip = "unreach","lvt","inner" Select the packages and classes you want to obfuscate. You should
only include libraries, that you don't ship separately. If you give a
package, all classes and subpackages are loaded. You can also use
load = new WildCard { value = "org.myorg.myproject" }, new WildCard { value = "org.myorg.mylib*" }, new WildCard { value = "org.otherorg.shortlib" } Select the methods and classes you want to preserve. This is
the main method for applications and the default constructor
<init>.()V for applets, resource bundles and other classes
that you load manually at runtime. preserve = new WildCard { value = "org.myorg.ApplicationClass.main.*" }, new WildCard { value = "org.myorg.AppletClass.<init>.()V" }, new WildCard { value = "org.resources.Bundle*.<init>.()V" }, If you want to obfuscate (or just shorten) the identifier you can specify a renamer. There are currently following renamer available
renamer = new StrongRenamer You can also create a renaming table with the same format as the table written by revtable. The entries in the table get precedence over renamer. Entries not in the table will get renamed by the renamer.
table = "translat.tbl" Now you can select the analyzer. The purpose of the analyzer is to mark all reachable methods, find out which methods needs to get the same name (overloading), and which method names mustn't change (overload of library methods, e.g. nextElement for Enumerations). There are currently two analyzers.
analyzer = new ConstantAnalyzer Pre- and Post transformers transform the bytecode before resp. after the Analyzer runs. Using this default should be okay. You may remove the LocalOptimizer, though, if you have problems. In the future I may add some new post transformers, that do string encryption, flow obfuscation and similar things. If you want to write your own Transformers please contact me, since the next version will change the bytecode interface. post = new LocalOptimizer, new RemovePopAnalyzer |
http://www.informatik.uni-oldenburg.de/~delwi/jode/usage.html, last updated on 30-Jan-2000.