diff --git a/jode/doc/Makefile.am b/jode/doc/Makefile.am deleted file mode 100644 index b0ce2fe..0000000 --- a/jode/doc/Makefile.am +++ /dev/null @@ -1,14 +0,0 @@ -## Input file for automake to generate the Makefile.in used by configure - -EXTRA_DIST = \ -applet.html \ -download.html.in \ -history.html \ -jode.html \ -license.html \ -links.html \ -usage.html \ -myproject.jos \ -dasm_to_java.perl \ -gimp/jode-logo.xcf \ -jode-logo.gif diff --git a/jode/doc/applet.html b/jode/doc/applet.html deleted file mode 100644 index 0b8f1d3..0000000 --- a/jode/doc/applet.html +++ /dev/null @@ -1,100 +0,0 @@ - - - -Java Optimize and Decompile Environment (JODE) - - - - - - - - - -
JODEPowered by SourceForge
Best viewed with Any
-      Browser
- - - - -
- -

The JODE Applet

- -

Please be patience, loading the applet may take some time.

- -
- - - - -

Sorry you need a java enabled browser to test a java applet ;-)

-

Don't read the rest, it only contains information about the applet.

-
-

- -

Press the start button to decompile Michael's -Plasma applet (and give the decompiler some time to download the -jar file).

- -You may change the classpath to point to a zip or jar file of your -choice, using a similar syntax. Use %3a instead of a -colon `:' in the url. You can also point it to a directory containing -the class-files (include a slash `/' at the end in this case), but -this is not recommended, since it is very slow. You may give -multiple entries in the class path field separated by a comma.

- -You can't use this applet for local files; the class files must be on -a server that is accessible from sourceforge. You can try to give -local filenames directly without the load.php wrapper, but that is -probably forbidden by your browser. Most browser only allow loading -files from the same server as the applet, and this is the reason why -you have to use such a cryptic URL.

- -Save probably doesn't work, because it is forbidden by your browser.

- - - - - - - - diff --git a/jode/doc/applet.php b/jode/doc/applet.php index cd6b70a..14c07c5 100644 --- a/jode/doc/applet.php +++ b/jode/doc/applet.php @@ -6,7 +6,7 @@
- +

Sorry you need a java enabled browser to test a java applet ;-)

Don't read the rest, it only contains information about the applet.

@@ -19,18 +19,20 @@ Plasma applet (and give the decompiler some time to download the jar file).

You may change the classpath to point to a zip or jar file of your -choice, using a similar syntax. Use %3a instead of a -colon `:' in the url. You can also point it to a directory containing +choice, using a similar syntax. Only http and ftp addresses are supported. +The file must be available from the world wide web. In fact you download it +from Sourceforge and Sourceforge gets it from the given address. This hack +is necessary, because Java's security policy doesn't allow applets to contact +a different server. You can also point the classpath to a directory containing the class-files (include a slash `/' at the end in this case), but this is not recommended, since it is very slow. You may give multiple entries in the class path field separated by a comma.

-You can't use this applet for local files; the class files must be on -a server that is accessible from sourceforge. You can try to give -local filenames directly without the load.php wrapper, but that is +You can't use this applet for local files. You can try to give +local filenames directly without going through Sourceforge, but that is probably forbidden by your browser. Most browser only allow loading files from the same server as the applet, and this is the reason why -you have to use such a cryptic URL.

+you have to use such a weird URL.

Save probably doesn't work, because it is forbidden by your browser.

diff --git a/jode/doc/bluesky.html b/jode/doc/bluesky.html deleted file mode 100644 index c0df044..0000000 --- a/jode/doc/bluesky.html +++ /dev/null @@ -1,136 +0,0 @@ - - - -Java Optimize and Decompile Environment (JODE) - - - - - - - - - -
JODEPowered by SourceForge
Best viewed with Any
-      Browser
- - - - -
- -

Blue Sky

- -

This section contains features that I think would be great to have, -but are also very hard to implement. The name of the section is -inspired, by Mozilla.

- -

Currently this are all my own ideas. But if you send me an idea -for an interesting feature, I will add it to this list.

- -

Outline inlined methods

- -

If java gets called with `-O' switch, it inlines methods, -that are private, final, or static and contain no loops. When -decompiling this it sometimes produces really ugly code. The right -way to solve this would be to outline the code again. This is -possible but requires to find the inlined method.

- -

The name `outline' was suggested by Michael. -

- -

Better names of local variables

- -

The local variable naming is very stupid. Even with pretty it just -names the variable after the type with a unifying number appended. A -method containing very much objects of the same type looks very -ugly.

- -

My plan is looking at the assignments. If we have locals in -assignments -

-int l_1 = array.length
-String l_2 = object.getName()
-
-we could name them "length" and "name". If we -have assignments: -
-MenuItem local_1 = new MenuItem("Open");
-MenuItem local_2 = new MenuItem("Save");
-
-good names would be miOpen and miSave.

- -

It is currently possible to assign a (hint name,type) pair -to a local. If the type matches, the local will be named after -hint name. This could be extended by giving them several -weighted hints and constructing the name in an intelligent way.

- -

Better deobfuscation features

-

First there should be a good Renamer: Methods that simply -return a field value should be renamed to getFieldName. -Fields should be named after their type, maybe also by assignments -(see section about local variable names).

- -

The deobfuscator should detect inner and anonymous variables, -synthetic methods and so on, and rename them accordingly.

- -

Handling of Class.forName in obfuscator

-

The obfuscator should detect Class.forName constructs (and -similarly for methods and fields) and if their parameters are constant -it should change the parameter according to the rename function.

- -

Merging javadoc comments

-

It would be nice if the decompiler could merge the javadoc comments -into the class file. More and more people use javadoc to comment the -public api of their java classes. It shouldn't be too difficult to -copy them back into the java code.

- -

This doesn't need to be built into the decompiler. A script that takes -the javadoc pages and the decompiled code can easily merge them.

- - - - - - - - diff --git a/jode/doc/download.html b/jode/doc/download.html deleted file mode 100644 index bc0e42e..0000000 --- a/jode/doc/download.html +++ /dev/null @@ -1,104 +0,0 @@ - - - -Java Optimize and Decompile Environment (JODE) - - - - - - - - - -
JODEPowered by SourceForge
Best viewed with Any
-      Browser
- - - - -
- -

Download

- -

Click here to download -the latest released source code of JODE . You need several -other packages to build JODE, check the links page.

- -

The simplest way to get it, especially for non unix users, is in -precompiled form, though. I have two jar archives at the ftp server. You may -need to press shift while clicking on the link, depending on your -browser. - - -

-

- -

CVS Repository

- -

You can get the latest sources from the CVS -repository. They may not always compile, though. If you want an -older version you can use the -r option:

- - -

To build the sources from CVS change to the main directory where -the configure.in file resides and run - -

aclocal && automake -a && autoconf
- -Afterwards follow the instruction in the INSTALL file.

- - - - - - - - - diff --git a/jode/doc/download.php b/jode/doc/download.php index 53000c7..bb7376e 100644 --- a/jode/doc/download.php +++ b/jode/doc/download.php @@ -1,41 +1,34 @@

Download

-

Click here to download -the latest released source code of JODE . You need several -other packages to build JODE, check the links page.

+

Jode is available in the download area in source or +binary form. For compiling the source code, you need several other +packages, check the links page. You +need a unix like environment for compilation.

The simplest way to get it, especially for non unix users, is in -precompiled form, though. I have two jar archives at the ftp server. You may -need to press shift while clicking on the link, depending on your -browser. +precompiled form, though. There are two jar archives in the download +area:

-jode-".$version.$what.".jar"; -} ?> +

CVS Repository

You can get the latest sources from the CVS -repository. They may not always compile, though. If you want an -older version you can use the -r option:

+repository. Follow the instruction on that page; use +jode as modulename. If you want to checkout a +specific version you can use the -r option:

+ +
  • -r jode_1_0_93: checks out the version 1.0.93
  • +
  • -r branch_1_1: checks out the latest version in the +1.1 series.
  • To build the sources from CVS change to the main directory where the configure.in file resides and run @@ -43,5 +36,5 @@ the configure.in file resides and run

    aclocal && automake -a && autoconf
    Afterwards follow the instruction in the INSTALL file.

    - + diff --git a/jode/doc/faq.php b/jode/doc/faq.php new file mode 100644 index 0000000..5aa6d74 --- /dev/null +++ b/jode/doc/faq.php @@ -0,0 +1,72 @@ + + +

    FAQ - Frequently Asked Questions

    + +This is a list of some questions that pop up from time to time. + +

    Decompiler issues

    + +

    The decompiler crashes with a VerifyException, what can I do?

    + +

    The class isn't verifiable, probably because there is not enough +information about used classes. See the question about the +classpath.

    + +

    This could also be caused by malicious bytecode, or because there +is a bug in Jode's verifier.

    + +

    What should be included in the classpath?

    + +

    Jode needs to know the full class hierarchie to guess the types. +This includes not only the classes in the program, but also the +libraries used by the java program, even the Java runtime library. +You should set the classpath to include all these classes.

    + +

    If you don't specify the classpath on the command line, Jode uses +the same as your Java Virtual Machine.

    + +

    As last resort, if Jode can't find a class in the classpath it uses +reflection to ask the Virtual Machine. This works quite well, but +loading classes can have side effects, e.g. when AWT classes are +loaded, an AWT thread is created, even though Jode doesn't need +it.

    + +

    Why doesn't Jode decompile my inner class +MyClass$Inner.class?

    + +

    You should decompile the outermost class (MyClass in +this case). The produced code contains the inner class.

    + +

    Obfuscator issues

    + +

    What should be included in the classpath?

    + +

    The program, all libraries, the Java runtime library. Don't omit a +library even when you don't want to obfuscate it.

    + +

    What should I preserve

    + +

    The most common mistake is to preserve a class. In most cases this +is not what you want. This only makes sure the class won't be +renamed, it doesn't prevent it from being stripped. Instead you +should preserve methods and constructors. The constructor is just a +method with the special name <init&rt;.

    + +

    Another common mistake is to omit the type +signature, e.g. to preserve Class.main instead of +Class.main.([Ljava/lang/String;)V. That doesn't work. If +you don't want to care about the format of the type signature use a +wildcard as in Class.main.*.

    + +

    What is a type signature

    + +

    The type signature is a machine readable representation of a java +type that is used all over in java bytecode. The JDK ships a command +named javap. With java -s you can lists the fields +and methods of a class with their type signatures.

    + +

    If you are interested in the format of type signatures read the +Java Virtual Machine Specification, Chapter 4.3 Descriptors

    + + + diff --git a/jode/doc/feedback.html b/jode/doc/feedback.html deleted file mode 100644 index 29a52d4..0000000 --- a/jode/doc/feedback.html +++ /dev/null @@ -1,83 +0,0 @@ - - - -Java Optimize and Decompile Environment (JODE) - - - - - - - - - -
    JODEPowered by SourceForge
    Best viewed with Any
-      Browser
    - - - - -
    - - - -

    Feedback

    - -

    You can report bugs to the bug forum. -Please send me a short notice if you add a bug.

    - -

    You can contact me per email via hoenicke at -users.sourceforge.net. Please mention jode in the -subject.

    - -

    There is a mailing list. Check this page for subscription informations.

    - - - - - - - - - - - - diff --git a/jode/doc/feedback.php b/jode/doc/feedback.php index e415db7..ee5b665 100644 --- a/jode/doc/feedback.php +++ b/jode/doc/feedback.php @@ -2,16 +2,13 @@

    Feedback

    -

    You can report bugs to the bug forum. -Please send me a short notice if you add a bug.

    +

    You can report bugs to the bug forum.

    -

    You can contact me per email via You can contact me by email via hoenicke at -users.sourceforge.net. Please mention Jode in the +users.sourceforge.net. Please mention jode in the subject.

    There is a mailing list. Check this page for subscription informations.

    - - diff --git a/jode/doc/footer.inc b/jode/doc/footer.inc index 1294ad1..bb3b3d5 100644 --- a/jode/doc/footer.inc +++ b/jode/doc/footer.inc @@ -2,8 +2,8 @@ All trademarks and copyrights on this page are properties of their respective owners.
    - Last updated on 3-Jul-2000, - Copyright © 1998-2001 by Jochen Hoenicke.
    + Last updated on 29-May-2001, + Copyright © 1998-2001 by Jochen Hoenicke. Canonic URL is http://jode.sourceforge.net/
    diff --git a/jode/doc/header.inc b/jode/doc/header.inc index 17671d2..ed76c8f 100644 --- a/jode/doc/header.inc +++ b/jode/doc/header.inc @@ -2,7 +2,7 @@ if (! $extension) { $extension = "php"; } -$version="1.0.93"; +$version="1.1"; function selflink($link) { global $extension; @@ -25,7 +25,7 @@ function sflink($link) { Java Optimize and Decompile Environment (JODE) - + @@ -42,7 +42,7 @@ body { color:#000000; background-color: #FFFFFF; } -
    JODE - - -Java Optimize and Decompile Environment (JODE) - - - - - - - - - -
    JODEPowered by SourceForge
    Best viewed with Any
-      Browser
    - - - - -
    - -

    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. So I wrote a -small perl script that -did this process automatically. At the end of the next day I had my -first working decompiler.

    - -

    Now while the perl script is working, it is not easy -to use. You have to decompile the code first with a disassembler, cut -out the code of a single method, and run the perl script on it. I -decided to get the bytecode directly out of the class files and do -this all automatically. I decided to write it in java -now, because it suited best.

    - -

    Just for the records: the java code is now more than 50 times -bigger than the original perl script and is still growing.

    - - - - - - - - - diff --git a/jode/doc/index.html b/jode/doc/index.html deleted file mode 100644 index 6aef02d..0000000 --- a/jode/doc/index.html +++ /dev/null @@ -1,134 +0,0 @@ - - - -Java Optimize and Decompile Environment (JODE) - - - - - - - - - -
    JODEPowered by SourceForge
    Best viewed with Any
-      Browser
    - - - - -
    - - - -

    JODE is a java package containing a decompiler and an -optimizer for java. This package is freely available under the GPL -(see license).

    - -

    The decompiler takes class files as input and produces -something similar to 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 when compiled with debuging) and there are -often more ways to write the same thing. But JODE does its job -quite well, so you should give it a try: start -the applet.

    - -

    The optimizer transforms class files in various ways with -can be controlled by a script file. It supports the following -operations:

    -
      -
    • Renaming class, method, field and local names to shorter, -obfuscated, or unique names or according to a given translation -table
    • -
    • Removing debugging information
    • -
    • Removing dead code (classes, fields, methods) and constant -fields
    • -
    • Optimizing local variable allocation
    • -
    - -

    News

    - -
      -
    • JODE is now hosted by SourceForge.
    • -
    • The latest CVS version breaks long lines
    • -
    • I can now decompile inner and anonymous classes.
    • -
    • The optimizer (aka obfuscator) can be customized via a small -config file
    • -
    • Jode is autoconfigured.
    • -
    - -

    Limitations

    - -

    If not all dependent classes can be found, the verifier (which is - run before decompilation starts) may exit with a type error. You - can decompile it with --verify=off, but take the warning - serious, that types may be incorrect. There's sometimes no way to - guess the right type, if you don't have access the full class - hierarchie.
    - - This is not a bug in the verifier: java will complain the same way, - if it is run with bytecode verification turned on. And if you don't - have the dependent classes, you can't compile the code again.

    - -

    There may be situations, where the code doesn't understand complex -expressions. In this case many ugly temporary variables are used, but -the code should still be compileable. This does especially happen -when you compile with `-O' flag and javac has inlined some -methods.

    - -

    Sometimes this program may exit with an Exception or -produce incorrect code. Most time the code can't be compiled, so that -it can be easily spotted. If you have one of these problems (except -those that occur on some of the jode.test files, I would -be very interested in a bug report (including the class -file, if possible).

    - -

    Sometimes JODE generates some GOTO expression and labels. -This shouldn't happen any more with code produced by javac or jikes. -But some flow obfuscator may provoke this. In that case you can run -the Obfuscator first (to optimize away the flow obfuscation ;-).

    - - - - - - - - diff --git a/jode/doc/index.php b/jode/doc/index.php index 98addb1..42f8471 100644 --- a/jode/doc/index.php +++ b/jode/doc/index.php @@ -1,16 +1,16 @@

    JODE is a java package containing a decompiler and an -optimizer for java. This package is freely available under the GPL -(see license).

    +optimizer for java. This package is freely available under the GNU GPL.

    -

    The decompiler takes class files as input and produces -something similar to 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 when compiled with debuging) and there are -often more ways to write the same thing. But JODE does its job -quite well, so you should give it a try: start -the applet.

    +

    The decompiler reads in class files and produces something +similar to 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 when compiled with debuging) and there are often +more ways to write the same thing. However, JODE does its job quite +well, so you should give it a try and start the +applet.

    The optimizer transforms class files in various ways with can be controlled by a script file. It supports the following @@ -28,14 +28,23 @@ fields

    News

      +
    • JODE 1.1 is out. With support for javac v8 (jdk 1.3).
    • JODE is now hosted by SourceForge.
    • -
    • The latest CVS version breaks long lines
    • -
    • I can now decompile inner and anonymous classes.
    • +
    • Now long lines are automatically broken.
    • +
    • Inner and anonymous classes are automatically decompiled.
    • The optimizer (aka obfuscator) can be customized via a small config file
    • -
    • Jode is autoconfigured.
    +

    Known bugs of the decompiler

    + +

    Some jdk1.3 synthetic access functions aren't understood. The + produced source contains access$xxx functions, but it still compiles.

    + +

    There may be other bugs, that cause Exceptions or invalid code. + If you have such a problems don't hesitate to issue a bug report. + Please include the class file if possible.

    +

    Limitations

    If not all dependent classes can be found, the verifier (which is @@ -55,15 +64,4 @@ the code should still be compileable. This does especially happen when you compile with `-O' flag and javac has inlined some methods.

    -

    Sometimes this program may exit with an Exception or -produce incorrect code. Most time the code can't be compiled, so that -it can be easily spotted. If you have one of these problems (except -those that occur on some of the jode.test files, I would -be very interested in a bug report (including the class -file, if possible).

    - -

    Sometimes JODE generates some GOTO expression and labels. -This shouldn't happen any more with code produced by javac or jikes. -But some flow obfuscator may provoke this. In that case you can run -the Obfuscator first (to optimize away the flow obfuscation ;-).

    diff --git a/jode/doc/license.html b/jode/doc/license.html deleted file mode 100644 index e182c7b..0000000 --- a/jode/doc/license.html +++ /dev/null @@ -1,80 +0,0 @@ - - - -Java Optimize and Decompile Environment (JODE) - - - - - - - - - -
    JODEPowered by SourceForge
    Best viewed with Any
-      Browser
    - - - - -
    - -

    License

    -

    JODE is Copyright © 1998-2000 by Jochen Hoenicke.

    - -

    This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public -License as published by the Free Software Foundation; either -version 2 of the License, or (at your option) any later version.

    - -

    This program is distributed in the hope that it will be useful, -but without any warranty; without even the implied warranty of -merchantability or fitness for a particular purpose. See the -GNU General Public License for more details.

    - - - - - - - - - diff --git a/jode/doc/links.html b/jode/doc/links.html deleted file mode 100644 index 19aa768..0000000 --- a/jode/doc/links.html +++ /dev/null @@ -1,128 +0,0 @@ - - - -Java Optimize and Decompile Environment (JODE) - - - - - - - - - -
    JODEPowered by SourceForge
    Best viewed with Any
-      Browser
    - - - - -
    - -

    JODE Links

    -

    Other decompilers

    - -

    Other obfuscators

    -
      -
    • The Open Directory list
    • -
    • Hashjava is another free obfuscator. It is no longer maintained, though, since its successor was commercialized.
    • -
    • Zelix -Klassmaster does a very good flow optimization and also decrypts -strings. But JODE's deobfuscator can undo both.
    • -
    • Christian S. Collberg has some really interesting papers about non reversible obfuscations.
    • -
    -

    Graphical User Interface

    - -

    Miscellanous packages needed to run JODE

    -
    -
    CYGWIN (unix tools for win95/NT)
    -
    - http://sourceware.cygnus.com/cygwin/ -
    -
    JDK 1.1:
    -
    - http://java.sun.com/products/jdk/1.1/ -
    -
    Swing for JDK 1.1:
    -
    - http://java.sun.com/products/jfc/index.html#download-swing -
    -
    JDK 1.2:
    -
    - http://java.sun.com/products/jdk/1.2/ -
    -
    Getopt:
    -
    - http://www.urbanophile.com/arenn/hacking/download.html#getopt -
    -
    Collection Classes:
    -
    I have written a small script that puts the collection classes -from the GNU Classpath Project -into its own package (gnu.java.util.collections). This -script is now part of GNU classpath. For your convenience I have put a -precompiled jar -file on this server. -
    -
    - - - - - - - - - diff --git a/jode/doc/links.php b/jode/doc/links.php index c6f1384..0bce94d 100644 --- a/jode/doc/links.php +++ b/jode/doc/links.php @@ -2,7 +2,7 @@

    JODE Links

    Other decompilers

      -
    • The Open Directory list
    • +
    • The Open Directory list
    • A list of decompilers can be found at Marc Meurren's list
    • A very fast decompiler is

      Other obfuscators

      +

      Software Directories

      +
        +
      • Get everything and anything for Linux at the + Linux Directory. +
      • +
      • A great place for developing free software is + SourceForge +
      • +

      Miscellanous packages needed to run JODE

      CYGWIN (unix tools for win95/NT)
      diff --git a/jode/doc/menu.inc b/jode/doc/menu.inc index a159f8e..0e6bfa5 100644 --- a/jode/doc/menu.inc +++ b/jode/doc/menu.inc @@ -4,6 +4,7 @@ $menu = "Project page" , "sflink", "project/", "Applet" , "selflink", "applet", "Download" , "selflink", "download", + "FAQ" , "selflink", "faq", "Feedback" , "selflink", "feedback", "Documentation", "selflink", "usage", "License" , "selflink", "license", diff --git a/jode/doc/usage.html b/jode/doc/usage.html deleted file mode 100644 index a780a50..0000000 --- a/jode/doc/usage.html +++ /dev/null @@ -1,289 +0,0 @@ - - - -Java Optimize and Decompile Environment (JODE) - - - - - - - - - -
      JODEPowered by SourceForge
      Best viewed with Any
-      Browser
      - - - - -
      - - -

      Using the Decompiler

      -After you have downloaded the necessary -packages, put them into your CLASSPATH: - -
      • Under Windows you have to start a MSDOS session and type -something like: -
        -set CLASSPATH=C:\download\jode-1.0.93-1.1.jar;C:\swing\swingall.jar
        -
        -
      • Under Unix you start a shell and type (for bourne shell): -
        export CLASSPATH=/tmp/jode-1.0.93-1.1.jar:/usr/local/swing/swingall.jar
        -or for csh: -
        setenv CLASSPATH /tmp/jode-1.0.93-1.1.jar:/usr/local/swing/swingall.jar
        -
      -
      -There is also a batch file for windows and a script file for unix, -that you can use. You can extract it with the following command: -
      -  jar -xvf jode-1.0.93-1.1.jar bin/jode.bat resp. bin/jode
      -
      -Edit the file to adapt it to your needs and put it to a convenient -location. - -

      Command Line Interface

      - -The 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
      - -If you have adapted the batch file/script, you can use it like this: -
      jode --help
      - -

      AWT Interface

      - -The AWT Interface looks exactly like the applet. In fact the applet uses the AWT Interface. You start it -after setting the CLASSPATH (see above), with - -
      java jode.decompiler.Window
      - -In 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 Interface

      - -For the swing interface you need java version 1.2 or the separately -available swing package (see link -page. You can invoke it like this: -
      -java jode.swingui.Main --classpath classes.jar
      -resp.jode swi --classpath classes.jar
      -
      - -The 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 Interface

      - -

      If you want to integrate JODE into your own java program, -you can use the jode.decompiler.Decompiler -class. Note that the GPL only allows you to integrate JODE -into GPL programs. Please tell me if you use JODE in this -way.

      - -

      You may use this stripped -down jar archive containing all necessary classes.

      - -

      Using the Obfuscator

      - -

      To 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 classes.zip or -rt.jar))

      -
      -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(,):

      -
      -
      unreach
      -
      strip unreachable methods and classes.
      -
      source
      -
      remove the name of the java file (exceptions will get unreadable).
      -
      lnt
      -
      remove the line number table (exceptions will get unreadable).
      -
      lvt
      -
      remove the local variable table (debugging doesn't work).
      -
      inner
      -
      strip inner class info (reflection doesn't work correctly).
      -
      -
      -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 -* as wild card, that matches everything (including dots). -

      -
      -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.
      You have to give the method -name and the type signature to identify your method. javap --s will show you the type signatures for your classes, but you -may also use *, to select all methods with that name.

      -
      -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

      -
      StrongRenamer
      -
      Renames to the shortest possible name. You can give a charset -that should be used. It uses the same name as much as possible.
      -
      UniqueRenamer
      -
      Renames to unique identifier of the form xxx123. Useful -to reduce name conflicts, before you decompile an obfuscated package.
      -
      NameSwapper
      -
      This renamer just swaps the names. This is a funny obfuscation -option that is not very strong, but very confusing.
      -
      KeywordRenamer
      -
      Renames identifiers to keyword. You can give your own list of -keywords as parameters. Resulting code is not decompilable directly, -but it is not legal bytecode either. Some paranoid -web browsers refuse to run applets containing keywords as identifiers -(and they are completely within the Java VM spec).
      -
      -
      -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. -

      SimpleAnalyzer
      -
      Straight forward analyzer. It is fast and will remove dead code -on method basis.
      - -
      ConstantAnalyzer
      -
      Strong analyzer that will determine, which fields and instructions -have constant values. It will remove dead code on instruction basis -and replace constant instruction with a load of the constant, or -remove them completely.
      This analyzer is especially useful to -revert the flow obfuscation of some other obfuscators.
      -
      -

      -
      -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
      -
      - - - - - - - - diff --git a/jode/doc/usage.php b/jode/doc/usage.php index 9495c2b..f7a55d7 100644 --- a/jode/doc/usage.php +++ b/jode/doc/usage.php @@ -9,27 +9,28 @@ */ ?>

      Using the Decompiler

      -After you have downloaded the necessary -packages, put them into your CLASSPATH: +

      After you have downloaded the jar archive +put it into your CLASSPATH. The package +swingall.jar is also needed if you are using JDK 1.1.

      • Under Windows you have to start a MSDOS session and type something like:
        -set CLASSPATH=C:\download\jode-.jar;C:\swing\swingall.jar
        +set CLASSPATH=C:\download\jode-.jar;C:\swing\swingall.jar
         
        -
      • Under Unix you start a shell and type (for bourne shell): -
        export CLASSPATH=/tmp/jode-.jar:/usr/local/swing/swingall.jar
        + +
      • Under Unix you start a shell and type (for bourne shell): +
        export CLASSPATH=/tmp/jode-.jar:/usr/local/swing/swingall.jar
        or for csh: -
        setenv CLASSPATH /tmp/jode-.jar:/usr/local/swing/swingall.jar
        +
        setenv CLASSPATH /tmp/jode-.jar:/usr/local/swing/swingall.jar

      There is also a batch file for windows and a script file for unix, that you can use. You can extract it with the following command:
      -  jar -xvf jode-.jar bin/jode.bat resp. bin/jode
      +  jar -xvf jode-.jar bin/jode.bat resp. bin/jode
       
      -Edit the file to adapt it to your needs and put it to a convenient -location. +Edit the file to adapt it to your paths and put it to a convenient location.

      Command Line Interface

      @@ -42,8 +43,12 @@ following command will give a complete list of the available commands:
      java jode.decompiler.Main --help
      -If you have adapted the batch file/script, you can use it like this: -
      jode --help
      +If you want to decompile a jar package you can do it this way: + +
      java jode.decompiler.Main --dest srcdir program.jar
      + +If you have installed the batch file/script, you can use it like this: +
      jode --dest srcdir program.jar

      AWT Interface

      @@ -64,35 +69,36 @@ appear. You can save it via the save button. For the swing interface you need java version 1.2 or the separately available swing package (see link -page. You can invoke it like this: +page. You can invoke it with the following command:
      -java jode.swingui.Main --classpath classes.jar
      -resp.jode swi --classpath classes.jar
      +java jode.swingui.Main classes.jar
      +resp. jode swi classes.jar
       
      -The swing interface will show the package hierarchie of all classes +

      The 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.
      +class inheritence tree.

      -The swing interface is very useful to browse through class files if +

      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.
      +you won't find a save option there.

      Java Interface

      If you want to integrate JODE into your own java program, you can use the jode.decompiler.Decompiler +href="http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/jode/jode/jode/decompiler/Decompiler.java?rev=jode_1_1&content-type=text/vnd.viewcvs-markup" +>jode.decompiler.Decompiler class. Note that the GPL only allows you to integrate JODE into GPL programs. Please tell me if you use JODE in this way.

      -

      You may use this stripped -down jar archive containing all necessary classes.

      +

      You should ship jode-1.1-embedded.jar with your program. This jar file is +available in the download area. +It works only under JDK 1.2 and above.

      Using the Obfuscator