Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Well, the subject says it all. I have an exe that is an SFX, and I want to extract the ZIP from the SFX. How can I do that?

share|improve this question

4 Answers 4

up vote 6 down vote accepted

7-Zip should be capable of doing this. You can right click the file and select "Open Archive" or navigate to the file within 7-Zip and right-click and select "Open Inside".

share|improve this answer
    
@Darcs: I can't open the archive because the zip is encrypted with password. I just want to extract the zip from the exe, without unzipping in the middle. –  TCS Sep 22 '11 at 9:40
    
Can't say if it will work for your file, but simply changing the extension from .exe to .zip seemed to work fine for me. It will still contain the executable parts of the file, but 7-Zip seems perfectly happy to ignore it. –  Dracs Sep 22 '11 at 10:07
    
7-zip will open and recognize it, but I don't want the exe part in the file (purly zip file, that its header is PK, and not MZ like an exe). –  TCS Sep 22 '11 at 10:58
1  
I've managed to do this using a hex editor. The plain zip file and the edited SFX are identical. The process I did was to look for the zip file's header in the SFX. For 7-Zip this seems to be 37 7A BC, I did a search for the last occurrence of it. Then I deleted everything prior to it. This seems to give me an file identical to zipping my test file by itself. If you need a hex editor I used XVI32‌​. Let me know if it works for you or if you need anymore help. –  Dracs Sep 22 '11 at 11:28
    
If it's a proper ZIP format archive, the correct way to locate the data is to locate the central directory header by its four byte magic number and read the central directory to find the first file header. –  JdeBP Sep 22 '11 at 15:03

You can open an SFX file with WinZip if you want to access the files within. You don't need to execute the file.

It looks like a range of other compression utilities will also open SFX files.

share|improve this answer
    
I don't want to decompress the file (it is password protected), I just want to extract the zip from the exe. –  TCS Sep 22 '11 at 9:41
    
That will do it for you. Open in WinZip, and save archive as something.zip –  Rory Alsop Sep 22 '11 at 9:49

I had a similar problem, an SFX executable, that basically runs an exe that then allows you to run the files within the archive. Opening exe in 7zip shows it password protected. I searched for a solution, it must store the password in some kind of header... While reading this thread an alternative solution occurred to me.

Run the exe, then check C:\windows\temp sort by date and find the folder that the exe extracted to, there are the files inside the zip. Take them out and zip them back up. Viola! you have a zip of the exe, sans password.

share|improve this answer

On Linux it is possible with "zip" utility:

$ file london_f.exe
london_f.exe: PE32 executable for MS Windows (GUI) Intel 80386 32-bit
$ zip -J london_f.exe
$ file london_f.exe
london_f.exe: Zip archive data, at least v1.0 to extract
$ zip --version
Copyright (c) 1990-2008 Info-ZIP - Type 'zip "-L"' for software license.
This is Zip 3.0 (July 5th 2008), by Info-ZIP.
Currently maintained by E. Gordon.  Please send bug reports to
the authors using the web page at www.info-zip.org; see README for details.
...
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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