How Unrar Handles 1990s RAR Archives

Modern versions of unrar maintain backward compatibility with archives created during the 1990s by retaining dedicated legacy decompression routines within its source code. While the RAR format underwent major architectural overhauls with RAR 3.0 in the early 2000s and RAR 5.0 in 2013, the official extraction utility inspects the archive header to detect vintage RAR 1.5 and RAR 2.0 formats, automatically routing data through specialized unpacking engines designed to parse 1990s compression algorithms.

Archive Header Identification

When unrar opens an archive, it reads the initial signature bytes (magic numbers) to determine the specification version:

  • RAR 1.x and 2.x: These legacy formats begin with the marker block 0x52 0x45 0x7E 0x5E (RE~^).
  • RAR 3.x and 4.x: These use 0x52 0x61 0x72 0x21 0x1A 0x07 0x00 (Rar!...).
  • RAR 5.x: Modern archives use 0x52 0x61 0x72 0x21 0x1A 0x07 0x01 0x00.

Upon encountering the vintage RE~^ marker, unrar bypasses its primary decompression engine and activates its legacy parsing modules.

Dedicated Legacy Decompression Modules

Instead of attempting to decompress older formats with modern algorithms, the official unrar source maintains isolated code files to replicate 1990s decompression behavior:

  1. Unpack 1.5 Engine (unpack15.cpp): Handles files created by RAR 1.5x (released in the mid-1990s). This engine processes basic sliding dictionary compression combined with fixed and dynamic Huffman trees.
  2. Unpack 2.0 Engine (unpack20.cpp): Handles files created by RAR 2.0 through 2.9 (introduced in 1996). RAR 2.0 expanded dictionary sizes up to 1 MB and introduced specialized compression algorithms for multimedia files (8-bit and 16-bit audio, raw bitmaps) along with solid archiving. The unpacker contains specific subroutines to reverse these obsolete multimedia filters.

Unsupported 1990s Formats

Compatibility does not extend indefinitely backward. Archives created by the earliest public releases, such as RAR 1.3 (released in 1993), are not fully supported by current builds of unrar. The internal unpack engine was standardized starting at RAR 1.5; archives older than this typically produce an unsupported format error, requiring original DOS binaries running in an emulator to extract properly.

Security and Legacy Code Maintenance

Legacy formats present a notable attack surface because 1990s formats were designed before modern secure coding standards were established. Over the years, vulnerabilities—such as integer overflows, out-of-bounds writes, and path traversal flaws—have been discovered within the legacy unpack modules. Rather than removing backward compatibility entirely, the maintainers of unrar have audited and hardened unpack15.cpp and unpack20.cpp, enforcing strict bounds checking when parsing corrupted or maliciously crafted vintage archives.