问题
I've got a file that is a binary java file that was compiled using a proprietary program. I've tried to open this up in some of the standard decompilers but they will not recognize it.
I suspect it's because some specific proprietary headers have been added, based on looking at the file in a hex editor. Is there any way to detect where the java bytecode begins and ends on this file, or how to extract it so I can run it through a decompiler like this one? Any help is much appreciated.
[Edit]
As a side note i'd like to know how this was achieved, in other words what facility/feature of Java allows you to use their compiler in such a customized way as this?
P.S. The image is bigger if you open it in another tab.回答1:
My guess is it is an encrypted jar. The compiled code still has to be Java bytecode to run on a JVM unless they wrote their own which is highly unlikely. The proprietary part of the process may be the encryption of the jar so that it won't run without the proper decryption key.
If that is the case, there has to be another part of the package that has both the proper key and mechanism to decrypt it. You say that it is a binary Java file but that could mean a .class file or a jar file.
How is this code executed? Do you have to start the jvm yourself ("c:/>java com.mystery.App") or is it a module used by some other executable (exe, jar, batch, etc.)?
回答2:
Did you try unpack200?
来源:https://stackoverflow.com/questions/4151696/decompile-compiled-java-file-with-proprietary-headers