I am currently implementing my own decompiler to help me fully understand the problems decompilers encounter and discover ways to improve decompilers. The decompiler is based on the ASM Java bytecode engineering library.
At first, I wish to decompile the 10 test programs from Godfrey Nolan's Decompiling Java. Decompiling Java contains a lot of information about Java bytecode, class files, obfuscation, security and decompilation. It includes two chapters (about half the book) detailing the design and implementation of a simple decompiler. This decompiler is built using the CUP parser generator for Java and the implementation chapter details how to implement a decompiler to decompile the 10 test programs.
I'm taking a different approach by taking advantage of a bytecode framework which provides an easy way to manipulate and analyse Java class files through a visitor based API.
The ten programs are attached to this post.
| Attachment | Size |
|---|---|
| HelloWorld.java | 111 bytes |
| Basics.java | 210 bytes |
| MathOps.java | 242 bytes |
| DoWhile.java | 272 bytes |
| IfTest.java | 169 bytes |
| Recurses.java | 247 bytes |
| WhileLoop.java | 217 bytes |
| ForLoop.java | 230 bytes |
| ArrayTest.java | 181 bytes |
| ArrayInit.java | 344 bytes |