Jump to content
Setting up an AI agent? ReverseEngineering.wiki skill (works from the command line, no configuration): https://reverseengineering.wiki/skill/rewiki/SKILL.md · setup for every client, including MCP: https://reverseengineering.wiki/llms.txt · REWiki:Connect

Format:MacBinary

From ReverseEngineering.wiki
Format
On this wiki Facts · Code · Notes · Topics

A 128-byte header followed by the data fork and resource fork (each padded to 128 bytes) that carries a classic Mac file through non-Mac systems; versions I, II (CRC at 124) and III (signature 'mBIN' at 102).

Overview

MacBinary packs the name, type, creator, Finder flags, dates and both forks of a classic Mac file into one stream (.bin, often wrapping a Format:StuffIt .sit archive as .sit.bin). It is the usual output of Mac downloads from the web in the 1990s. See Platform:Classic Mac OS, Format:Mac resource fork.

Recognition

The Unarchiver (XADMaster, LGPL-2.1) decides the version in XADMacArchiveParser macBinaryVersionForHeader (lines 34-76) from the first 128 bytes. The header is rejected unless: byte 0 is 0, byte 74 is 0, byte 82 is 0, bytes 108-115 are all 0, the filename length at byte 1 is 1-63 and the filename bytes (from byte 2) contain no zero. Then the big-endian CRC-16 (polynomial 0x1021, init 0) of bytes 0-123 is compared with the u16 at 124: if it matches and the u32 at 102 is 'mBIN' the file is MacBinary III, otherwise II. A second check with CRC-16/USB (init 0xFFFF, reflected polynomial 0xA001, xor 0xFFFF) is accepted too, because real files needed it. If both CRCs fail, version I is accepted only if bytes 99-125 are all zero, the data fork length (u32 at 83) and the resource fork length (u32 at 87) are at most 0x7FFFFFFF and the creation date (u32 at 91) and modification date (u32 at 95) are non-zero.

The fields at offsets 83, 87, 91, 95, 99 (comment), 102 and 124 therefore are: data fork length, resource fork length, creation date, modification date, then the signature and CRC. Unverified (from the published MacBinary spec, not from the parser): offset 65 file type, 69 creator, 73 Finder flags high byte, 101 Finder flags low byte (MacBinary II), 120-121 secondary header length, 122 version that wrote the file (129 for II, 130 for III), 123 minimum version (129).

Layout

Unverified: after the 128-byte header come the data fork, padded with zeros to a multiple of 128 bytes, then the resource fork padded the same way; with MacBinary II/III an optional secondary header (comment) may follow the header.

Tools

XADMaster (The Unarchiver) reads it. Unverified: libarchive and other tools were not checked.

Code & repositories

  • https://github.com/MacPaw/XADMaster @ 7cb9ee0abbb163f261e4cb74501e15067032319c · license: LGPL-2.1
    The Unarchiver's engine (Objective-C, LGPL-2.1): recognisers and parsers for MacBinary, AppleSingle/Double, BinHex and StuffIt 1-5.
    Tested on: source read, not run: read the source only · checked 2026-10-19; last activity 2026-09-21