Question

As a project at some point in time, I would like to make my own Java decompiler to convert bytecodes back to plain text.

I did Google for some APIs that would let me do that but I could not find any.

So my question to you is: How do I decompile the class file ?
If there is an API and I have missed that, please let me know.

I know that book questions are frowned upon but do you think Decompiling Java Language by Godfrey Nolan is a good place to begin at?

Was it helpful?

Solution

So my question to you is: How do I decompile the class file ?

  • By writing lots and lots of Java code to implement a decompiler ... or
  • By starting from an existing open source decompiler and modifying it. (But you will need to understand and conform to the license ...)

These steps need to be preceded by background research / reading to understand the domain, formulating requirements, design, etcetera. That's way beyond the scope of a SO Question.

If there is an API and I have missed that, please let me know.

AFAIK, there isn't one.

But you should be able to find source code in other forms. (How reusable it would be is anyone's guess. But, hey, this is your project.)

(Frown!)

I've not read that book, but it is probably worth a read, especially if the only alternative for learning is reversing engineering an existing codebase. Try going to your favourite online bookstore, reading the reviews, the ToC, etcetera ... and make up your own mind whether it is worth buying.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top