1# $OpenBSD: apple,v 1.4 2004/06/03 03:14:19 tedu Exp $ 2 3#------------------------------------------------------------------------------ 4# apple: file(1) magic for Apple file formats 5# 60 string FiLeStArTfIlEsTaRt binscii (apple ][) text 70 string \x0aGL Binary II (apple ][) data 80 string \x76\xff Squeezed (apple ][) data 90 string NuFile NuFile archive (apple ][) data 100 string N\xf5F\xe9l\xe5 NuFile archive (apple ][) data 110 belong 0x00051600 AppleSingle encoded Macintosh file 120 belong 0x00051607 AppleDouble encoded Macintosh file 13 14# magic for Newton PDA package formats 15# from Ruda Moura <ruda@helllabs.org> 160 string package0 Newton package, NOS 1.x, 17>12 belong &0x80000000 AutoRemove, 18>12 belong &0x40000000 CopyProtect, 19>12 belong &0x10000000 NoCompression, 20>12 belong &0x04000000 Relocation, 21>12 belong &0x02000000 UseFasterCompression, 22>16 belong x version %d 23 240 string package1 Newton package, NOS 2.x, 25>12 belong &0x80000000 AutoRemove, 26>12 belong &0x40000000 CopyProtect, 27>12 belong &0x10000000 NoCompression, 28>12 belong &0x04000000 Relocation, 29>12 belong &0x02000000 UseFasterCompression, 30>16 belong x version %d 31 320 string package4 Newton package, 33>8 byte 8 NOS 1.x, 34>8 byte 9 NOS 2.x, 35>12 belong &0x80000000 AutoRemove, 36>12 belong &0x40000000 CopyProtect, 37>12 belong &0x10000000 NoCompression, 38 39# The following entries for the Apple II are for files that have 40# been transferred as raw binary data from an Apple, without having 41# been encapsulated by any of the above archivers. 42# 43# In general, Apple II formats are hard to identify because Apple DOS 44# and especially Apple ProDOS have strong typing in the file system and 45# therefore programmers never felt much need to include type information 46# in the files themselves. 47# 48# Eric Fischer <enf@pobox.com> 49 50# AppleWorks word processor: 51# 52# This matches the standard tab stops for an AppleWorks file, but if 53# a file has a tab stop set in the first four columns this will fail. 54# 55# The "O" is really the magic number, but that's so common that it's 56# necessary to check the tab stops that follow it to avoid false positives. 57 584 string O==== AppleWorks word processor data 59>85 byte&0x01 >0 \b, zoomed 60>90 byte&0x01 >0 \b, paginated 61>92 byte&0x01 >0 \b, with mail merge 62#>91 byte x \b, left margin %d 63 64# AppleWorks database: 65# 66# This isn't really a magic number, but it's the closest thing to one 67# that I could find. The 1 and 2 really mean "order in which you defined 68# categories" and "left to right, top to bottom," respectively; the D and R 69# mean that the cursor should move either down or right when you press Return. 70 71#30 string \x01D AppleWorks database data 72#30 string \x02D AppleWorks database data 73#30 string \x01R AppleWorks database data 74#30 string \x02R AppleWorks database data 75 76# AppleWorks spreadsheet: 77# 78# Likewise, this isn't really meant as a magic number. The R or C means 79# row- or column-order recalculation; the A or M means automatic or manual 80# recalculation. 81 82#131 string RA AppleWorks spreadsheet data 83#131 string RM AppleWorks spreadsheet data 84#131 string CA AppleWorks spreadsheet data 85#131 string CM AppleWorks spreadsheet data 86 87# Applesoft BASIC: 88# 89# This is incredibly sloppy, but will be true if the program was 90# written at its usual memory location of 2048 and its first line 91# number is less than 256. Yuck. 92 930 belong&0xff00ff 0x80000 Applesoft BASIC program data 94#>2 leshort x \b, first line number %d 95 96# ORCA/EZ assembler: 97# 98# This will not identify ORCA/M source files, since those have 99# some sort of date code instead of the two zero bytes at 6 and 7 100# XXX Conflicts with ELF 101#4 belong&0xff00ffff 0x01000000 ORCA/EZ assembler source data 102#>5 byte x \b, build number %d 103 104# Broderbund Fantavision 105# 106# I don't know what these values really mean, but they seem to recur. 107# Will they cause too many conflicts? 108 109# Probably :-) 110#2 belong&0xFF00FF 0x040008 Fantavision movie data 111 112# Some attempts at images. 113# 114# These are actually just bit-for-bit dumps of the frame buffer, so 115# there's really no reasonably way to distinguish them except for their 116# address (if preserved) -- 8192 or 16384 -- and their length -- 8192 117# or, occasionally, 8184. 118# 119# Nevertheless this will manage to catch a lot of images that happen 120# to have a solid-colored line at the bottom of the screen. 121 1228144 string \x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F Apple II image with white background 1238144 string \x55\x2A\x55\x2A\x55\x2A\x55\x2A Apple II image with purple background 1248144 string \x2A\x55\x2A\x55\x2A\x55\x2A\x55 Apple II image with green background 1258144 string \xD5\xAA\xD5\xAA\xD5\xAA\xD5\xAA Apple II image with blue background 1268144 string \xAA\xD5\xAA\xD5\xAA\xD5\xAA\xD5 Apple II image with orange background 127 128# Beagle Bros. Apple Mechanic fonts 129 1300 belong&0xFF00FFFF 0x6400D000 Apple Mechanic font 131