Discussion:
C++ class to parse java .class file
(too old to reply)
wolverine
2007-03-26 14:21:53 UTC
Permalink
Hi,
I recently read that every java .class file, is written in a
specific binary format.
http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html

I just want to know whether there is any C++ class for extracting
those structure information from a .class file . I am NOT speaking
about decompiling the java class. I just want to parse and extract
some information from the .class file.

Thanks in Advance
Kiran.
Victor Bazarov
2007-03-26 14:45:34 UTC
Permalink
Post by wolverine
Hi,
I recently read that every java .class file, is written in a
specific binary format.
http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html
I just want to know whether there is any C++ class for extracting
those structure information from a .class file . I am NOT speaking
about decompiling the java class. I just want to parse and extract
some information from the .class file.
You might find it useful to ask about it in a Java newsgroup. After
all, C++ knows nothing about .class files, it's all defined in the
Java language specification, and that's why a Java forum is a more
likely place where you can find a solution for parsing .class files.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
rossum
2007-03-26 15:36:25 UTC
Permalink
Post by wolverine
Hi,
I recently read that every java .class file, is written in a
specific binary format.
http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html
I just want to know whether there is any C++ class for extracting
those structure information from a .class file . I am NOT speaking
about decompiling the java class. I just want to parse and extract
some information from the .class file.
Thanks in Advance
Kiran.
In principle, a C++ program can be written to parse any specified
format of binary file. Whether anyone has written such a parser for
Java .class files is another question. As Victor says, you are much
more likely to find such a parser in a Java newsgroup. It will
probably be written in Java, but that should be easy enough to convert
to C++ if you really require something written in C++.

An alternative would be to find a general purpose parser in C++ and
adapt that to handle the specifics of your target file type.

rossum

Loading...