Self-extracting archive

Last updated

A self-extracting archive created using 7-Zip 7-Zip self-extracting archive.png
A self-extracting archive created using 7-Zip

A self-extracting archive (SFX or SEA) is a computer executable program which combines compressed data in an archive file with machine-executable code to extract the information. Running on a compatible operating system, it does not need a suitable extractor in the target computer to extract the data [ citation needed ]. The executable part of the file is known as a decompressor stub .

Contents

Self-extracting files are used to share compressed files with a party that may not have the software needed to decompress a regular archive. Users can also use self-extracting archives to distribute their own software. For example, the WinRAR installation program is made using the graphical GUI RAR self-extracting module Default.sfx. [ citation needed ]

Overview

Self-extracting archives contain an executable file module, which is used to run uncompressed files from compressed files. The latter does not require an external program to decompress the contents of the self-extracting file, and can run the operation itself. However, file archivers like WinRAR can still treat a self-extracting file as if they were any other type of compressed file. By using a file archiver, users can view or decompress self-extracting files they received without running executable code (for example, if they are concerned about viruses). [ citation needed ]

A self-extracting archive is extracted and stored on a disk when executed under an operating system that supports it. Many embedded self-extractors support a number of command line arguments, such as specifying the target location or selecting only specific files. [ citation needed ]

Unlike self-extracting archives, non-self-extracting archives only contain archived files and must be extracted with a program that is compatible with them. While self-extracting archives cannot be extracted under another operating system, non-self-extracting ones can usually still be opened using a suitable extractor. This tool will disregard the executable part of the file and extract only the archive resource. The self-extracting executable may need to be renamed to contain a file extension associated with the corresponding packer; archive file formats known to support this include ARJ [1] and ZIP. [2] [3] Typically, self-extracting files have a .exe extension, just like any other executable file.

For example, an archive may be called "somefiles.zip—it" can be opened under any operating system by a suitable archive manager which supports both the file format and compression algorithm used. [2] It may also be converted into somefiles.exe, which will self-extract under Microsoft Windows. It will not self-extract under Linux, but can be opened with a suitable archive manager [ citation needed ]. Files that are not recognized as archives by archive managers due to their executable extension can be renamed into .zip. [3] This works for ZIP archives due to the way the ZIP header is defined, but not necessarily for other less flexible archive format.

There are several functionally equivalent but incompatible archive file formats, such as ZIP, RAR, 7z and others [ citation needed ]. Many programs can handle multiple types of archives, whereas others can create, extract, or modify only one type [ citation needed ]. Additionally, there is a distinction between the file format and the compression algorithm. A single file format, such as 7z, can support multiple different compression algorithms including LZMA, LZMA2, PPMd and BZip2 [ citation needed ]. Decompression utilities must be able to handle both the file format and the algorithm used when expanding self-extracting or standard archives. Depending on the options used to create a self-extracting archive, the executable code placed at the beginning may vary. When comparing a LZMA 7z archive to a LZMA2 7z archive, for example, the decompression routines will differ [ citation needed ].

Several programs can create self-extracting archives. Among the Windows archivers are WinZip, WinRAR, 7-Zip, WinUHA, KGB Archiver, Make SFX, the built-in IExpress wizard and others, including also experimental ones [ citation needed ]. Macintosh users can choose among StuffIt, The Unarchiver, or 7z X as their archivers. There are also programs that create self-extracting archives on Unix as shell scripts, which utilize programs like tar and gzip (which must be present in the destination system)[ citation needed ]. Others (like 7-Zip or RAR) can create self-extracting archives as regular executables in ELF format [ citation needed ]. One of the early examples of self-extracting archives is the Unix shar archive, which combined a number of text files into a shell script that recreated their original content after being executed [ citation needed ].

It is possible to archive both data and executable files with self-extracting archives. It must be distinguished from executable compression, where the executable file only contains a single executable, and running the file does not result in the uncompressed file being stored on disk, but in its code being executed in memory after decompression [ citation needed ].

Advantages

  1. Archiving files rather than sending them separately allows several related files to be combined into a single resource [ citation needed ].
  2. It reduces the size of files that aren't already efficiently compressed (most compression algorithms cannot reduce the size of already compressed files. Compression usually reduces the size of plain text documents, but rarely affects JPEGs or word processor documents, as many modern word processors already involve a certain level of compression) [ citation needed ].
  3. Self-extracting archives can also be used by users without the necessary programs for extracting their contents, as long as they run a compatible operating system. A self-extracting archive may still be more convenient for users who do have archive management software [ citation needed ].  

