1b6cee71dSXin LI 2b6cee71dSXin LI#------------------------------------------------------------------------------ 3*898496eeSXin LI# $File: macintosh,v 1.36 2022/12/06 18:45:20 christos Exp $ 4b6cee71dSXin LI# macintosh description 5b6cee71dSXin LI# 6b6cee71dSXin LI# BinHex is the Macintosh ASCII-encoded file format (see also "apple") 7b6cee71dSXin LI# Daniel Quinlan, quinlan@yggdrasil.com 8d38c30c0SXin LI# Update: Joerg Jenderek 9d38c30c0SXin LI# URL: https://en.wikipedia.org/wiki/BinHex 10d38c30c0SXin LI# Reference: http://fileformats.archiveteam.org/wiki/BinHex 11d38c30c0SXin LI# Note: only tested with version 4.0 and hqx extension 12d38c30c0SXin LI# Any text/binary before the characteristic comment sentence is to be ignored like in 13d38c30c0SXin LI# http://ftp.vim.org/pub/ftp/ftp/infomac/disk/mac-update-40b7.hqx 14d38c30c0SXin LI0 search/1602 (This\ file\ 15d38c30c0SXin LI>&0 use binhex 16d38c30c0SXin LI# http://ftp.vim.org/pub/ftp/ftp/infomac/_Disk_&_File/zap-res-forks-101.hqx 17d38c30c0SXin LI0 search/2652/b (This\ file\ 18d38c30c0SXin LI>&0 use binhex 19d38c30c0SXin LI0 name binhex 2043a5ec4eSXin LI# keep split search string format similar like in version 5.37 21d38c30c0SXin LI>0 string must\ be\ converted\ with\ BinHex\ BinHex binary text, version 22d38c30c0SXin LI# http://www.macdisk.com/binhexen.php3 23d38c30c0SXin LI!:apple BNHQTEXT 24d38c30c0SXin LI# http://www.faqs.org/faqs/macintosh/comm-faq/part1/ 25d38c30c0SXin LI>>&0 string 1.0 1.0 26d38c30c0SXin LI!:mime application/mac-binhex 27d38c30c0SXin LI!:ext hex 28d38c30c0SXin LI>>&0 string 2.0 2.0 29d38c30c0SXin LI!:mime application/mac-binhex 30d38c30c0SXin LI!:ext hcx 31d38c30c0SXin LI# BinHex 3.0 never existed 32d38c30c0SXin LI>>&0 string 4.0 4.0 33b6cee71dSXin LI!:mime application/mac-binhex40 34d38c30c0SXin LI!:ext hqx 35d38c30c0SXin LI# BinHex 5.0 also MacBinary I 36d38c30c0SXin LI>>&0 string 5.0 5.0 37d38c30c0SXin LI!:mime application/mac-binhex40 38d38c30c0SXin LI!:ext hqx 39d38c30c0SXin LI# this should never happen 40d38c30c0SXin LI>>&0 default x 41d38c30c0SXin LI>>>&0 string x %.3s 42d38c30c0SXin LI!:mime application/mac-binhex 43d38c30c0SXin LI!:ext hqx 44b6cee71dSXin LI 45b6cee71dSXin LI# Stuffit archives are the de facto standard of compression for Macintosh 46b6cee71dSXin LI# files obtained from most archives. (franklsm@tuns.ca) 47b6cee71dSXin LI0 string SIT! StuffIt Archive (data) 48b6cee71dSXin LI!:mime application/x-stuffit 49b6cee71dSXin LI!:apple SIT!SIT! 50b6cee71dSXin LI>2 string x : %s 51b6cee71dSXin LI0 string SITD StuffIt Deluxe (data) 52b6cee71dSXin LI>2 string x : %s 53b6cee71dSXin LI0 string Seg StuffIt Deluxe Segment (data) 54b6cee71dSXin LI>2 string x : %s 55b6cee71dSXin LI 56b6cee71dSXin LI# Newer StuffIt archives (grant@netbsd.org) 57b6cee71dSXin LI0 string StuffIt StuffIt Archive 58b6cee71dSXin LI!:mime application/x-stuffit 59b6cee71dSXin LI!:apple SIT!SIT! 60b6cee71dSXin LI#>162 string >0 : %s 61b6cee71dSXin LI 62b6cee71dSXin LI# Macintosh Applications and Installation binaries (franklsm@tuns.ca) 63b6cee71dSXin LI# GRR: Too weak 64b6cee71dSXin LI#0 string APPL Macintosh Application (data) 65b6cee71dSXin LI#>2 string x \b: %s 66b6cee71dSXin LI 67b6cee71dSXin LI# Macintosh System files (franklsm@tuns.ca) 68b6cee71dSXin LI# GRR: Too weak 69b6cee71dSXin LI#0 string zsys Macintosh System File (data) 70b6cee71dSXin LI#0 string FNDR Macintosh Finder (data) 71b6cee71dSXin LI#0 string libr Macintosh Library (data) 72b6cee71dSXin LI#>2 string x : %s 73b6cee71dSXin LI#0 string shlb Macintosh Shared Library (data) 74b6cee71dSXin LI#>2 string x : %s 75b6cee71dSXin LI#0 string cdev Macintosh Control Panel (data) 76b6cee71dSXin LI#>2 string x : %s 77b6cee71dSXin LI#0 string INIT Macintosh Extension (data) 78b6cee71dSXin LI#>2 string x : %s 79b6cee71dSXin LI#0 string FFIL Macintosh Truetype Font (data) 80b6cee71dSXin LI#>2 string x : %s 81b6cee71dSXin LI#0 string LWFN Macintosh Postscript Font (data) 82b6cee71dSXin LI#>2 string x : %s 83b6cee71dSXin LI 84b6cee71dSXin LI# Additional Macintosh Files (franklsm@tuns.ca) 85b6cee71dSXin LI# GRR: Too weak 86b6cee71dSXin LI#0 string PACT Macintosh Compact Pro Archive (data) 87b6cee71dSXin LI#>2 string x : %s 88b6cee71dSXin LI#0 string ttro Macintosh TeachText File (data) 89b6cee71dSXin LI#>2 string x : %s 90b6cee71dSXin LI#0 string TEXT Macintosh TeachText File (data) 91b6cee71dSXin LI#>2 string x : %s 92b6cee71dSXin LI#0 string PDF Macintosh PDF File (data) 93b6cee71dSXin LI#>2 string x : %s 94b6cee71dSXin LI 95b6cee71dSXin LI# MacBinary format (Eric Fischer, enf@pobox.com) 9658a0f0d0SEitan Adler# Update: Joerg Jenderek 9758a0f0d0SEitan Adler# URL: https://en.wikipedia.org/wiki/MacBinary 98*898496eeSXin LI# http://fileformats.archiveteam.org/wiki/MacBinary 9948c779cdSXin LI# Reference: https://files.stairways.com/other/macbinaryii-standard-info.txt 100*898496eeSXin LI# Note: verified by macutils `macunpack -i -v BBEdit4.0.sit.bin` and 101*898496eeSXin LI# `deark -l -d -m macbinary G3FirmwareUpdate1.1.smi.bin` 102b6cee71dSXin LI# 103b6cee71dSXin LI# Unfortunately MacBinary doesn't really have a magic number prior 10458a0f0d0SEitan Adler# to the MacBinary III format. 105b6cee71dSXin LI# 10658a0f0d0SEitan Adler 10758a0f0d0SEitan Adler# old version number, must be kept at zero for compatibility 10858a0f0d0SEitan Adler0 byte 0 10958a0f0d0SEitan Adler# length of filename (must be in the range 1-63) 11058a0f0d0SEitan Adler>1 ubyte >0 11158a0f0d0SEitan Adler# skip T.PIC.LZ INSTRUMENT.7T INVENTORY 11258a0f0d0SEitan Adler>>1 ubyte <64 11358a0f0d0SEitan Adler# skip Docs.MWII ReadMe.MacWrite "Notes (MacWrite II)" 11458a0f0d0SEitan Adler# by looking for printable characters at beginning of file name 11558a0f0d0SEitan Adler>>>2 ubelong >0x1F000000 11658a0f0d0SEitan Adler# zero fill, must be zero for compatibility 11758a0f0d0SEitan Adler>>>>74 byte 0 11858a0f0d0SEitan Adler# zero fill, must be zero for compatibility 11958a0f0d0SEitan Adler>>>>>82 byte 0 120*898496eeSXin LI# skip few DEGAS mid-res uncompressed bitmap (GEMINI03.PI2 CODE_RAM.PI2) with "too high" file names ffffff88 ffff4f00 121*898496eeSXin LI>>>>>>2 ubelong <0xffff0000 12258a0f0d0SEitan Adler# MacBinary I test for valid version numbers 123*898496eeSXin LI>>>>>>>122 ubeshort 0 12458a0f0d0SEitan Adler# additional check for undefined header fields in MacBinary I 125*898496eeSXin LI#>>>>>>>>101 ulong 0 126*898496eeSXin LI>>>>>>>>0 use mac-bin 12758a0f0d0SEitan Adler# MacBinary II the newer versions begins at 129 128*898496eeSXin LI>>>>>>>122 ubeshort 0x8181 129*898496eeSXin LI>>>>>>>>0 use mac-bin 13058a0f0d0SEitan Adler# MacBinary III with MacBinary II to read 131*898496eeSXin LI>>>>>>122 ubeshort 0x8281 132*898496eeSXin LI>>>>>>>0 use mac-bin 13358a0f0d0SEitan Adler 13458a0f0d0SEitan Adler# display information of MacBinary file 13558a0f0d0SEitan Adler0 name mac-bin 13658a0f0d0SEitan Adler>122 ubyte x MacBinary 13758a0f0d0SEitan Adler# versions for MacBinary II/III 13858a0f0d0SEitan Adler>122 ubyte 129 II 13958a0f0d0SEitan Adler>122 ubyte 130 III 14058a0f0d0SEitan Adler# only in MacBinary III 14158a0f0d0SEitan Adler>>102 string !mBIN with surprising version 14258a0f0d0SEitan Adler!:mime application/x-macbinary 14358a0f0d0SEitan Adler!:apple PSPTBINA 14458a0f0d0SEitan Adler!:ext bin/macbin 145*898496eeSXin LI# THIS SHOULD NEVER HAPPEN! Maybe another file type is misidentified as MacBinary 14658a0f0d0SEitan Adler#>1 ubyte >63 \b, name length %u too BIG! 14743a5ec4eSXin LI#>122 ubeshort x \b, version %#x 14858a0f0d0SEitan Adler# Finder flags if not 0 14958a0f0d0SEitan Adler# >73 byte !0 \b, flags 0x 15058a0f0d0SEitan Adler# >73 byte =0 15158a0f0d0SEitan Adler# >>101 byte !0 \b, flags 0x 15258a0f0d0SEitan Adler# # original Finder flags (Bits 8-15) 15358a0f0d0SEitan Adler# >73 byte !0 \b%x 15458a0f0d0SEitan Adler# # finder flags, bits 0-7 15558a0f0d0SEitan Adler# >101 byte !0 \b%x 15658a0f0d0SEitan Adler>73 byte &0x01 \b, inited 15758a0f0d0SEitan Adler>73 byte &0x02 \b, changed 15858a0f0d0SEitan Adler>73 byte &0x04 \b, busy 15958a0f0d0SEitan Adler>73 byte &0x08 \b, bozo 16058a0f0d0SEitan Adler>73 byte &0x10 \b, system 16158a0f0d0SEitan Adler>73 byte &0x20 \b, bundle 16258a0f0d0SEitan Adler>73 byte &0x40 \b, invisible 16358a0f0d0SEitan Adler>73 byte &0x80 \b, locked 16458a0f0d0SEitan Adler 165b6cee71dSXin LI# 75 beshort # vertical posn in window 16658a0f0d0SEitan Adler#>75 beshort !0 \b, v.pos %u 167b6cee71dSXin LI# 77 beshort # horiz posn in window 16858a0f0d0SEitan Adler#>77 beshort !0 \b, h.pos %u 169b6cee71dSXin LI# 79 beshort # window or folder ID 17043a5ec4eSXin LI>79 ubeshort !0 \b, ID %#x 17158a0f0d0SEitan Adler# protected flag 17243a5ec4eSXin LI>81 byte !0 \b, protected %#x 17358a0f0d0SEitan Adler# length of comment after resource 17458a0f0d0SEitan Adler>99 ubeshort !0 \b, comment length %u 17558a0f0d0SEitan Adler# char. code of file name 17643a5ec4eSXin LI>106 ubyte !0 \b, char. code %#x 17758a0f0d0SEitan Adler# still more Finder flags 17843a5ec4eSXin LI>107 ubyte !0 \b, more flags %#x 17958a0f0d0SEitan Adler# length of total files when unpacked only used when pack and unpack on the fly 18058a0f0d0SEitan Adler>116 ubelong !0 \b, total length %u 181b6cee71dSXin LI# 120 beshort # length of add'l header 18258a0f0d0SEitan Adler>120 ubeshort !0 \b, 2nd header length %u 183b6cee71dSXin LI# 124 beshort # checksum 18443a5ec4eSXin LI#>124 ubeshort !0 \b, CRC %#x 18558a0f0d0SEitan Adler# creation date in seconds since MacOS epoch start. So 1 Jan 1970 ~ 7C25B080 186*898496eeSXin LI# few (31/1247) examples (hinkC4.0.sitx.bin InternetExplorer5.1.smi.bin G3FirmwareUpdate1.1.smi.bin Firewire2.3.3.smi.bin LR2image.bin) contain zeroed date fields 187*898496eeSXin LI>91 long !0 188*898496eeSXin LI>>91 beldate-0x7C25B080 x \b, %s 189*898496eeSXin LI# THIS SHOULD NEVER HAPPEN! Maybe another file type is misidentified or time overflow 19058a0f0d0SEitan Adler>91 ubelong <0x7c25b080 INVALID date 191*898496eeSXin LI# reported date seconds by deark 192*898496eeSXin LI#>91 ubelong x deark-DATE=%u 19358a0f0d0SEitan Adler# last modified date 194*898496eeSXin LI>95 long !0 195*898496eeSXin LI>>95 beldate-0x7C25B080 x \b, modified %s 19658a0f0d0SEitan Adler# Apple creator+typ if not null 19758a0f0d0SEitan Adler# file creator (normally expressed as four characters) 19858a0f0d0SEitan Adler>69 ulong !0 \b, creator 19958a0f0d0SEitan Adler# instead 4 character code display full creator name 20058a0f0d0SEitan Adler>>69 use apple-creator 20158a0f0d0SEitan Adler# file type (normally expressed as four characters) 20258a0f0d0SEitan Adler>65 ulong !0 \b, type 20358a0f0d0SEitan Adler>>65 use apple-type 20458a0f0d0SEitan Adler# length of data segment 20558a0f0d0SEitan Adler>83 ubelong !0 \b, %u bytes 20658a0f0d0SEitan Adler# filename (in the range 1-63) 207*898496eeSXin LI# like "BBEdit4.0.sit" "Archive.sitx" "MacPGP 2.2 (.sea)" 20858a0f0d0SEitan Adler>1 pstring x "%s" 20958a0f0d0SEitan Adler# print 1 space and then at offset 128 inspect data fork content if it has one 21058a0f0d0SEitan Adler>83 ubelong !0 \b 21158a0f0d0SEitan Adler>>128 indirect x 21258a0f0d0SEitan Adler# Afterwards resource fork if length of resource segment not zero 21358a0f0d0SEitan Adler>87 ubelong !0 21458a0f0d0SEitan Adler# calculate resource fork offset 21543a5ec4eSXin LI>>83 ubelong+128 x \b, at %#x 21658a0f0d0SEitan Adler# length of resource segment 21758a0f0d0SEitan Adler>>87 ubelong !0 %u bytes 21858a0f0d0SEitan Adler>>(83.S+128) ubequad x resource 21958a0f0d0SEitan Adler# further resource fork content inspection 22058a0f0d0SEitan Adler>>>&-8 indirect x 221b6cee71dSXin LI 22258a0f0d0SEitan Adler# Apple Type/Creator Database 22358a0f0d0SEitan Adler# URL: https://en.wikipedia.org/wiki/Type_code 22448c779cdSXin LI# Reference: https://www.lacikam.co.il/tcdb/ 22548c779cdSXin LI# https://www.macdisk.com/macsigen.php 22658a0f0d0SEitan Adler# Note: classic Mac OS files have two 4 character codes for type and creator. 22758a0f0d0SEitan Adler# Thereby the Finder attach documents types to applications. 228b6cee71dSXin LI 229b6cee71dSXin LI#>65 string x \b, type "%4.4s" 230b6cee71dSXin LI 23158a0f0d0SEitan Adler# display information about apple type 23258a0f0d0SEitan Adler0 name apple-type 23358a0f0d0SEitan Adler>0 string 8BIM PhotoShop 23458a0f0d0SEitan Adler>0 string ALB3 PageMaker 3 23558a0f0d0SEitan Adler>0 string ALB4 PageMaker 4 23658a0f0d0SEitan Adler>0 string ALT3 PageMaker 3 23758a0f0d0SEitan Adler>0 string APPL application 23858a0f0d0SEitan Adler>0 string AWWP AppleWorks word processor 23958a0f0d0SEitan Adler>0 string CIRC simulated circuit 24058a0f0d0SEitan Adler>0 string DRWG MacDraw 24158a0f0d0SEitan Adler>0 string EPSF Encapsulated PostScript 24258a0f0d0SEitan Adler>0 string FFIL font suitcase 24358a0f0d0SEitan Adler>0 string FKEY function key 24458a0f0d0SEitan Adler>0 string FNDR Macintosh Finder 24558a0f0d0SEitan Adler>0 string GIFf GIF image 24658a0f0d0SEitan Adler>0 string Gzip GNU gzip 24758a0f0d0SEitan Adler>0 string INIT system extension 24858a0f0d0SEitan Adler>0 string LIB\ library 24958a0f0d0SEitan Adler>0 string LWFN PostScript font 25058a0f0d0SEitan Adler>0 string MSBC Microsoft BASIC 25158a0f0d0SEitan Adler>0 string PACT Compact Pro archive 25258a0f0d0SEitan Adler>0 string PDF\ Portable Document Format 25358a0f0d0SEitan Adler>0 string PICT picture 25458a0f0d0SEitan Adler>0 string PNTG MacPaint picture 25558a0f0d0SEitan Adler>0 string PREF preferences 25658a0f0d0SEitan Adler>0 string PROJ Think C project 25758a0f0d0SEitan Adler>0 string QPRJ Think Pascal project 25858a0f0d0SEitan Adler>0 string SCFL Defender scores 25958a0f0d0SEitan Adler>0 string SCRN startup screen 26058a0f0d0SEitan Adler>0 string SITD StuffIt Deluxe 26158a0f0d0SEitan Adler>0 string SPn3 SuperPaint 26258a0f0d0SEitan Adler>0 string STAK HyperCard stack 26358a0f0d0SEitan Adler>0 string Seg\ StuffIt segment 26458a0f0d0SEitan Adler>0 string TARF Unix tar archive 26558a0f0d0SEitan Adler>0 string TEXT ASCII 26658a0f0d0SEitan Adler>0 string TIFF TIFF image 26758a0f0d0SEitan Adler>0 string TOVF Eudora table of contents 26858a0f0d0SEitan Adler>0 string WDBN Microsoft Word word processor 26958a0f0d0SEitan Adler>0 string WORD MacWrite word processor 27058a0f0d0SEitan Adler>0 string XLS\ Microsoft Excel 27158a0f0d0SEitan Adler>0 string ZIVM compress (.Z) 27258a0f0d0SEitan Adler>0 string ZSYS Pre-System 7 system file 27358a0f0d0SEitan Adler>0 string acf3 Aldus FreeHand 27458a0f0d0SEitan Adler>0 string cdev control panel 27558a0f0d0SEitan Adler>0 string dfil Desk Accessory suitcase 27658a0f0d0SEitan Adler>0 string libr library 27758a0f0d0SEitan Adler>0 string nX^d WriteNow word processor 27858a0f0d0SEitan Adler>0 string nX^w WriteNow dictionary 27958a0f0d0SEitan Adler>0 string rsrc resource 28058a0f0d0SEitan Adler>0 string scbk Scrapbook 28158a0f0d0SEitan Adler>0 string shlb shared library 28258a0f0d0SEitan Adler>0 string ttro SimpleText read-only 28358a0f0d0SEitan Adler>0 string zsys system file 28458a0f0d0SEitan Adler 28558a0f0d0SEitan Adler# additional types added in Dec 2017 28658a0f0d0SEitan Adler>0 string BINA binary file 28758a0f0d0SEitan Adler>0 string BMPp BMP image 28858a0f0d0SEitan Adler>0 string JPEG JPEG image 28958a0f0d0SEitan Adler#>0 string W4BN Microsoft Word x.y word processor? 29058a0f0d0SEitan Adler# if type name is not known display 4 character identifier 29158a0f0d0SEitan Adler>0 default x 29258a0f0d0SEitan Adler>>0 string x '%4.4s' 293b6cee71dSXin LI 294b6cee71dSXin LI#>69 string x \b, creator "%4.4s" 295b6cee71dSXin LI 29658a0f0d0SEitan Adler# Now Apple has no repository of registered Creator IDs any more. These are 297b6cee71dSXin LI# just the ones that I happened to have files from and was able to identify. 298b6cee71dSXin LI 29958a0f0d0SEitan Adler# display information about apple creator 30058a0f0d0SEitan Adler0 name apple-creator 30158a0f0d0SEitan Adler>0 string 8BIM Adobe Photoshop 30258a0f0d0SEitan Adler>0 string ALD3 PageMaker 3 30358a0f0d0SEitan Adler>0 string ALD4 PageMaker 4 30458a0f0d0SEitan Adler>0 string ALFA Alpha editor 30558a0f0d0SEitan Adler>0 string APLS Apple Scanner 30658a0f0d0SEitan Adler>0 string APSC Apple Scanner 30758a0f0d0SEitan Adler>0 string BRKL Brickles 30858a0f0d0SEitan Adler>0 string BTFT BitFont 30958a0f0d0SEitan Adler>0 string CCL2 Common Lisp 2 31058a0f0d0SEitan Adler>0 string CCL\ Common Lisp 31158a0f0d0SEitan Adler>0 string CDmo The Talking Moose 31258a0f0d0SEitan Adler>0 string CPCT Compact Pro 31358a0f0d0SEitan Adler>0 string CSOm Eudora 31458a0f0d0SEitan Adler>0 string DMOV Font/DA Mover 31558a0f0d0SEitan Adler>0 string DSIM DigSim 31658a0f0d0SEitan Adler>0 string EDIT Macintosh Edit 31758a0f0d0SEitan Adler>0 string ERIK Macintosh Finder 31858a0f0d0SEitan Adler>0 string EXTR self-extracting archive 31958a0f0d0SEitan Adler>0 string Gzip GNU gzip 32058a0f0d0SEitan Adler>0 string KAHL Think C 32158a0f0d0SEitan Adler>0 string LWFU LaserWriter Utility 32258a0f0d0SEitan Adler>0 string LZIV compress 32358a0f0d0SEitan Adler>0 string MACA MacWrite 32458a0f0d0SEitan Adler>0 string MACS Macintosh operating system 32558a0f0d0SEitan Adler>0 string MAcK MacKnowledge terminal emulator 32658a0f0d0SEitan Adler>0 string MLND Defender 32758a0f0d0SEitan Adler>0 string MPNT MacPaint 32858a0f0d0SEitan Adler>0 string MSBB Microsoft BASIC (binary) 32958a0f0d0SEitan Adler>0 string MSWD Microsoft Word 33058a0f0d0SEitan Adler>0 string NCSA NCSA Telnet 33158a0f0d0SEitan Adler>0 string PJMM Think Pascal 33258a0f0d0SEitan Adler>0 string PSAL Hunt the Wumpus 33358a0f0d0SEitan Adler#>0 string PSI2 Apple File Exchange 33458a0f0d0SEitan Adler>0 string R*ch BBEdit 33558a0f0d0SEitan Adler>0 string RMKR Resource Maker 33658a0f0d0SEitan Adler>0 string RSED Resource Editor 33758a0f0d0SEitan Adler>0 string Rich BBEdit 33858a0f0d0SEitan Adler>0 string SIT! StuffIt 33958a0f0d0SEitan Adler>0 string SPNT SuperPaint 34058a0f0d0SEitan Adler>0 string Unix NeXT Mac filesystem 34158a0f0d0SEitan Adler>0 string VIM! Vim editor 34258a0f0d0SEitan Adler>0 string WILD HyperCard 34358a0f0d0SEitan Adler>0 string XCEL Microsoft Excel 34458a0f0d0SEitan Adler>0 string aCa2 Fontographer 34558a0f0d0SEitan Adler>0 string aca3 Aldus FreeHand 34658a0f0d0SEitan Adler>0 string dosa Macintosh MS-DOS file system 34758a0f0d0SEitan Adler>0 string movr Font/DA Mover 34858a0f0d0SEitan Adler>0 string nX^n WriteNow 34958a0f0d0SEitan Adler>0 string pdos Apple ProDOS file system 35058a0f0d0SEitan Adler>0 string scbk Scrapbook 35158a0f0d0SEitan Adler>0 string ttxt SimpleText 35258a0f0d0SEitan Adler>0 string ufox Foreign File Access 35358a0f0d0SEitan Adler# additional creators added in Dec 2017 35458a0f0d0SEitan Adler# Claris/Apple Works 35558a0f0d0SEitan Adler>0 string BOBO Apple Works 35658a0f0d0SEitan Adler# CU-SeeMe_0.87b3_(68K).bin 35758a0f0d0SEitan Adler#>0 string CUce bar 35858a0f0d0SEitan Adler>0 string PSPT Apple File Exchange 35958a0f0d0SEitan Adler# Disk_Copy_4.2.sea.bin 36058a0f0d0SEitan Adler#>0 string NCse foo 36158a0f0d0SEitan Adler# probably StuffIt/Aladdin by Smith Micro Software, Inc. 36258a0f0d0SEitan Adler>0 string STi0 stuffit 36358a0f0d0SEitan Adler# MacGzip-1.1.3.sea.bin 36458a0f0d0SEitan Adler#>0 string aust bar 36558a0f0d0SEitan Adler# D-Disk_Copy_6.3.3.smi.bin 36658a0f0d0SEitan Adler>0 string oneb Disk Copy Self Mounting 36758a0f0d0SEitan Adler# if creator name is not known display 4 character identifier 36858a0f0d0SEitan Adler>0 default x 36958a0f0d0SEitan Adler>>0 string x '%4.4s' 370b6cee71dSXin LI 371b6cee71dSXin LI# sas magic from Bruce Foster (bef@nwu.edu) 372b6cee71dSXin LI# 373b6cee71dSXin LI#0 string SAS SAS 374b6cee71dSXin LI#>8 string x %s 375b6cee71dSXin LI0 string SAS SAS 376b6cee71dSXin LI>24 string DATA data file 377b6cee71dSXin LI>24 string CATALOG catalog 378b6cee71dSXin LI>24 string INDEX data file index 379b6cee71dSXin LI>24 string VIEW data view 380b6cee71dSXin LI# sas 7+ magic from Reinhold Koch (reinhold.koch@roche.com) 381b6cee71dSXin LI# 382b6cee71dSXin LI0x54 string SAS SAS 7+ 383b6cee71dSXin LI>0x9C string DATA data file 384b6cee71dSXin LI>0x9C string CATALOG catalog 385b6cee71dSXin LI>0x9C string INDEX data file index 386b6cee71dSXin LI>0x9C string VIEW data view 387b6cee71dSXin LI 388b6cee71dSXin LI# spss magic for SPSS system and portable files, 389b6cee71dSXin LI# from Bruce Foster (bef@nwu.edu). 390b6cee71dSXin LI 391b6cee71dSXin LI0 long 0xc1e2c3c9 SPSS Portable File 392b6cee71dSXin LI>40 string x %s 393b6cee71dSXin LI 394b6cee71dSXin LI0 string $FL2 SPSS System File 395b6cee71dSXin LI>24 string x %s 396b6cee71dSXin LI 397b6cee71dSXin LI0 string $FL3 SPSS System File 398b6cee71dSXin LI>24 string x %s 399b6cee71dSXin LI 400b6cee71dSXin LI# Macintosh filesystem data 401b6cee71dSXin LI# From "Tom N Harris" <telliamed@mac.com> 402b6cee71dSXin LI# Fixed HFS+ and Partition map magic: Ethan Benson <erbenson@alaska.net> 403b6cee71dSXin LI# The MacOS epoch begins on 1 Jan 1904 instead of 1 Jan 1970, so these 404b6cee71dSXin LI# entries depend on the data arithmetic added after v.35 405b6cee71dSXin LI# There's also some Pascal strings in here, ditto... 406b6cee71dSXin LI 407b6cee71dSXin LI# The boot block signature, according to IM:Files, is 408b6cee71dSXin LI# "for HFS volumes, this field always contains the value 0x4C4B." 409b6cee71dSXin LI# But if this is true for MFS or HFS+ volumes, I don't know. 410b6cee71dSXin LI# Alternatively, the boot block is supposed to be zeroed if it's 411b6cee71dSXin LI# unused, so a simply >0 should suffice. 412b6cee71dSXin LI 413b6cee71dSXin LI0x400 beshort 0xD2D7 Macintosh MFS data 414b6cee71dSXin LI>0 beshort 0x4C4B (bootable) 415b6cee71dSXin LI>0x40a beshort &0x8000 (locked) 416b6cee71dSXin LI>0x402 beldate-0x7C25B080 x created: %s, 417b6cee71dSXin LI>0x406 beldate-0x7C25B080 >0 last backup: %s, 418b6cee71dSXin LI>0x414 belong x block size: %d, 419b6cee71dSXin LI>0x412 beshort x number of blocks: %d, 420b6cee71dSXin LI>0x424 pstring x volume name: %s 421b6cee71dSXin LI 422c2931133SXin LI# *.hfs updated by Joerg Jenderek 42348c779cdSXin LI# https://en.wikipedia.org/wiki/Hierarchical_File_System 424b6cee71dSXin LI# "BD" gives many false positives 425c2931133SXin LI0x400 beshort 0x4244 426c2931133SXin LI# ftp://ftp.mars.org/pub/hfs/hfsutils-3.2.6.tar.gz/hfsutils-3.2.6/libhfs/apple.h 427c2931133SXin LI# first block of volume bit map (always 3) 428c2931133SXin LI>0x40e ubeshort 0x0003 429c2931133SXin LI# maximal length of volume name is 27 430c2931133SXin LI>>0x424 ubyte <28 Macintosh HFS data 431c2931133SXin LI!:mime application/x-apple-diskimage 432c2931133SXin LI#!:apple hfsdINIT 433c2931133SXin LI#!:apple MACSdisk 43448c779cdSXin LI# https://www.macdisk.com/macsigen.php 4353e41d09dSXin LI#!:apple ddskdevi 4363e41d09dSXin LI!:apple ????devi 4373e41d09dSXin LI# https://en.wikipedia.org/wiki/Apple_Disk_Image 4383e41d09dSXin LI!:ext hfs/dmg 439c2931133SXin LI>>>0 beshort 0x4C4B (bootable) 440c2931133SXin LI#>>>0 beshort 0x0000 (not bootable) 441c2931133SXin LI>>>0x40a beshort &0x8000 (locked) 442c2931133SXin LI>>>0x40a beshort ^0x0100 (mounted) 443c2931133SXin LI>>>0x40a beshort &0x0200 (spared blocks) 444c2931133SXin LI>>>0x40a beshort &0x0800 (unclean) 445c2931133SXin LI>>>0x47C beshort 0x482B (Embedded HFS+ Volume) 44648c779cdSXin LI# https://www.epochconverter.com/ 447c2931133SXin LI# 0x7C245F00 seconds ~ 2082758400 ~ 01 Jan 2036 00:00:00 ~ 66 years to 1970 448c2931133SXin LI# 0x7C25B080 seconds ~ 2082844800 ~ 02 Jan 2036 00:00:00 449c2931133SXin LI# construct not working 450c2931133SXin LI#>>>0x402 beldate-0x7C25B080 x created: %s, 451c2931133SXin LI#>>>0x406 beldate-0x7C25B080 x last modified: %s, 452c2931133SXin LI#>>>0x440 beldate-0x7C25B080 >0 last backup: %s, 453c2931133SXin LI# found block sizes 200h,1200h,2800h 454c2931133SXin LI>>>0x414 belong x block size: %d, 455c2931133SXin LI>>>0x412 beshort x number of blocks: %d, 456c2931133SXin LI>>>0x424 pstring x volume name: %s 457b6cee71dSXin LI 458*898496eeSXin LI0 name hfsplus 459b6cee71dSXin LI>&0 beshort x version %d data 460b6cee71dSXin LI>0 beshort 0x4C4B (bootable) 461b6cee71dSXin LI>0x404 belong ^0x00000100 (mounted) 462b6cee71dSXin LI>&2 belong &0x00000200 (spared blocks) 463b6cee71dSXin LI>&2 belong &0x00000800 (unclean) 464b6cee71dSXin LI>&2 belong &0x00008000 (locked) 465b6cee71dSXin LI>&6 string x last mounted by: '%.4s', 466b6cee71dSXin LI# really, that should be treated as a belong and we print a string 467b6cee71dSXin LI# based on the value. TN1150 only mentions '8.10' for "MacOS 8.1" 468b6cee71dSXin LI>&14 beldate-0x7C25B080 x created: %s, 469b6cee71dSXin LI# only the creation date is local time, all other timestamps in HFS+ are UTC. 470b6cee71dSXin LI>&18 bedate-0x7C25B080 x last modified: %s, 471b6cee71dSXin LI>&22 bedate-0x7C25B080 >0 last backup: %s, 472b6cee71dSXin LI>&26 bedate-0x7C25B080 >0 last checked: %s, 473b6cee71dSXin LI>&38 belong x block size: %d, 474b6cee71dSXin LI>&42 belong x number of blocks: %d, 475b6cee71dSXin LI>&46 belong x free blocks: %d 476b6cee71dSXin LI 477*898496eeSXin LI0x400 beshort 0x482B Apple HFS Plus 478*898496eeSXin LI>&0 use hfsplus 479*898496eeSXin LI0x400 beshort 0x4858 Apple HFS Plus Extended 480*898496eeSXin LI>&0 use hfsplus 481*898496eeSXin LI 482b6cee71dSXin LI## AFAIK, only the signature is different 483c2931133SXin LI# same as Apple Partition Map 484c2931133SXin LI# GRR: This magic is too weak, it is just "TS" 485b6cee71dSXin LI#0x200 beshort 0x5453 Apple Old Partition data 486b6cee71dSXin LI#>0x2 beshort x block size: %d, 487b6cee71dSXin LI#>0x230 string x first type: %s, 488b6cee71dSXin LI#>0x210 string x name: %s, 489b6cee71dSXin LI#>0x254 belong x number of blocks: %d, 490b6cee71dSXin LI#>0x400 beshort 0x504D 491b6cee71dSXin LI#>>0x430 string x second type: %s, 492b6cee71dSXin LI#>>0x410 string x name: %s, 493b6cee71dSXin LI#>>0x454 belong x number of blocks: %d, 494b6cee71dSXin LI#>>0x800 beshort 0x504D 495b6cee71dSXin LI#>>>0x830 string x third type: %s, 496b6cee71dSXin LI#>>>0x810 string x name: %s, 497b6cee71dSXin LI#>>>0x854 belong x number of blocks: %d, 498b6cee71dSXin LI#>>>0xa00 beshort 0x504D 499b6cee71dSXin LI#>>>>0xa30 string x fourth type: %s, 500b6cee71dSXin LI#>>>>0xa10 string x name: %s, 501b6cee71dSXin LI#>>>>0xa54 belong x number of blocks: %d 502b6cee71dSXin LI 503b6cee71dSXin LI# From: Remi Mommsen <mommsen@slac.stanford.edu> 504b6cee71dSXin LI0 string BOMStore Mac OS X bill of materials (BOM) file 505b6cee71dSXin LI 506