4

I have a Java application that was converted to an .exe with launch4j. For several reasons I need to get access to the class files of the application.

The first thing I tried was unpacking the exe with 7zip. That way I get a handful of class files, but definately not the whole application packed in the exe (the class files seem to belong to launch4j).

What other options are there?

Boris
  • 8,551
  • 25
  • 67
  • 120
  • 1
    They may have used this to obfuscate and protect the code as well. Can I ask why you need to modify and decompile this executable? Can you not ask the vendor of the application for the source code? – maple_shaft Feb 14 '13 at 16:36
  • Since I'm the vendor that would not help ;-) I've created the application some time ago. I thought I wouldn't have to touch the application ever again, so now all my projects files are gone. Only the executable remains. And no, the sources weren't obfuscated or anything... – Boris Feb 14 '13 at 16:39
  • When you create a launch4j exe that wraps a JAR, the resulting `.exe` file is actually still a valid JAR due to the way the ZIP file format allows arbitrary "junk" to be prepended to a ZIP file. Launch4J doesn't itself do any kind of obfuscation, it simply sticks an executable header on the front of whatever JAR you told it to wrap. – Ian Roberts Feb 14 '13 at 17:34

2 Answers2

1

You can use something like this to extract the JAR from the Launch4j executable:

http://www.nirsoft.net/utils/resources_extract.html

Typically the executable packages necessary JAR's as executable resources and then looks for a JDK on the path to execute.

Once you get the JAR file you should be able to decompile it.

maple_shaft
  • 10,435
  • 6
  • 46
  • 74
-4

You cannot get access to class files. Exes are created, So that nobody can get access to your code. If somehow , you are able to get access to jar files then you can decompile them to get the code and make changes.

RajputAdya
  • 63
  • 1
  • 8
  • 2
    Actually, the point of launch4j is to provide a better experience for the user, not to protect the jar file. The same way UPX is so easy to unpack because it’s a packer, not a protector. – Emily Feb 14 '13 at 17:34