As long as the underlying compression algorithm and format allows it, self-extracting archives can also be encrypted for security [ citation needed ]. It is important to note, however, that in many cases, the file and directory names are not included in the encryption and can be viewed by anyone without a key or password. If a person can guess part of the contents of the files from their names or context alone, an attacker may be able to break the encryption on the entire archive in a short amount of computing power and time.

Disadvantages

  1. When sent as an email attachment or downloaded from the Internet, it may be a security risk. [2] An executable file described as a self-extracting archive may actually be a malicious program. [2] A suggested protection against this is to open it with an archive manager instead of executing it (losing the advantage of self-extraction); the archive manager will either report the file as not an archive or will show the underlying metadata of the executable file - a strong indication that the file is not actually a self-extracting archive [ citation needed ].
  2. Some systems for distributing files do not accept executable files in order to prevent the transmission of malicious programs. These systems disallow self-extracting archive files unless they are cumbersomely renamed by the sender to, say, somefiles.exe, and later renamed back again by the recipient [ citation needed ]. This technique is gradually becoming less effective, however, as an increasing number of security suites and antivirus software packages instead scan file headers for the underlying format rather than relying on a correct file extension [ citation needed ].
  3. Self-extracting archives will only run under the operating system family and platform with which they are compatible, making it more difficult to extract their contents under other systems. [2] Examples of self-extracting archives, which can be run on multiple targets (such as DOS and CP/M) rather than only the archive contents to be usable under multiple systems, are very rare, because they require the embedded decompressor stub to be a fat binary. [4] [5] [6] [7]
  4. Since the self-extracting archives must include executable code to handle the extraction of the contained archive file, they are slightly larger in size than the original archive [ citation needed ].

See also

Related Research Articles

ZIP is an archive file format that supports lossless data compression. A ZIP file may contain one or more files or directories that may have been compressed. The ZIP file format permits a number of compression algorithms, though DEFLATE is the most common. This format was originally created in 1989 and was first implemented in PKWARE, Inc.'s PKZIP utility, as a replacement for the previous ARC compression format by Thom Henderson. The ZIP format was then quickly supported by many software utilities other than PKZIP. Microsoft has included built-in ZIP support in versions of Microsoft Windows since 1998 via the "Plus! 98" addon for Windows 98. Native support was added as of the year 2000 in Windows ME. Apple has included built-in ZIP support in Mac OS X 10.3 and later. Most free operating systems have built in support for ZIP in similar manners to Windows and macOS.

RAR is a proprietary archive file format that supports data compression, error correction and file spanning. It was developed in 1993 by Russian software engineer Eugene Roshal and the software is licensed by win.rar GmbH. The name RAR stands for Roshal Archive.

Cabinet is an archive-file format for Microsoft Windows that supports lossless data compression and embedded digital certificates used for maintaining archive integrity. Cabinet files have .cab filename extensions and are recognized by their first four bytes MSCF. Cabinet files were known originally as Diamond files.

<span class="mw-page-title-main">7-Zip</span> Open-source file archiver

7-Zip is a free and open-source file archiver, a utility used to place groups of files within compressed containers known as "archives". It is developed by Igor Pavlov and was first released in 1999. 7-Zip has its own archive format called 7z, but can read and write several others.

7z is a compressed archive file format that supports several different data compression, encryption and pre-processing algorithms. The 7z format initially appeared as implemented by the 7-Zip archiver. The 7-Zip program is publicly available under the terms of the GNU Lesser General Public License. The LZMA SDK 4.62 was placed in the public domain in December 2008. The latest stable version of 7-Zip and LZMA SDK is version 23.01.

<span class="mw-page-title-main">StuffIt Expander</span> File decompressor software utility

StuffIt Expander is a proprietary, freeware, closed source, decompression software utility developed by Allume Systems. It runs on the classic Mac OS, macOS, and Microsoft Windows. Prior to 2011, a Linux version had also been available for download.

For Microsoft Windows, OS/2, and DOS, .exe is the filename extension that denotes a file as being executable – a computer program – containing an entry point.

<span class="mw-page-title-main">WinRAR</span> File archiver

WinRAR is a trialware file archiver utility for Windows, developed by Eugene Roshal of win.rar GmbH. It can create and view archives in RAR or ZIP file formats, and unpack numerous archive file formats. To enable the user to test the integrity of archives, WinRAR embeds CRC32 or BLAKE2 checksums for each file in each archive. WinRAR supports creating encrypted, multi-part and self-extracting archives.

