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
3
  • 2
    Related Jan 24, 2014 at 8:48
  • Your question is unclear, I assume you want to get back the JAR file from the EXE generated by launch4j?
    – ekse
    Jan 24, 2014 at 15:34
  • oops i am sorry, my bad.. It was meant to get back the jar
    – meain
    Jan 25, 2014 at 8:31

3 Answers 3

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

4
  • How is it different if it wrapped using wrappers other than launch4j
    – meain
    Jan 27, 2014 at 13:05
  • @MEAIN: a very theoretical question. Depends how it gets packaged. If the JAR gets simply put into the file, the process will be very similar.
    – 0xC0000022L
    Jan 27, 2014 at 14:23
  • 1
    Man, this 7zip trick is really cool. Jan 21, 2015 at 1:36
  • @TomášZato glad you found it useful!
    – ekse
    Jan 21, 2015 at 1:45
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

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.