Valhalla Legends Archive

Programming => General Programming => Java Programming => Topic started by: Tontow on November 08, 2004, 06:20 PM

Title: good java decompiler and compiler
Post by: Tontow on November 08, 2004, 06:20 PM
I'm looking for a good java compiler and a good decompiler.  I'm not sure if class files are readable after there compiled; for that matter I'm not sure if java compiles at all.

The reason I'm asking is because I found this old game called RoboForge (www.roboforge.net) that is no longer being developed and I would like to make some independent improvements on it. -(Once I finish learning java)
The game is basically dead except for one or two small groups that still play; it seems the only way to get the full version is through someone that already has it (the game is no longer being sold anywhere).
Title: Re: good java decompiler and compiler
Post by: Banana fanna fo fanna on November 08, 2004, 07:26 PM
compiler: jikes
decompiler: jad
Title: Re: good java decompiler and compiler
Post by: Tontow on November 09, 2004, 02:11 PM
Are there any other good decompilers?  It seems jad dosent handle loops very well...   I would like to decompile itt back to the original source code if at all possable.
Title: Re: good java decompiler and compiler
Post by: Banana fanna fo fanna on November 09, 2004, 02:34 PM
From what I know, jad is _the_ java decompiler.

Also, the code is likely obfuscated.
Title: Re: good java decompiler and compiler
Post by: Tontow on November 09, 2004, 04:09 PM
Quote from: Banana fanna fo fanna on November 09, 2004, 02:34 PM
Also, the code is likely obfuscated.
Is there any way around that? (aside from rewriting the code after it is decompiled)
Title: Re: good java decompiler and compiler
Post by: TangoFour on November 09, 2004, 05:55 PM
No, not really any way around obfuscation

As for compiler, you could just use javac, the standard SUN java compiler

As for decompiler, I've used Dejava a few times - it does the job, but isn't that stunning
Title: Re: good java decompiler and compiler
Post by: Tontow on November 10, 2004, 02:03 PM
I don't cair if it is stunning so long as I can get it back to the original code and be able to just reinsert it back in with the other class files and have the changes I make work.
Title: Re: good java decompiler and compiler
Post by: Banana fanna fo fanna on November 10, 2004, 08:55 PM
Quote from: Tontow on November 10, 2004, 02:03 PM
I can get it back to the original code

You can't.
Title: Re: good java decompiler and compiler
Post by: MyndFyre on November 11, 2004, 04:52 AM
Quote from: Tontow on November 10, 2004, 02:03 PM
I don't cair if it is stunning so long as I can get it back to the original code and be able to just reinsert it back in with the other class files and have the changes I make work.

My experience with .NET decompilation is that, once you go beyond, say, one level of if/else statements, decompilers begin to get nutty.  Code optimizations will put gotos and things through code paths, and make nested ifs look haywire, not to mention nested select cases.  Chances are that if the code is complicated at all, a decompiler is not going to help you very much.
Title: Re: good java decompiler and compiler
Post by: TangoFour on November 11, 2004, 09:53 AM
Quote from: Banana fanna fo fanna on November 10, 2004, 08:55 PM
Quote from: Tontow on November 10, 2004, 02:03 PM
I can get it back to the original code

You can't.

Indeed not, many of the original source file will be lost during compilation - all comment in any case, and variable names might get shifted around as well - at best you'll get an approximation of the original code
Title: Re: good java decompiler and compiler
Post by: iago on November 14, 2004, 02:13 PM
IDA can disassemble .class files.  I've never tried, so I have no clue how it is.
Title: Re: good java decompiler and compiler
Post by: Tontow on November 15, 2004, 12:11 PM
Is there any way to monitor wich .class files are active or being accessed while the program is running?
Title: Re: good java decompiler and compiler
Post by: iago on November 15, 2004, 12:42 PM
Well, you know the main one, I hope.  It's the one that comes after "java".  From there, you can probably find references to the ones it uses, etc.  Generally, they'll all be used at some point or other, unless the programmers suck :)
Title: Re: good java decompiler and compiler
Post by: MyndFyre on November 15, 2004, 06:26 PM
Quote from: iago on November 14, 2004, 02:13 PM
IDA can disassemble .class files.  I've never tried, so I have no clue how it is.

Chances are that it displays bytecode, not Javacode.  :P
Title: Re: good java decompiler and compiler
Post by: Banana fanna fo fanna on November 15, 2004, 07:20 PM
you can do a debug dump of all loaded classes.