Decompiling JavaWednesday, February 19, 1997 by Dave Winer. An exciting, fascinating, and then sad story started unveiling yesterday. It began with an excited phone call from a friend who has been working in Java for the last few months. He found a program on the net called Mocha that can be used to decompile Java apps. He was psyched! Learning a lot about Java by looking at the source code of apps downloaded from the net. http://www.brouhaha.com/~eric/computers/mocha.html A decompiler undoes the work of a compiler. It takes a machine-executable program and turns it into source code. For most languages, such as C or Pascal, the resulting decompiled program is quite artificial, and can't really be used to reverse-engineer the program that was decompiled. This is one of the most important ways commercial developers protect the intellectual property value of the software they distribute. It turns out, due to a quirk in the design of the Java Runtime system and the relationship with its compilers, that Java code can be almost entirely reconstructed, including the actual names of variables used by the original programmer! The only things missing are the comments. This is an amazing oversight in the architecture of Java. Why is it this way? I don't know. I'd be interested in hearing more. My friend had used Mocha to decompile one of the most widely publicized commercial Java apps, so we know that the process works. I published a link to Mocha, alongside a reference to an Infoworld article detailing a huge committment by IBM to Java. I wondered if they knew that anyone could decompile their Java code and learn all their secrets? I bet they didn't. There's more to the story
|