<span class="mw-page-title-main">LHA (file format)</span>

LHA or LZH is a freeware compression utility and associated file format. It was created in 1988 by Haruyasu Yoshizaki, a doctor and originally named LHarc. A complete rewrite of LHarc, tentatively named LHx, was eventually released as LH. It was then renamed to LHA to avoid conflicting with the then-new MS-DOS 5.0 LH command. The original LHA and its Windows port, LHA32, are no longer in development because Yoshizaki is busy at work.

<span class="mw-page-title-main">TUGZip</span>

TUGZip is a freeware file archiver for Microsoft Windows. It handles a great variety of archive formats, including some of the commonly used ones like zip, rar, gzip, bzip2, sqx and 7z. It can also view disk image files like BIN, C2D, IMG, ISO and NRG. TugZip repairs corrupted ZIP archives and can encrypt files with 6 different algorithms.

The following tables compare general and technical information for a number of file archivers. Please see the individual products' articles for further information. They are neither all-inclusive nor are some entries necessarily up to date. Unless otherwise specified in the footnotes section, comparisons are based on the stable versions—without add-ons, extensions or external programs.

Executable compression is any means of compressing an executable file and combining the compressed data with decompression code into a single executable. When this compressed executable is executed, the decompression code recreates the original code from the compressed code before executing it. In most cases this happens transparently so the compressed executable can be used in exactly the same way as the original. Executable compressors are often referred to as executable packers, runtime packers, software packers, software protectors, or even "polymorphic packers" and "obfuscating tools".

<span class="mw-page-title-main">ZipGenius</span> Freeware file archiver

ZipGenius is a freeware file archiver developed by The ZipGenius Team for Microsoft Windows. It is capable of handling nearly two dozen file formats, including all the most common formats, as well as password-protect archives and work directly with CD-R/RW drives. It is presented in two editions: standard and suite. While the suite edition includes optional modules of the ZipGenius project, the standard setup package simply includes the main ZipGenius application.

<span class="mw-page-title-main">GNOME Archive Manager</span> Archive manager of the GNOME desktop environment (former File Roller)

Archive Manager is the file archiver of the GNOME desktop environment.

<span class="mw-page-title-main">PeaZip</span> File archive computer program

PeaZip is a free and open-source file manager and file archiver for Microsoft Windows, ReactOS, Linux, MacOS and BSD by Giorgio Tani. It supports its native PEA archive format and other mainstream formats, with special focus on handling open formats. Version 9.4.0 supported 234 file extensions.

<span class="mw-page-title-main">Xarchiver</span>

Xarchiver is a front-end to various command line archiving tools for Linux and BSD operating systems, designed to be independent of the desktop environment. It is the default archiving application of Xfce and LXDE. Deepin's archive manager is based on Xarchiver.

FreeArc is a free and open-source high-performance file archiver developed by Bulat Ziganshin. The project is presumably discontinued, since no information has been released by the developers since 2016 and the official website is down.

<span class="mw-page-title-main">BetterZip</span>

BetterZip is a trialware file archiver developed by Robert Rezabek, and first released in May 2006.It is developed solely for the macOS platform. Unlike the built-in Archive Utility from Apple it includes the ability to extract and compress in many archive formats, as well as the ability to view an archive and selectively extract files without automatically extracting the entire contents.

Express Zip File Compression Software is a file compression and archiving software program developed by NCH Software for Windows and Mac OS first released in 2010. It offers the ability to open, manage, archive, extract, and compress digital documents into .zip, .tar, .tgz, .wim, .arj, and .lzh as well as additional archive formats. It also supports file zipping and unzipping, file compression, sending compressed files as attachments via email, and backing up files by burning them to compatible discs (CD/DVD).

