StuffIt Archive (.sit)

Classic Mac archive format.

Overview

Classic StuffIt files begin with the signature SIT! (and others such as StuffIt) and contain file headers with separate resource and data fork information, compression methods (stored, RLE, LZW, Huffman, Method 13, Method 15) and CRC-16. Passwords and later formats (StuffIt 5+) differ.

Where it is used

  • Classic Mac OS software distribution, 1987-2000s.

History

  • Created by Raymond Lau in 1987; later developed by Aladdin Systems and Smith Micro.

Status today

  • Legacy; encountered in vintage Mac archives.

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.

struct.ParseDecoded buffer data · BinHexCarver.cs

OffsetSizeTypeFieldNotes
0x01u8Name Length
at + 44bytesCreator
at + 104u32 BEData Length
at + 144u32 BEResource Length

MacBinaryCarver.Carve buffer h · MacBinaryCarver.cs

OffsetSizeTypeFieldNotes
0x0124bytesCrc Ok
0x0124bytes–
0x01u8–
0x11u8Name Length
0x414bytesType
0x454bytesCreator
0x4A1u8–
0x521u8–
0x534u32 BEData Length
0x574u32 BEResource Length
0x5B4u32 BE–
0x5B4u32 BECreated
0x5F4u32 BE–
0x5F4u32 BEOdified
0x6327bytes–
0x664bytesBin3
0x6C8bytes–
0x782u16 BE–
0x7C2u16 BEStored Crc

StuffItArchiveModule.IsClassicSignature buffer head · StuffItArchiveModule.cs

OffsetSizeTypeFieldNotes
0x01u8–
0x11u8–
0x21u8–
0x31u8–
0xA4bytes–

StuffItArchiveModule.WalkClassic buffer head · StuffItArchiveModule.cs

OffsetSizeTypeFieldNotes
0x64u32 BETotal Size
0xE1u8Version

StuffItArchiveModule.WalkClassic buffer span · StuffItArchiveModule.cs

OffsetSizeTypeFieldNotes
0x504u32 BEOdified
0x544u32 BEResource Size
0x584u32 BEData Size
0x5C4u32 BEResource Packed
0x604u32 BEData Packed
0x6E2u16 BE–

StuffItArchiveModule.WalkSit5 buffer fixedPart · StuffItArchiveModule.cs

OffsetSizeTypeFieldNotes
0x04u32 BE–
0x41u8Version
0x62u16 BEHeader Size
0x1E2u16 BEName Length

StuffItArchiveModule.WalkSit5 buffer head · StuffItArchiveModule.cs

OffsetSizeTypeFieldNotes
0x521u8–
0x544u32 BETotal Size
0x5E4u32 BEFirst Offset

StuffItArchiveModule.WalkSit5 buffer header · StuffItArchiveModule.cs

OffsetSizeTypeFieldNotes
0x91u8Flags
0x202u16 BEStored
0x2E1u8Data Method
0x2F1u8Pass Length

StuffItArchiveModule.WalkSit5 buffer span · StuffItArchiveModule.cs

OffsetSizeTypeFieldNotes
0xE4u32 BEOdified
0x1A4u32 BEDir Offset
0x224u32 BEData Size
0x264u32 BEData Packed
p2u16 BEComment Size

StuffItArchiveModule.WalkSit5 buffer tail · StuffItArchiveModule.cs

OffsetSizeTypeFieldNotes
0x02u16 BEResource Flags
t4u32 BEResource Size
t + 44u32 BEResource Packed
t + 121u8Resource Method
t + 131u8Resource Pass

StuffItCarver.IsClassicSignature buffer head · StuffItCarver.cs

OffsetSizeTypeFieldNotes
0x01u8–
0x11u8–
0x21u8–
0x31u8–
0xA4bytes–

Walker.ReadClassicEntry buffer span · StuffItCarver.cs

OffsetSizeTypeFieldNotes
0x424u32 BEFile Type
0x464u32 BECreator
0x4C4u32 BECreated
0x504u32 BEModified
0x544u32 BEResource Size
0x584u32 BEData Size
0x5C4u32 BEResource Packed
0x604u32 BEData Packed
0x642u16 BE–
0x662u16 BE–
0x6E2u16 BE–

Walker.ReadClassicHeader buffer head · StuffItCarver.cs

OffsetSizeTypeFieldNotes
0x64u32 BETotal Size
0xE1u8Version

Walker.ReadSit5Entry buffer fixedPart · StuffItCarver.cs

OffsetSizeTypeFieldNotes
0x04u32 BE–
0x41u8Version
0x62u16 BEHeader Size
0x1E2u16 BEName Length

Walker.ReadSit5Entry buffer header · StuffItCarver.cs

OffsetSizeTypeFieldNotes
0x91u8Flags
0x202u16 BEStored
0x2E1u8–
0x2F1u8Pass Length

Walker.ReadSit5Entry buffer span · StuffItCarver.cs

OffsetSizeTypeFieldNotes
0xA4u32 BECreated
0xE4u32 BEModified
0x1A4u32 BEDirectory Offset
0x224u32 BEData Size
0x264u32 BEData Packed
0x2A2u16 BE–
p2u16 BEComment Size

Walker.ReadSit5Entry buffer tail · StuffItCarver.cs

OffsetSizeTypeFieldNotes
0x02u16 BEResource Flags
0x44u32 BEFile Type
0x84u32 BECreator
t4u32 BEResource Size
t + 44u32 BEResource Packed
t + 82u16 BEResource Crc
t + 121u8Resource Method
t + 131u8Resource Pass

