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
Offset
Size
Type
Field
Notes
0x0
1
u8
First Size
0x4
1
u8
Flags
0x5
1
u8
Ethod
0x6
1
u8
File Type
0xC
4
u32 LE/BE
Packed
0x10
4
u32 LE/BE
Size
struct.Carve buffer b · ArjCarver.cs
Offset
Size
Type
Field
Notes
0x0
1
u8
First Size
0x3
1
u8
Host Os
0x4
1
u8
Flags
0x5
1
u8
Ethod
0x6
1
u8
–
0x6
1
u8
File Type
0x8
4
u32 LE
Odified
0xC
4
u32 LE
Packed
0x10
4
u32 LE
Size
0x14
4
u32 LE
Crc
struct.Carve buffer main · ArjCarver.cs
Offset
Size
Type
Field
Notes
0x0
1
u8
–
0x1
1
u8
–
0x1
1
u8
Version
0x3
1
u8
Ain Os
0x4
1
u8
Ain Flags
0x8
4
u32 LE
Created
0x14
4
u32 LE
Envelope
0x1A
2
u16 LE
Envelope Length
struct.ReadHeader buffer head · ArjCarver.cs
Offset
Size
Type
Field
Notes
0x0
1
u8
–
0x1
1
u8
–
0x2
2
u16 LE
Size
struct.RunsOffDevice buffer head · ArjCarver.cs
Offset
Size
Type
Field
Notes
0x0
1
u8
–
0x1
1
u8
–
0x2
2
u16 LE
–
Other fields read
Read in
Offset
Size
Type
Field
Notes
struct.ReadHeader
size
4
u32 LE
–
struct.ReadHeader
0x0
2
u16 LE
Extended Size
Constants
General ArjCarver
Name
Value
Type
Notes
MainFileType
2
int
General ArjArchiveModule
Name
Value
Type
Notes
MainFileType
2
int
Implementation limits reader
Class
Name
Value
Notes
ArjCarver
MaxBasicHeader
2600
ArjCarver
MinBasicHeader
30
ArjCarver
MaxEntries
65536
ArjCarver
MaxExtendedHeaders
64
ArjCarver
MaxCheckedOutput
1L << 30
decode at most 1 GB per archive for CRC checks
ArjDecoder
WindowSize
1 << 15
ArjDecoder
WindowMask
WindowSize – 1
ArjDecoder
MaxLiterals
510
NC: 256 literals + 254 match lengths
ArjDecoder
MaxDistanceSymbols
17
ArjDecoder
MaxMetaSymbols
19
ArjDecoder
MaxCodeLength
16
ArjDecoder
MaxOverrun
4
bytes the bit reader may fetch past the compressed data
ArjArchiveModule
MaxEntries
2_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.