Question

What I'm currently dealing with is a Windows .exe that contains an executable .jar. I've tried running it through various .exe and .jar decompilers to no avail. My question is, how would I go about obtaining the .jar in the state it was in prior to being shorved into a .exe?

Please be aware, I'm not trying to convert a program from C++ or C# to java, but a .jar packed into an .exe back into a raw .jar.

Was it helpful?

Solution

Without knowing any information about how it was packaged into an exe, one way would be to replace the core ClassLoader in rt.jar and write the data to a file in its defineClass method. This way, whenever the classes are loaded, they will be written to respective files.

Note that this is a hack and has a ton of pitfalls. To name one, it won't include other data in jar files such as resources. Your best bet would be to find out how it was packaged like @HovercraftFullOfEels mentioned.

OpenJDK java.lang.ClassLoader source

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