WingDis is a command-line utility which allows users to convert a Java class file, zip or JAR file to Java-like source code. The eventual goal of WingDis is to generate compilable and equivalent source code as the original one. WingDis may be used in analyzing unknown Java class files or public interfaces such as JDK, or help recover Java source code after source files are accidently removed.
WingDis is implemented in Java, so it can run on any platforms which support Java.
java wingsoft.Decompiler [options] [<applets urls, files or classes list >]
If no options are given, the output will be sent to the standard output. Here are
the options list,
-l Generate line number information in the output.
-n Turn off control flow analysis.
-s Save the output to separate files. Each class will
have a separate file. The file name will be the
class name plus extension (.javadis or specified by
users with option -e). The default is
to send the output to the standard output.
-t Use the fully-qualified Java class name as the file name.
No subdirectories will be generated. This option is only
valid when -s is also used.
-dir path Specify a directory where the output will be saved.
WingDis will create subdirectories for packages when
needed. The default directory is the current directory.
This option will be effective only if -s is also used.
-e .ext Specify extension of the output file. The defualt
extension is .javadis. This option will be effective
only if -s is also used.
-o Overwrite the output files that already exist.
The default is to ask users to confirm on whether
existing files should be overwritten.
This option will be effective only if -s is also used.
-v Verbose mode, for printing some detailed information
during processing. The default is off.
-dos Generate output which is DOS-compliant.
-host name Specify the proxy server name.
-port num Specify the proxy server port number.
-one class Decompile a java program obfuscated with OneClass.
Applet URLs should be an URL address with applets referenced in it. When a proxy server is used, host and port can be specified with -host and -port options. Files names should be ended with either ".class", ".zip", or ".jar", and classes names should not be ended with ".class", ".zip", or ".jar". When files names are specified, the specified path will be searched for the files. When classes are specified, the CLASSPATH will be searched.
Example 1:
java wingsoft.Decompiler user.class
This requires that the file user.class be located in the current directory.
Example 2:
java wingsoft.Decompiler user
This example requires that a class file named user.class is at somewhere on the CLASSPATH.
Example 3:
java wingsoft.Decompiler http://www.javasoft.com
This example shows how an applet can be decompiled with WingDis. The applets contained in the web page will be decompiled.
The options and files order are flexible.
File names can contain alias characters '*', '?', '[', ']' which are used to specifiy a group of files. As used in a regular expression, '*' means any characters including none, and '?' represents any single character, '[' and ']' are for any one character in a group.
Example 3:
java wingsoft.Decompiler -s *.class
WingDis will decompile all class files in the current directory and save the output to separate files which with extension ".javadis", and rooted at the current directory.
Example 4:
java wingsoft.Decompiler -s -e .java a*.class
WingDis will decompile all class files in the current directory with
names begin with "a", and save the output to separate files with
extension ".java".
In the above examples, if an output file exists, WingDis will ask users to confirm on overwriting. If users want to overwrite all the existing files, -o option should be used.
A lot of new features and changes are suggested by WingDis users. If you want to have some new features in WingDis, or report a problem in WingDis, please send an email to support@wingsoft.com.
When you report a problem, we appreciate that you could provide the following information,
Java is a registered trademark of Sun Microsystems, Inc.
OneClass is a registered trademark of Mandate Software.