Friday, November 10, 2006

Anonymity in Code too not allowed!

So, here i go into the java world. The only world which am into presently. You write code, tons of java code. There area few who would not like to give there source code to other. As, they feel that its there work, they have put lots of hour of effort into it, have optimized the code to the maximum extent possible and why should some other guy with very little effort get to know what they have done. So, if you think you can just provide the class file to them and not the source java file, again you are wrong. Reverse-engineering is present in this world, and this applies to java code too. You just have to input the class file to the tool and with in few seconds the whole source is at your disposal. I found 3 tools which did the same, two free and one paid.

I will start from the least user friendly one.

1. The javap tool that comes with the JDK itself. This is a command line tool. But, the decompiled code is not too easy to follow. I tried it with all the command line options present. I wouldn't suggest this tool unless you really want to know the whole inside of the code, i mean at the byte code level.

2. The next tools is also a free tool, Cavaj. This is really cool, and much more easier to use than the ugly command line version of the javap. You just have to open the class file and the Cavaj does the rest. The exact java file is back on your screen. With not much options present like syntax coloring or finding matching braces, this tool serves the purpose. Once you have decompiled you can use some other IDE like eclipse to do the remaining part of your work on the code you just decompiled.There is one more platform independent version JCavaj in java.

3. The last tool i went through was DJ Decompiler. Now this isn't a freeware, and does the same job as the one above but has much more options like syntax coloring, getting the byte code version of the decompiled code, searching matching parenthesis, running the applet, compiling the code from the GUI itself, shell integration so that you can right click the class file and decompile and some more. But, all these comes with a cost.

I personally liked the DJ decompiler and would suggest to bye it if you have enough money, but the basic purpose of the Decompiling is achieved in a good manner using the CavaJ decompiler, Which also gets a thumbs up from my side.

No comments:

Post a Comment