Walker.ReadSit5Header buffer head · StuffItCarver.cs

OffsetSizeTypeFieldNotes
0x521u8–
0x531u8Flags
0x544u32 BETotal Size
0x5E4u32 BEFirst Offset

Walker.ReadSit5Header buffer header · StuffItCarver.cs

OffsetSizeTypeFieldNotes
0x622u16 BEStored
0x621u8–
0x631u8–
p2u16 BEComment Size
p2u16 BE–

Other fields read

Read inOffsetSizeTypeFieldNotes
struct.Checkstart + length2u16 BEStored
StuffItArchiveModule.Mount0x016bytes–
Walker.ScanClassic0x6E2u16 BE–

Constants

General BinHexCarver

NameValueTypeNotes
ReadBlock1 << 20int
DecodeBuildDecode()sbyte[]

General MacBinaryCarver

NameValueTypeNotes
HeaderSize128int

Mac OS Roman for bytes 0x80-0xFF. MacFormats

NameValueTypeNotes
MacEpochnew(1904, 1, 1, 0, 0, 0, DateTimeKind.Unspecified)DateTime

General StuffItCarver

NameValueTypeNotes
ClassicHeaderSize22int
ClassicEntrySize112int
Sit5EntryFixed48int
Sit5EntryId0xA5A5A5A5uint
ResyncBack1024 * 1024long
ResyncAhead16L * 1024 * 1024long
ReadBlock1024 * 1024int
Sector512int
Sit5Text“StuffIt (c)1997-“u8.ToArray()byte[]

Mac OS Roman for bytes 0x80-0xFF (StuffIt names are Mac Roman, also from StuffIt for Windows). StuffItCarver

NameValueTypeNotes
MacEpochnew(1904, 1, 1, 0, 0, 0, DateTimeKind.Unspecified)DateTime

—- Method 2: LZW ————————————————————————– StuffItDecoders

NameValueTypeNotes
MaxBits14, Clear = 256, MaxDictionary = 1 << MaxBitsint

—- Method 8: MW (Miller-Wegman) ————————————————————- StuffItDecoders

NameValueTypeNotes
DictionarySize16385int

General Arsenic

NameValueTypeNotes
NumBits26, One = 1 << (NumBits – 1), Half = 1 << (NumBits – 2)int

General StuffItArchiveModule

NameValueTypeNotes
ClassicHeaderSize22int
ClassicEntrySize112int
Sit5EntryFixed48int
Sit5EntryId0xA5A5A5A5uint
Sit5Text“StuffIt (c)1997-“u8.ToArray()byte[]
MacEpochnew(1904, 1, 1, 0, 0, 0, DateTimeKind.Utc)DateTime

Implementation limits reader

ClassNameValueNotes
BinHexCarverMaxHeaderSearch4096
BinHexCarverMaxDecoded256 * 1024 * 1024
MacBinaryCarverMaxFork1L << 31
StuffItCarverMaxResyncs64
StuffItCarverMaxShiftSectors64
StuffItCarverMaxEntries1_000_000
StuffItCarverMaxNamesInDetails25
StuffItArchiveModuleMaxEntries1_000_000

Signatures and magic strings referenced

TextWhereContext
mBINMacBinaryCarver.Carvebool mbin3 = h.AsSpan(102, 4).SequenceEqual(“mBIN”u8);
StuffIt (c)1997-MacFormats.FindStuffItif (at.StartsWith(“StuffIt (c)1997-“u8))
SIT!MacFormats.FindStuffItif (at[10] == ‘r’ && at[11] == ‘L’ && at[12] == ‘a’ && at[13] == ‘u’ && (at.StartsWith(“SIT!”u8) || (at[0] == ‘S’ && at[1] == ‘T’)))
StuffIt (c)1997-StuffItCarverprivate static readonly byte[] Sit5Text = “StuffIt (c)1997-“u8.ToArray();
SIT!\0\0\0\0\0\0rLauStuffItCarvernew CarveSignature(“SIT!\0\0\0\0\0\0rLau”u8.ToArray(), 0,
ST\0\0\0\0\0\0\0\0rLauStuffItCarvernew CarveSignature(“ST\0\0\0\0\0\0\0\0rLau”u8.ToArray(), 0,
rLauStuffItCarver.IsClassicSignatureif (head.Length < 14 || !head.Slice(10, 4).SequenceEqual(“rLau”u8))
SIT!StuffItCarver.IsClassicSignatureif (head[..4].SequenceEqual(“SIT!”u8))
StuffIt (c)1997-StuffItArchiveModuleprivate static readonly byte[] Sit5Text = “StuffIt (c)1997-“u8.ToArray();
SIT!StuffItArchiveModulenew Signature(0, “SIT!”u8.ToArray(), Confidence.High, “StuffIt 1.5-4.5”),
STStuffItArchiveModulenew Signature(0, “ST”u8.ToArray(), Confidence.Low, “StuffIt installer”),
rLauStuffItArchiveModule.IsClassicSignatureif (head.Length < 14 || !head.Slice(10, 4).SequenceEqual(“rLau”u8))
Structures and constants were extracted from: Carving/Plugins/StuffIt/BinHexCarver.cs, Carving/Plugins/StuffIt/MacBinaryCarver.cs, Carving/Plugins/StuffIt/MacFormats.cs, Carving/Plugins/StuffIt/StuffItCarver.cs, Carving/Plugins/StuffIt/StuffItDecoders.cs, Carving/Plugins/StuffIt/StuffItMethod13Tables.cs, Modules/FileSystems/StuffItArchiveModule.cs. Prose sections are a summary from public sources; verify details before relying on them.