[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Java Decompilation
You might also run into problems compiling the resulting .java files if the
.class files they were generated from used some form of Inner Classes.
Inner Classes (classes that are defined within another class) are compiled
into separate .class files, which the compiler generates automatically.
Generally, the compiler names these files with the parent class' name
appended with a '$', the Inner Class name and possibly some numeric value.
I don't believe the compiler will allow your .java source files to reference
any classes with a '$' in their names, as the '$' is reserved for the
compiler's use. You may be able to recreate the Inner Class elements by
manually replacing the code for the Inner Class into its original parent
class file, removing the '$' and renaming it appropriately, but be prepared
for a somewhat laborious process.
Allan
-----Original Message-----
From: Scott P. Smith [mailto:ssmith@scott-smith.com]
Sent: Thursday, September 04, 2003 11:47 AM
To: ajug-members@ajug.org
Subject: Re: Java Decompilation
Look at the code the decompiler creates. Does it look correct? If it
does, then your environment must have changed from the first time you
compiled.
Either the code is wrong, or your build environment is different.
I have not decompiled class files before, but I have read about it and I
remember reading about obfuscater. If an obfuscater was used then it
mangled all method names, but it did so in a consistent manner. So you
can't mix obfuscated code with non-obfuscated code because the method
names will be different. It could be that you are trying to decompile a
single obfuscated class in isolation, which won't work (as I understand
it). But you could manually edit the decompiled code if you have access
to the code it's calling. But it would be a big pain.
Scott
On Thu, 2003-09-04 at 11:20, Christopher Fowler wrote:
> The problem with these classes are they are scrambled. When I decompile
> one class and try to recompile I get method not found errors.
>
> On Thu, Sep 04, 2003 at 11:11:52AM -0400, Minor, Eric wrote:
> > Do a search on DJ Java Decompiler 3.5 I am using it and it worked well
for
> > me.
> >
> > I accidentally deleted a .java file that I recently compiled to a .class
> > file.\
> > The .java file was very important and contained a lot of coding updates
that
> > I could
> > Not remember from the top of my head. Luckily, I had a .class version
of
> > the .java file.
> > I found the decompiler on the net, loaded it and decompiled my .class
file.
> > All of my updated
> > Code was retrieved which saved me a lot of time. Note: any comments in
the
> > .java file will not
> > Be retrieved from the .class file.
> >
> > -----Original Message-----
> > From: Christopher Fowler [mailto:cfowler@outpostsentinel.com]
> > Sent: Tuesday, September 02, 2003 3:22 PM
> > To: ajug-members@ajug.org
> > Subject: Java Decompilation
> >
> >
> > I'm trying to deompile one class files out of a package with 20 class
files.
> > I've tried jad and mocha and neither produce code that can be
recompiled.
> > Is there a product that can allow me to decompile a class make
modifications
> > then recompile it?
> >
> > Thanks,
> > Chris
>
>