apple 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249
  1. #------------------------------------------------------------------------------
  2. # apple: file(1) magic for Apple file formats
  3. #
  4. 0 search/1 FiLeStArTfIlEsTaRt binscii (apple ][) text
  5. 0 string \x0aGL Binary II (apple ][) data
  6. 0 string \x76\xff Squeezed (apple ][) data
  7. 0 string NuFile NuFile archive (apple ][) data
  8. 0 string N\xf5F\xe9l\xe5 NuFile archive (apple ][) data
  9. 0 belong 0x00051600 AppleSingle encoded Macintosh file
  10. 0 belong 0x00051607 AppleDouble encoded Macintosh file
  11. # Type: Apple Emulator 2IMG format
  12. # From: Radek Vokal <rvokal@redhat.com>
  13. 0 string 2IMG Apple ][ 2IMG Disk Image
  14. >4 string XGS! \b, XGS
  15. >4 string CTKG \b, Catakig
  16. >4 string ShIm \b, Sheppy's ImageMaker
  17. >4 string WOOF \b, Sweet 16
  18. >4 string B2TR \b, Bernie ][ the Rescue
  19. >4 string !nfc \b, ASIMOV2
  20. >4 string x \b, Unknown Format
  21. >0xc byte 00 \b, DOS 3.3 sector order
  22. >>0x10 byte 00 \b, Volume 254
  23. >>0x10 byte&0x7f x \b, Volume %u
  24. >0xc byte 01 \b, ProDOS sector order
  25. >>0x14 short x \b, %u Blocks
  26. >0xc byte 02 \b, NIB data
  27. # magic for Newton PDA package formats
  28. # from Ruda Moura <ruda@helllabs.org>
  29. 0 string package0 Newton package, NOS 1.x,
  30. >12 belong &0x80000000 AutoRemove,
  31. >12 belong &0x40000000 CopyProtect,
  32. >12 belong &0x10000000 NoCompression,
  33. >12 belong &0x04000000 Relocation,
  34. >12 belong &0x02000000 UseFasterCompression,
  35. >16 belong x version %d
  36. 0 string package1 Newton package, NOS 2.x,
  37. >12 belong &0x80000000 AutoRemove,
  38. >12 belong &0x40000000 CopyProtect,
  39. >12 belong &0x10000000 NoCompression,
  40. >12 belong &0x04000000 Relocation,
  41. >12 belong &0x02000000 UseFasterCompression,
  42. >16 belong x version %d
  43. 0 string package4 Newton package,
  44. >8 byte 8 NOS 1.x,
  45. >8 byte 9 NOS 2.x,
  46. >12 belong &0x80000000 AutoRemove,
  47. >12 belong &0x40000000 CopyProtect,
  48. >12 belong &0x10000000 NoCompression,
  49. # The following entries for the Apple II are for files that have
  50. # been transferred as raw binary data from an Apple, without having
  51. # been encapsulated by any of the above archivers.
  52. #
  53. # In general, Apple II formats are hard to identify because Apple DOS
  54. # and especially Apple ProDOS have strong typing in the file system and
  55. # therefore programmers never felt much need to include type information
  56. # in the files themselves.
  57. #
  58. # Eric Fischer <enf@pobox.com>
  59. # AppleWorks word processor:
  60. #
  61. # This matches the standard tab stops for an AppleWorks file, but if
  62. # a file has a tab stop set in the first four columns this will fail.
  63. #
  64. # The "O" is really the magic number, but that's so common that it's
  65. # necessary to check the tab stops that follow it to avoid false positives.
  66. 4 string O==== AppleWorks word processor data
  67. >85 byte&0x01 >0 \b, zoomed
  68. >90 byte&0x01 >0 \b, paginated
  69. >92 byte&0x01 >0 \b, with mail merge
  70. #>91 byte x \b, left margin %d
  71. # AppleWorks database:
  72. #
  73. # This isn't really a magic number, but it's the closest thing to one
  74. # that I could find. The 1 and 2 really mean "order in which you defined
  75. # categories" and "left to right, top to bottom," respectively; the D and R
  76. # mean that the cursor should move either down or right when you press Return.
  77. #30 string \x01D AppleWorks database data
  78. #30 string \x02D AppleWorks database data
  79. #30 string \x01R AppleWorks database data
  80. #30 string \x02R AppleWorks database data
  81. # AppleWorks spreadsheet:
  82. #
  83. # Likewise, this isn't really meant as a magic number. The R or C means
  84. # row- or column-order recalculation; the A or M means automatic or manual
  85. # recalculation.
  86. #131 string RA AppleWorks spreadsheet data
  87. #131 string RM AppleWorks spreadsheet data
  88. #131 string CA AppleWorks spreadsheet data
  89. #131 string CM AppleWorks spreadsheet data
  90. # Applesoft BASIC:
  91. #
  92. # This is incredibly sloppy, but will be true if the program was
  93. # written at its usual memory location of 2048 and its first line
  94. # number is less than 256. Yuck.
  95. 0 belong&0xff00ff 0x80000 Applesoft BASIC program data
  96. #>2 leshort x \b, first line number %d
  97. # ORCA/EZ assembler:
  98. #
  99. # This will not identify ORCA/M source files, since those have
  100. # some sort of date code instead of the two zero bytes at 6 and 7
  101. # XXX Conflicts with ELF
  102. #4 belong&0xff00ffff 0x01000000 ORCA/EZ assembler source data
  103. #>5 byte x \b, build number %d
  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. # Probably :-)
  109. #2 belong&0xFF00FF 0x040008 Fantavision movie data
  110. # Some attempts at images.
  111. #
  112. # These are actually just bit-for-bit dumps of the frame buffer, so
  113. # there's really no reasonably way to distinguish them except for their
  114. # address (if preserved) -- 8192 or 16384 -- and their length -- 8192
  115. # or, occasionally, 8184.
  116. #
  117. # Nevertheless this will manage to catch a lot of images that happen
  118. # to have a solid-colored line at the bottom of the screen.
  119. # GRR: Magic too weak
  120. #8144 string \x7F\x7F\x7F\x7F\x7F\x7F\x7F\x7F Apple II image with white background
  121. #8144 string \x55\x2A\x55\x2A\x55\x2A\x55\x2A Apple II image with purple background
  122. #8144 string \x2A\x55\x2A\x55\x2A\x55\x2A\x55 Apple II image with green background
  123. #8144 string \xD5\xAA\xD5\xAA\xD5\xAA\xD5\xAA Apple II image with blue background
  124. #8144 string \xAA\xD5\xAA\xD5\xAA\xD5\xAA\xD5 Apple II image with orange background
  125. # Beagle Bros. Apple Mechanic fonts
  126. 0 belong&0xFF00FFFF 0x6400D000 Apple Mechanic font
  127. # Apple Universal Disk Image Format (UDIF) - dmg files.
  128. # From Johan Gade.
  129. # These entries are disabled for now until we fix the following issues.
  130. #
  131. # Note there might be some problems with the "VAX COFF executable"
  132. # entry. Note this entry should be placed before the mac filesystem section,
  133. # particularly the "Apple Partition data" entry.
  134. #
  135. # The intended meaning of these tests is, that the file is only of the
  136. # specified type if both of the lines are correct - i.e. if the first
  137. # line matches and the second doesn't then it is not of that type.
  138. #
  139. #0 long 0x7801730d
  140. #>4 long 0x62626060 UDIF read-only zlib-compressed image (UDZO)
  141. #
  142. # Note that this entry is recognized correctly by the "Apple Partition
  143. # data" entry - however since this entry is more specific - this
  144. # information seems to be more useful.
  145. #0 long 0x45520200
  146. #>0x410 string disk\ image UDIF read/write image (UDRW)
  147. # From: Toby Peterson <toby@apple.com>
  148. 0 string bplist00 Apple binary property list
  149. # Apple binary property list (bplist)
  150. # Assumes version bytes are hex.
  151. # Provides content hints for version 0 files. Assumes that the root
  152. # object is the first object (true for CoreFoundation implementation).
  153. # From: David Remahl <dremahl@apple.com>
  154. 0 string bplist
  155. >6 byte x \bCoreFoundation binary property list data, version 0x%c
  156. >>7 byte x \b%c
  157. >6 string 00 \b
  158. >>8 byte&0xF0 0x00 \b
  159. >>>8 byte&0x0F 0x00 \b, root type: null
  160. >>>8 byte&0x0F 0x08 \b, root type: false boolean
  161. >>>8 byte&0x0F 0x09 \b, root type: true boolean
  162. >>8 byte&0xF0 0x10 \b, root type: integer
  163. >>8 byte&0xF0 0x20 \b, root type: real
  164. >>8 byte&0xF0 0x30 \b, root type: date
  165. >>8 byte&0xF0 0x40 \b, root type: data
  166. >>8 byte&0xF0 0x50 \b, root type: ascii string
  167. >>8 byte&0xF0 0x60 \b, root type: unicode string
  168. >>8 byte&0xF0 0x80 \b, root type: uid (CORRUPT)
  169. >>8 byte&0xF0 0xa0 \b, root type: array
  170. >>8 byte&0xF0 0xd0 \b, root type: dictionary
  171. # Apple/NeXT typedstream data
  172. # Serialization format used by NeXT and Apple for various
  173. # purposes in YellowStep/Cocoa, including some nib files.
  174. # From: David Remahl <dremahl@apple.com>
  175. 2 string typedstream NeXT/Apple typedstream data, big endian
  176. >0 byte x \b, version %hhd
  177. >0 byte <5 \b
  178. >>13 byte 0x81 \b
  179. >>>14 ubeshort x \b, system %hd
  180. 2 string streamtyped NeXT/Apple typedstream data, little endian
  181. >0 byte x \b, version %hhd
  182. >0 byte <5 \b
  183. >>13 byte 0x81 \b
  184. >>>14 uleshort x \b, system %hd
  185. #------------------------------------------------------------------------------
  186. # CAF: Apple CoreAudio File Format
  187. #
  188. # Container format for high-end audio purposes.
  189. # From: David Remahl <dremahl@apple.com>
  190. #
  191. 0 string caff CoreAudio Format audio file
  192. >4 beshort <10 version %d
  193. >6 beshort x
  194. #------------------------------------------------------------------------------
  195. # Keychain database files
  196. 0 string kych Mac OS X Keychain File
  197. #------------------------------------------------------------------------------
  198. # Code Signing related file types
  199. 0 belong 0xfade0c00 Mac OS X Code Requirement
  200. >8 belong 1 (opExpr)
  201. >4 belong x - %d bytes
  202. 0 belong 0xfade0c01 Mac OS X Code Requirement Set
  203. >8 belong >1 containing %d items
  204. >4 belong x - %d bytes
  205. 0 belong 0xfade0c02 Mac OS X Code Directory
  206. >8 belong x version %x
  207. >12 belong >0 flags 0x%x
  208. >4 belong x - %d bytes
  209. 0 belong 0xfade0cc0 Mac OS X Detached Code Signature (non-executable)
  210. >4 belong x - %d bytes
  211. 0 belong 0xfade0cc1 Mac OS X Detached Code Signature
  212. >8 belong >1 (%d elements)
  213. >4 belong x - %d bytes
  214. # From: "Nelson A. de Oliveira" <naoliv@gmail.com>
  215. # .vdi
  216. 4 string innotek\ VirtualBox\ Disk\ Image %s