Jad the Java decompiler

I have been looking at how the Java class file is built and astonished how easy it is one great tool for decompiling java is jad. With knowing the JVM instructions you can really see what the java is trying to do. I found out loads of stuff about the internals of the JVM. A little example.

public class TextClass extends Object{

public TextClass(){
super();
}


public static void main(String[] args)
{
System.out.println("HEllO WORLD");
}
}
is identicall to

public class TextClass
{
public static void main(String[] args)
{
System.out.println("HEllO WORLD");
}
}

Java just adds all that stuff. Here is the decompiled class file

import java.io.PrintStream;

public class TextClass
{

public TextClass()
{
// 0 0:aload_0
// 1 1:invokespecial #8 Method void Object()
// 2 4:return
}
public static void main(String args[])
{
// 0 0:getstatic #16 Field PrintStream System.out
// 1 3:ldc1 #22 String "HEllO WORLD"
// 2 5:invokevirtual #24 Method void PrintStream.println(String)
// 3 8:return
}
}


You can find out loads of interresting stuff through this. Have a try :)

No comments: