Jump to content

Self-extracting archive

From Wikipedia, the free encyclopedia

A self-extracting archive created using7-Zip

Aself-extracting archive(SFXorSEA) is acomputerexecutable programwhich combines compressed data in anarchive filewith 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 adecompressor stub.

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, theWinRARinstallation program is made using the graphical GUIRARself-extracting module Default.sfx.[citation needed]

Overview

[edit]

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 it 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 anoperating systemthat 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 some formats of 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 includeARJ[1]andZIP.[2][3]Typically, self-extracting files have a.exeextension, just like any other executable file.

For example, an archive may be called "somefiles.zip—it", which can be opened under any operating system by a suitable archive manager that supports both the file format and compression algorithm used.[2]It may also be converted into somefiles.exe, which will self-extract underMicrosoft Windows.It will not self-extract underLinuxbut 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 formats.

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, includingLZMA,LZMA2,PPMd,andBZip2.[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 theWindowsarchivers areWinZip,WinRAR,7-Zip,WinUHA,KGB Archiver,Make SFX, the built-inIExpresswizard, and others, including experimental ones.[citation needed]Macintosh users can choose amongStuffIt,The Unarchiver,or 7z X as their archivers. There are also programs that create self-extracting archives onUnixasshell scripts,which utilize programs like tar andgzip(which must be present in the destination system).[citation needed]Others (like7-ZiporRAR) can create self-extracting archives as regular executables inELFformat.[citation needed]One of the early examples of self-extracting archives is the Unixshararchive, 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 fromexecutable 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

[edit]
  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 efficientlycompressed(most compression algorithms cannot reduce the size of already compressed files. Compression usually reduces the size ofplain textdocuments, but rarely affectsJPEGsorword processordocuments, 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 allow it, self-extracting archives can also beencryptedfor 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 with a short amount of computing power and time.

Disadvantages

[edit]
  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 andantivirus softwarepackages 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 asDOSandCP/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 afat 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

[edit]

References

[edit]
  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.).Archivedfrom the original on 2017-09-10.Retrieved2014-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 desNorton Commandersist 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 largerMPDOSTIP.ZIPcollection maintained up to 2001 and distributed on many sites at the time. The provided link points to a HTML-converted older version of theNWDOSTIP.TXTfile.)[1]
  2. ^abcdePaul, Matthias R. (2010-12-03)."Firmware 2.00 für Sony Alpha DSLR-A850/DSLR-A900".Mi-Fo(in German). Archived fromthe originalon 2015-10-03.Retrieved2022-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. […][2]
  3. ^abTunney, Justine Alexandra Roberts (2020-08-24)."αcτµαlly pδrταblε εxεcµταblε (Ape)".Archivedfrom the original on 2021-09-12.Retrieved2021-09-12.
  4. ^Elliott, John C. (1997-01-18) [1997-01-11]."PMSFX 2".Newsgroup:comp.os.cpm.Archivedfrom the original on 2021-12-13.Retrieved2021-12-13.[…] I've written a version ofPMSFXthat produces.COM filesunpackable underDOSandCP/M(the first three bytes are both legalZ80code, legal8086code and legalPMAheader). 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.Archivedfrom the original on 2021-12-13.Retrieved2021-12-13.
  6. ^Elliott, John C. (2012-06-20) [2005-01-05]."Generic CP/M".Seasip.info.Archivedfrom the original on 2021-11-17.Retrieved2021-12-12.[…] Self-extracting archives are.COM filescontaining a number of smaller files. When you run one, it will create its smaller files […] The self-extract archive programs will run underDOS(2 or later) orCP/M,with identical effects. To extract them underUnix,you can use ZXCC […]PMSFX21X.COM[…]PMSFXis 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 needPMARCto use PMSFX. […]{{cite web}}:External link in|quote=(help)[3]
  7. ^Elliott, John C. (2009-10-27)."CP/M info program".Newsgroup:comp.os.cpm.Archivedfrom the original on 2021-12-13.Retrieved2021-12-13.[…] More fun can be had with self-extractPMArcarchives. Start one with […] defb 0EBh, 018h, '-pms-' […] and it's treated as a valid archive by the PMA utilities, sends8086processors to 011Ah, andZ80processors to 0130h. […]
[edit]