From 7fca8d09e9340b1268eb6de3a3bab9603dcb886d Mon Sep 17 00:00:00 2001 From: hoenicke Date: Sun, 27 May 2001 16:10:07 +0000 Subject: [PATCH] Remove .html files, added a-logo.gif git-svn-id: https://svn.code.sf.net/p/jode/code/branches/branch_1_1@1316 379699f6-c40d-0410-875b-85095c16579e --- jode/doc/a-logo.gif | Bin 0 -> 894 bytes jode/doc/applet.html | 101 -------------- jode/doc/bluesky.html | 137 ------------------- jode/doc/download.html | 99 -------------- jode/doc/faq.php | 66 +++++++++ jode/doc/feedback.php | 7 +- jode/doc/history.html | 88 ------------ jode/doc/index.html | 132 ------------------ jode/doc/license.html | 81 ----------- jode/doc/links.html | 129 ------------------ jode/doc/usage.html | 295 ----------------------------------------- 11 files changed, 68 insertions(+), 1067 deletions(-) create mode 100644 jode/doc/a-logo.gif delete mode 100644 jode/doc/applet.html delete mode 100644 jode/doc/bluesky.html delete mode 100644 jode/doc/download.html create mode 100644 jode/doc/faq.php delete mode 100644 jode/doc/history.html delete mode 100644 jode/doc/index.html delete mode 100644 jode/doc/license.html delete mode 100644 jode/doc/links.html delete mode 100644 jode/doc/usage.html diff --git a/jode/doc/a-logo.gif b/jode/doc/a-logo.gif new file mode 100644 index 0000000000000000000000000000000000000000..cf0283900cd3cb32cab907d7bf9ec58f4121f9a9 GIT binary patch literal 894 zcmV-^1A+WUNk%v~VORhk0K@S>zy}ic0y}h-ywSmLS|9+UIrKNeQ zt(26M|5JI-gM8aZ0>kl1p5H!|i&%U~d#kEnXN7qA=UshP#^gm!M00JmX)PI6zo0 zL2Nm48ij>~90UT38y+7Kc|K(m0|O2W6IVZi1&3fJgaraQ9u*rKIS~~VcL@d?3k9zY zNk$WwA_10aKAeVeTp}DABOJnEIuRcU$_WLm6%8J!(*?~=RRaM50G1b47*;*L8NUFA z5F>`?zlEa(jj|sV&mTGQ6?ms)7Y+^x0UUrMGGPLs9lkVVSO{PtLjVUvtZS!1l$|9@ z@UXgv$Br^cP{26|n5hZ^1{fUwAY_umVTOh-MWlmSj^@HqtQzQKm0%-0JU@X(DT2Vk ztttT+SW&5jWr3J36^M9glO}}>q=XtM+ z;3`9xd9Fn&;%@>11i92+VH+1N+y`2dRBv%F} z8AUcif(jZSf`azgryxBxY|sFRs3@~QK0ifZ2Z$b&Mhl5w830XvLpi%cedc3|q-F|=0ilS7>Rk>A zG-4_(rN$zQDH|lWRV)#NW#lQQ - - -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/bluesky.html b/jode/doc/bluesky.html deleted file mode 100644 index 5379cd9..0000000 --- a/jode/doc/bluesky.html +++ /dev/null @@ -1,137 +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 044f6c2..0000000 --- a/jode/doc/download.html +++ /dev/null @@ -1,99 +0,0 @@ - - - -Java Optimize and Decompile Environment (JODE) - - - - - - - - - -
JODEPowered by SourceForge
Best viewed with Any
-      Browser
- - - - -
- -

Download

- -

Jode is available in the download section. Click here to download the latest -released source code of JODE - -

If you download the source code, 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 xftp server. You may -need to press shift while clicking on the link, depending on your -browser. - - -

  • jode-1.1-1.1.jar is for JDK 1.1. It contains -the collection classes from the GNU Classpath project. If you want to -use the swing interface, you have to download swing separately.
  • - -
  • jode-1.1-1.2.jar is for JDK 1.2 or better.
-

- -

CVS Repository

- -

You can get the latest sources from the CVS repository. -Follow the instruction on that page; use jode as -modulename. Then change to the directory jode 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..bcadf76 --- /dev/null +++ b/jode/doc/faq.php @@ -0,0 +1,66 @@ + + +

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.

+ +

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.php b/jode/doc/feedback.php index a165044..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 subject.

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

- - diff --git a/jode/doc/history.html b/jode/doc/history.html deleted file mode 100644 index 580f8f3..0000000 --- a/jode/doc/history.html +++ /dev/null @@ -1,88 +0,0 @@ - - - -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 b9743e7..0000000 --- a/jode/doc/index.html +++ /dev/null @@ -1,132 +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 GNU GPL.

- -

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 -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 1.1 is out. With support for javac v8 (jdk 1.3).
  • -
  • JODE is now hosted by SourceForge.
  • -
  • 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
  • -
- -

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

- - - - - - - - - diff --git a/jode/doc/license.html b/jode/doc/license.html deleted file mode 100644 index df2947a..0000000 --- a/jode/doc/license.html +++ /dev/null @@ -1,81 +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 efe02e2..0000000 --- a/jode/doc/links.html +++ /dev/null @@ -1,129 +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/usage.html b/jode/doc/usage.html deleted file mode 100644 index e83f7a0..0000000 --- a/jode/doc/usage.html +++ /dev/null @@ -1,295 +0,0 @@ - - - -Java Optimize and Decompile Environment (JODE) - - - - - - - - - -
JODEPowered by SourceForge
Best viewed with Any
-      Browser
- - - - -
- - -

Using the Decompiler

-

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-1.1.jar;C:\swing\swingall.jar
    -
    - -
  • Under Unix you start a shell and type (for bourne shell): -
    export CLASSPATH=/tmp/jode-1.1.jar:/usr/local/swing/swingall.jar
    -or for csh: -
    setenv CLASSPATH /tmp/jode-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.1-jdk1.1.jar bin/jode.bat resp. bin/jode
-
-Edit the file to adapt it to your paths 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 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

- -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 with the following command: -
-java jode.swingui.Main classes.jar
-resp. jode swi 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
-
- - - - - - - -