References

  1. Paul, Matthias R. (1997-07-30) [1994-05-01]. "Chapter I.2. Novell DOS 7 Updates: iii. Entpacken der Updates". NWDOS-TIPs Tips & Tricks rund um Novell DOS 7, mit Blick auf undokumentierte Details, Bugs und Workarounds. MPDOSTIP (in German) (3 ed.). Archived from the original on 2017-09-10. Retrieved 2014-08-06. Möchten Sie mit ARJ arbeiten, können Sie die .EXE-Datei auch einfach zu .ARJ umbenennen. ARJ kann darin enthaltene Dateien mit den üblichen Optionen entpacken (innerhalb des Norton Commanders ist dies allerdings wegen des anderen Dateikopfes nicht möglich). (NB. NWDOSTIP.TXT is a comprehensive work on Novell DOS 7 and OpenDOS 7.01, including the description of many undocumented features and internals. It is part of the author's yet larger MPDOSTIP.ZIP collection maintained up to 2001 and distributed on many sites at the time. The provided link points to a HTML-converted older version of the NWDOSTIP.TXT file.)
  2. 1 2 3 4 5 Paul, Matthias R. (2010-12-03). "Firmware 2.00 für Sony Alpha DSLR-A850/DSLR-A900". Mi-Fo (in German). Archived from the original on 2015-10-03. Retrieved 2022-05-28. […] bei modernen Systemen ist die Funktionalität, in ZIP-Archive hineinzugehen, als wären es Unterverzeichnisse im Dateisystem, voll in die Shell integriert, so daß man dafür gar kein eigenständiges Entpackprogramm mehr bemühen muß, wie das früher der Fall war. Das funktioniert auch unter Windows (Explorer) schon seit fünfzehn Jahren so (Windows 95), und selbst unter DOS läßt sich sowas problemlos für die Kommandozeile einrichten, bzw. war in Dateimanagern wie dem Norton Commander schon vor bald zwanzig Jahren integriert. […] Es ist eine wirklich sehr schlechte Idee, ausführbare Dateien (wie .EXE-Dateien) über das Netz verteilen zu wollen - im Grunde halte ich das für unverantwortlich, gerade wenn man auch unbedarfte "Nur-Anwender" in der Zielgruppe hat. Ausführbare Dateien stellen ein erhebliches Sicherheitsrisiko dar, denn sie können Viren enthalten (und tun dies auch oft). Deshalb blockieren viele Virenscanner und Firewalls sowas, und die Anwender, die sich an die Instruktionen auf Sonys Webseite halten (gerade, weil sie nichts falsch machen möchten), werden Schwierigkeiten haben, die Datei überhaupt herunterladen zu können. Die Leute, die es dennoch schaffen, werden u.U. mit dem nächsten Problem konfrontiert, nämlich der Tatsache, daß der spezielle Selbstentpacker, der in der .EXE-Datei integriert ist, nur unter bestimmten Versionen von Windows funktioniert. Manche Windows x64-Versionen, manche Windows Starter-Versionen und manche älteren Windows-Versionen werden nicht unterstützt. Das muß nicht so sein, man müßte einfach nur einen Selbstentpacker verwenden, der mit allen Windows-Versionen kompatibel ist. […]
  3. 1 2 Tunney, Justine Alexandra Roberts (2020-08-24). "αcτµαlly pδrταblε εxεcµταblε (Ape)". Archived from the original on 2021-09-12. Retrieved 2021-09-12.
  4. Elliott, John C. (1997-01-18) [1997-01-11]. "PMSFX 2". Newsgroup:  comp.os.cpm. Archived from the original on 2021-12-13. Retrieved 2021-12-13. […] I've written a version of PMSFX that produces .COM files unpackable under DOS and CP/M (the first three bytes are both legal Z80 code, legal 8086 code and legal PMA header). You can find it […] as a self-extracting archive. […]
  5. Wilkinson, William "Bill" Albert; Seligman, Cory; Drushel, Richard F.; Harston, Jonathan Graham; Elliott, John C. (1999-02-17). "MS-DOS & CP/M-Compatible Binaries". Newsgroup:  comp.os.cpm. Archived from the original on 2021-12-13. Retrieved 2021-12-13.
  6. Elliott, John C. (2012-06-20) [2005-01-05]. "Generic CP/M". Seasip.info. Archived from the original on 2021-11-17. Retrieved 2021-12-12. […] Self-extracting archives are .COM files containing a number of smaller files. When you run one, it will create its smaller files […] The self-extract archive programs will run under DOS (2 or later) or CP/M, with identical effects. To extract them under Unix, you can use ZXCC […] PMSFX21X.COM […] PMSFX is the program that was used to generate these self-unpacking archives. This version (2.11) can generate archives which unpack themselves under CP/M or DOS. You will need PMARC to use PMSFX. […]{{cite web}}: External link in |quote= (help)
  7. Elliott, John C. (2009-10-27). "CP/M info program". Newsgroup:  comp.os.cpm. Archived from the original on 2021-12-13. Retrieved 2021-12-13. […] More fun can be had with self-extract PMArc archives. Start one with […] defb 0EBh, 018h, '-pms-' […] and it's treated as a valid archive by the PMA utilities, sends 8086 processors to 011Ah, and Z80 processors to 0130h. […]