如何从自解压exe提取ZIP?


18

好吧,这个话题说明了一切。我有一个SFX文件,我想从SFX文件中提取ZIP。我怎样才能做到这一点?

Answers:


16

7-Zip应该可以做到这一点。您可以右键单击文件,然后选择“打开存档”,或者导航到7-Zip中的文件,然后右键单击并选择“内部打开”。


@Darcs:我无法打开档案,因为该邮编已用密码加密。我只想从exe解压缩文件,而无需在中间解压缩。
TCS

不能说它是否适用于您的文件,但是将扩展名从.exe更改为.zip似乎对我来说很好。它仍然包含文件的可执行部分,但是7-Zip似乎很乐意忽略它。
Dracs 2011年

7-zip将打开并识别它,但是我不希望文件中的exe部分(纯zip文件,其标题是PK,而不是像exe一样的MZ)。
TCS

1
我已经设法使用十六进制编辑器来做到这一点。普通的zip文件和编辑的SFX是相同的。我所做的过程是在SFX中查找zip文件的标头。对于7-Zip,这似乎是BC 7 7A BC,我搜索了它的最后一次出现。然后我删除了之前的所有内容。这似乎给了我一个文件,该文件与单独压缩测试文件相同。如果需要十六进制编辑器,则可以使用XVI32。让我知道它是否适合您,或者您是否需要更多帮助。
Dracs

1
如果它是正确ZIP格式的存档,则定位数据的正确方法是通过中央字节头的四字节幻数来定位中央目录头,然后读取中央目录以查找第一个文件头。
JdeBP 2011年

8

在Linux上,可以使用“ zip”实用程序:

$ file london_f.exe
london_f.exe: PE32 executable for MS Windows (GUI) Intel 80386 32-bit

警告:下一行将更改原始.exe文件,使其成为没有exe部件的纯zip存档!

$ 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.
...

2

在Linux上,如果是固执的

zip -J file.exe

不会将其转换为可解压缩的zip,因为非zip部分不仅是前置的,请参见手册页:

   -J
   --junk-sfx
          Strip any prepended data (e.g. a SFX stub) from the archive.

那么zip实用程序还有另外两个有用的选项:

   -F
   --fix
   -FF
   --fixfix
          Fix the zip archive. The -F option can be used if some portions of the archive are missing, but requires a reasonably intact  central  directory.   The
          input archive is scanned as usual, but zip will ignore some problems.  The resulting archive should be valid, but any inconsistent entries will be left
          out.

          When doubled as in -FF, the archive is scanned from the beginning and zip scans for special signatures to identify the limits between the archive  mem‐
          bers. The single -F is more reliable if the archive is not too much damaged, so try this option first.

          If  the  archive is too damaged or the end has been truncated, you must use -FF.  This is a change from zip 2.32, where the -F option is able to read a
          truncated archive.  The -F option now more reliably fixes archives with minor damage and the -FF option is needed to fix archives where -F  might  have
          been sufficient before.

          Neither  option  will recover archives that have been incorrectly transferred in ascii mode instead of binary. After the repair, the -t option of unzip
          may show that some files have a bad CRC. Such files cannot be recovered; you can remove them from the archive using the -d option of zip.

          Note that -FF may have trouble fixing archives that include an embedded zip archive that was stored (without compression) in the archive and, depending
          on the damage, it may find the entries in the embedded archive rather than the archive itself.  Try -F first as it does not have this problem.

          The format of the fix commands have changed.  For example, to fix the damaged archive foo.zip,

                 zip -F foo --out foofix

          tries  to read the entries normally, copying good entries to the new archive foofix.zip.  If this doesn't work, as when the archive is truncated, or if
          some entries you know are in the archive are missed, then try

                 zip -FF foo --out foofixfix

          and compare the resulting archive to the archive created by -F.  The -FF option may create an inconsistent archive.  Depending on what is damaged,  you
          can then use the -F option to fix that archive.

          A split archive with missing split files can be fixed using -F if you have the last split of the archive (the .zip file).  If this file is missing, you
          must use -FF to fix the archive, which will prompt you for the splits you have.

          Currently the fix options can't recover entries that have a bad checksum or are otherwise damaged.

所以尝试

zip -F file.exe --out extracted.zip

如果失败了

zip -FF file.exe --out extracted.zip

1

我还没有看到无法执行此操作的zip操纵程序。自我解压缩的存档文件也是有效的zip文件,只是其中包含一堆额外的内容(提取器)。

您可能会发现您无法选择该实用程序作为打开文件的方式,但是如果您只运行该实用程序然后选择它可以工作的文件,则可能会发现。


您将如何使用Windows的默认内置“压缩文件夹”实用程序来执行此操作?
cowlinator

@cowlinator不知道。很久很久以前,我发现了内置处理程序越野车,从那时起我就再也没有尝试过使用它。
罗伦·佩希特

0

如果要访问其中的文件,可以使用WinZip打开SFX文件。您不需要执行文件。

看起来许多其他压缩实用程序也将打开SFX文件。


我不想解压缩文件(它受密码保护),我只想从exe解压缩zip。
TCS

那将为您做到。在WinZip中打开,然后将存档另存为something.zip
Rory Alsop

0

我有一个类似的问题,一个SFX可执行文件,它基本上运行一个exe,然后允许您运行存档中的文件。在7zip中打开exe会显示它受密码保护。我在寻找解决方案,它必须将密码存储在某种标头中...在阅读此线程时,我想到了另一种解决方案。

运行exe,然后检查C:\ windows \ temp按日期排序,找到exe提取到的文件夹,其中包含zip文件。将它们取出并拉回拉链。中提琴!您有一个zip压缩文件,没有密码。


0

如果您要处理gog.com游戏,请使用Innoextractunzip,,unrar7zip等人对我不起作用。


其他压缩程序是否不适用于GOG文件?GOG文件是自解压的吗?
music2myear
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.