1b6cee71dSXin LI 2b6cee71dSXin LI#------------------------------------------------------------------------------ 3*ae316d1dSXin LI# $File: apple,v 1.51 2024/09/04 19:06:12 christos Exp $ 4b6cee71dSXin LI# apple: file(1) magic for Apple file formats 5b6cee71dSXin LI# 6b6cee71dSXin LI0 search/1/t FiLeStArTfIlEsTaRt binscii (apple ][) text 7b6cee71dSXin LI0 string \x0aGL Binary II (apple ][) data 8b6cee71dSXin LI0 string \x76\xff Squeezed (apple ][) data 9b6cee71dSXin LI0 string NuFile NuFile archive (apple ][) data 10b6cee71dSXin LI0 string N\xf5F\xe9l\xe5 NuFile archive (apple ][) data 11b6cee71dSXin LI0 belong 0x00051600 AppleSingle encoded Macintosh file 12b6cee71dSXin LI0 belong 0x00051607 AppleDouble encoded Macintosh file 13b6cee71dSXin LI 14898496eeSXin LI# Type: Apple Emulator A2R format 15898496eeSXin LI# From: Greg Wildman <greg@apple2.org.za> 16898496eeSXin LI# Ref: https://applesaucefdc.com/a2r2-reference/ 17898496eeSXin LI# Ref: https://applesaucefdc.com/a2r/ 18898496eeSXin LI0 string A2R 19898496eeSXin LI>3 string \x31\xFF\x0A\x0D\x0A Applesauce A2R 1.x Disk Image 20*ae316d1dSXin LI>>0 use applesauce 21898496eeSXin LI>3 string \x32\xFF\x0A\x0D\x0A Applesauce A2R 2.x Disk Image 22*ae316d1dSXin LI>>0 use applesauce 23898496eeSXin LI>3 string \x33\xFF\x0A\x0D\x0A Applesauce A2R 3.x Disk Image 24*ae316d1dSXin LI>>0 use applesauce 25*ae316d1dSXin LI 26*ae316d1dSXin LI0 name applesauce 27898496eeSXin LI>8 string INFO 28898496eeSXin LI>>49 byte 01 \b, 5.25″ SS 40trk 29898496eeSXin LI>>49 byte 02 \b, 3.5″ DS 80trk 30898496eeSXin LI>>49 byte 03 \b, 5.25″ DS 80trk 31898496eeSXin LI>>49 byte 04 \b, 5.25″ DS 40trk 32898496eeSXin LI>>49 byte 05 \b, 3.5″ DS 80trk 33898496eeSXin LI>>49 byte 06 \b, 8″ DS 34898496eeSXin LI>>50 byte 01 \b, write protected 35898496eeSXin LI>>51 byte 01 \b, cross track synchronized 36898496eeSXin LI>>17 string/T x \b, %.32s 37898496eeSXin LI 3848c779cdSXin LI# Type: Apple Emulator WOZ format 3948c779cdSXin LI# From: Greg Wildman <greg@apple2.org.za> 4048c779cdSXin LI# Ref: https://applesaucefdc.com/woz/reference/ 4148c779cdSXin LI# Ref: https://applesaucefdc.com/woz/reference2/ 42898496eeSXin LI0 string WOZ 43898496eeSXin LI>3 string \x31\xFF\x0A\x0D\x0A Apple ][ WOZ 1.0 Disk Image 44*ae316d1dSXin LI>>0 use applewoz 45898496eeSXin LI>3 string \x32\xFF\x0A\x0D\x0A Apple ][ WOZ 2.0 Disk Image 46*ae316d1dSXin LI>>0 use applewoz 47*ae316d1dSXin LI 48*ae316d1dSXin LI0 name applewoz 4948c779cdSXin LI>12 string INFO 5048c779cdSXin LI>>21 byte 01 \b, 5.25 inch 5148c779cdSXin LI>>21 byte 02 \b, 3.5 inch 5248c779cdSXin LI>>22 byte 01 \b, write protected 5348c779cdSXin LI>>23 byte 01 \b, cross track synchronized 5448c779cdSXin LI>>25 string/T x \b, %.32s 55898496eeSXin LI 56898496eeSXin LI# Type: Apple Macintosh Emulator MOOF format 57898496eeSXin LI# From: Greg Wildman <greg@apple2.org.za> 58898496eeSXin LI# Ref: https://applesaucefdc.com/moof-reference/ 59898496eeSXin LI0 string MOOF 60898496eeSXin LI>4 string \xFF\x0A\x0D\x0A Apple Macintosh MOOF Disk Image 61*ae316d1dSXin LI>>12 string INFO 62*ae316d1dSXin LI>>>21 byte 01 \b, SSDD GCR (400K) 63*ae316d1dSXin LI>>>21 byte 02 \b, DSDD GCR (800K) 64*ae316d1dSXin LI>>>21 byte 03 \b, DSHD MFM (1.44M) 65*ae316d1dSXin LI>>>22 byte 01 \b, write protected 66*ae316d1dSXin LI>>>23 byte 01 \b, cross track synchronized 67*ae316d1dSXin LI>>>25 string/T x \b, %.32s 6848c779cdSXin LI 6948c779cdSXin LI# Type: Apple Emulator disk images 7048c779cdSXin LI# From: Greg Wildman <greg@apple2.org.za> 7148c779cdSXin LI# ProDOS boot loader? 7248c779cdSXin LI0 string \x01\x38\xB0\x03\x4C Apple ProDOS Image 7348c779cdSXin LI# Detect Volume Directory block ($02) 7448c779cdSXin LI>0x400 string \x00\x00\x03\x00 7548c779cdSXin LI>>0x404 byte &0xF0 7648c779cdSXin LI>>>0x405 string x \b, Volume /%s 77898496eeSXin LI>>>0x429 uleshort x \b, %u Blocks 7848c779cdSXin LI# ProDOS ordered ? 7948c779cdSXin LI>0xb00 string \x00\x00\x03\x00 8048c779cdSXin LI>>0xb04 byte &0xF0 8148c779cdSXin LI>>>0xb05 string x \b, Volume /%s 82898496eeSXin LI>>>0xb29 uleshort x \b, %u Blocks 8348c779cdSXin LI# 84898496eeSXin LI# Proboot HD 85898496eeSXin LI0 string \x01\x8A\x48\xD8\x2C\x82\xC0\x8D\x0E\xC0\x8D\x0C Apple ProDOS ProBoot Image 86898496eeSXin LI>0x400 string \x00\x00\x03\x00 87898496eeSXin LI>>0x404 byte &0xF0 88898496eeSXin LI>>>0x405 string x \b, Volume /%s 89898496eeSXin LI>>>0x429 uleshort x \b, %u Blocks 90898496eeSXin LI>0xb00 string \x00\x00\x03\x00 91898496eeSXin LI>>0xb04 byte &0xF0 92898496eeSXin LI>>>0xb05 string x \b, Volume /%s 93898496eeSXin LI>>>0xb29 uleshort x \b, %u Blocks 94898496eeSXin LI0 string \x01\xA8\x8A\x20\x7B\xF8\x29\x07\x09\xC0\x99\x30 Apple ProDOS ProBoot Image 95898496eeSXin LI>0x400 string \x00\x00\x03\x00 96898496eeSXin LI>>0x404 byte &0xF0 97898496eeSXin LI>>>0x405 string x \b, Volume /%s 98898496eeSXin LI>>>0x429 uleshort x \b, %u Blocks 99898496eeSXin LI>0xb00 string \x00\x00\x03\x00 100898496eeSXin LI>>0xb04 byte &0xF0 101898496eeSXin LI>>>0xb05 string x \b, Volume /%s 102898496eeSXin LI>>>0xb29 uleshort x \b, %u Blocks 103898496eeSXin LI0 string \x01\x4A\xD0\x34\xE6\x3D\x8A\x20\x7B\xF8\x09\xC0 Apple ProDOS ProBoot Image 104898496eeSXin LI>0x400 string \x00\x00\x03\x00 105898496eeSXin LI>>0x404 byte &0xF0 106898496eeSXin LI>>>0x405 string x \b, Volume /%s 107898496eeSXin LI>>>0x429 uleshort x \b, %u Blocks 108898496eeSXin LI>0xb00 string \x00\x00\x03\x00 109898496eeSXin LI>>0xb04 byte &0xF0 110898496eeSXin LI>>>0xb05 string x \b, Volume /%s 111898496eeSXin LI>>>0xb29 uleshort x \b, %u Blocks 112898496eeSXin LI# 113898496eeSXin LI# ProDOS formatted 114898496eeSXin LI0 string \x01\xBD\x88\xC0\x20\x2F\xFB\x20\x58\xFC\x20\x40 Apple ProDOS Unbootable Image 115898496eeSXin LI>0x400 string \x00\x00\x03\x00 116898496eeSXin LI>>0x404 byte &0xF0 117898496eeSXin LI>>>0x405 string x \b, Volume /%s 118898496eeSXin LI>>>0x429 uleshort x \b, %u Blocks 119898496eeSXin LI>0xb00 string \x00\x00\x03\x00 120898496eeSXin LI>>0xb04 byte &0xF0 121898496eeSXin LI>>>0xb05 string x \b, Volume /%s 122898496eeSXin LI>>>0xb29 uleshort x \b, %u Blocks 123898496eeSXin LI0 string \x01\x38\xB0\x03\x4C\x1C\x09\x78\x86\x43\xC9\x03 Apple ProDOS Unbootable Image 124898496eeSXin LI>0x400 string \x00\x00\x03\x00 125898496eeSXin LI>>0x404 byte &0xF0 126898496eeSXin LI>>>0x405 string x \b, Volume /%s 127898496eeSXin LI>>>0x429 uleshort x \b, %u Blocks 128898496eeSXin LI>0xb00 string \x00\x00\x03\x00 129898496eeSXin LI>>0xb04 byte &0xF0 130898496eeSXin LI>>>0xb05 string x \b, Volume /%s 131898496eeSXin LI>>>0xb29 uleshort x \b, %u Blocks 132898496eeSXin LI# 133898496eeSXin LI# DOS3 boot loader 134898496eeSXin LI0 string \x01\xA5\x27\xC9\x09\xD0 135898496eeSXin LI>0x11001 byte 0x11 136898496eeSXin LI>>0x11003 ubyte x Apple DOS 3.%u Image 137898496eeSXin LI>>0x11006 ubyte x \b, Volume #%03u 138898496eeSXin LI>>0x11034 ubyte x \b, %u Tracks 139898496eeSXin LI>>0x11035 ubyte x \b, %u Sectors 140898496eeSXin LI>>0x11036 uleshort x \b, %u bytes per sector 141898496eeSXin LI# 142898496eeSXin LI# DOS3 uninitialized disk 143898496eeSXin LI0 string \x01\xA6\x2B\xBD\x88\xC0\x8A\x4A\x4A 144898496eeSXin LI>0x11001 byte 0x11 145898496eeSXin LI>>0x11003 ubyte x Apple DOS 3.%u Unbootable Image 146898496eeSXin LI>>>0x11006 ubyte x \b, Volume #%03u 147898496eeSXin LI>>>0x11034 ubyte x \b, %u Tracks 148898496eeSXin LI>>>0x11035 ubyte x \b, %u Sectors 149898496eeSXin LI>>>0x11036 uleshort x \b, %u bytes per sector 15048c779cdSXin LI# 15148c779cdSXin LI# Pascal boot loader? 15248c779cdSXin LI0 string \x01\xE0\x60\xF0\x03\x4C\xE3\x08\xAD 15348c779cdSXin LI>0xd6 pstring SYSTEM.APPLE 15448c779cdSXin LI>>0xb00 leshort 0x0000 15548c779cdSXin LI>>>0xb04 leshort 0x0000 Apple Pascal Image 15648c779cdSXin LI>>>>0xb06 pstring x \b, Volume %s: 15748c779cdSXin LI>>>>0xb0e leshort x \b, %u Blocks 15848c779cdSXin LI>>>>0xb10 leshort x \b, %u Files 159d38c30c0SXin LI# 160d38c30c0SXin LI# Diversi Dos boot loader? 161d38c30c0SXin LI0 string \x01\xA8\xAD\x81\xC0\xEE\x09\x08\xAD 162d38c30c0SXin LI>0x11001 string \x11\x0F\x03 Apple Diversi Dos Image 163d38c30c0SXin LI>>0x11006 byte x \b, Volume %u 164d38c30c0SXin LI>>0x11034 byte x \b, %u Tracks 165d38c30c0SXin LI>>0x11035 byte x \b, %u Sectors 166d38c30c0SXin LI>>0x11036 leshort x \b, %u bytes per sector 16748c779cdSXin LI 168b6cee71dSXin LI# Type: Apple Emulator 2IMG format 169b6cee71dSXin LI# From: Radek Vokal <rvokal@redhat.com> 17048c779cdSXin LI# Update: Greg Wildman <greg@apple2.org.za> 171b6cee71dSXin LI0 string 2IMG Apple ][ 2IMG Disk Image 17248c779cdSXin LI>4 clear x 173b6cee71dSXin LI>4 string XGS! \b, XGS 174b6cee71dSXin LI>4 string CTKG \b, Catakig 175b6cee71dSXin LI>4 string ShIm \b, Sheppy's ImageMaker 17648c779cdSXin LI>4 string SHEP \b, Sheppy's ImageMaker 177b6cee71dSXin LI>4 string WOOF \b, Sweet 16 178b6cee71dSXin LI>4 string B2TR \b, Bernie ][ the Rescue 17948c779cdSXin LI>4 string \!nfc \b, ASIMOV2 18048c779cdSXin LI>4 string \>BD\< \b, Brutal Deluxe's Cadius 18148c779cdSXin LI>4 string CdrP \b, CiderPress 18248c779cdSXin LI>4 string Vi][ \b, Virtual ][ 18348c779cdSXin LI>4 string PRFS \b, ProFUSE 18448c779cdSXin LI>4 string FISH \b, FishWings 18548c779cdSXin LI>4 string RVLW \b, Revival for Windows 18648c779cdSXin LI>4 default x 18748c779cdSXin LI>>4 string x \b, Creator tag "%-4.4s" 188b6cee71dSXin LI>0xc byte 00 \b, DOS 3.3 sector order 189b6cee71dSXin LI>>0x10 byte 00 \b, Volume 254 190b6cee71dSXin LI>>0x10 byte&0x7f x \b, Volume %u 191b6cee71dSXin LI>0xc byte 01 \b, ProDOS sector order 192d38c30c0SXin LI# Detect Volume Directory block ($02) + 2mg header offset 193d38c30c0SXin LI>>0x440 string \x00\x00\x03\x00 194d38c30c0SXin LI>>>0x444 byte &0xF0 195d38c30c0SXin LI>>>>0x445 string x \b, Volume /%s 196898496eeSXin LI>>>>0x469 uleshort x \b, %u Blocks 197b6cee71dSXin LI>0xc byte 02 \b, NIB data 198b6cee71dSXin LI 199898496eeSXin LI# Type: Peter Ferrie QBoot 200898496eeSXin LI# From: Greg Wildman <greg@apple2.org.za> 201898496eeSXin LI# Ref: https://github.com/peterferrie/qboot 202898496eeSXin LI0 string \x01\x4A\xA8\x69\x0F\x85\x27\xC9 203898496eeSXin LI>8 string \x12\xF0\x10\xE6\x3D\x86\xDA\x8A Apple ][ QBoot Image 204898496eeSXin LI# Type: Peter Ferrie 0Boot 205898496eeSXin LI# From: Greg Wildman <greg@apple2.org.za> 206898496eeSXin LI# Ref: https://github.com/peterferrie/0boot 207898496eeSXin LI>8 string \x12\xF0\x10\xE6\x3D\x86\xDA\x8A Apple ][ 0Boot Image 208898496eeSXin LI 209898496eeSXin LI# Different proprietary boot sectors 210898496eeSXin LI0 string \x01\x0F\x21\x74\x00\x01\x6B\x00\x02\x30\x81\x5D Apple ][ Disk Image 211898496eeSXin LI0 string \x01\x20\x58\xFC\xA2\x00\x8E\x78\x04\x8E\xF4\x03 Apple ][ Disk Image 212898496eeSXin LI0 string \x01\x20\x58\xFC\xAD\x51\xC0\xAD\x54\xC0\xA6\x2B Apple ][ Disk Image 213898496eeSXin LI0 string \x01\x20\x89\xFE\x20\x93\xFE\xA6\x2B\xBD\x88\xC0 Apple ][ Disk Image 214898496eeSXin LI0 string \x01\x20\x93\xFE\x20\x89\xFE\x4C\x25\x08\x68\x85 Apple ][ Disk Image 215898496eeSXin LI0 string \x01\x20\x93\xFE\x20\x89\xFE\x4C\x2D\x08\x68\x85 Apple ][ Disk Image 216898496eeSXin LI0 string \x01\x38\x90\x2A\xC9\x01\xF0\x33\xA8\xC8\xC0\x10 Apple ][ Disk Image 217898496eeSXin LI0 string \x01\x38\xB0\x03\x4C\x32\xA1\x87\x43\xC9\x03\x08 Apple ][ Disk Image 218898496eeSXin LI0 string \x01\x4C\x04\x08\xA9\x2A\x8D\x02\x08\x86\x2B\xEE Apple ][ Disk Image 219898496eeSXin LI0 string \x01\x4C\x60\x08\x09\xD0\x18\xA5\x2B\x4A\x4A\x4A Apple ][ Disk Image 220898496eeSXin LI0 string \x01\x4C\x92\x08\x01\x08\xA2\x00\xB5\x00\x9D\x00 Apple ][ Disk Image 221898496eeSXin LI0 string \x01\x4C\xB3\x08\x09\xD0\x18\xA5\x2B\x4A\x4A\x4A Apple ][ Disk Image 222898496eeSXin LI0 string \x01\x8D\xFB\x03\x8E\xFC\x03\x8C\xFD\x03\x8A\x29 Apple ][ Disk Image 223898496eeSXin LI0 string \x01\xA2\xFF\x9A\xD8\x20\x20\x08\x20\x34\x08\xAD Apple ][ Disk Image 224898496eeSXin LI0 string \x01\xA5\x27\xBD\x88\xC0\x2C\x10\xC0\xA2\x00\xA9 Apple ][ Disk Image 225898496eeSXin LI0 string \x01\xA5\x2B\xAE\x51\xC0\xEA\xAA\xBD\x88\xC0\x20 Apple ][ Disk Image 226898496eeSXin LI0 string \x01\xA6\x27\xBD\x0B\x08\x48\xBD\x0A\x08\x48\x85 Apple ][ Disk Image 227898496eeSXin LI0 string \x01\xA6\x2B\xBD\x88\xC0\x20\x58\xFC\xA9\x01\x85 Apple ][ Disk Image 228898496eeSXin LI0 string \x01\xA6\x2B\xBD\x88\xC0\x20\x58\xFC\xA9\x25\x85 Apple ][ Disk Image 229898496eeSXin LI0 string \x01\xA8\xC0\x0F\x90\x16\xF0\x12\xA0\xFF\x18\xAD Apple ][ Disk Image 230898496eeSXin LI0 string \x01\xA9\x00\x85\xF0\xA9\x04\x85\xF1\xA0\x00\xA9 Apple ][ Disk Image 231898496eeSXin LI0 string \x01\xA9\x5C\x8D\xF2\x03\xA9\xC6\x8D\xF3\x03\x49 Apple ][ Disk Image 232898496eeSXin LI0 string \x01\xA9\x60\x8D\x01\x08\x20\x2F\xFB\x20\x58\xFC Apple ][ Disk Image 233898496eeSXin LI0 string \x01\xA9\x60\x8D\x01\x08\x20\x49\x08\xA9\x0A\x85 Apple ][ Disk Image 234898496eeSXin LI0 string \x01\xA9\x60\x8D\x01\x08\x2C\x82\xC0\xBD\x88\xC0 Apple ][ Disk Image 235898496eeSXin LI0 string \x01\xA9\x60\x8D\x01\x08\x86\x43\x8A\x4A\x4A\x4A Apple ][ Disk Image 236898496eeSXin LI0 string \x01\xA9\x60\x8D\x01\x08\xA2\x00\x86\xFF\xB5\x00 Apple ][ Disk Image 237898496eeSXin LI0 string \x01\xA9\x60\x8D\x01\x08\xA2\x00\xB5\x00\x9D\x00 Apple ][ Disk Image 238898496eeSXin LI0 string \x01\xA9\x60\x8D\x01\x08\xA9\xB2\x8D\xF2\x03\xA9 Apple ][ Disk Image 239898496eeSXin LI0 string \x01\xA9\x60\x8D\x01\x08\xA9\xFF\x8D\xF3\x03\x8D Apple ][ Disk Image 240898496eeSXin LI0 string \x01\xAC\x00\x08\xF0\x19\xB9\x30\x08\x85\x3D\xCE Apple ][ Disk Image 241898496eeSXin LI0 string \x01\xAC\x23\x08\x30\x2E\xB9\x24\x08\x85\x3D\xCE Apple ][ Disk Image 242898496eeSXin LI0 string \x01\xAD\x00\x08\xC9\x09\xB0\x20\x69\x02\x8D\x00 Apple ][ Disk Image 243898496eeSXin LI0 string \x01\xB0\x00\xA9\x3C\x8D\x02\x08\x86\x2B\x8A\x4A Apple ][ Disk Image 244898496eeSXin LI0 string \x01\xB0\x00\xA9\x3C\x8D\x02\x08\xA9\xF5\x8D\xF2 Apple ][ Disk Image 245898496eeSXin LI0 string \x01\xB0\x00\xA9\x3F\x8D\x02\x08\x86\x2B\x8E\xF4 Apple ][ Disk Image 246898496eeSXin LI0 string \x01\xB0\x00\xA9\x48\x8D\x02\x08\x86\x2B\x8E\xF4 Apple ][ Disk Image 247898496eeSXin LI0 string \x01\xBD\x88\xC0\x8A\x4A\x4A\x4A\x4A\x09\xC0\x8D Apple ][ Disk Image 248898496eeSXin LI0 string \x01\xBD\x88\xC0\x8A\x4A\x4A\x4A\x4A\x8D\x2F\x08 Apple ][ Disk Image 249898496eeSXin LI0 string \x01\xD8\x2C\x81\xC0\xA9\x60\x4D\x58\xFF\xD0\xFE Apple ][ Disk Image 250898496eeSXin LI0 string \x01\xD8\x78\xBD\x88\xC0\xA9\xFD\x85\x37\x85\x39 Apple ][ Disk Image 251898496eeSXin LI0 string \x01\xE0\x60\xF0\x03\x4C\x16\x09\xAD\x00\x08\xC9 Apple ][ Disk Image 252898496eeSXin LI0 string \x01\xE0\x60\xF0\x03\x4C\xCB\x08\xAD\x00\x08\xC9 Apple ][ Disk Image 253898496eeSXin LI0 string \x01\xE0\x60\xF0\x03\x4C\xEE\x08\xAD\x00\x08\xC9 Apple ][ Disk Image 254898496eeSXin LI0 string \x01\xE0\x60\xF0\x03\x4C\xEF\x08\xAD\x00\x08\xC9 Apple ][ Disk Image 255898496eeSXin LI0 string \x01\xE0\x70\xB0\x04\xE0\x40\xB0\x39\xBD\x88\xC0 Apple ][ Disk Image 256898496eeSXin LI0 string \x01\xEA\x8D\xF4\x03\xA9\x60\x9D\x88\xC0\x8D\x51 Apple ][ Disk Image 257898496eeSXin LI 258b6cee71dSXin LI# magic for Newton PDA package formats 259b6cee71dSXin LI# from Ruda Moura <ruda@helllabs.org> 260b6cee71dSXin LI0 string package0 Newton package, NOS 1.x, 261b6cee71dSXin LI>12 belong &0x80000000 AutoRemove, 262b6cee71dSXin LI>12 belong &0x40000000 CopyProtect, 263b6cee71dSXin LI>12 belong &0x10000000 NoCompression, 264b6cee71dSXin LI>12 belong &0x04000000 Relocation, 265b6cee71dSXin LI>12 belong &0x02000000 UseFasterCompression, 266b6cee71dSXin LI>16 belong x version %d 267b6cee71dSXin LI 268b6cee71dSXin LI0 string package1 Newton package, NOS 2.x, 269b6cee71dSXin LI>12 belong &0x80000000 AutoRemove, 270b6cee71dSXin LI>12 belong &0x40000000 CopyProtect, 271b6cee71dSXin LI>12 belong &0x10000000 NoCompression, 272b6cee71dSXin LI>12 belong &0x04000000 Relocation, 273b6cee71dSXin LI>12 belong &0x02000000 UseFasterCompression, 274b6cee71dSXin LI>16 belong x version %d 275b6cee71dSXin LI 276b6cee71dSXin LI0 string package4 Newton package, 277b6cee71dSXin LI>8 byte 8 NOS 1.x, 278b6cee71dSXin LI>8 byte 9 NOS 2.x, 279b6cee71dSXin LI>12 belong &0x80000000 AutoRemove, 280b6cee71dSXin LI>12 belong &0x40000000 CopyProtect, 281b6cee71dSXin LI>12 belong &0x10000000 NoCompression, 282b6cee71dSXin LI 283b6cee71dSXin LI# The following entries for the Apple II are for files that have 284b6cee71dSXin LI# been transferred as raw binary data from an Apple, without having 285b6cee71dSXin LI# been encapsulated by any of the above archivers. 286b6cee71dSXin LI# 287b6cee71dSXin LI# In general, Apple II formats are hard to identify because Apple DOS 288b6cee71dSXin LI# and especially Apple ProDOS have strong typing in the file system and 289b6cee71dSXin LI# therefore programmers never felt much need to include type information 290b6cee71dSXin LI# in the files themselves. 291b6cee71dSXin LI# 292b6cee71dSXin LI# Eric Fischer <enf@pobox.com> 293b6cee71dSXin LI 294b6cee71dSXin LI# AppleWorks word processor: 2953e41d09dSXin LI# URL: https://en.wikipedia.org/wiki/AppleWorks 2963e41d09dSXin LI# Reference: http://www.gno.org/pub/apple2/doc/apple/filetypes/ftn.1a.xxxx 2973e41d09dSXin LI# Update: Joerg Jenderek 2983e41d09dSXin LI# NOTE: 299b6cee71dSXin LI# The "O" is really the magic number, but that's so common that it's 300b6cee71dSXin LI# necessary to check the tab stops that follow it to avoid false positives. 3013e41d09dSXin LI# and/or look for unused bits of booleans bytes like zoom, paginated, mail merge 3023e41d09dSXin LI# the newer AppleWorks is from claris with extension CWK 3033e41d09dSXin LI4 string O 3043e41d09dSXin LI# test for unused bits of zoom- , paginated-boolean bytes 3053e41d09dSXin LI>84 ubequad ^0x00Fe00000000Fe00 3063e41d09dSXin LI# look for tabstop definitions "=" no tab, "|" no tab 3073e41d09dSXin LI# "<" left tab,"^" center tab,">" right tab, "." decimal tab, 3083e41d09dSXin LI# unofficial "!" other , "\x8a" other 3093e41d09dSXin LI# official only if SFMinVers is nonzero 3103e41d09dSXin LI>>5 regex/s [=.<>|!^\x8a]{79} AppleWorks Word Processor 3113e41d09dSXin LI# AppleWorks Word Processor File (Apple II) 3123e41d09dSXin LI# ./apple (version 5.25) labeled the entry as "AppleWorks word processor data" 3133e41d09dSXin LI# application/x-appleworks is mime type for claris version with cwk extension 3143e41d09dSXin LI!:mime application/x-appleworks3 3153e41d09dSXin LI# http://home.earthlink.net/~hughhood/appleiiworksenvoy/ 3163e41d09dSXin LI# ('p' + 1-byte ProDOS File Type + 2-byte ProDOS Aux Type') 3173e41d09dSXin LI# $70 $1A $F8 $FF is this the apple type ? 31848c779cdSXin LI#:apple pdosp^Z\xf8\xff 3193e41d09dSXin LI!:ext awp 3203e41d09dSXin LI# minimum version needed to read this files. SFMinVers (0 , 30~3.0 ) 3213e41d09dSXin LI>>>183 ubyte 30 3.0 3223e41d09dSXin LI>>>183 ubyte !30 32343a5ec4eSXin LI>>>>183 ubyte !0 %#x 3243e41d09dSXin LI# usual tabstop start sequence "=====<" 3253e41d09dSXin LI>>>5 string x \b, tabstop ruler "%6.6s" 3263e41d09dSXin LI# tabstop ruler 3273e41d09dSXin LI#>>>5 string >\0 \b, tabstops "%-79s" 3283e41d09dSXin LI# zoom switch 3293e41d09dSXin LI>>>85 byte&0x01 >0 \b, zoomed 3303e41d09dSXin LI# whether paginated 3313e41d09dSXin LI>>>90 byte&0x01 >0 \b, paginated 3323e41d09dSXin LI# contains any mail-merge commands 3333e41d09dSXin LI>>>92 byte&0x01 >0 \b, with mail merge 3343e41d09dSXin LI# left margin in 1/10 inches ( normally 0 or 10 ) 3353e41d09dSXin LI>>>91 ubyte >0 3363e41d09dSXin LI>>>>91 ubyte x \b, %d/10 inch left margin 337b6cee71dSXin LI 338b6cee71dSXin LI# AppleWorks database: 339b6cee71dSXin LI# 340b6cee71dSXin LI# This isn't really a magic number, but it's the closest thing to one 341b6cee71dSXin LI# that I could find. The 1 and 2 really mean "order in which you defined 342b6cee71dSXin LI# categories" and "left to right, top to bottom," respectively; the D and R 343b6cee71dSXin LI# mean that the cursor should move either down or right when you press Return. 344b6cee71dSXin LI 345b6cee71dSXin LI#30 string \x01D AppleWorks database data 346b6cee71dSXin LI#30 string \x02D AppleWorks database data 347b6cee71dSXin LI#30 string \x01R AppleWorks database data 348b6cee71dSXin LI#30 string \x02R AppleWorks database data 349b6cee71dSXin LI 350b6cee71dSXin LI# AppleWorks spreadsheet: 351b6cee71dSXin LI# 352b6cee71dSXin LI# Likewise, this isn't really meant as a magic number. The R or C means 353b6cee71dSXin LI# row- or column-order recalculation; the A or M means automatic or manual 354b6cee71dSXin LI# recalculation. 355b6cee71dSXin LI 356b6cee71dSXin LI#131 string RA AppleWorks spreadsheet data 357b6cee71dSXin LI#131 string RM AppleWorks spreadsheet data 358b6cee71dSXin LI#131 string CA AppleWorks spreadsheet data 359b6cee71dSXin LI#131 string CM AppleWorks spreadsheet data 360b6cee71dSXin LI 361b6cee71dSXin LI# Applesoft BASIC: 362b6cee71dSXin LI# 363b6cee71dSXin LI# This is incredibly sloppy, but will be true if the program was 364b6cee71dSXin LI# written at its usual memory location of 2048 and its first line 365b6cee71dSXin LI# number is less than 256. Yuck. 366b6cee71dSXin LI# update by Joerg Jenderek at Feb 2013 367b6cee71dSXin LI 368b6cee71dSXin LI# GRR: this test is still too general as it catches also Gujin BOOT144.SYS (0xfa080000) 369b6cee71dSXin LI#0 belong&0xff00ff 0x80000 Applesoft BASIC program data 370b6cee71dSXin LI0 belong&0x00ff00ff 0x00080000 371b6cee71dSXin LI# assuming that line number must be positive 372b6cee71dSXin LI>2 leshort >0 Applesoft BASIC program data, first line number %d 373b6cee71dSXin LI#>2 leshort x \b, first line number %d 374b6cee71dSXin LI 375b6cee71dSXin LI# ORCA/EZ assembler: 376b6cee71dSXin LI# 377b6cee71dSXin LI# This will not identify ORCA/M source files, since those have 378b6cee71dSXin LI# some sort of date code instead of the two zero bytes at 6 and 7 379b6cee71dSXin LI# XXX Conflicts with ELF 380b6cee71dSXin LI#4 belong&0xff00ffff 0x01000000 ORCA/EZ assembler source data 381b6cee71dSXin LI#>5 byte x \b, build number %d 382b6cee71dSXin LI 383b6cee71dSXin LI# Broderbund Fantavision 384b6cee71dSXin LI# 385b6cee71dSXin LI# I don't know what these values really mean, but they seem to recur. 386b6cee71dSXin LI# Will they cause too many conflicts? 387b6cee71dSXin LI 388b6cee71dSXin LI# Probably :-) 389b6cee71dSXin LI#2 belong&0xFF00FF 0x040008 Fantavision movie data 390b6cee71dSXin LI 391b6cee71dSXin LI# Some attempts at images. 392b6cee71dSXin LI# 393b6cee71dSXin LI# These are actually just bit-for-bit dumps of the frame buffer, so 394b6cee71dSXin LI# there's really no reasonably way to distinguish them except for their 395b6cee71dSXin LI# address (if preserved) -- 8192 or 16384 -- and their length -- 8192 396b6cee71dSXin LI# or, occasionally, 8184. 397b6cee71dSXin LI# 398b6cee71dSXin LI# Nevertheless this will manage to catch a lot of images that happen 399b6cee71dSXin LI# to have a solid-colored line at the bottom of the screen. 400b6cee71dSXin LI 401b6cee71dSXin LI# GRR: Magic too weak 402b6cee71dSXin LI#8144 string \x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F Apple II image with white background 403b6cee71dSXin LI#8144 string \x55\x2A\x55\x2A\x55\x2A\x55\x2A Apple II image with purple background 404b6cee71dSXin LI#8144 string \x2A\x55\x2A\x55\x2A\x55\x2A\x55 Apple II image with green background 405b6cee71dSXin LI#8144 string \xD5\xAA\xD5\xAA\xD5\xAA\xD5\xAA Apple II image with blue background 406b6cee71dSXin LI#8144 string \xAA\xD5\xAA\xD5\xAA\xD5\xAA\xD5 Apple II image with orange background 407b6cee71dSXin LI 408b6cee71dSXin LI# Beagle Bros. Apple Mechanic fonts 409b6cee71dSXin LI 410b6cee71dSXin LI0 belong&0xFF00FFFF 0x6400D000 Apple Mechanic font 411b6cee71dSXin LI 412b6cee71dSXin LI# Apple Universal Disk Image Format (UDIF) - dmg files. 413b6cee71dSXin LI# From Johan Gade. 414b6cee71dSXin LI# These entries are disabled for now until we fix the following issues. 415b6cee71dSXin LI# 416b6cee71dSXin LI# Note there might be some problems with the "VAX COFF executable" 417b6cee71dSXin LI# entry. Note this entry should be placed before the mac filesystem section, 418b6cee71dSXin LI# particularly the "Apple Partition data" entry. 419b6cee71dSXin LI# 420b6cee71dSXin LI# The intended meaning of these tests is, that the file is only of the 421b6cee71dSXin LI# specified type if both of the lines are correct - i.e. if the first 422b6cee71dSXin LI# line matches and the second doesn't then it is not of that type. 423b6cee71dSXin LI# 424b6cee71dSXin LI#0 long 0x7801730d 425b6cee71dSXin LI#>4 long 0x62626060 UDIF read-only zlib-compressed image (UDZO) 426b6cee71dSXin LI# 427b6cee71dSXin LI# Note that this entry is recognized correctly by the "Apple Partition 428b6cee71dSXin LI# data" entry - however since this entry is more specific - this 429b6cee71dSXin LI# information seems to be more useful. 430b6cee71dSXin LI#0 long 0x45520200 431b6cee71dSXin LI#>0x410 string disk\ image UDIF read/write image (UDRW) 432b6cee71dSXin LI 433b6cee71dSXin LI# From: Toby Peterson <toby@apple.com> 434898496eeSXin LI# From https://www.nationalarchives.gov.uk/pronom/fmt/866 435898496eeSXin LI0 string bplist00 436898496eeSXin LI>8 search/500 WebMainResource Apple Safari Webarchive 437898496eeSXin LI!:mime application/x-webarchive 438898496eeSXin LI!:strength +50 439b6cee71dSXin LI0 string bplist00 Apple binary property list 440898496eeSXin LI!:mime application/x-bplist 441b6cee71dSXin LI 442b6cee71dSXin LI# Apple binary property list (bplist) 443b6cee71dSXin LI# Assumes version bytes are hex. 444b6cee71dSXin LI# Provides content hints for version 0 files. Assumes that the root 445b6cee71dSXin LI# object is the first object (true for CoreFoundation implementation). 446b6cee71dSXin LI# From: David Remahl <dremahl@apple.com> 447b6cee71dSXin LI0 string bplist 448*ae316d1dSXin LI>6 byte x CoreFoundation binary property list data, version %#c 449b6cee71dSXin LI>>7 byte x \b%c 450*ae316d1dSXin LI>>6 string 00 \b 451*ae316d1dSXin LI>>>8 byte&0xF0 0x00 \b 452*ae316d1dSXin LI>>>>8 byte&0x0F 0x00 \b, root type: null 453*ae316d1dSXin LI>>>>8 byte&0x0F 0x08 \b, root type: false boolean 454*ae316d1dSXin LI>>>>8 byte&0x0F 0x09 \b, root type: true boolean 455*ae316d1dSXin LI>>>8 byte&0xF0 0x10 \b, root type: integer 456*ae316d1dSXin LI>>>8 byte&0xF0 0x20 \b, root type: real 457*ae316d1dSXin LI>>>8 byte&0xF0 0x30 \b, root type: date 458*ae316d1dSXin LI>>>8 byte&0xF0 0x40 \b, root type: data 459*ae316d1dSXin LI>>>8 byte&0xF0 0x50 \b, root type: ascii string 460*ae316d1dSXin LI>>>8 byte&0xF0 0x60 \b, root type: unicode string 461*ae316d1dSXin LI>>>8 byte&0xF0 0x80 \b, root type: uid (CORRUPT) 462*ae316d1dSXin LI>>>8 byte&0xF0 0xa0 \b, root type: array 463*ae316d1dSXin LI>>>8 byte&0xF0 0xd0 \b, root type: dictionary 464b6cee71dSXin LI 465b6cee71dSXin LI# Apple/NeXT typedstream data 466b6cee71dSXin LI# Serialization format used by NeXT and Apple for various 467b6cee71dSXin LI# purposes in YellowStep/Cocoa, including some nib files. 468b6cee71dSXin LI# From: David Remahl <dremahl@apple.com> 469b6cee71dSXin LI2 string typedstream NeXT/Apple typedstream data, big endian 470b6cee71dSXin LI>0 byte x \b, version %d 471b6cee71dSXin LI>0 byte <5 \b 472b6cee71dSXin LI>>13 byte 0x81 \b 473b6cee71dSXin LI>>>14 ubeshort x \b, system %d 474b6cee71dSXin LI2 string streamtyped NeXT/Apple typedstream data, little endian 475b6cee71dSXin LI>0 byte x \b, version %d 476b6cee71dSXin LI>0 byte <5 \b 477b6cee71dSXin LI>>13 byte 0x81 \b 478b6cee71dSXin LI>>>14 uleshort x \b, system %d 479b6cee71dSXin LI 480b6cee71dSXin LI#------------------------------------------------------------------------------ 481b6cee71dSXin LI# CAF: Apple CoreAudio File Format 482b6cee71dSXin LI# 483b6cee71dSXin LI# Container format for high-end audio purposes. 484b6cee71dSXin LI# From: David Remahl <dremahl@apple.com> 485b6cee71dSXin LI# 486b6cee71dSXin LI0 string caff CoreAudio Format audio file 487b6cee71dSXin LI>4 beshort <10 version %d 488b6cee71dSXin LI 489b6cee71dSXin LI 490b6cee71dSXin LI#------------------------------------------------------------------------------ 491b6cee71dSXin LI# Keychain database files 492b6cee71dSXin LI0 string kych Mac OS X Keychain File 493b6cee71dSXin LI 494b6cee71dSXin LI#------------------------------------------------------------------------------ 495b6cee71dSXin LI# Code Signing related file types 496b6cee71dSXin LI0 belong 0xfade0c00 Mac OS X Code Requirement 497b6cee71dSXin LI>8 belong 1 (opExpr) 498b6cee71dSXin LI>4 belong x - %d bytes 499b6cee71dSXin LI 500b6cee71dSXin LI0 belong 0xfade0c01 Mac OS X Code Requirement Set 501b6cee71dSXin LI>8 belong >1 containing %d items 502b6cee71dSXin LI>4 belong x - %d bytes 503b6cee71dSXin LI 504b6cee71dSXin LI0 belong 0xfade0c02 Mac OS X Code Directory 505b6cee71dSXin LI>8 belong x version %x 50643a5ec4eSXin LI>12 belong >0 flags %#x 507b6cee71dSXin LI>4 belong x - %d bytes 508b6cee71dSXin LI 509b6cee71dSXin LI0 belong 0xfade0cc0 Mac OS X Detached Code Signature (non-executable) 510b6cee71dSXin LI>4 belong x - %d bytes 511b6cee71dSXin LI 512b6cee71dSXin LI0 belong 0xfade0cc1 Mac OS X Detached Code Signature 513b6cee71dSXin LI>8 belong >1 (%d elements) 514b6cee71dSXin LI>4 belong x - %d bytes 515b6cee71dSXin LI 516b6cee71dSXin LI# From: "Nelson A. de Oliveira" <naoliv@gmail.com> 517b6cee71dSXin LI# .vdi 518b6cee71dSXin LI4 string innotek\ VirtualBox\ Disk\ Image %s 519b6cee71dSXin LI 520a5d223e6SXin LI# Apple disk partition stuff 521a5d223e6SXin LI# URL: https://en.wikipedia.org/wiki/Apple_Partition_Map 522a5d223e6SXin LI# Reference: https://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/sys/sys/bootblock.h 523a5d223e6SXin LI# Update: Joerg Jenderek 524a5d223e6SXin LI# "ER" is APPLE_DRVR_MAP_MAGIC signature 525b6cee71dSXin LI0 beshort 0x4552 526a5d223e6SXin LI# display Apple Driver Map (strength=50) after Syslinux bootloader (71) 527a5d223e6SXin LI#!:strength +0 528a5d223e6SXin LI# strengthen the magic by looking for used blocksizes 512 2048 529a5d223e6SXin LI>2 ubeshort&0xf1FF 0 Apple Driver Map 530a5d223e6SXin LI# last 6 bytes for padding found are 0 or end with 55AAh marker for MBR hybrid 531a5d223e6SXin LI#>>504 ubequad&0x0000FFffFFff0000 0 532a5d223e6SXin LI!:mime application/x-apple-diskimage 533a5d223e6SXin LI!:apple ????devr 534a5d223e6SXin LI# https://en.wikipedia.org/wiki/Apple_Disk_Image 535a5d223e6SXin LI!:ext dmg/iso 536a5d223e6SXin LI# sbBlkSize for driver descriptor map 512 2048 537b6cee71dSXin LI>>2 beshort x \b, blocksize %d 538a5d223e6SXin LI# sbBlkCount sometimes garbish like 539a5d223e6SXin LI# 0xb0200000 for unzlibed install_flash_player_19.0.0.245_osx.dmg 540a5d223e6SXin LI# 0xf2720100 for bunziped Firefox 48.0-2.dmg 541a5d223e6SXin LI# 0xeb02ffff for super_grub2_disk_hybrid_2.02s3.iso 542a5d223e6SXin LI# 0x00009090 by syslinux-6.03/utils/isohybrid.c 543a5d223e6SXin LI>>4 ubelong x \b, blockcount %u 544a5d223e6SXin LI# following device/driver information not very useful 545a5d223e6SXin LI# device type 0 1 (37008 garbage for super_grub2_disk_hybrid_2.02s3.iso) 546a5d223e6SXin LI>>8 ubeshort x \b, devtype %u 547a5d223e6SXin LI# device id 0 1 (37008 garbage for super_grub2_disk_hybrid_2.02s3.iso) 548a5d223e6SXin LI>>10 ubeshort x \b, devid %u 549a5d223e6SXin LI# driver data 0 (2425393296 garbage for super_grub2_disk_hybrid_2.02s3.iso) 550a5d223e6SXin LI>>12 ubelong >0 551a5d223e6SXin LI>>>12 ubelong x \b, driver data %u 552a5d223e6SXin LI# number of driver descriptors sbDrvrCount <= 61 553a5d223e6SXin LI# (37008 garbage for super_grub2_disk_hybrid_2.02s3.iso) 554a5d223e6SXin LI>>16 ubeshort x \b, driver count %u 555a5d223e6SXin LI# 61 * apple_drvr_descriptor[8]. information not very useful or same as in partition map 556a5d223e6SXin LI# >>18 use apple-driver-map 557a5d223e6SXin LI# >>26 use apple-driver-map 558a5d223e6SXin LI# # ... 559a5d223e6SXin LI# >>500 use apple-driver-map 560a5d223e6SXin LI# number of partitions is always same in every partition (map block count) 561a5d223e6SXin LI#>>0x0204 ubelong x \b, %u partitions 562a5d223e6SXin LI>>0x0204 ubelong >0 \b, contains[@0x200]: 563a5d223e6SXin LI>>>0x0200 use apple-apm 564a5d223e6SXin LI>>0x0204 ubelong >1 \b, contains[@0x400]: 565a5d223e6SXin LI>>>0x0400 use apple-apm 566a5d223e6SXin LI>>0x0204 ubelong >2 \b, contains[@0x600]: 567a5d223e6SXin LI>>>0x0600 use apple-apm 568a5d223e6SXin LI>>0x0204 ubelong >3 \b, contains[@0x800]: 569a5d223e6SXin LI>>>0x0800 use apple-apm 570a5d223e6SXin LI>>0x0204 ubelong >4 \b, contains[@0xA00]: 571a5d223e6SXin LI>>>0x0A00 use apple-apm 572a5d223e6SXin LI>>0x0204 ubelong >5 \b, contains[@0xC00]: 573a5d223e6SXin LI>>>0x0C00 use apple-apm 574a5d223e6SXin LI>>0x0204 ubelong >6 \b, contains[@0xE00]: 575a5d223e6SXin LI>>>0x0E00 use apple-apm 576a5d223e6SXin LI>>0x0204 ubelong >7 \b, contains[@0x1000]: 577a5d223e6SXin LI>>>0x1000 use apple-apm 578a5d223e6SXin LI# display apple driver descriptor map (start-block, # blocks in sbBlkSize sizes, type) 579a5d223e6SXin LI0 name apple-driver-map 580a5d223e6SXin LI>0 ubequad !0 581a5d223e6SXin LI# descBlock first block of driver 582a5d223e6SXin LI>>0 ubelong x \b, driver start block %u 583a5d223e6SXin LI# descSize driver size in blocks 584a5d223e6SXin LI>>4 ubeshort x \b, size %u 585a5d223e6SXin LI# descType driver system type 1 701h F8FFh FFFFh 58643a5ec4eSXin LI>>6 ubeshort x \b, type %#x 587b6cee71dSXin LI 588a5d223e6SXin LI# URL: https://en.wikipedia.org/wiki/Apple_Partition_Map 58948c779cdSXin LI# Reference: https://opensource.apple.com/source/IOStorageFamily/IOStorageFamily-116/IOApplePartitionScheme.h 590a5d223e6SXin LI# Update: Joerg Jenderek 591a5d223e6SXin LI# Yes, the 3rd and 4th bytes pmSigPad are reserved, but we use them to make the 592b6cee71dSXin LI# magic stronger. 593a5d223e6SXin LI# for apple partition map stored as a single file 594a5d223e6SXin LI0 belong 0x504d0000 595a5d223e6SXin LI# to display Apple Partition Map (strength=70) after Syslinux bootloader (71) 596a5d223e6SXin LI#!:strength +0 597a5d223e6SXin LI>0 use apple-apm 598a5d223e6SXin LI# magic/Magdir/apple14.test, 365: Warning: Current entry does not yet have a description for adding a EXTENSION type 599a5d223e6SXin LI# file: could not find any valid magic files! 600a5d223e6SXin LI#!:ext bin 601a5d223e6SXin LI# display apple partition map. Normally called after Apple driver map 602a5d223e6SXin LI0 name apple-apm 603a5d223e6SXin LI>0 belong 0x504d0000 Apple Partition Map 604a5d223e6SXin LI# number of partitions 605a5d223e6SXin LI>>4 ubelong x \b, map block count %u 606a5d223e6SXin LI# logical block (512 bytes) start of partition 607a5d223e6SXin LI>>8 ubelong x \b, start block %u 608a5d223e6SXin LI>>12 ubelong x \b, block count %u 609a5d223e6SXin LI>>16 string >0 \b, name %s 610a5d223e6SXin LI>>48 string >0 \b, type %s 611a5d223e6SXin LI# processor type dpme_process_id[16] e.g. "68000" "68020" 612a5d223e6SXin LI>>120 string >0 \b, processor %s 613a5d223e6SXin LI# A/UX boot arguments BootArgs[128] 614a5d223e6SXin LI>>136 string >0 \b, boot arguments %s 615a5d223e6SXin LI# status of partition dpme_flags 616a5d223e6SXin LI>>88 belong & 1 \b, valid 617a5d223e6SXin LI>>88 belong & 2 \b, allocated 618a5d223e6SXin LI>>88 belong & 4 \b, in use 619a5d223e6SXin LI>>88 belong & 8 \b, has boot info 620a5d223e6SXin LI>>88 belong & 16 \b, readable 621a5d223e6SXin LI>>88 belong & 32 \b, writable 622a5d223e6SXin LI>>88 belong & 64 \b, pic boot code 623a5d223e6SXin LI>>88 belong & 128 \b, chain compatible driver 624a5d223e6SXin LI>>88 belong & 256 \b, real driver 625a5d223e6SXin LI>>88 belong & 512 \b, chain driver 626a5d223e6SXin LI# mount automatically at startup APPLE_PS_AUTO_MOUNT 627a5d223e6SXin LI>>88 ubelong &0x40000000 \b, mount at startup 628a5d223e6SXin LI# is the startup partition APPLE_PS_STARTUP 629a5d223e6SXin LI>>88 ubelong &0x80000000 \b, is the startup partition 630b6cee71dSXin LI 63148c779cdSXin LI#https://wiki.mozilla.org/DS_Store_File_Format 63248c779cdSXin LI#https://en.wikipedia.org/wiki/.DS_Store 633b6cee71dSXin LI0 string \0\0\0\1Bud1\0 Apple Desktop Services Store 6345f0216bdSXin LI 6355f0216bdSXin LI# HFS/HFS+ Resource fork files (andrew.roazen@nau.edu Apr 13 2015) 6365f0216bdSXin LI# Usually not in separate files, but have either filename rsrc with 6375f0216bdSXin LI# no extension, or a filename corresponding to another file, with 6385f0216bdSXin LI# extensions rsr/rsrc 639898496eeSXin LI# URL: http://fileformats.archiveteam.org/wiki/Macintosh_resource_file 640898496eeSXin LI# https://en.wikipedia.org/wiki/Resource_fork 641898496eeSXin LI# Reference: https://github.com/kreativekorp/ksfl/wiki/Macintosh-Resource-File-Format 642898496eeSXin LI# http://developer.apple.com/legacy/mac/library/documentation/mac/pdf/MoreMacintoshToolbox.pdf 643898496eeSXin LI# https://formats.kaitai.io/resource_fork/ 644898496eeSXin LI# Update: Joerg Jenderek 645898496eeSXin LI# Note: verified often by command like `deark -m macrsrc Icon_.rsrc` 646898496eeSXin LI# offset of resource data; usually starts at offset 0x0100 6475f0216bdSXin LI0 string \000\000\001\000 648898496eeSXin LI# skip NPETraceSession.etl with invalid "low" map offset 0 649898496eeSXin LI>4 ubelong >0xFF 650898496eeSXin LI# skip few Atari DEGAS Elite bitmap (eil2.pi1 nastro.pi1) with ivalid "high" 0x6550766 0x7510763 map length 651898496eeSXin LI>>12 ubelong <0x8001 652898496eeSXin LI# most examples with zeroed system reserved field 653898496eeSXin LI>>>16 lelong =0 654898496eeSXin LI>>>>0 use apple-rsr 655898496eeSXin LI# few samples with not zeroed system reserved field like: Empty.rsrc.rsr OpenSans-CondBold.dfont 656898496eeSXin LI>>>16 lelong !0 657898496eeSXin LI# resource fork variant with not zeroed system reserved field and copy of header 658898496eeSXin LI>>>>(4.L) ubelong 0x100 659898496eeSXin LI# GRR: the line above only works if in ../../src/file.h FILE_BYTES_MAX is raised from 1 MiB above 0x6ab0f4 (HelveticaNeue.dfont) 660898496eeSXin LI>>>>>0 use apple-rsr 661898496eeSXin LI# data fork variant with not zeroed system reserved field and no copy of header 662898496eeSXin LI>>>>(4.L) ubelong 0 663898496eeSXin LI>>>>>0 use apple-rsr 664898496eeSXin LI# Note: moved and merged from ./macintosh 665898496eeSXin LI# From: Adam Buchbinder <adam.buchbinder@gmail.com> 666898496eeSXin LI# URL: https://en.wikipedia.org/wiki/Datafork_TrueType 667898496eeSXin LI# Derived from the 'fondu' and 'ufond' source code (fondu.sf.net). 'sfnt' is 668898496eeSXin LI# TrueType; 'POST' is PostScript. 'FONT' and 'NFNT' sometimes appear, but I 669898496eeSXin LI# don't know what they mean. 670898496eeSXin LI# display information about Mac OSX datafork font DFONT 671898496eeSXin LI0 name apple-dfont 672898496eeSXin LI>(4.L+30) ubelong x Mac OSX datafork font, 673898496eeSXin LI# https://en.wikipedia.org/wiki/Datafork_TrueType 674898496eeSXin LI!:mime application/x-dfont 675898496eeSXin LI!:ext dfont 676898496eeSXin LI# https://exiftool.org/TagNames/RSRC.html 677898496eeSXin LI>(4.L+30) ubelong 0x73666e74 TrueType 678898496eeSXin LI>(4.L+30) ubelong 0x464f4e54 'FONT' 679898496eeSXin LI>(4.L+30) ubelong 0x4e464e54 'NFNT' 680898496eeSXin LI>(4.L+30) ubelong 0x504f5354 PostScript 681898496eeSXin LI>(4.L+30) ubelong 0x464f4e44 'FOND' 682898496eeSXin LI>(4.L+30) ubelong 0x76657273 'vers' 683898496eeSXin LI# display information about Macintosh resource 684898496eeSXin LI0 name apple-rsr 685898496eeSXin LI>(4.L+30) ubelong 0x73666e74 686898496eeSXin LI>>0 use apple-dfont 687898496eeSXin LI>(4.L+30) ubelong 0x464f4e54 688898496eeSXin LI>>0 use apple-dfont 689898496eeSXin LI>(4.L+30) ubelong 0x4e464e54 690898496eeSXin LI>>0 use apple-dfont 691898496eeSXin LI>(4.L+30) ubelong 0x504f5354 692898496eeSXin LI>>0 use apple-dfont 693898496eeSXin LI>(4.L+30) ubelong 0x464f4e44 694898496eeSXin LI>>0 use apple-dfont 695898496eeSXin LI>(4.L+30) ubelong 0x76657273 696898496eeSXin LI>>0 use apple-dfont 697898496eeSXin LI>(4.L+30) default x Apple HFS/HFS+ resource fork 698898496eeSXin LI#!:mime application/octet-stream 699898496eeSXin LI!:mime application/x-apple-rsr 700898496eeSXin LI!:ext rsrc/rsr 701898496eeSXin LI# offset to resource data; usually starts at offset 0x0100 702898496eeSXin LI>0 ubelong !0x100 \b, data offset %#x 703898496eeSXin LI# offset to resource map; positive but not nil like in NPETraceSession.etl 704898496eeSXin LI>4 ubelong x \b, map offset %#x 705898496eeSXin LI# length of resource map; positive with 32K limitation but not 706898496eeSXin LI# nil like in NPETraceSession.etl or high like 0x7510763 in nastro.pi1 707898496eeSXin LI>12 ubelong x \b, map length %#x 708898496eeSXin LI# length of resource data; positive but not nil like in NPETraceSession.etl 709898496eeSXin LI>8 ubelong x \b, data length %#x 710898496eeSXin LI# reserved 112 bytes for system use; apparently often nil, but 8fd20000h in Empty.rsrc.rsr and 0x00768c2b in OpenSans-CondBold.dfont 711898496eeSXin LI>16 ubelong !0 \b, at 16 %#8.8x 712898496eeSXin LI# https://fontforge.org/docs/techref/macformats.html 713898496eeSXin LI# jump to resource map 714898496eeSXin LI# a copy of resource header or 16 bytes of zeros for data fork 715898496eeSXin LI#>(4.L) ubelong x \b, DATA offset %#x 716898496eeSXin LI#>(4.L+4) ubelong x \b, MAP offset %#x 717898496eeSXin LI#>(4.L+8) ubelong x \b, DATA length %#x 718898496eeSXin LI#>(4.L+12) ubelong x \b, MAP length %#x 719898496eeSXin LI# nextResourceMap; handle to next resource map; used by the Resource Manager for internal bookkeeping; should be zero 720898496eeSXin LI>(4.L+16) ubelong !0 \b, nextResourceMap %#x 721898496eeSXin LI# fileRef; file reference number; used by the Resource Manager for internal bookkeeping; should be zero 722898496eeSXin LI>(4.L+20) ubeshort !0 \b, fileRef %#x 723898496eeSXin LI# attributes; Resource fork attributes (80h~read-only 40h~compression needed 20h~changed); other bits are reserved and should be zero 724898496eeSXin LI>(4.L+22) ubeshort !0 \b, attributes %#x 725898496eeSXin LI# typeListOffset; offset from resource map to start of type list like: 1Ch 726898496eeSXin LI>(4.L+24) ubeshort x \b, list offset %#x 727898496eeSXin LI# nameListOffset; offset from esource map to start of name list like: 32h 46h 56h (XLISP.RSR XLISPTIN.RSR) 13Eh (HelveticaNeue.dfont) 728898496eeSXin LI>(4.L+26) ubeshort x \b, name offset %#x 729898496eeSXin LI# typeCount; number of types in the map minus 1; If there are no resources, this is 0xFFFF 730898496eeSXin LI>(4.L+28) beshort+1 >0 \b, %u type 731898496eeSXin LI# plural s 732898496eeSXin LI>>(4.L+28) beshort+1 >1 \bs 733898496eeSXin LI# resource type list array; 1st resource type like: ALRT CODE FOND MPSR icns scsz 734898496eeSXin LI>>(4.L+30) ubelong x \b, %#x 735898496eeSXin LI>>(4.L+30) string x '%-.4s' 736898496eeSXin LI# resourceCount; number of this type resources minus one. If there is one resource of this type, this is 0x0000 737898496eeSXin LI>>(4.L+34) beshort+1 x * %d 738898496eeSXin LI# resourceListOffset; offset from type list to resource list like: Ah 12h DAh 739898496eeSXin LI>(4.L+36) ubeshort x resource offset %#x 7405f0216bdSXin LI 741a5d223e6SXin LI#https://en.wikipedia.org/wiki/AppleScript 742a5d223e6SXin LI0 string FasdUAS AppleScript compiled 743a5d223e6SXin LI 744a5d223e6SXin LI# AppleWorks/ClarisWorks 745a5d223e6SXin LI# https://github.com/joshenders/appleworks_format 746a5d223e6SXin LI# http://fileformats.archiveteam.org/wiki/AppleWorks 747a5d223e6SXin LI0 name appleworks 748a5d223e6SXin LI>0 belong&0x00ffffff 0x07e100 AppleWorks CWK Document 749a5d223e6SXin LI>0 belong&0x00ffffff 0x008803 ClarisWorks CWK Document 750a5d223e6SXin LI>0 default x 751a5d223e6SXin LI>>0 belong x AppleWorks/ClarisWorks CWK Document 752a5d223e6SXin LI>0 byte x \b, version %d 753a5d223e6SXin LI>30 beshort x \b, %d 754a5d223e6SXin LI>32 beshort x \bx%d 755a5d223e6SXin LI!:ext cwk 756a5d223e6SXin LI 757a5d223e6SXin LI4 string BOBO 758a5d223e6SXin LI>0 byte >4 759a5d223e6SXin LI>>12 belong 0 760a5d223e6SXin LI>>>26 belong 0 761a5d223e6SXin LI>>>>0 use appleworks 762a5d223e6SXin LI>0 belong 0x0481ad00 763a5d223e6SXin LI>>0 use appleworks 76458a0f0d0SEitan Adler 76558a0f0d0SEitan Adler# magic for Apple File System (APFS) 76658a0f0d0SEitan Adler# from Alex Myczko <alex@aiei.ch> 76758a0f0d0SEitan Adler32 string NXSB Apple File System (APFS) 76858a0f0d0SEitan Adler>36 ulelong x \b, blocksize %u 76958a0f0d0SEitan Adler 77058a0f0d0SEitan Adler# iTunes cover art (versions 1 and 2) 77158a0f0d0SEitan Adler4 string itch 77258a0f0d0SEitan Adler>24 string artw 77358a0f0d0SEitan Adler>>0x1e8 string data iTunes cover art 77458a0f0d0SEitan Adler>>>0x1ed string PNG (PNG) 77558a0f0d0SEitan Adler>>>0x1ec beshort 0xffd8 (JPEG) 77658a0f0d0SEitan Adler 77758a0f0d0SEitan Adler# MacPaint image 77858a0f0d0SEitan Adler65 string PNTGMPNT MacPaint image data 77958a0f0d0SEitan Adler#0 belong 2 MacPaint image data 780