how to disassembly a .jar file? how to see what are the classes inside the .jar file?

L

lucy

Dear all Java gurus,

Is there a way to disassembly a .jar file. How to see what are the classes
inside the .jar file; what are the methods available, and the calling
convention to those mothod functions?

Is there such a debugger or disassembler in Java?

thanks a lot
 
P

Paul Lutus

lucy said:
Dear all Java gurus,

Is there a way to disassembly a .jar file. How to see what are the classes
inside the .jar file; what are the methods available, and the calling
convention to those mothod functions?

Is there such a debugger or disassembler in Java?

thanks a lot

List jar contents:

jar -t filename.jar

Extract a named file:

jar -x filename.jar (name)

Extract all:

jar -x filename.jar
 
B

Byron Lee

In addition to using the jar commandline, if you're using an IDE (like Sun
One Studio, etc.), you can mount the jar file and expand it in a tree
structure to see all of it's classes, fields, method signatures, etc.
visually.
 
H

hg

Hi,
The simple answer is yes. I do not know of a tool that will decompile the
classes from the jar (but it may be out there). If you unzip or extract
using jar -x so you have class files, then you can use jad to decompile.
Also Jedit has a plugin that will use Jode, within the Jedit IDE.
You could build a tool that would read the jar (see java.util.jar) and then
stream the stuff to Jode, and for all I know this may exist as a plugin to
Jedit. Jode is written in Java with source, Jad is C.

This will work on 99% of the stuff out there. A few people have encrypted
the class files, and provide a class loader that knows how to decrypt the
files. Having written one of these encryption tools I would point out they
are not that secure.Just note that by using Jode/Jad you may be breaking a
copyright or other legal agreements, so don't publish the code you obtain
this way, it almost always is illegal. There are a few books that discuss
this, if you just want to hack then "Covert Java" is pretty interesting and
while written on a basic level the author (Alex Kalinosky) does address some
very interesting problems, but not for the OO crowd.

Howie
 
S

Smith

As someone said, jad is good. I would use winzip & extract all the
class files into some directory and then run jad from dos on them.
 
S

steve

As someone said, jad is good. I would use winzip & extract all the
class files into some directory and then run jad from dos on them.

nar, if you want to be blown away by a good decompiler, that can find dead
code, and handle messed up class files you need

djdec377.zip


just do a search on the internet
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,731
Latest member
MarcyGipso

Latest Threads

Top