ARJ Archive (.arj)

DOS-era archive format.

Overview

ARJ files begin with the magic 60 EA. A main header and local file headers carry CRC-32, methods (stored and 1-4) and flags for multi-volume sets. Compression uses LZ77 with Huffman coding.

Where it is used

  • DOS and BBS software distribution in the 1990s.

History

  • Created by Robert Jung in 1991.

Status today

  • Legacy; supported by common extraction tools.

Structures read by the implementation

Offsets are in bytes from the start of the buffer named in each heading. Field names are taken from the implementation and are not an official specification. Fixed-width integers are shown as u/i (unsigned/signed) followed by bit width and byte order.

ArjArchiveModule.Mount buffer b · ArjArchiveModule.cs

OffsetSizeTypeFieldNotes
0x01u8First Size
0x41u8Flags
0x51u8Ethod
0x61u8File Type
0xC4u32 LE/BEPacked
0x104u32 LE/BESize

struct.Carve buffer b · ArjCarver.cs

OffsetSizeTypeFieldNotes
0x01u8First Size
0x31u8Host Os
0x41u8Flags
0x51u8Ethod
0x61u8–
0x61u8File Type
0x84u32 LEOdified
0xC4u32 LEPacked
0x104u32 LESize
0x144u32 LECrc

struct.Carve buffer main · ArjCarver.cs

OffsetSizeTypeFieldNotes
0x01u8–
0x11u8–
0x11u8Version
0x31u8Ain Os
0x41u8Ain Flags
0x84u32 LECreated
0x144u32 LEEnvelope
0x1A2u16 LEEnvelope Length

struct.ReadHeader buffer head · ArjCarver.cs

OffsetSizeTypeFieldNotes
0x01u8–
0x11u8–
0x22u16 LESize

struct.RunsOffDevice buffer head · ArjCarver.cs

OffsetSizeTypeFieldNotes
0x01u8–
0x11u8–
0x22u16 LE–

Other fields read

Read inOffsetSizeTypeFieldNotes
struct.ReadHeadersize4u32 LE–
struct.ReadHeader0x02u16 LEExtended Size

Constants

General ArjCarver

NameValueTypeNotes
MainFileType2int

General ArjArchiveModule

NameValueTypeNotes
MainFileType2int

Implementation limits reader

ClassNameValueNotes
ArjCarverMaxBasicHeader2600
ArjCarverMinBasicHeader30
ArjCarverMaxEntries65536
ArjCarverMaxExtendedHeaders64
ArjCarverMaxCheckedOutput1L << 30decode at most 1 GB per archive for CRC checks
ArjDecoderWindowSize1 << 15
ArjDecoderWindowMaskWindowSize – 1
ArjDecoderMaxLiterals510NC: 256 literals + 254 match lengths
ArjDecoderMaxDistanceSymbols17
ArjDecoderMaxMetaSymbols19
ArjDecoderMaxCodeLength16
ArjDecoderMaxOverrun4bytes the bit reader may fetch past the compressed data
ArjArchiveModuleMaxEntries2_000_000
Structures and constants were extracted from: Carving/Plugins/Arj/ArjCarver.cs, Carving/Plugins/Arj/ArjDecoder.cs, Modules/FileSystems/ArjArchiveModule.cs. Prose sections are a summary from public sources; verify details before relying on them.