9

Is there any way to get a jar file from a jar wrapped using a exe wrapper. I have an exe file and I know that it was wrapper using exe wrapper (launch4j to be precise). How do I unwrap this jar to get back the jar. I have seen that I can unwrap it in Linux using fileroller, how do I do it in windows

ADD : How is it different if it wrapped using wrappers other than launch4j
meain
  • 243
  • 1
  • 2
  • 9

3 Answers3

13

I assume you want to extract a JAR file wrapped inside a .exe generated by launch4j. Launch4j places the jar file in the overlay of the executable, that is after the PE file. To extract it you can search for the string 'PK' from the bottom of the file to find the JAR archive, you should see something like this :

The jar file

Once you found it, remove all the content before it and save it to a new file with ".jar" extension.

There is actually a faster way to do it using 7zip. If you open the file with 7zip it will open the JAR file directly (a JAR is just a ZIP file), you can then extract the files and recreate the ZIP archive if needed.

enter image description here

ekse
  • 2,208
  • 13
  • 19
5

I was really checking on it and it seems there is a really easy way to do this.

PROGRAM USED : jd-gui


STEPS

  1. Extract the exe file using any archive manager (eg:WinRar)

  2. Now use this program (jd-gui) to decompile it.

    jd-gui

  3. You are done and now you have the code in native java form

perror
  • 19,083
  • 29
  • 87
  • 150
meain
  • 243
  • 1
  • 2
  • 9
0

Since we're talking windows (and 5 years later) how about this: intall the program, go to the install dir and get the jar(s) from there. Now you can decompile the jar directly.

Juan Carlos
  • 101
  • 1