home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 4 / DATAFILE_PDCD4.iso / unix / riscbsd / 1_1_beta / upgrades / magic_gz / magic
Encoding:
Text File  |  1995-12-08  |  97.9 KB  |  2,914 lines

  1. #! file
  2. # Magic data for file(1) command.
  3. # Machine-genererated from src/cmd/file/magdir/*; edit there only!
  4. # Format is described in magic(files), where:
  5. # files is 4 on V7 and BSD, 4 on SV, and ?? in the SVID.
  6.  
  7. #------------------------------------------------------------------------------
  8. # Localstuff:  file(1) magic for locally observed files
  9. #
  10. # $Id: Localstuff,v 1.2 1995/03/25 22:37:25 christos Exp $
  11. # Add any locally observed files here.  Remember:
  12. # text if readable, executable if runnable binary, data if unreadable.
  13. #------------------------------------------------------------------------------
  14. # mirage:  file(1) magic for NetBSD executables
  15. #
  16. # All new-style magic numbers are in network byte order.
  17. #
  18. 0    lelong            000000413    386BSD demand paged executable
  19. >16    lelong            >0        not stripped
  20. 0    lelong            000000314    BSDI demand paged executable
  21. >16    lelong            >0        not stripped
  22.  
  23. 0    lelong            000000407    NetBSD little-endian object file
  24. >16    lelong            >0        not stripped
  25. 0    belong            000000407    NetBSD big-endian object file
  26. >16    belong            >0        not stripped
  27.  
  28. 0    belong&0377777777    041400413    NetBSD/i386 demand paged
  29. >0    byte            &0x80        
  30. >>20    lelong            <4096        shared library
  31. >>20    lelong            =4096        dynamically linked executable
  32. >>20    lelong            >4096        dynamically linked executable
  33. >0    byte            ^0x80        executable
  34. >16    lelong            >0        not stripped
  35. 0    belong&0377777777    041400410    NetBSD/i386 pure
  36. >0    byte            &0x80        dynamically linked executable
  37. >0    byte            ^0x80        executable
  38. >16    lelong            >0        not stripped
  39. 0    belong&0377777777    041400407    NetBSD/i386
  40. >0    byte            &0x80        dynamically linked executable
  41. >0    byte            ^0x80
  42. >>0    byte            &0x40        position independent
  43. >>20    lelong            !0        executable
  44. >>20    lelong            =0        object file
  45. >16    lelong            >0        not stripped
  46. 0    belong&0377777777    041400507    NetBSD/i386 core
  47. >12    string            >\0        from '%s'
  48.  
  49. 0    belong&0377777777    041600413    NetBSD/m68k demand paged
  50. >0    byte            &0x80        
  51. >>20    belong            <8192        shared library
  52. >>20    belong            =8192        dynamically linked executable
  53. >>20    belong            >8192        dynamically linked executable
  54. >0    byte            ^0x80        executable
  55. >16    belong            >0        not stripped
  56. 0    belong&0377777777    041600410    NetBSD/m68k pure
  57. >0    byte            &0x80        dynamically linked executable
  58. >0    byte            ^0x80        executable
  59. >16    belong            >0        not stripped
  60. 0    belong&0377777777    041600407    NetBSD/m68k
  61. >0    byte            &0x80        dynamically linked executable
  62. >0    byte            ^0x80
  63. >>0    byte            &0x40        position independent
  64. >>20    belong            !0        executable
  65. >>20    belong            =0        object file
  66. >16    belong            >0        not stripped
  67. 0    belong&0377777777    041600507    NetBSD/m68k core
  68. >12    string            >\0        from '%s'
  69.  
  70. 0    belong&0377777777    042000413    NetBSD/m68k4k demand paged
  71. >0    byte            &0x80        
  72. >>20    belong            <4096        shared library
  73. >>20    belong            =4096        dynamically linked executable
  74. >>20    belong            >4096        dynamically linked executable
  75. >0    byte            ^0x80        executable
  76. >16    belong            >0        not stripped
  77. 0    belong&0377777777    042000410    NetBSD/m68k4k pure
  78. >0    byte            &0x80        dynamically linked executable
  79. >0    byte            ^0x80        executable
  80. >16    belong            >0        not stripped
  81. 0    belong&0377777777    042000407    NetBSD/m68k4k
  82. >0    byte            &0x80        dynamically linked executable
  83. >0    byte            ^0x80
  84. >>0    byte            &0x40        position independent
  85. >>20    belong            !0        executable
  86. >>20    belong            =0        object file
  87. >16    belong            >0        not stripped
  88. 0    belong&0377777777    042000507    NetBSD/m68k4k core
  89. >12    string            >\0        from '%s'
  90.  
  91. 0    belong&0377777777    042200413    NetBSD/ns32532 demand paged
  92. >0    byte            &0x80        
  93. >>20    lelong            <4096        shared library
  94. >>20    lelong            =4096        dynamically linked executable
  95. >>20    lelong            >4096        dynamically linked executable
  96. >0    byte            ^0x80        executable
  97. >16    lelong            >0        not stripped
  98. 0    belong&0377777777    042200410    NetBSD/ns32532 pure
  99. >0    byte            &0x80        dynamically linked executable
  100. >0    byte            ^0x80        executable
  101. >16    lelong            >0        not stripped
  102. 0    belong&0377777777    042200407    NetBSD/ns32532
  103. >0    byte            &0x80        dynamically linked executable
  104. >0    byte            ^0x80
  105. >>0    byte            &0x40        position independent
  106. >>20    lelong            !0        executable
  107. >>20    lelong            =0        object file
  108. >16    lelong            >0        not stripped
  109. 0    belong&0377777777    042200507    NetBSD/ns32532 core
  110. >12    string            >\0        from '%s'
  111.  
  112. 0    belong&0377777777    042400413    NetBSD/sparc demand paged
  113. >0    byte            &0x80        
  114. >>20    belong            <8192        shared library
  115. >>20    belong            =8192        dynamically linked executable
  116. >>20    belong            >8192        dynamically linked executable
  117. >0    byte            ^0x80        executable
  118. >16    belong            >0        not stripped
  119. 0    belong&0377777777    042400410    NetBSD/sparc pure
  120. >0    byte            &0x80        dynamically linked executable
  121. >0    byte            ^0x80        executable
  122. >16    belong            >0        not stripped
  123. 0    belong&0377777777    042400407    NetBSD/sparc
  124. >0    byte            &0x80        dynamically linked executable
  125. >0    byte            ^0x80
  126. >>0    byte            &0x40        position independent
  127. >>20    belong            !0        executable
  128. >>20    belong            =0        object file
  129. >16    belong            >0        not stripped
  130. 0    belong&0377777777    042400507    NetBSD/sparc core
  131. >12    string            >\0        from '%s'
  132.  
  133. 0    belong&0377777777    042600413    NetBSD/pmax demand paged
  134. >0    byte            &0x80        
  135. >>20    lelong            <4096        shared library
  136. >>20    lelong            =4096        dynamically linked executable
  137. >>20    lelong            >4096        dynamically linked executable
  138. >0    byte            ^0x80        executable
  139. >16    lelong            >0        not stripped
  140. 0    belong&0377777777    042600410    NetBSD/pmax pure
  141. >0    byte            &0x80        dynamically linked executable
  142. >0    byte            ^0x80        executable
  143. >16    lelong            >0        not stripped
  144. 0    belong&0377777777    042600407    NetBSD/pmax
  145. >0    byte            &0x80        dynamically linked executable
  146. >0    byte            ^0x80
  147. >>0    byte            &0x40        position independent
  148. >>20    lelong            !0        executable
  149. >>20    lelong            =0        object file
  150. >16    lelong            >0        not stripped
  151. 0    belong&0377777777    042600507    NetBSD/pmax core
  152. >12    string            >\0        from '%s'
  153.  
  154. 0    belong&0377777777    043000413    NetBSD/vax demand paged
  155. >0    byte            &0x80        
  156. >>20    lelong            <4096        shared library
  157. >>20    lelong            =4096        dynamically linked executable
  158. >>20    lelong            >4096        dynamically linked executable
  159. >0    byte            ^0x80        executable
  160. >16    lelong            >0        not stripped
  161. 0    belong&0377777777    043000410    NetBSD/vax pure
  162. >0    byte            &0x80        dynamically linked executable
  163. >0    byte            ^0x80        executable
  164. >16    lelong            >0        not stripped
  165. 0    belong&0377777777    043000407    NetBSD/vax
  166. >0    byte            &0x80        dynamically linked executable
  167. >0    byte            ^0x80
  168. >>0    byte            &0x40        position independent
  169. >>20    lelong            !0        executable
  170. >>20    lelong            =0        object file
  171. >16    lelong            >0        not stripped
  172. 0    belong&0377777777    043000507    NetBSD/vax core
  173. >12    string            >\0        from '%s'
  174.  
  175. 0    belong&0377777777    043400413    NetBSD/mips demand paged
  176. >0    byte            &0x80        
  177. >>20    belong            <8192        shared library
  178. >>20    belong            =8192        dynamically linked executable
  179. >>20    belong            >8192        dynamically linked executable
  180. >0    byte            ^0x80        executable
  181. >16    belong            >0        not stripped
  182. 0    belong&0377777777    043400410    NetBSD/mips pure
  183. >0    byte            &0x80        dynamically linked executable
  184. >0    byte            ^0x80        executable
  185. >16    belong            >0        not stripped
  186. 0    belong&0377777777    043400407    NetBSD/mips
  187. >0    byte            &0x80        dynamically linked executable
  188. >0    byte            ^0x80
  189. >>0    byte            &0x40        position independent
  190. >>20    belong            !0        executable
  191. >>20    belong            =0        object file
  192. >16    belong            >0        not stripped
  193. 0    belong&0377777777    043400507    NetBSD/mips core
  194. >12    string            >\0        from '%s'
  195.  
  196. 0    belong            043600413    NetBSD/arm32 demand paged
  197. >0    byte            &0x80
  198. >>20    lelong            <8192        shared library
  199. >>20    lelong            =8192        dynamically linked executable
  200. >>20    lelong            >8192        dynamically linked executable
  201. >0    byte            ^0x80        executable
  202. >>20    lelong            =0x400000    4M text base
  203. >>20    lelong            >0x400000    4M text base
  204. >16    lelong            >0        not stripped
  205. 0    belong            043600410    NetBSD/arm32 pure
  206. >0    byte            &0x80        dynamically linked executable
  207. >0    byte            ^0x80        executable
  208. >16    lelong            >0        not stripped
  209. 0    belong            043600407    NetBSD/arm32
  210. >0    byte            &0x80        dynamically linked executable
  211. >0    byte            ^0x80
  212. >>20    lelong            !0        executable
  213. >>20    lelong            =0        object file
  214. >16    lelong            >0        not stripped
  215. 0    belong            043600507    NetBSD/arm32 core
  216. >12    string            >\0        from '%s'
  217.  
  218. # Old arm MID
  219. 0    belong            031600413    old NetBSD/arm demand paged
  220. >0    byte            &0x80
  221. >>20    lelong            <8192        old shared library
  222. >>20    lelong            =8192        dynamically linked executable
  223. >>20    lelong            >8192        dynamically linked executable
  224. >0    byte            ^0x80        executable
  225. >16    lelong            >0        not stripped
  226. 0    belong            031600410    old NetBSD/arm pure
  227. >0    byte            &0x80        dynamically linked executable
  228. >0    byte            ^0x80        executable
  229. >16    lelong            >0        not stripped
  230. 0    belong            031600407    old NetBSD/arm
  231. >0    byte            &0x80        dynamically linked executable
  232. >0    byte            ^0x80
  233. >>20    lelong            !0        executable
  234. >>20    lelong            =0        object file
  235. >16    lelong            >0        not stripped
  236. 0    belong            031600507    old NetBSD/arm core
  237. >12    string            >\0        from '%s'
  238.  
  239. #------------------------------------------------------------------------------
  240. # alliant:  file(1) magic for Alliant FX series a.out files
  241. #
  242. # If the FX series is the one that had a processor with a 68K-derived
  243. # instruction set, the "short" should probably become "beshort" and the
  244. # "long" should probably become "belong".
  245. # If it's the i860-based one, they should probably become either the
  246. # big-endian or little-endian versions, depending on the mode they ran
  247. # the 860 in....
  248. #
  249. 0    short        0420        0420 Alliant virtual executable
  250. >2    short        &0x0020        common library
  251. >16    long        >0        not stripped
  252. 0    short        0421        0421 Alliant compact executable
  253. >2    short        &0x0020        common library
  254. >16    long        >0        not stripped
  255.  
  256. #------------------------------------------------------------------------------
  257. # animation:  file(1) magic for animation/movie formats
  258. #
  259. # animation formats
  260. # MPEG, FLI, DL originally from vax@ccwf.cc.utexas.edu (VaX#n8)
  261. # FLC, SGI, Apple originally from Daniel Quinlan (quinlan@yggdrasil.com)
  262.  
  263. # MPEG animation format
  264. 0    string        \000\000\001\263    MPEG file
  265.  
  266. # FLI animation format
  267. 4    leshort        0xAF11            FLI file
  268. >6    leshort        x            - %d frames,
  269. >8    leshort        x            width=%d pixels,
  270. >10    leshort        x            height=%d pixels,
  271. >12    leshort        x            depth=%d,
  272. >16    leshort        x            ticks/frame=%d
  273. # newer FLI or FLC format
  274. 4    leshort        0xAF12            newer FLI or FLC file
  275. >6    leshort        x            - %d frames
  276. >8    leshort        x            width=%d pixels,
  277. >10    leshort        x            height=%d pixels,
  278. >12    leshort        x            depth=%d,
  279. >16    leshort        x            ticks/frame=%d
  280.  
  281. # DL animation format
  282. # XXX - collision with most `mips' magic
  283. #
  284. # I couldn't find a real magic number for these, however, this
  285. # -appears- to work.  Note that it might catch other files, too, so be
  286. # careful!
  287. #
  288. # Note that title and author appear in the two 20-byte chunks
  289. # at decimal offsets 2 and 22, respectively, but they are XOR'ed with
  290. # 255 (hex FF)!  The DL format is really bad.
  291. #
  292. #0    byte    1    DL version 1, medium format (160x100, 4 images/screen)
  293. #>42    byte    x    - %d screens,
  294. #>43    byte    x    %d commands
  295. #0    byte    2    DL version 2
  296. #>1    byte    1    - large format (320x200,1 image/screen),
  297. #>1    byte    2    - medium format (160x100,4 images/screen),
  298. #>1    byte    >2    - unknown format,
  299. #>42    byte    x    %d screens,
  300. #>43    byte    x    %d commands
  301. # Based on empirical evidence, DL version 3 have several nulls following the
  302. # \003.  Most of them start with non-null values at hex offset 0x34 or so.
  303. #0    string    \3\0\0\0\0\0\0\0\0\0\0\0    DL version 3
  304.  
  305. # SGI and Apple formats
  306. 0    string        MOVI        Silicon Graphics movie file
  307. 4    string        moov        Apple QuickTime movie file (moov)
  308. 4    string        mdat        Apple QuickTime movie file (mdat)
  309.  
  310. #------------------------------------------------------------------------------
  311. # apl:  file(1) magic for APL (see also "pdp" and "vax" for other APL
  312. #       workspaces)
  313. #
  314. 0    long        0100554        APL workspace (Ken's original?)
  315.  
  316. #------------------------------------------------------------------------------
  317. # apple:  file(1) magic for Apple II file formats
  318. #
  319. 0    string        FiLeStArTfIlEsTaRt    binscii (apple ][) text
  320. 0    string        \x0aGL            Binary II (apple ][) data
  321. 0    string        \x76\xff        Squeezed (apple ][) data
  322. 0    string        SIT!            StuffIt (macintosh) text
  323. 0    string        NuFile            NuFile archive (apple ][) data
  324. 0    string        N\xf5F\xe9l\xe5        NuFile archive (apple ][) data
  325.  
  326. #------------------------------------------------------------------------------
  327. # archive:  file(1) magic for archive formats (see also "msdos" for self-
  328. #           extracting compressed archives)
  329. #
  330. # cpio, ar, arc, arj, hpack, lha/lharc, rar, squish, uc2, zip, zoo, etc.
  331. # pre-POSIX "tar" archives are handled in the C code.
  332.  
  333. # POSIX tar archives
  334. 257    string        ustar\0        POSIX tar archive
  335. 257    string        ustar\040\040\0    GNU tar archive
  336.  
  337. # cpio archives
  338. #
  339. # Yes, the top two "cpio archive" formats *are* supposed to just be "short".
  340. # The idea is to indicate archives produced on machines with the same
  341. # byte order as the machine running "file" with "cpio archive", and
  342. # to indicate archives produced on machines with the opposite byte order
  343. # from the machine running "file" with "byte-swapped cpio archive".
  344. #
  345. # The SVR4 "cpio(4)" hints that there are additional formats, but they
  346. # are defined as "short"s; I think all the new formats are
  347. # character-header formats and thus are strings, not numbers.
  348. 0    short        070707        cpio archive
  349. 0    short        0143561        byte-swapped cpio archive
  350. 0    string        070707        ASCII cpio archive (pre-SVR4 or odc)
  351. 0    string        070701        ASCII cpio archive (SVR4 with no CRC)
  352. 0    string        070702        ASCII cpio archive (SVR4 with CRC)
  353.  
  354. # other archives
  355. 0    long        0177555        very old archive
  356. 0    short        0177555        very old PDP-11 archive
  357. 0    long        0177545        old archive
  358. 0    short        0177545        old PDP-11 archive
  359. 0    long        0100554        apl workspace
  360. 0    string        =<ar>        archive
  361.  
  362. # MIPS archive (needs to go first)
  363. #
  364. 0    string    !<arch>\n__________E    MIPS archive
  365. >20    string    U            with MIPS Ucode members
  366. >21    string    L            with MIPSEL members
  367. >21    string    B            with MIPSEB members
  368. >19    string    L            and an EL hash table
  369. >19    string    B            and an EB hash table
  370. >22    string    X            -- out of date
  371.  
  372. 0    string        !<arch>        archive
  373. >8    string        __.SYMDEF    random library
  374. 0    string        -h-        Software Tools format archive text
  375.  
  376. #
  377. # XXX - why are there multiple <ar> thingies?  Note that 0x213c6172 is
  378. # "!<ar", so, for new-style (4.xBSD/SVR2andup) archives, we have:
  379. #
  380. # 0    string        !<arch>        current ar archive
  381. # 0    long        0x213c6172    archive file
  382. #
  383. # and for SVR3.1 archives, we have:
  384. #
  385. # 0    string        \<ar>        System V Release 1 ar archive
  386. # 0    string        =<ar>        archive
  387. # 0    string        =<ar>        archive
  388. #
  389. # XXX - did Aegis really store shared libraries, breakpointed modules,
  390. # and absolute code program modules in the same format as new-style
  391. # "ar" archives?
  392. #
  393. 0    string        !<arch>        current ar archive
  394. >8    string        __.SYMDEF    random library
  395. >0    belong        =65538        - pre SR9.5
  396. >0    belong        =65539        - post SR9.5
  397. >0    beshort        2        - object archive
  398. >0    beshort        3        - shared library module
  399. >0    beshort        4        - debug break-pointed module
  400. >0    beshort        5        - absolute code program module
  401. 0    string        \<ar>        System V Release 1 ar archive
  402. 0    string        =<ar>        archive
  403. #
  404. # XXX - from "vax", which appears to collect a bunch of byte-swapped
  405. # thingies, to help you recognize VAX files on big-endian machines;
  406. # with "leshort", "lelong", and "string", that's no longer necessary....
  407. #
  408. 0    belong        0x65ff0000    VAX 3.0 archive
  409. 0    belong        0x3c61723e    VAX 5.0 archive
  410. #
  411. 0    long        0x213c6172    archive file
  412. 0    lelong        0177555        very old VAX archive
  413. 0    leshort        0177555        very old PDP-11 archive
  414. #
  415. # XXX - "pdp" claims that 0177545 can have an __.SYMDEF member and thus
  416. # be a random library (it said 0xff65 rather than 0177545).
  417. #
  418. 0    lelong        0177545        old VAX archive
  419. >8    string        __.SYMDEF    random library
  420. 0    leshort        0177545        old PDP-11 archive
  421. >8    string        __.SYMDEF    random library
  422. #
  423. 0    string        =<ar>        archive
  424. #
  425. # From "pdp":
  426. #
  427. 0    lelong        0x39bed        PDP-11 old archive
  428. 0    lelong        0x39bee        PDP-11 4.0 archive
  429. #
  430. 0    string        -h-        Software Tools format archive text
  431.  
  432. # ARC archiver, from Daniel Quinlan (quinlan@yggdrasil.com)
  433. #
  434. # The first byte is the magic (0x1a), byte 2 is the compression type for
  435. # the first file (0x01 through 0x09), and bytes 3 to 15 are the MS-DOS
  436. # filename of the first file (null terminated).  Since some types collide
  437. # we only test some types on basis of frequency: 0x08 (83%), 0x09 (5%),
  438. # 0x02 (5%), 0x03 (3%), 0x04 (2%), 0x06 (2%).  0x01 collides with terminfo.
  439. 0    lelong&0x8080ffff    0x0000081a    ARC archive data, dynamic LZW
  440. 0    lelong&0x8080ffff    0x0000091a    ARC archive data, squashed
  441. 0    lelong&0x8080ffff    0x0000021a    ARC archive data, uncompressed
  442. 0    lelong&0x8080ffff    0x0000031a    ARC archive data, packed
  443. 0    lelong&0x8080ffff    0x0000041a    ARC archive data, squeezed
  444. 0    lelong&0x8080ffff    0x0000061a    ARC archive data, crunched
  445.  
  446. # Acorn archive formats (Disaster prone simpleton, m91dps@ecs.ox.ac.uk)
  447. # I can't create either SPARK or ArcFS archives so I have not tested this stuff
  448. # [GRR:  the original entries collide with ARC, above; replaced with combined
  449. #  version (not tested)]
  450. #0    byte        0x1a        RISC OS archive
  451. #>1    string        archive        (ArcFS format)
  452. 0    string        \032archive    RISC OS archive (ArcFS format)
  453.  
  454. # ARJ archiver (jason@jarthur.Claremont.EDU)
  455. 0    leshort        0xea60        ARJ archive data
  456. >5    byte        x        \b, v%d,
  457. >8    byte        &0x04        multi-volume,
  458. >8    byte        &0x10        slash-switched,
  459. >8    byte        &0x20        backup,
  460. >34    string        x        original name: %s,
  461. >7    byte        0        os: MS-DOS
  462. >7    byte        1        os: PRIMOS
  463. >7    byte        2        os: Unix
  464. >7    byte        3        os: Amiga
  465. >7    byte        4        os: Macintosh
  466. >7    byte        5        os: OS/2
  467. >7    byte        6        os: Apple ][ GS
  468. >7    byte        7        os: Atari ST
  469. >7    byte        8        os: NeXT
  470. >7    byte        9        os: VAX/VMS
  471. >3    byte        >0        %d]
  472.  
  473. # HA archiver (Greg Roelofs, newt@uchicago.edu)
  474. # This is a really bad format. A file containing HAWAII will match this...
  475. #0    string        HA        HA archive data,
  476. #>2    leshort        =1        1 file,
  477. #>2    leshort        >1        %u files,
  478. #>4    byte&0x0f    =0        first is type CPY
  479. #>4    byte&0x0f    =1        first is type ASC
  480. #>4    byte&0x0f    =2        first is type HSC
  481. #>4    byte&0x0f    =0x0e        first is type DIR
  482. #>4    byte&0x0f    =0x0f        first is type SPECIAL
  483.  
  484. # HPACK archiver (Peter Gutmann, pgut1@cs.aukuni.ac.nz)
  485. 0    string        HPAK        HPACK archive data
  486.  
  487. # JAM Archive volume format, by Dmitry.Kohmanyuk@UA.net
  488. 0    string        \351,\001JAM\        JAM archive,
  489. >7    string        >\0            version %.4s
  490. >0x26    byte        =0x27            -
  491. >>0x2b    string          >\0            label %.11s,
  492. >>0x27    lelong        x            serial %08x,
  493. >>0x36    string        >\0            fstype %.8s
  494.  
  495. # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
  496. 2    string        -lh0-        LHarc 1.x archive data [lh0]
  497. 2    string        -lh1-        LHarc 1.x archive data [lh1]
  498. 2    string        -lz4-        LHarc 1.x archive data [lz4]
  499. 2    string        -lz5-        LHarc 1.x archive data [lz5]
  500. #    [never seen any but the last; -lh4- reported in comp.compression:]
  501. 2    string        -lzs-        LHa 2.x? archive data [lzs]
  502. 2    string        -lh -        LHa 2.x? archive data [lh ]
  503. 2    string        -lhd-        LHa 2.x? archive data [lhd]
  504. 2    string        -lh2-        LHa 2.x? archive data [lh2]
  505. 2    string        -lh3-        LHa 2.x? archive data [lh3]
  506. 2    string        -lh4-        LHa (2.x) archive data [lh4]
  507. 2    string        -lh5-        LHa (2.x) archive data [lh5]
  508. >20    byte        x        - header level %d
  509.  
  510. # RAR archiver (Greg Roelofs, newt@uchicago.edu)
  511. 0    string        Rar!        RAR archive data
  512.  
  513. # SQUISH archiver (Greg Roelofs, newt@uchicago.edu)
  514. 0    string        SQSH        squished archive data (Acorn RISCOS)
  515.  
  516. # UC2 archiver (Greg Roelofs, newt@uchicago.edu)
  517. # I can't figure out the self-extracting form of these buggers...
  518. 0    string        UC2\x1a        UC2 archive data
  519.  
  520. # ZIP archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
  521. 0    string        PK\003\004    Zip archive data
  522. >4    byte        0x09        \b, at least v0.9 to extract
  523. >4    byte        0x0a        \b, at least v1.0 to extract
  524. >4    byte        0x0b        \b, at least v1.1 to extract
  525. >4    byte        0x14        \b, at least v2.0 to extract
  526.  
  527. # Zoo archiver
  528. 20    lelong        0xfdc4a7dc    Zoo archive data
  529. >4    byte        >48        \b, v%c.
  530. >>6    byte        >47        \b%c
  531. >>>7    byte        >47        \b%c
  532. >32    byte        >0        \b, modify: v%d
  533. >>33    byte        x        \b.%d+
  534. >42    lelong        0xfdc4a7dc    \b,
  535. >>70    byte        >0        extract: v%d
  536. >>>71    byte        x        \b.%d+
  537.  
  538. # Shell archives
  539. 10    string        #\ This\ is\ a\ shell\ archive    shell archive text
  540.  
  541. #------------------------------------------------------------------------------
  542. # att3b:  file(1) magic for AT&T 3B machines
  543. #
  544. # The `versions' should be un-commented if they work for you.
  545. # (Was the problem just one of endianness?)
  546. #
  547. # 3B20
  548. #
  549. 0    beshort        0550        3b20 COFF executable
  550. >12    belong        >0        not stripped
  551. #>22    beshort        >0        - version %ld
  552. 0    beshort        0551        3b20 COFF executable (TV)
  553. >12    belong        >0        not stripped
  554. #>22    beshort        >0        - version %ld
  555. #
  556. # WE32K
  557. #
  558. 0    beshort        0560        WE32000 COFF
  559. >18    beshort        ^00000020    object
  560. >18    beshort        &00000020    executable
  561. >12    belong        >0        not stripped
  562. >18    beshort        ^00010000    N/A on 3b2/300 w/paging
  563. >18    beshort        &00020000    32100 required
  564. >18    beshort        &00040000    and MAU hardware required
  565. >20    beshort        0407        (impure)
  566. >20    beshort        0410        (pure)
  567. >20    beshort        0413        (demand paged)
  568. >20    beshort        0443        (target shared library)
  569. >22    beshort        >0        - version %ld
  570. 0    beshort        0561        WE32000 COFF executable (TV)
  571. >12    belong        >0        not stripped
  572. #>18    beshort        &00020000    - 32100 required
  573. #>18    beshort        &00040000    and MAU hardware required
  574. #>22    beshort        >0        - version %ld
  575. #
  576. # core file for 3b2 
  577. 0    string        \000\004\036\212\200    3b2 core file
  578. >364    string        >\0        of '%s'
  579.  
  580. #------------------------------------------------------------------------------
  581. # audio:  file(1) magic for sound formats
  582. #
  583. # Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
  584. # and others
  585. #
  586.  
  587. # Sun/NeXT audio data
  588. 0    string        .snd        Sun/NeXT audio data:
  589. >12    belong        1        8-bit ISDN u-law,
  590. >12    belong        2        8-bit linear PCM [REF-PCM],
  591. >12    belong        3        16-bit linear PCM,
  592. >12    belong        4        24-bit linear PCM,
  593. >12    belong        5        32-bit linear PCM,
  594. >12    belong        6        32-bit IEEE floating point,
  595. >12    belong        7        64-bit IEEE floating point,
  596. >12    belong        23        8-bit ISDN u-law compressed (CCITT G.721 ADPCM voice data encoding),
  597. >20    belong        1        mono,
  598. >20    belong        2        stereo,
  599. >20    belong        4        quad,
  600. >16    belong        >0        %d Hz
  601.  
  602. # DEC systems (e.g. DECstation 5000) use a variant of the Sun/NeXT format
  603. # that uses little-endian encoding and has a different magic number
  604. 0    lelong        0x0064732E    DEC audio data:
  605. >12    lelong        1        8-bit ISDN u-law,
  606. >12    lelong        2        8-bit linear PCM [REF-PCM],
  607. >12    lelong        3        16-bit linear PCM,
  608. >12    lelong        4        24-bit linear PCM,
  609. >12    lelong        5        32-bit linear PCM,
  610. >12    lelong        6        32-bit IEEE floating point,
  611. >12    lelong        7        64-bit IEEE floating point,
  612. >12    lelong        23        8-bit ISDN u-law compressed (CCITT G.721 ADPCM voice data encoding),
  613. >20    lelong        1        mono,
  614. >20    lelong        2        stereo,
  615. >20    lelong        4        quad,
  616. >16    lelong        >0        %d Hz
  617.  
  618. # Bytes 0-3 of AIFF, AIFF-C, & 8SVX audio files are "FORM"
  619. 8    string        AIFF        AIFF audio data
  620. 8    string        AIFC        AIFF-C audio data
  621. 8    string        8SVX        IFF/8SVX audio data
  622.  
  623. # Creative Labs AUDIO stuff
  624. 0    string    MThd            Standard MIDI data
  625. >9     byte    >0            (format %d)
  626. >11    byte    >1            using %d channels
  627. 0    string    CTMF            Creative Music (CMF) data
  628. 0    string    SBI            SoundBlaster instrument data
  629. 0    string    Creative\ Voice\ File    Creative Labs voice data
  630. # is this next line right?  it came this way...
  631. >19    byte    0x1A
  632. >23    byte    >0            - version %d
  633. >22    byte    >0            \b.%d
  634.  
  635. # first entry is also the string "NTRK"
  636. 0    belong        0x4e54524b    MultiTrack sound data
  637. >4    belong        x        - version %ld
  638.  
  639. # Microsoft WAVE format (*.wav)
  640. # [GRR 950115:  probably all of the shorts and longs should be leshort/lelong]
  641. 0    string        RIFF        Microsoft RIFF
  642. >8    string        WAVE        - WAVE format
  643. >34    short        >0        %d bit
  644. >22    short        =1        Mono
  645. >22    short        =2        Stereo
  646. >22    short        >2        %d Channels
  647. >24    long        >0        %d Hz
  648.  
  649. # Extended MOD format (*.emd) (Greg Roelofs, newt@uchicago.edu); NOT TESTED
  650. # [based on posting 940824 by "Dirk/Elastik", husberg@lehtori.cc.tut.fi]
  651. 0    string        EMOD        Extended MOD sound data,
  652. >4    byte&0xf0    x        version %d
  653. >4    byte&0x0f    x        \b.%d,
  654. >45    byte        x        %d instruments
  655. >83    byte        0        (module)
  656. >83    byte        1        (song)
  657.  
  658. #------------------------------------------------------------------------------
  659. # blit:  file(1) magic for 68K Blit stuff as seen from 680x0 machine
  660. #
  661. # Note that this 0407 conflicts with several other a.out formats...
  662. #
  663. # XXX - should this be redone with "be" and "le", so that it works on
  664. # little-endian machines as well?  If so, what's the deal with
  665. # "VAX-order" and "VAX-order2"?
  666. #
  667. #0    long        0407        68K Blit (standalone) executable
  668. #0    short        0407        VAX-order2 68K Blit (standalone) executable
  669. 0    short        03401        VAX-order 68K Blit (standalone) executable
  670. 0    long        0406        68k Blit mpx/mux executable
  671. 0    short        0406        VAX-order2 68k Blit mpx/mux executable
  672. 0    short        03001        VAX-order 68k Blit mpx/mux executable
  673. # Need more values for WE32 DMD executables.
  674. # Note that 0520 is the same as COFF
  675. #0    short        0520        tty630 layers executable
  676.  
  677. #------------------------------------------------------------------------------
  678. # c-lang:  file(1) magic for C programs (or REXX)
  679. #
  680.  
  681. # XPM icons (Greg Roelofs, newt@uchicago.edu)
  682. # ideally should go into "images", but entries below would tag XPM as C source
  683. 0    string        /*\ XPM        X pixmap image data
  684.  
  685. # this first will upset you if you're a PL/1 shop...
  686. # in which case rm it; ascmagic will catch real C programs
  687. #0    string        /*        C or REXX program text
  688. 0    string        //        C++ program text
  689.  
  690. #------------------------------------------------------------------------------
  691. # chi:  file(1) magic for ChiWriter files
  692. #
  693. 0       string          \\1cw\          ChiWriter file
  694. >5      string          >\0             version %s
  695. 0       string          \\1cw           ChiWriter file
  696.  
  697. #------------------------------------------------------------------------------
  698. # clipper:  file(1) magic for Intergraph (formerly Fairchild) Clipper.
  699. #
  700. # XXX - what byte order does the Clipper use?
  701. #
  702. # XXX - what's the "!" stuff:
  703. #
  704. # >18    short        !074000,000000    C1 R1 
  705. # >18    short        !074000,004000    C2 R1
  706. # >18    short        !074000,010000    C3 R1
  707. # >18    short        !074000,074000    TEST
  708. #
  709. # I shall assume it's ANDing the field with the first value and
  710. # comparing it with the second, and rewrite it as:
  711. #
  712. # >18    short&074000    000000        C1 R1 
  713. # >18    short&074000    004000        C2 R1
  714. # >18    short&074000    010000        C3 R1
  715. # >18    short&074000    074000        TEST
  716. #
  717. # as SVR3.1's "file" doesn't support anything of the "!074000,000000"
  718. # sort, nor does SunOS 4.x, so either it's something Intergraph added
  719. # in CLIX, or something AT&T added in SVR3.2 or later, or something
  720. # somebody else thought was a good idea; it's not documented in the
  721. # man page for this version of "magic", nor does it appear to be
  722. # implemented (at least not after I blew off the bogus code to turn
  723. # old-style "&"s into new-style "&"s, which just didn't work at all).
  724. #
  725. 0    short        0575        CLIPPER COFF executable (VAX #)
  726. >20    short        0407        (impure)
  727. >20    short        0410        (5.2 compatible)
  728. >20    short        0411        (pure)
  729. >20    short        0413        (demand paged)
  730. >20    short        0443        (target shared library)
  731. >12    long        >0        not stripped
  732. >22    short        >0        - version %ld
  733. 0    short        0577        CLIPPER COFF executable
  734. >18    short&074000    000000        C1 R1 
  735. >18    short&074000    004000        C2 R1
  736. >18    short&074000    010000        C3 R1
  737. >18    short&074000    074000        TEST
  738. >20    short        0407        (impure)
  739. >20    short        0410        (pure)
  740. >20    short        0411        (separate I&D)
  741. >20    short        0413        (paged)
  742. >20    short        0443        (target shared library)
  743. >12    long        >0        not stripped
  744. >22    short        >0        - version %ld
  745. >48    long&01        01        alignment trap enabled
  746. >52    byte        1        -Ctnc
  747. >52    byte        2        -Ctsw
  748. >52    byte        3        -Ctpw
  749. >52    byte        4        -Ctcb
  750. >53    byte        1        -Cdnc
  751. >53    byte        2        -Cdsw
  752. >53    byte        3        -Cdpw
  753. >53    byte        4        -Cdcb
  754. >54    byte        1        -Csnc
  755. >54    byte        2        -Cssw
  756. >54    byte        3        -Cspw
  757. >54    byte        4        -Cscb
  758. 4    string        pipe        CLIPPER instruction trace
  759. 4    string        prof        CLIPPER instruction profile
  760.  
  761. #------------------------------------------------------------------------------
  762. # commands:  file(1) magic for various shells and interpreters
  763. #
  764. 0    string        :\ shell archive or commands for antique kernel text
  765. 0    string        #!/bin/sh        Bourne Shell script text
  766. 0    string        #!\ /bin/sh        Bourne Shell script text
  767. 0    string        #!/bin/csh        C Shell script text
  768. 0    string        #!\ /bin/csh        C Shell script text
  769. # korn shell magic, sent by George Wu, gwu@clyde.att.com
  770. 0    string        #!/bin/ksh        Korn Shell script text
  771. 0    string        #!\ /bin/ksh        Korn Shell script text
  772. 0    string         #!/bin/tcsh        Tenex C Shell script text
  773. 0    string         #!\ /bin/tcsh        Tenex C Shell script text
  774. 0    string        #!/usr/local/tcsh    Tenex C Shell script text
  775. 0    string         #!\ /usr/local/tcsh    Tenex C Shell script text
  776. 0    string        #!/usr/local/bin/tcsh    Tenex C Shell script text
  777. 0    string        #!\ /usr/local/bin/tcsh    Tenex C Shell script text
  778. #
  779. # zsh/ash/ae/nawk/gawk magic from cameron@cs.unsw.oz.au (Cameron Simpson)
  780. 0    string        #!/usr/local/bin/zsh    - Paul Falstad's zsh
  781. 0    string        #!\ /usr/local/bin/zsh    - Paul Falstad's zsh
  782. 0    string        #!/usr/local/bin/ash    - NeilBrown's ash
  783. 0    string        #!\ /usr/local/bin/ash    - NeilBrown's ash
  784. 0    string        #!/usr/local/bin/ae    - NeilBrown's ae
  785. 0    string        #!\ /usr/local/bin/ae    - NeilBrown's ae
  786. 0    string        #!/bin/nawk        - New Awk script text
  787. 0    string        #!\ /bin/nawk        - New Awk script text
  788. 0    string        #!/usr/bin/nawk        - New Awk script text
  789. 0    string        #!\ /usr/bin/nawk    - New Awk script text
  790. 0    string        #!/usr/local/bin/nawk    - New Awk script text
  791. 0    string        #!\ /usr/local/bin/nawk    - New Awk script text
  792. 0    string        #!/bin/gawk        - GNU awk script text
  793. 0    string        #!\ /bin/gawk        - GNU awk script text
  794. 0    string        #!/usr/bin/gawk        - GNU awk script text
  795. 0    string        #!\ /usr/bin/gawk    - GNU awk script text
  796. 0    string        #!/usr/local/bin/gawk    - GNU awk script text
  797. 0    string        #!\ /usr/local/bin/gawk    - GNU awk script text
  798. #
  799. 0    string        #!/bin/awk        Awk Commands text
  800. 0    string        #!\ /bin/awk        Awk Commands text
  801. 0    string        #!/usr/bin/awk        Awk Commands text
  802. 0    string        #!\ /usr/bin/awk    Awk Commands text
  803.  
  804. # For Larry Wall's perl language.  The ``eval'' line recognizes an
  805. # outrageously clever hack for USG systems.
  806. #                Keith Waclena <keith@cerberus.uchicago.edu>
  807. 0    string        #!/bin/perl            perl commands text
  808. 0    string        #!\ /bin/perl            perl commands text
  809. 0    string        eval\ "exec\ /bin/perl        perl commands text
  810. 0    string        #!/usr/bin/perl            perl commands text
  811. 0    string        #!\ /usr/bin/perl        perl commands text
  812. 0    string        eval\ "exec\ /usr/bin/perl    perl commands text
  813. 0    string        #!/usr/local/bin/perl        perl commands text
  814. 0    string        #!\ /usr/local/bin/perl        perl commands text
  815. 0    string        eval\ "exec\ /usr/local/bin/perl    perl commands text
  816.  
  817. # AT&T Bell Labs' Plan 9 shell
  818. 0    string        #!/bin/rc    Plan 9 rc Shell script text
  819. 0    string        #!\ /bin/rc    Plan 9 rc Shell script text
  820.  
  821. # bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de)
  822. 0    string        #!/bin/bash    Bourne-Again Shell script text
  823. 0    string        #!\ /bin/bash    Bourne-Again Shell script text
  824. 0    string        #!/usr/local/bin/bash    Bourne-Again Shell script text
  825. 0    string        #!\ /usr/local/bin/bash    Bourne-Again Shell script text
  826.  
  827. # generic shell magic
  828. 0    string        #!\ /            a
  829. >3    string        >\0            %s script text
  830. 0    string        #!/            a
  831. >2    string        >\0            %s script text
  832. 0    string        #!\             commands text
  833. >3    string        >\0            for %s
  834.  
  835. #------------------------------------------------------------------------------
  836. # compress:  file(1) magic for pure-compression formats (no archives)
  837. #
  838. # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, whap, etc.
  839. #
  840. # Formats for various forms of compressed data
  841. # Formats for "compress" proper have been moved into "compress.c",
  842. # because it tries to uncompress it to figure out what's inside.
  843.  
  844. # standard unix compress
  845. 0    string        \037\235    compress'd data
  846. >2    byte&0x80    >0        block compressed
  847. >2    byte&0x1f    x        %d bits
  848.  
  849. # gzip (GNU zip, not to be confused with [Info-ZIP/PKWARE] zip archiver)
  850. 0       string          \037\213        gzip compressed data
  851. >2      byte            <8              - reserved method,
  852. >2      byte            8               - deflate method,
  853. >3    byte        &0x01        ascii,
  854. >3    byte        &0x02        continuation,
  855. >3    byte        &0x04        extra field,
  856. >3    byte        &0x08        original file name,
  857. >3    byte        &0x10        comment,
  858. >3    byte        &0x20        encrypted,
  859. >4    ledate        x        last modified: %s,
  860. >8    byte        2        max compression,
  861. >8    byte        4        max speed,
  862. >9    byte        =0x00        os: MS-DOS
  863. >9    byte        =0x01        os: Amiga
  864. >9    byte        =0x02        os: VMS
  865. >9    byte        =0x03        os: Unix
  866. >9    byte        =0x05        os: Atari
  867. >9    byte        =0x06        os: OS/2
  868. >9    byte        =0x07        os: MacOS
  869. >9    byte        =0x0A        os: Tops/20
  870. >9    byte        =0x0B        os: Win/32
  871.  
  872. # According to gzip.h, this is the correct byte order for packed data.
  873. #
  874. 0    string        \037\036    packed data
  875. >2    belong        >1        %d characters originally
  876. >2    belong        =1        %d character originally
  877. #
  878. # This magic number is byte-order-independent.
  879. # Are there two types of old packed data?  One big endian, one little endian?
  880. #
  881. #0    beshort        017437        old packed data, big endian
  882. #0    leshort        017437        old packed data, little endian
  883. 0    short        017437        old packed data
  884.  
  885. # XXX - why *two* entries for "compacted data", one of which is
  886. # byte-order independent, and one of which is byte-order dependent?
  887. #
  888. 0    short        0x1fff        compacted data
  889. 0    string        \377\037    compacted data
  890. 0    short        0145405        huf output
  891.  
  892. # Squeeze and Crunch...
  893. # These numbers were gleaned from the Unix versions of the programs to
  894. # handle these formats.  Note that I can only uncrunch, not crunch, and
  895. # I didn't have a crunched file handy, so the crunch number is untested.
  896. #                Keith Waclena <keith@cerberus.uchicago.edu>
  897. 0    leshort        0x76FF        squeezed data (CP/M, DOS)
  898. 0    leshort        0x76FE        crunched data (CP/M, DOS)
  899.  
  900. # Freeze
  901. 0    string        \037\237    Frozen file 2.1
  902. 0    string        \037\236    Frozen file 1.0 (or gzip 0.5)
  903.  
  904. # lzh?
  905. 0    string        \037\240    LZH compressed data
  906.  
  907. # European GSM 06.10 is a provisional standard for full-rate speech
  908. # transcoding, prI-ETS 300 036, which uses RPE/LTP (residual pulse
  909. # excitation/long term prediction) coding at 13 kbit/s.
  910. #
  911. # WEAK - There's only a magic nibble (4 bits); but that nibble repeats
  912. # every 33 bytes.  This magic is NOT suited for use, but maybe we can
  913. # use it someday.
  914. #
  915. # This will cause very short GSM files to be declared as data and
  916. # mismatches to be declared as data too!
  917. #0    byte&0xF0    0xd0    data
  918. #>33    byte&0xF0    0xd0
  919. #>66    byte&0xF0    0xd0
  920. #>99    byte&0xF0    0xd0
  921. #>132    byte&0xF0    0xd0    GSM 06.10 compressed audio
  922.  
  923. #------------------------------------------------------------------------------
  924. # convex:  file(1) magic for Convex boxes
  925. #
  926. # Convexes are big-endian.
  927. #
  928. 0    long        0513        Convex executable
  929.  
  930. #------------------------------------------------------------------------------
  931. # database:  file(1) magic for various databases
  932. #
  933. # extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
  934. #
  935. 0    long        0x13579ace    GNU gdbm or ndbm database
  936. #
  937. 0    belong    0x061561    Berkeley DB Hash file
  938. >4    belong    >0        (Version %d,
  939. >8    belong    1234        Little Endian,
  940. >8    belong    4321        Big Endian,
  941. >12    belong    x        Bucket Size %d,
  942. >16    belong    x        Directory Size %d,
  943. >20    belong    x        Segment Size %d,
  944. >24    belong    x        Segment Shift %d,
  945. >28    belong    x        Overflow Point %d,
  946. >32    belong    x        Last Freed %d,
  947. >36    belong    x        Max Bucket %d,
  948. >40    belong    x        High Mask 0x%x,
  949. >44    belong    x        Low Mask 0x%x,
  950. >48    belong    x        Fill Factor %d,
  951. >52    belong    x        Number of Keys %d)
  952. #
  953. 0    belong    0x053162    Berkeley DB Btree file
  954. >4    belong    >0        (Version %d,
  955. >8    belong    x        Page Size %d,
  956. >12    belong    x        Free Page %d,
  957. >16    belong    x        Number of Records %d,
  958. >20    belong    x        Flags 0x%x)
  959.  
  960. #------------------------------------------------------------------------------
  961. # diamond:  file(1) magic for Diamond system
  962. #
  963. # ... diamond is a multi-media mail and electronic conferencing system....
  964. #
  965. # XXX - I think it was either renamed Slate, or replaced by Slate....
  966. #
  967. #    The full deal is too long...
  968. #0    string    <list>\n<protocol\ bbn-multimedia-format>    Diamond Multimedia Document
  969. 0    string    =<list>\n<protocol\ bbn-m    Diamond Multimedia Document
  970.  
  971. #------------------------------------------------------------------------------
  972. # diff:  file(1) magic for diff(1) output
  973. #
  974. 0    string        diff\     'diff' output text
  975. 0    string        ***\         'diff' output text
  976. 0    string        Only\ in\     'diff' output text
  977. 0    string        Common\ subdirectories:\     'diff' output text
  978.  
  979. #------------------------------------------------------------------------------
  980. # dump:  file(1) magic for dump file format--for new and old dump filesystems
  981. #
  982. # We specify both byte orders in order to recognize byte-swapped dumps.
  983. #
  984. 24    belong    60012        new-fs dump file (big endian),
  985. >4    bedate    x        Previous dump %s,
  986. >8    bedate    x        This dump %s,
  987. >12    belong    >0        Volume %ld,
  988. >692    belong    0        Level zero, type:
  989. >692    belong    >0        Level %d, type:
  990. >0    belong    1        tape header,
  991. >0    belong    2        beginning of file record,
  992. >0    belong    3        map of inodes on tape,
  993. >0    belong    4        continuation of file record,
  994. >0    belong    5        end of volume,
  995. >0    belong    6        map of inodes deleted,
  996. >0    belong    7        end of medium (for floppy),
  997. >676    string    >\0        Label %s,
  998. >696    string    >\0        Filesystem %s,
  999. >760    string    >\0        Device %s,
  1000. >824    string    >\0        Host %s,
  1001. >888    belong    >0        Flags %x
  1002.  
  1003. 24    belong    60011        old-fs dump file (big endian),
  1004. #>4    bedate    x        Previous dump %s,
  1005. #>8    bedate    x        This dump %s,
  1006. >12    belong    >0        Volume %ld,
  1007. >692    belong    0        Level zero, type:
  1008. >692    belong    >0        Level %d, type:
  1009. >0    belong    1        tape header,
  1010. >0    belong    2        beginning of file record,
  1011. >0    belong    3        map of inodes on tape,
  1012. >0    belong    4        continuation of file record,
  1013. >0    belong    5        end of volume,
  1014. >0    belong    6        map of inodes deleted,
  1015. >0    belong    7        end of medium (for floppy),
  1016. >676    string    >\0        Label %s,
  1017. >696    string    >\0        Filesystem %s,
  1018. >760    string    >\0        Device %s,
  1019. >824    string    >\0        Host %s,
  1020. >888    belong    >0        Flags %x
  1021.  
  1022. 24    lelong    60012        new-fs dump file (little endian),
  1023. >4    ledate    x        Previous dump %s,
  1024. >8    ledate    x        This dump %s,
  1025. >12    lelong    >0        Volume %ld,
  1026. >692    lelong    0        Level zero, type:
  1027. >692    lelong    >0        Level %d, type:
  1028. >0    lelong    1        tape header,
  1029. >0    lelong    2        beginning of file record,
  1030. >0    lelong    3        map of inodes on tape,
  1031. >0    lelong    4        continuation of file record,
  1032. >0    lelong    5        end of volume,
  1033. >0    lelong    6        map of inodes deleted,
  1034. >0    lelong    7        end of medium (for floppy),
  1035. >676    string    >\0        Label %s,
  1036. >696    string    >\0        Filesystem %s,
  1037. >760    string    >\0        Device %s,
  1038. >824    string    >\0        Host %s,
  1039. >888    lelong    >0        Flags %x
  1040.  
  1041. 24    lelong    60011        old-fs dump file (little endian),
  1042. #>4    ledate    x        Previous dump %s,
  1043. #>8    ledate    x        This dump %s,
  1044. >12    lelong    >0        Volume %ld,
  1045. >692    lelong    0        Level zero, type:
  1046. >692    lelong    >0        Level %d, type:
  1047. >0    lelong    1        tape header,
  1048. >0    lelong    2        beginning of file record,
  1049. >0    lelong    3        map of inodes on tape,
  1050. >0    lelong    4        continuation of file record,
  1051. >0    lelong    5        end of volume,
  1052. >0    lelong    6        map of inodes deleted,
  1053. >0    lelong    7        end of medium (for floppy),
  1054. >676    string    >\0        Label %s,
  1055. >696    string    >\0        Filesystem %s,
  1056. >760    string    >\0        Device %s,
  1057. >824    string    >\0        Host %s,
  1058. >888    lelong    >0        Flags %x
  1059.  
  1060. #------------------------------------------------------------------------------
  1061. # elf:  file(1) magic for ELF executables
  1062. #
  1063. # We have to check the byte order flag to see what byte order all the
  1064. # other stuff in the header is in.
  1065. #
  1066. # updated by Daniel Quinlan (quinlan@yggdrasil.com)
  1067. 0    string        \177ELF        ELF
  1068. >4    byte        0        invalid class
  1069. >4    byte        1        32-bit
  1070. >4    byte        2        64-bit
  1071. >5    byte        0        invalid byte order
  1072. >5    byte        1        LSB
  1073. >>16    leshort        0        no file type,
  1074. >>16    leshort        1        relocatable,
  1075. >>16    leshort        2        executable,
  1076. >>16    leshort        3        shared object,
  1077. >>16    leshort        4        core file,
  1078. >>16    leshort        &0xff00        processor-specific,
  1079. >>18    leshort        0        no machine,
  1080. >>18    leshort        1        AT&T WE32100,
  1081. >>18    leshort        2        SPARC - invalid byte order,
  1082. >>18    leshort        3        Intel 80386,
  1083. >>18    leshort        4        Motorola 68000 - invalid byte order,
  1084. >>18    leshort        5        Motorola 88000 - invalid byte order,
  1085. >>18    leshort        6        Intel 80486,
  1086. >>18    leshort        7        Intel 80860,
  1087. >>18    leshort        8        MIPS RS3000,
  1088. >>20    lelong        0        invalid version
  1089. >>20    lelong        1        version 1
  1090. >>36    lelong        1        MathCoPro/FPU/MAU Required
  1091. >5    byte        2        MSB
  1092. >>16    beshort        0        no file type,
  1093. >>16    beshort        1        relocatable,
  1094. >>16    beshort        2        executable,
  1095. >>16    beshort        3        shared object,
  1096. >>16    beshort        4        core file,
  1097. >>16    beshort        &0xff00        processor-specific,
  1098. >>18    beshort        0        no machine,
  1099. >>18    beshort        1        AT&T WE32100,
  1100. >>18    beshort        2        SPARC,
  1101. >>18    beshort        3        Intel 80386 - invalid byte order,
  1102. >>18    beshort        4        Motorola 68000,
  1103. >>18    beshort        5        Motorola 88000,
  1104. >>18    beshort        6        Intel 80486 - invalid byte order,
  1105. >>18    beshort        7        Intel 80860,
  1106. >>18    beshort        8        MIPS RS3000,
  1107. >>20    belong        0        invalid version
  1108. >>20    belong        1        version 1
  1109. >>36    belong        1        MathCoPro/FPU/MAU Required
  1110.  
  1111. #------------------------------------------------------------------------------
  1112. # encore:  file(1) magic for Encore machines
  1113. #
  1114. # XXX - needs to have the byte order specified (NS32K was little-endian,
  1115. # dunno whether they run the 88K in little-endian mode or not).
  1116. #
  1117. 0    short        0x154        Encore
  1118. >20    short        0x107        executable
  1119. >20    short        0x108        pure executable
  1120. >20    short        0x10b        demand-paged executable
  1121. >20    short        0x10f        unsupported executable
  1122. >12    long        >0        not stripped
  1123. >22    short        >0        - version %ld
  1124. >22    short        0        -
  1125. #>4    date        x        stamp %s
  1126. 0    short        0x155        Encore unsupported executable
  1127. >12    long        >0        not stripped
  1128. >22    short        >0        - version %ld
  1129. >22    short        0        -
  1130. #>4    date        x        stamp %s
  1131.  
  1132. #------------------------------------------------------------------------------
  1133. # filesystems:  file(1) magic for different filesystems
  1134. #
  1135. 0x438    leshort    0xEF53            Linux/i386 ext2 filesystem
  1136. 0    string    \366\366\366\366    PC formatted floppy with no filesystem
  1137.  
  1138. #------------------------------------------------------------------------------
  1139. # fonts:  file(1) magic for font data
  1140. #
  1141. 0    string        FONT        ASCII vfont text
  1142. 0    short        0436        Berkeley vfont data
  1143. 0    short        017001        byte-swapped Berkeley vfont data
  1144.  
  1145. # PostScript fonts (must precede "printer" entries), quinlan@yggdrasil.com
  1146. 0    string        %!PS-AdobeFont-1.0    PostScript Type 1 font text
  1147. >20    string        >\0        (%s)
  1148. 6    string        %!PS-AdobeFont-1.0    PostScript Type 1 font program data
  1149.  
  1150. # X11 font files in SNF (Server Natural Format) format
  1151. 0    belong        00000004        X11 big-endian SNF font
  1152. 0    lelong        00000004        X11 little-endian SNF font
  1153.  
  1154. # X11 fonts, from Daniel Quinlan (quinlan@yggdrasil.com)
  1155. # PCF must come before SGI additions ("MIPSEL MIPS-II COFF" collides)
  1156. # (0x7063601 is "PCF" + \001 as a lelong)
  1157. 0    lelong        0x70636601        X11 Portable Compiled Font data
  1158. 0    string        D1.0\015        X11 Speedo font data
  1159.  
  1160. #------------------------------------------------------------------------------
  1161. # frame:  file(1) magic for FrameMaker files
  1162. #
  1163. # This stuff came on a FrameMaker demo tape, most of which is
  1164. # copyright, but this file is "published" as witness the following:
  1165. #
  1166. 0    string        \<MakerFile    FrameMaker document
  1167. >11    string        4.0         (4.0
  1168. >11    string        3.0         (3.0
  1169. >11    string        2.0         (2.0
  1170. >11    string        1.0         (1.0
  1171. >14    byte        x          %c)
  1172. 0    string        \<MIFFile    FrameMaker MIF (ASCII) file
  1173. >9    string        4.0         (4.0)
  1174. >9    string        3.0         (3.0)
  1175. >9    string        2.0         (2.0)
  1176. >9    string        1.0         (1.x)
  1177. 0    string        \<MakerDictionary    FrameMaker Dictionary text
  1178. >17    string        3.0         (3.0)
  1179. >17    string        2.0         (2.0)
  1180. >17    string        1.0         (1.x)
  1181. 0    string        \<MakerScreenFon    FrameMaker Font file
  1182. >17    string        1.01         (%s)
  1183. 0    string        \<MML        FrameMaker MML file
  1184. 0    string        \<Book        FrameMaker Book file
  1185. >10    string        3.0         (3.0
  1186. >10    string        2.0         (2.0
  1187. >10    string        1.0         (1.0
  1188. >13    byte        x          %c)
  1189. 0    string        \<Maker Intermediate Print File    FrameMaker IPL file
  1190.  
  1191. #------------------------------------------------------------------------------
  1192. # hp:  file(1) magic for Hewlett Packard machines (see also "printer")
  1193. #
  1194. # XXX - somebody should figure out whether any byte order needs to be
  1195. # applied to the "TML" stuff; I'm assuming the Apollo stuff is
  1196. # big-endian as it was mostly 68K-based.
  1197. #
  1198. # HP-PA is big-endian, so it (and "800", which is *also* HP-PA-based; I
  1199. # assume "HPPA-RISC1.1" really means "HP-PA Version 1.1", which first
  1200. # showed up in the 700 series, although later 800 series machines are,
  1201. # I think, based on the PA7100 which implements HP-PA 1.1) are flagged
  1202. # as big-endian.
  1203. #
  1204. # I think the 500 series was the old stack-based machines, running a
  1205. # UNIX environment atop the "SUN kernel"; dunno whether it was
  1206. # big-endian or little-endian.
  1207. #
  1208. # Daniel Quinlan (quinlan@yggdrasil.com): hp200 machines are 68010 based;
  1209. # hp300 are 68020+68881 based; hp400 are also 68k.  The following basic
  1210. # HP magic is useful for reference, but using "long" magic is a better
  1211. # practice in order to avoid collisions.
  1212. #
  1213. # 0    beshort        200        hp200 (68010) BSD binary
  1214. # 0    beshort        300        hp300 (68020+68881) BSD binary
  1215. # 0    beshort        0x20c        hp200/300 HP-UX binary
  1216. # 0    beshort        0x20b        hp800 HP-UX binary
  1217.  
  1218. #
  1219. # The "misc" stuff needs a byte order; the archives look suspiciously
  1220. # like the old 177545 archives (0xff65 = 0177545).
  1221. #
  1222. #### Old Apollo stuff
  1223. 0    beshort        0627        Apollo m68k COFF executable
  1224. >18    beshort        ^040000        not stripped
  1225. >22    beshort        >0        - version %ld
  1226. 0    beshort        0624        apollo a88k COFF executable
  1227. >18    beshort        ^040000        not stripped
  1228. >22    beshort        >0        - version %ld
  1229. 0       long            01203604016     TML 0123 byte-order format
  1230. 0       long            01702407010     TML 1032 byte-order format
  1231. 0       long            01003405017     TML 2301 byte-order format
  1232. 0       long            01602007412     TML 3210 byte-order format
  1233. #### HPPA
  1234. 0    belong         0x02100106    HPPA-RISC1.1 relocatable object
  1235. 0    belong         0x02100107    HPPA-RISC1.1 executable
  1236. >(144)    belong        0x054ef630    dynamically linked
  1237. >96    belong        >0        -not stripped
  1238.  
  1239. 0    belong         0x02100108    HPPA-RISC1.1 shared executable
  1240. >(144)    belong        0x054ef630    dynamically linked
  1241. >96    belong        >0        -not stripped
  1242.  
  1243. 0    belong         0x0210010b    HPPA-RISC1.1 demand-load executable
  1244. >(144)    belong        0x054ef630    dynamically linked
  1245. >96    belong        >0        -not stripped
  1246.  
  1247. 0    belong         0x0210010e    HPPA-RISC1.1 shared library
  1248. >96    belong        >0        -not stripped
  1249.  
  1250. 0    belong         0x0210010d    HPPA-RISC1.1 dynamic load library
  1251. >96    belong        >0        -not stripped
  1252.  
  1253. #### 800
  1254. 0    belong         0x020b0106    HP s800 relocatable object
  1255.  
  1256. 0    belong         0x020b0107    HP s800 executable
  1257. >(144)    belong        0x054ef630    dynamically linked
  1258. >96    belong        >0        -not stripped
  1259.  
  1260. 0    belong         0x020b0108    HP s800 shared executable
  1261. >(144)    belong        0x054ef630    dynamically linked
  1262. >96    belong        >0        -not stripped
  1263.  
  1264. 0    belong         0x020b010b    HP s800 demand-load executable
  1265. >(144)    belong        0x054ef630    dynamically linked
  1266. >96    belong        >0        -not stripped
  1267.  
  1268. 0    belong         0x020b010e    HP s800 shared library
  1269. >96    belong        >0        -not stripped
  1270.  
  1271. 0    belong         0x020b010d    HP s800 dynamic load library
  1272. >96    belong        >0        -not stripped
  1273.  
  1274. 0    belong        0x213c6172    archive file
  1275. >68    belong         0x020b0619    -HP s800 relocatable library
  1276.  
  1277. #### 500
  1278. 0    long        0x02080106    HP s500 relocatable executable
  1279. >16    long        >0        -version %ld
  1280.  
  1281. 0    long        0x02080107    HP s500 executable
  1282. >16    long        >0        -version %ld
  1283.  
  1284. 0    long        0x02080108    HP s500 pure executable
  1285. >16    long        >0        -version %ld
  1286.  
  1287. #### 200
  1288. 0    belong         0x020c0108    HP s200 pure executable
  1289. >4    beshort        >0        -version %ld
  1290. >8    belong        &0x80000000    save fp regs
  1291. >8    belong        &0x40000000    dynamically linked
  1292. >8    belong        &0x20000000    debuggable
  1293. >36    belong        >0        not stripped
  1294.  
  1295. 0    belong        0x020c0107    HP s200 executable
  1296. >4    beshort        >0        -version %ld
  1297. >8    belong        &0x80000000    save fp regs
  1298. >8    belong        &0x40000000    dynamically linked
  1299. >8    belong        &0x20000000    debuggable
  1300. >36    belong        >0        not stripped
  1301.  
  1302. 0    belong        0x020c010b    HP s200 demand-load executable
  1303. >4    beshort        >0        -version %ld
  1304. >8    belong        &0x80000000    save fp regs
  1305. >8    belong        &0x40000000    dynamically linked
  1306. >8    belong        &0x20000000    debuggable
  1307. >36    belong        >0        not stripped
  1308.  
  1309. 0    belong        0x020c0106    HP s200 relocatable executable
  1310. >4    beshort        >0        -version %ld
  1311. >6    beshort        >0        -highwater %d
  1312. >8    belong        &0x80000000    save fp regs
  1313. >8    belong        &0x20000000    debuggable
  1314. >8    belong        &0x10000000    PIC
  1315.  
  1316. 0    belong         0x020a0108    HP s200 (2.x release) pure executable
  1317. >4    beshort        >0        -version %ld
  1318. >36    belong        >0        not stripped
  1319.  
  1320. 0    belong        0x020a0107    HP s200 (2.x release) executable
  1321. >4    beshort        >0        -version %ld
  1322. >36    belong        >0        not stripped
  1323.  
  1324. 0    belong        0x020c010e    HP s200 shared library
  1325. >4    beshort        >0        -version %ld
  1326. >6    beshort        >0        -highwater %d
  1327. >36    belong        >0        not stripped
  1328.  
  1329. 0    belong        0x020c010d    HP s200 dynamic load library
  1330. >4    beshort        >0        -version %ld
  1331. >6    beshort        >0        -highwater %d
  1332. >36    belong        >0        not stripped
  1333.  
  1334. #### MISC
  1335. 0    long        0x0000ff65    HP old archive
  1336. 0    long        0x020aff65    HP s200 old archive
  1337. 0    long        0x020cff65    HP s200 old archive
  1338. 0    long        0x0208ff65    HP s500 old archive
  1339.  
  1340. 0    long        0x015821a6    HP core file
  1341.  
  1342. 0    long        0x4da7eee8    HP-WINDOWS font
  1343. >8    byte        >0        -version %ld
  1344. 0    string        Bitmapfile    HP Bitmapfile
  1345.  
  1346. 0    string        IMGfile    CIS     compimg HP Bitmapfile
  1347. # XXX - see "lif"
  1348. 0    short        0x8000        lif file
  1349. 0    long        0x020c010c    compiled Lisp
  1350.  
  1351. 0    string        msgcat01    HP NLS message catalog,
  1352. >8    long        >0        %d messages
  1353.  
  1354. # addendum to /etc/magic with HP-48sx file-types by phk@data.fls.dk 1jan92
  1355. 0    string        HPHP48-        HP48 binary
  1356. >7    byte        >0        - Rev %c
  1357. >8    short        0x1129        (ADR)
  1358. >8    short        0x3329        (REAL)
  1359. >8    short        0x5529        (LREAL)
  1360. >8    short        0x7729        (COMPLX)
  1361. >8    short        0x9d29        (LCOMPLX)
  1362. >8    short        0xbf29        (CHAR)
  1363. >8    short        0xe829        (ARRAY)
  1364. >8    short        0x0a2a        (LNKARRAY)
  1365. >8    short        0x2c2a        (STRING)
  1366. >8    short        0x4e2a        (HXS)
  1367. >8    short        0x742a        (LIST)
  1368. >8    short        0x962a        (DIR)
  1369. >8    short        0xb82a        (ALG)
  1370. >8    short        0xda2a        (UNIT)
  1371. >8    short        0xfc2a        (TAGGED)
  1372. >8    short        0x1e2b        (GROB)
  1373. >8    short        0x402b        (LIB)
  1374. >8    short        0x622b        (BACKUP)
  1375. >8    short        0x882b        (LIBDATA)
  1376. >8    short        0x9d2d        (PROG)
  1377. >8    short        0xcc2d        (CODE)
  1378. >8    short        0x482e        (GNAME)
  1379. >8    short        0x6d2e        (LNAME)
  1380. >8    short        0x922e        (XLIB)
  1381. 0    string        %%HP:        HP48 text
  1382. >6    string        T(0)        - T(0)
  1383. >6    string        T(1)        - T(1)
  1384. >6    string        T(2)        - T(2)
  1385. >6    string        T(3)        - T(3)
  1386. >10    string        A(D)        A(D)
  1387. >10    string        A(R)        A(R)
  1388. >10    string        A(G)        A(G)
  1389. >14    string        F(.)        F(.);
  1390. >14    string        F(,)        F(,);
  1391.  
  1392. # hpBSD magic numbers
  1393. 0    beshort        200        hp200 (68010) BSD
  1394. >2    beshort        0407        impure binary
  1395. >2    beshort        0410        read-only binary
  1396. >2    beshort        0413        demand paged binary
  1397. 0    beshort        300        hp300 (68020+68881) BSD
  1398. >2    beshort        0407        impure binary
  1399. >2    beshort        0410        read-only binary
  1400. >2    beshort        0413        demand paged binary
  1401.  
  1402.  
  1403. #------------------------------------------------------------------------------
  1404. # html:  file(1) magic for HTML (HyperText Markup Language) docs
  1405. #
  1406. # from Daniel Quinlan <quinlan@yggdrasil.com>
  1407. #
  1408. 0    string        \<HEAD        HTML document text (old type)
  1409. 0    string        \<head        HTML document text (old type)
  1410. 0    string        \<TITLE        HTML document text (old type)
  1411. 0    string        \<title        HTML document text (old type)
  1412. 0       string          \<html          HTML document text
  1413. 0       string          \<HTML          HTML document text
  1414. 0    string        \<!        HTML document text
  1415. 0    string        \<h1        Untitled HTML document text
  1416. 0    string        \<H1        Untitled HTML document text
  1417.  
  1418. #------------------------------------------------------------------------------
  1419. # ibm370:  file(1) magic for IBM 370 and compatibles.
  1420. #
  1421. # "ibm370" said that 0x15d == 0535 was "ibm 370 pure executable".
  1422. # What the heck *is* "USS/370"?
  1423. #
  1424. 0       beshort        0531        SVR2 executable (Amdahl-UTS)
  1425. >12    belong        >0        not stripped
  1426. >24     belong        >0        - version %ld
  1427. 0    beshort        0534        SVR2 pure executable (Amdahl-UTS)
  1428. >12    belong        >0        not stripped
  1429. >24    belong        >0        - version %ld
  1430. 0    beshort        0530        SVR2 pure executable (USS/370)
  1431. >12    belong        >0        not stripped
  1432. >24    belong        >0        - version %ld
  1433. 0    beshort        0535        SVR2 executable (USS/370)
  1434. >12    belong        >0        not stripped
  1435. >24    belong        >0        - version %ld
  1436.  
  1437.  
  1438. #------------------------------------------------------------------------------
  1439. # ibm6000:  file(1) magic for RS/6000 and the RT PC.
  1440. #
  1441. 0    beshort        0x01df        executable (RISC System/6000 V3.1) or obj module
  1442. >12    belong        >0        not stripped
  1443. # Breaks sun4 statically linked execs.
  1444. #0      beshort        0x0103        executable (RT Version 2) or obj module
  1445. #>2    byte        0x50        pure
  1446. #>28    belong        >0        not stripped
  1447. #>6    beshort        >0        - version %ld
  1448. 0    beshort        0x0104        shared library
  1449. 0    beshort        0x0105        ctab data
  1450. 0    beshort        0xfe04        structured file
  1451. 0    string        0xabcdef    message catalog
  1452. #0    string        <aiaff>        archive
  1453.  
  1454. #------------------------------------------------------------------------------
  1455. # images:  file(1) magic for image formats (see also "c-lang" for XPM bitmaps)
  1456. #
  1457. # originally from jef@helios.ee.lbl.gov (Jef Poskanzer),
  1458. # additions by janl@ifi.uio.no as well as others. Jan also suggested
  1459. # merging several one- and two-line files into here.
  1460. #
  1461. # XXX - byte order for GIF and TIFF fields?
  1462. # [GRR:  TIFF allows both byte orders; GIF is little-endian]
  1463. #
  1464.  
  1465. # [GRR:  what the hell is this doing in here?]
  1466. 0    string        xbtoa        btoa'd file
  1467.  
  1468. # PBMPLUS
  1469. 0    string        P1        PBM file
  1470. 0    string        P2        PGM file
  1471. 0    string        P3        PPM file
  1472. 0    string        P4        PBM "rawbits" file
  1473. 0    string        P5        PGM "rawbits" file
  1474. 0    string        P6        PPM "rawbits" file
  1475.  
  1476. # NIFF (Navy Interchange File Format, a modification of TIFF) images
  1477. # this *must* go before TIFF
  1478. 0    string        IIN1        NIFF raster data
  1479.  
  1480. # TIFF images
  1481. 0    string        MM        TIFF file, big-endian
  1482. >2    beshort        >0        - version %d
  1483. 0    string        II        TIFF file, little-endian
  1484. >2    leshort        >0        - version %d
  1485.  
  1486. # PNG [Portable Network Graphics, or "PNG's Not GIF"] images
  1487. # (Greg Roelofs, newt@uchicago.edu)
  1488. #
  1489. # 137 P N G \r \n ^Z \n [4-byte length] H E A D [HEAD data] [HEAD crc] ...
  1490. #
  1491. 0    string        \x89PNG        PNG image,
  1492. >4    belong        !0x0d0a1a0a    CORRUPTED,
  1493. >16    belong        x        %ld x
  1494. >20    belong        x        %ld,
  1495. >24    byte        x        %d-bit
  1496. >25    byte        0        grayscale,
  1497. >25    byte        2        \b/color RGB,
  1498. >25    byte        3        colormap,
  1499. >25    byte        4        gray+alpha,
  1500. >25    byte        6        \b/color RGBA,
  1501. #>26    byte        0        deflate/32K,
  1502. >28    byte        0        non-interlaced
  1503. >28    byte        1        interlaced
  1504.  
  1505. # GIF
  1506. 0    string        GIF        GIF image
  1507. >3    string        87a        - version %s,
  1508. >3    string        89a        - version %s,
  1509. >6    leshort        >0        %hd x
  1510. >8    leshort        >0        %hd,
  1511. #>10    byte        &0x80        color mapped,
  1512. # GRR 950330:  the following is not accurate for most GIFs:
  1513. #>10    byte        &0x40        interlaced,
  1514. >10    byte&0x07    =0x00        2 colors
  1515. >10    byte&0x07    =0x01        4 colors
  1516. >10    byte&0x07    =0x02        8 colors
  1517. >10    byte&0x07    =0x03        16 colors
  1518. >10    byte&0x07    =0x04        32 colors
  1519. >10    byte&0x07    =0x05        64 colors
  1520. >10    byte&0x07    =0x06        128 colors
  1521. >10    byte&0x07    =0x07        256 colors
  1522.  
  1523. # Miscellany
  1524. 0    long        1123028772    Artisan image file
  1525. >4    long        1    rectangular 24-bit image
  1526. >4    long        2    rectangular 8-bit image with colormap
  1527. >4    long        3    rectangular 32-bit image (24-bit with matte)
  1528. 0    string        \361\0\100\273    CMU window manager bitmap
  1529. 0    string        #FIG        FIG graphics savefile text
  1530. >6    string        2.1        Version 2.1
  1531. >6    string        2.0        Version 2.0
  1532. 0    string        GKSM        GKS Metafile
  1533. 8    string        ILBM        IFF ILBM file
  1534. 0    string        ARF_BEGARF    PHIGS clear text archive
  1535.  
  1536. # More miscellany from Daniel Quinlan (quinlan@yggdrasil.com)
  1537. 0    string    This\ is\ a\ BitMap\ file    Lisp Machine bit-array-file
  1538. 0    string        !!            Bennet Yee's "face" format
  1539. 0    string        @(#)SunPHIGS        SunPHIGS
  1540. # version number follows, in the form m.n
  1541. >40    string        SunBin            binary
  1542. >32    string        archive            archive
  1543. 0    string        BEGMF        clear text Computer Graphics Metafile
  1544. # these should be beshort, but not sure
  1545. 0    beshort&0xffe0    0x0020        binary Computer Graphics Metafile
  1546. 0    beshort        0x3020        character Computer Graphics Metafile
  1547.  
  1548.  
  1549. # From: <u31b3hs@pool.informatik.rwth-aachen.de> (Michael Haardt)
  1550. 0    string          yz      MGR bitmap, modern format, 8 bit aligned
  1551. 0    string          zz      MGR bitmap, old format, 1 bit deep, 16 bit aligned
  1552. 0    string          xz      MGR bitmap, old format, 1 bit deep, 32 bit aligned
  1553. 0    string          yx      MGR bitmap, modern format, squeezed
  1554.  
  1555. 0    string        %bitmap        FBM pixmap
  1556. >30    long        0x31        (mono)
  1557. >30    long        0x33        (color)
  1558.  
  1559. 4    string        Research,    Digifax-G3-File
  1560. >29    byte        1        , fine resolution
  1561. >29    byte        0        , normal resolution
  1562.  
  1563. # JPEG images
  1564. 0    beshort        0xffd8        JPEG image
  1565. >6    string        JFIF        - JFIF standard
  1566. # from cameron@cs.unsw.oz.au (Cameron Simpson):
  1567. 0    string        hsi1        JPEG image - HSI encoded (proprietary)
  1568.  
  1569. # PC bitmaps (OS/2, Windoze BMP files)  (Greg Roelofs, newt@uchicago.edu)
  1570. 0    string        BM        bitmap
  1571. >14    byte        12        (OS/2 1.x format)
  1572. >14    byte        64        (OS/2 2.x format)
  1573. >14    byte        40        (Windows 3.x format)
  1574. 0    string        IC        icon
  1575. 0    string        PI        pointer
  1576. 0    string        CI        color icon
  1577. 0    string        CP        color pointer
  1578. 0    string        BA        bitmap array
  1579.  
  1580. # Utah Raster Toolkit RLE images (two versions)
  1581. #
  1582. # From <janl@ifi.uio.no>
  1583. # I made this with the help of the man page for rle(5). Ihey missing
  1584. # from the magic numbers I have:
  1585. 0    beshort        0xcc52        Utah Raster Toolkit RLE
  1586. >2    beshort        >0        lower left corner: %d
  1587. >4    beshort        >0        lower right corner: %d
  1588. >6    beshort        >0        %d x
  1589. >8    beshort        >0        %d
  1590. >10    byte&0x1    =0x1        CLEARFIRST
  1591. >10    byte&0x2    =0x2        NO_BACKGROUND
  1592. >10    byte&0x4    =0x4        ALPHA
  1593. >10    byte&0x8    =0x8        COMMENT
  1594. >11    byte        >0        %d colour channels
  1595. >12    byte        >0        %d bits per pixel
  1596. >13    byte        >0        %d colour map channels
  1597. #
  1598. # RLE images (Disaster prone simpleton, m91dps@ecs.ox.ac.uk)
  1599. # Here's a magic file entry for rle images. 24-bit images tend to produce
  1600. # foo.rle size 42x42, 3 comps each 8 bits
  1601. # (for arbitary, prossibly different values of 42).
  1602. # freely redistribuable under the GPL
  1603. # [GRR:  which endianness?  big?]
  1604. 0    short        0xcc55        RLE image data
  1605. >6    short        >0        %d x
  1606. >8    short        >0        %d,
  1607. >2    short        >0        x offset by %d,
  1608. >4    short        >0        y offset by %d,
  1609. >11    byte        =0        colour map
  1610. >11    byte        >1        %d comps each
  1611. >12    byte        =1        1 bit
  1612. >12    byte        >1        %d bits
  1613.  
  1614. # FBM images, culled from xli source (d. p. simpleton, m91dps@ecs.ox.ac.uk)
  1615. 0       string          %bitmap         fbm image data
  1616.  
  1617. # image file format (Robert Potter, potter@cs.rochester.edu)
  1618. 0    string        Imagefile\ version-    iff image data
  1619. # this adds the whole header (inc. version number), informative but longish
  1620. >10    string        >\0        %s
  1621.  
  1622. # Sun rasterfiles, from Daniel Quinlan (quinlan@yggdrasil.com)
  1623. #
  1624. # XXX - Does the Sun 386i use the same byte order?
  1625. #
  1626. 0    belong        0x59a66a95    Sun raster image
  1627. >4    belong        >0        %d x
  1628. >8    belong        >0        %d,
  1629. >12    belong        >0        %d-bit,
  1630. # this is almost the same as the file length (what about compressed?)
  1631. #>16    belong        >0        %d bytes long,
  1632. >20    belong        0        old format,
  1633. # no need to complain if it is standard
  1634. #>20    belong        1        standard,
  1635. >20    belong        2        compressed,
  1636. >20    belong        3        RGB,
  1637. >20    belong        4        TIFF,
  1638. >20    belong        5        IFF,
  1639. >20    belong        0xffff        reserved for testing,
  1640. >24    belong        0        no colormap
  1641. >24    belong        1        RGB colormap
  1642. >24    belong        2        raw colormap
  1643. # this doesn't impart much useful information (or does it?)
  1644. #>28    belong        >0        colormap is %d bytes long
  1645.  
  1646. # Daniel Quinlan (quinlan@yggdrasil.com) -- from an SGI machine
  1647. # There may be a byte swapped version of SGI imagelib images, but
  1648. # I haven't seen any evidence of programs that support it.
  1649. 0    beshort        000732        SGI imagelib image
  1650. >6    beshort        x        \b, %d x
  1651. >8    beshort        x        %d
  1652. #
  1653. 0    string        IT01        FIT image file
  1654. >4    belong        x        \b, %d x
  1655. >8    belong        x        %d x
  1656. >12    belong        x        %d
  1657. #
  1658. 0    string        IT02        FIT image file
  1659. >4    belong        x        \b, %d x
  1660. >8    belong        x        %d x
  1661. >12    belong        x        %d
  1662. #
  1663. 2048    string        PCD_IPI        Kodak Photo CD image pack file
  1664. 0    string        PCD_OPA        Kodak Photo CD overview pack file
  1665.  
  1666. # Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>
  1667. # FITS is the Flexible Image Transport System, the de facto standard for
  1668. # data and image transfer, storage, etc., for the astronomical community.
  1669. # FITS format.
  1670. 0    string    SIMPLE\ \ =    FITS
  1671. >107    string    -32        32 bits per pixel, IEEE big endian float
  1672. >107    string    \ 32        32 bits per pixel, unsigned integer
  1673. >108    string    16        16 bits per pixel, unsigned integer
  1674. >109    string    8        8 bits per pixel, unsigned integer
  1675.  
  1676. #------------------------------------------------------------------------------
  1677. # intel:  file(1) magic for x86 Unix
  1678. #
  1679. # Various flavors of x86 UNIX executable/object (other than Xenix, which
  1680. # is in "microsoft").  DOS is in "ms-dos"; the ambitious soul can do
  1681. # Windows as well.
  1682. #
  1683. # Windows NT belongs elsewhere, as you need x86 and MIPS and Alpha and
  1684. # whatever comes next (HP-PA Hummingbird?).  OS/2 may also go elsewhere
  1685. # as well, if, as, and when IBM makes it portable.
  1686. #
  1687. # The `versions' should be un-commented if they work for you.
  1688. # (Was the problem just one of endianness?)
  1689. #
  1690. 0    leshort        0502        basic-16 executable
  1691. >12    lelong        >0        not stripped
  1692. #>22    leshort        >0        - version %ld
  1693. 0    leshort        0503        basic-16 executable (TV)
  1694. >12    lelong        >0        not stripped
  1695. #>22    leshort        >0        - version %ld
  1696. 0    leshort        0510        x86 executable
  1697. >12    lelong        >0        not stripped
  1698. 0    leshort        0511        x86 executable (TV)
  1699. >12    lelong        >0        not stripped
  1700. 0    leshort        =0512        iAPX 286 executable small model (COFF)
  1701. >12    lelong        >0        not stripped
  1702. #>22    leshort        >0        - version %ld
  1703. 0    leshort        =0522        iAPX 286 executable large model (COFF)
  1704. >12    lelong        >0        not stripped
  1705. #>22    leshort        >0        - version %ld
  1706. # SGI labeled the next entry as "iAPX 386 executable" --Dan Quinlan
  1707. 0    leshort        =0514        80386 COFF executable
  1708. >12    lelong        >0        not stripped
  1709. >22    leshort        >0        - version %ld
  1710.  
  1711. #------------------------------------------------------------------------------
  1712. # interleaf:  file(1) magic for InterLeaf TPS:
  1713. #
  1714. 0    string        =\210OPS    Interleaf saved data
  1715. 0    string        =<!OPS        Interleaf document text
  1716. >5    string        ,\ Version\     (version
  1717. >>14    string        >\0        %s)
  1718.  
  1719. #------------------------------------------------------------------------------
  1720. # ispell:  file(1) magic for ispell
  1721. #
  1722. # Ispell 3.0 has a magic of 0x9601 and ispell 3.1 has 0x9602.  This magic
  1723. # will match 0x9600 through 0x9603 in *both* little endian and big endian.
  1724. # (No other current magic entries collide.)
  1725. #
  1726. # Updated by Daniel Quinlan (quinlan@yggdrasil.com)
  1727. #
  1728. 0    leshort&0xFFFC    0x9600        little endian ispell
  1729. >0    byte        0        hash file (?),
  1730. >0    byte        1        3.0 hash file,
  1731. >0    byte        2        3.1 hash file,
  1732. >0    byte        3        hash file (?),
  1733. >2    leshort        0x00        8-bit, no capitalization, 26 flags
  1734. >2    leshort        0x01        7-bit, no capitalization, 26 flags
  1735. >2    leshort        0x02        8-bit, capitalization, 26 flags
  1736. >2    leshort        0x03        7-bit, capitalization, 26 flags
  1737. >2    leshort        0x04        8-bit, no capitalization, 52 flags
  1738. >2    leshort        0x05        7-bit, no capitalization, 52 flags
  1739. >2    leshort        0x06        8-bit, capitalization, 52 flags
  1740. >2    leshort        0x07        7-bit, capitalization, 52 flags
  1741. >2    leshort        0x08        8-bit, no capitalization, 128 flags
  1742. >2    leshort        0x09        7-bit, no capitalization, 128 flags
  1743. >2    leshort        0x0A        8-bit, capitalization, 128 flags
  1744. >2    leshort        0x0B        7-bit, capitalization, 128 flags
  1745. >2    leshort        0x0C        8-bit, no capitalization, 256 flags
  1746. >2    leshort        0x0D        7-bit, no capitalization, 256 flags
  1747. >2    leshort        0x0E        8-bit, capitalization, 256 flags
  1748. >2    leshort        0x0F        7-bit, capitalization, 256 flags
  1749. >4    leshort        >0        and %d string characters
  1750. 0    beshort&0xFFFC    0x9600        big endian ispell
  1751. >1    byte        0        hash file (?),
  1752. >1    byte        1        3.0 hash file,
  1753. >1    byte        2        3.1 hash file,
  1754. >1    byte        3        hash file (?),
  1755. >2    beshort        0x00        8-bit, no capitalization, 26 flags
  1756. >2    beshort        0x01        7-bit, no capitalization, 26 flags
  1757. >2    beshort        0x02        8-bit, capitalization, 26 flags
  1758. >2    beshort        0x03        7-bit, capitalization, 26 flags
  1759. >2    beshort        0x04        8-bit, no capitalization, 52 flags
  1760. >2    beshort        0x05        7-bit, no capitalization, 52 flags
  1761. >2    beshort        0x06        8-bit, capitalization, 52 flags
  1762. >2    beshort        0x07        7-bit, capitalization, 52 flags
  1763. >2    beshort        0x08        8-bit, no capitalization, 128 flags
  1764. >2    beshort        0x09        7-bit, no capitalization, 128 flags
  1765. >2    beshort        0x0A        8-bit, capitalization, 128 flags
  1766. >2    beshort        0x0B        7-bit, capitalization, 128 flags
  1767. >2    beshort        0x0C        8-bit, no capitalization, 256 flags
  1768. >2    beshort        0x0D        7-bit, no capitalization, 256 flags
  1769. >2    beshort        0x0E        8-bit, capitalization, 256 flags
  1770. >2    beshort        0x0F        7-bit, capitalization, 256 flags
  1771. >4    beshort        >0        and %d string characters
  1772.  
  1773. #------------------------------------------------------------------------------
  1774. # karma:  file(1) magic for Karma data files
  1775. #
  1776. # From <rgooch@atnf.csiro.au>
  1777.  
  1778. 0    string        KarmaRHD Version    Karma Data Structure Version
  1779. >16    long        x        %lu
  1780.  
  1781.  
  1782. #------------------------------------------------------------------------------
  1783. # lex:  file(1) magic for lex
  1784. #
  1785. #    derived empirically, your offsets may vary!
  1786. 53    string        yyprevious    c program text (from lex)
  1787. >3    string        >\0         for %s
  1788. # C program text from GNU flex, from Daniel Quinlan <quinlan@yggdrasil.com>
  1789. 21    string        generated\ by\ flex    C program text (from flex)
  1790. # lex description file, from Daniel Quinlan <quinlan@yggdrasil.com>
  1791. 0    string        %{        lex description text
  1792.  
  1793. #------------------------------------------------------------------------------
  1794. # lif:  file(1) magic for lif
  1795. #
  1796. # XXX - byte order?  (Probably beshort, Daniel Quinlan <quinlan@yggdrasil.com>)
  1797. #
  1798. 0    short        0x8000        lif file
  1799.  
  1800. #------------------------------------------------------------------------------
  1801. # linux:  file(1) magic for Linux files
  1802. #
  1803. # Values for Linux/i386 binaries, from Daniel Quinlan <quinlan@yggdrasil.com>
  1804. # The following basic Linux magic is useful for reference, but using
  1805. # "long" magic is a better practice in order to avoid collisions.
  1806. #
  1807. # 2    leshort        100        Linux/i386
  1808. # >0    leshort        0407        impure executable (OMAGIC)
  1809. # >0    leshort        0410        pure executable (NMAGIC)
  1810. # >0    leshort        0413        demand-paged executable (ZMAGIC)
  1811. # >0    leshort        0314        demand-paged executable (QMAGIC)
  1812. #
  1813. 0    lelong        0x00640107    Linux/i386 impure executable (OMAGIC)
  1814. >16    lelong        0        - stripped
  1815. 0    lelong        0x00640108    Linux/i386 pure executable (NMAGIC)
  1816. >16    lelong        0        - stripped
  1817. 0    lelong        0x0064010b    Linux/i386 demand-paged executable (ZMAGIC)
  1818. >16    lelong        0        - stripped
  1819. 0    lelong        0x006400cc    Linux/i386 demand-paged executable (QMAGIC)
  1820. >16    lelong        0        - stripped
  1821. #
  1822. 0    string        \007\001\000    Linux/i386 object file
  1823. >20    lelong        >0x1020        - DLL library
  1824. # message catalogs, from Mitchum DSouza <m.dsouza@mrc-apu.cam.ac.uk>
  1825. 0    string        *nazgul*    compiled message catalog
  1826. >8    lelong        >0        - version %ld
  1827. # core dump file, from Bill Reynolds <bill@goshawk.lanl.gov>
  1828. 216    lelong        0421        Linux/i386 core file
  1829. >220    string        >\0        of '%s'
  1830. >200    lelong        >0        (signal %d)
  1831. #
  1832. # LILO boot/chain loaders, from Daniel Quinlan <quinlan@yggdrasil.com>
  1833. # this can be overridden by the DOS executable (COM) entry
  1834. 2    string        LILO        Linux/i386 LILO boot/chain loader
  1835. #
  1836. # Debian Packages, from Peter Tobias <tobias@server.et-inf.fho-emden.de>
  1837. 0    string        0.9
  1838. >8    byte        0x0a        Debian Binary Package -
  1839. >>3    byte        >0        created by dpkg 0.9%c
  1840. >>4    byte        >0        pl%c
  1841. # PSF fonts, from H. Peter Anvin <hpa@yggdrasil.com>
  1842. 0    leshort        0x0436        Linux/i386 PC Screen Font data
  1843. >2    byte        0        - 256 characters, no directory,
  1844. >2    byte        1        - 512 characters, no directory,
  1845. >2    byte        2        - 256 characters, Unicode directory,
  1846. >2    byte        3        - 512 characters, Unicode directory,
  1847. >3    byte        >0        8x%d
  1848. # Linux swap file, from Daniel Quinlan <quinlan@yggdrasil.com>
  1849. 4086    string        SWAP-SPACE    Linux/i386 swap file
  1850.  
  1851. #------------------------------------------------------------------------------
  1852. # lisp:  file(1) magic for lisp programs
  1853. #
  1854. # various lisp types, from Daniel Quinlan (quinlan@yggdrasil.com)
  1855. 0    string    ;;            Lisp/Scheme program text
  1856. # Emacs 18 - this is always correct, but not very magical.
  1857. 0    string    \012(            byte-compiled Emacs-Lisp program data
  1858. # Emacs 19
  1859. 0    string    ;ELC\023\000\000\000    byte-compiled Emacs-Lisp program data
  1860.  
  1861. #------------------------------------------------------------------------------
  1862. # magic:  file(1) magic for magic files
  1863. #
  1864. 0    string        #\ Magic    magic text file for file(1) cmd
  1865.  
  1866. #------------------------------------------------------------------------------
  1867. # mail.news:  file(1) magic for mail and news
  1868. #
  1869. # Unfortunately, saved netnews also has From line added in some news software.
  1870. #0    string        From         mail text
  1871. # There are tests to ascmagic.c to cope with mail and news.
  1872. 0    string        Relay-Version:     old news text
  1873. 0    string        #!\ rnews    batched news text
  1874. 0    string        N#!\ rnews    mailed, batched news text
  1875. 0    string        Forward\ to     mail forwarding text
  1876. 0    string        Pipe\ to     mail piping text
  1877. 0    string        Return-Path:    smtp mail text
  1878. 0    string        Path:        news text
  1879. 0    string        Xref:        news text
  1880. 0    string        From:        news or mail text
  1881. 0    string        Article     saved news text
  1882.  
  1883. #------------------------------------------------------------------------------
  1884. # microsoft:  file(1) magic for Microsoft Xenix
  1885. #
  1886. # "Middle model" stuff, and "Xenix 8086 relocatable or 80286 small
  1887. # model" lifted from "magic.xenix", with comment "derived empirically;
  1888. # treat as folklore until proven"
  1889. #
  1890. # "small model", "large model", "huge model" stuff lifted from XXX
  1891. #
  1892. # XXX - "x.out" collides with PDP-11 archives
  1893. #
  1894. 0    string        core        core file (Xenix)
  1895. 0    byte        0x80        8086 relocatable (Microsoft)
  1896. 0    leshort        0xff65        x.out
  1897. >2    string        __.SYMDEF     randomized
  1898. >0    byte        x        archive
  1899. 0    leshort        0x206        Microsoft a.out
  1900. >8    leshort        1        Middle model
  1901. >0x1e    leshort        &0x10        overlay
  1902. >0x1e    leshort        &0x2        separate
  1903. >0x1e    leshort        &0x4        pure
  1904. >0x1e    leshort        &0x800        segmented
  1905. >0x1e    leshort        &0x400        standalone
  1906. >0x1e    leshort        &0x8        fixed-stack
  1907. >0x1c    byte        &0x80        byte-swapped
  1908. >0x1c    byte        &0x40        word-swapped
  1909. >0x10    lelong        >0        not-stripped
  1910. >0x1e    leshort        ^0xc000        pre-SysV
  1911. >0x1e    leshort        &0x4000        V2.3
  1912. >0x1e    leshort        &0x8000        V3.0
  1913. >0x1c    byte        &0x4        86
  1914. >0x1c    byte        &0xb        186
  1915. >0x1c    byte        &0x9        286
  1916. >0x1c    byte        &0xa        386
  1917. >0x1f    byte        <0x040        small model
  1918. >0x1f    byte        =0x048        large model    
  1919. >0x1f    byte        =0x049        huge model 
  1920. >0x1e    leshort        &0x1        executable
  1921. >0x1e    leshort        ^0x1        object file
  1922. >0x1e    leshort        &0x40        Large Text
  1923. >0x1e    leshort        &0x20        Large Data
  1924. >0x1e    leshort        &0x120        Huge Objects Enabled
  1925. >0x10    lelong        >0        not stripped
  1926.  
  1927. 0    leshort        0x140        old Microsoft 8086 x.out
  1928. >0x3    byte        &0x4        separate
  1929. >0x3    byte        &0x2        pure
  1930. >0    byte        &0x1        executable
  1931. >0    byte        ^0x1        relocatable
  1932. >0x14    lelong        >0        not stripped
  1933.  
  1934. 0    lelong        0x206        b.out
  1935. >0x1e    leshort        &0x10        overlay
  1936. >0x1e    leshort        &0x2        separate
  1937. >0x1e    leshort        &0x4        pure
  1938. >0x1e    leshort        &0x800        segmented
  1939. >0x1e    leshort        &0x400        standalone
  1940. >0x1e    leshort        &0x1        executable
  1941. >0x1e    leshort        ^0x1        object file
  1942. >0x1e    leshort        &0x4000        V2.3
  1943. >0x1e    leshort        &0x8000        V3.0
  1944. >0x1c    byte        &0x4        86
  1945. >0x1c    byte        &0xb        186
  1946. >0x1c    byte        &0x9        286
  1947. >0x1c    byte        &0x29        286
  1948. >0x1c    byte        &0xa        386
  1949. >0x1e    leshort        &0x4        Large Text
  1950. >0x1e    leshort        &0x2        Large Data
  1951. >0x1e    leshort        &0x102        Huge Objects Enabled
  1952.  
  1953. 0    leshort        0x580        XENIX 8086 relocatable or 80286 small model
  1954.  
  1955. #------------------------------------------------------------------------------
  1956. # mirage:  file(1) magic for Mirage executables
  1957. #
  1958. # XXX - byte order?
  1959. #
  1960. 0    long    31415        Mirage Assembler m.out executable
  1961.  
  1962. #------------------------------------------------------------------------------
  1963. # mkid:  file(1) magic for mkid(1) databases
  1964. #
  1965. # ID is the binary tags database produced by mkid(1).
  1966. #
  1967. # XXX - byte order?
  1968. #
  1969. 0    string        \311\304    ID tags data
  1970. >2    short        >0        version %d
  1971.  
  1972. #------------------------------------------------------------------------------
  1973. # mmdf:  file(1) magic for MMDF mail files
  1974. #
  1975. 0    string    \001\001\001\001    MMDF mailbox
  1976.  
  1977. #------------------------------------------------------------------------------
  1978. # motorola:  file(1) magic for Motorola 68K and 88K binaries
  1979. #
  1980. # 68K
  1981. #
  1982. 0    beshort        0520        mc68k COFF
  1983. >18    beshort        ^00000020    object
  1984. >18    beshort        &00000020    executable
  1985. >12    belong        >0        not stripped
  1986. >168    string        .lowmem        Apple toolbox
  1987. >20    beshort        0407        (impure)
  1988. >20    beshort        0410        (pure)
  1989. >20    beshort        0413        (demand paged)
  1990. >20    beshort        0421        (standalone)
  1991. 0    beshort        0521        mc68k executable (shared)
  1992. >12    belong        >0        not stripped
  1993. 0    beshort        0522        mc68k executable (shared demand paged)
  1994. >12    belong        >0        not stripped
  1995. #
  1996. # Motorola/UniSoft 68K Binary Compatibility Standard (BCS)
  1997. #
  1998. 0    beshort        0554        68K BCS executable
  1999. #
  2000. # 88K
  2001. #
  2002. # Motorola/88Open BCS
  2003. #
  2004. 0    beshort        0555        88K BCS executable
  2005.  
  2006. #------------------------------------------------------------------------------
  2007. # msdos:  file(1) magic for MS-DOS files
  2008. #
  2009.  
  2010. # .EXE formats (Greg Roelofs, newt@uchicago.edu)
  2011. #
  2012. 0    string    MZ        MS-DOS executable (EXE)
  2013. >24    string    @        \b, OS/2 or Windows
  2014. >1638    string    -lh5-        \b, LHa SFX archive v2.13S
  2015. >7195    string    Rar!        \b, RAR self-extracting archive
  2016. #
  2017. # [GRR 950118:  file 3.15 has a buffer-size limitation; offsets bigger than
  2018. #   8161 bytes are ignored.  To make the following entries work, increase
  2019. #   HOWMANY in file.h to 32K at least, and maybe to 70K or more for OS/2,
  2020. #   NT/Win32 and VMS.]
  2021. # [GRR:  some company sells a self-extractor/displayer for image data(!)]
  2022. #
  2023. >11696    string    PK\003\004    \b, PKZIP SFX archive v1.1
  2024. >13297    string    PK\003\004    \b, PKZIP SFX archive v1.93a
  2025. >15588    string    PK\003\004    \b, PKZIP2 SFX archive v1.09
  2026. >15770    string    PK\003\004    \b, PKZIP SFX archive v2.04g
  2027. >28374    string    PK\003\004    \b, PKZIP2 SFX archive v1.02
  2028. #
  2029. # Info-ZIP self-extractors
  2030. #    these are the DOS versions:
  2031. >25115    string    PK\003\004    \b, Info-ZIP SFX archive v5.12
  2032. >26331    string    PK\003\004    \b, Info-ZIP SFX archive v5.12 w/decryption
  2033. #    these are the OS/2 versions (OS/2 is flagged above):
  2034. >47031    string    PK\003\004    \b, Info-ZIP SFX archive v5.12
  2035. >49845    string    PK\003\004    \b, Info-ZIP SFX archive v5.12 w/decryption
  2036. #    this is the NT/Win32 version:
  2037. >69120    string    PK\003\004    \b, Info-ZIP NT SFX archive v5.12 w/decryption
  2038. #
  2039. # TELVOX Teleinformatica CODEC self-extractor for OS/2:
  2040. >49801    string    \x79\xff\x80\xff\x76\xff    \b, CODEC archive v3.21
  2041. >>49824    leshort        =1            \b, 1 file
  2042. >>49824    leshort        >1            \b, %u files
  2043.  
  2044. # .COM formats (Daniel Quinlan, quinlan@yggdrasil.com)
  2045. # Uncommenting only the first two lines will cover about 2/3 of COM files,
  2046. # but it isn't feasible to match all COM files since there must be at least
  2047. # two dozen different one-byte "magics".
  2048. #0    byte        0xe9        MS-DOS executable (COM)
  2049. #0    byte        0x8c        MS-DOS executable (COM)
  2050. # 0xeb conflicts with "sequent" magic
  2051. #0    byte        0xeb        MS-DOS executable (COM)
  2052. #0    byte        0xb8        MS-DOS executable (COM)
  2053.  
  2054. # miscellaneous formats
  2055. 0    string        LZ        MS-DOS executable (built-in)
  2056. #0    byte        0xf0        MS-DOS program library data
  2057. #
  2058.  
  2059. # Popular applications
  2060. 2080    string    Microsoft\ Word\ 6.0\ Document    %s
  2061. #
  2062. 0    belong    0x31be0000    Microsoft Word Document
  2063. #
  2064. 2080    string    Microsoft\ Excel\ 5.0\ Worksheet    %s
  2065. #
  2066. 0    belong    0x00001a00    Lotus 1-2-3
  2067. >4    belong    0x00100400    wk3 document
  2068. >4    belong    0x02100400    wk4 document
  2069. >4    belong    0x07800100    fm3 or fmb document
  2070. >4    belong    0x07800000    fm3 or fmb document
  2071. #
  2072. 0    belong    0x00000200     Lotus 1-2-3
  2073. >4    belong    0x06040600    wk1 document
  2074. >4    belong    0x06800200    fmt document
  2075.  
  2076. #------------------------------------------------------------------------------
  2077. # ncr:  file(1) magic for NCR Tower objects
  2078. #
  2079. # contributed by
  2080. # Michael R. Wayne  ***  TMC & Associates  ***  INTERNET: wayne@ford-vax.arpa
  2081. # uucp: {philabs | pyramid} !fmsrl7!wayne   OR   wayne@fmsrl7.UUCP
  2082. #
  2083. 0    beshort        000610    Tower/XP rel 2 object
  2084. >12       belong        >0    not stripped
  2085. >20       beshort        0407    executable
  2086. >20       beshort        0410    pure executable
  2087. >22       beshort        >0    - version %ld
  2088. 0    beshort        000615    Tower/XP rel 2 object
  2089. >12       belong        >0    not stripped
  2090. >20       beshort        0407    executable
  2091. >20       beshort        0410    pure executable
  2092. >22       beshort        >0    - version %ld
  2093. 0    beshort        000620    Tower/XP rel 3 object
  2094. >12       belong        >0    not stripped
  2095. >20       beshort        0407    executable
  2096. >20       beshort        0410    pure executable
  2097. >22       beshort        >0    - version %ld
  2098. 0    beshort        000625    Tower/XP rel 3 object
  2099. >12       belong        >0    not stripped
  2100. >20       beshort        0407    executable
  2101. >20       beshort        0410    pure executable
  2102. >22       beshort        >0    - version %ld
  2103. 0    beshort        000630    Tower32/600/400 68020 object
  2104. >12       belong        >0    not stripped
  2105. >20       beshort        0407    executable
  2106. >20       beshort        0410    pure executable
  2107. >22       beshort        >0    - version %ld
  2108. 0    beshort        000640    Tower32/800 68020
  2109. >18       beshort        &020000    w/68881 object
  2110. >18       beshort        &040000    compatible object
  2111. >18       beshort        &~060000    object
  2112. >20       beshort        0407    executable
  2113. >20       beshort        0413    pure executable
  2114. >12       belong        >0    not stripped
  2115. >22       beshort        >0    - version %ld
  2116. 0    beshort        000645    Tower32/800 68010
  2117. >18       beshort        &040000    compatible object
  2118. >18       beshort        &~060000 object
  2119. >20       beshort        0407    executable
  2120. >20       beshort        0413    pure executable
  2121. >12       belong        >0    not stripped
  2122. >22       beshort        >0    - version %ld
  2123.  
  2124. #------------------------------------------------------------------------------
  2125. # news:  file(1) magic for SunOS NeWS fonts (not "news" as in "netnews")
  2126. #
  2127. 0    string        StartFontMetrics    ASCII font metrics
  2128. 0    string        StartFont    ASCII font bits
  2129. 0    belong        0x137A2944    NeWS bitmap font
  2130. 0    belong        0x137A2947    NeWS font family
  2131. 0    belong        0x137A2950    scalable OpenFont binary
  2132. 0    belong        0x137A2951    encrypted scalable OpenFont binary
  2133. 8    belong        0x137A2B45    X11/NeWS bitmap font
  2134. 8    belong        0x137A2B48    X11/NeWS font family
  2135.  
  2136. #------------------------------------------------------------------------------
  2137. # pbm:  file(1) magic for Portable Bitmap files
  2138. #
  2139. # XXX - byte order?
  2140. #
  2141. 0    short    0x2a17    "compact bitmap" format (Poskanzer)
  2142.  
  2143. #------------------------------------------------------------------------------
  2144. # pdp:  file(1) magic for PDP-11 executable/object and APL workspace
  2145. #
  2146. 0    lelong        0101555        PDP-11 single precision APL workspace
  2147. 0    lelong        0101554        PDP-11 double precision APL workspace
  2148. #
  2149. # PDP-11 a.out
  2150. #
  2151. 0    leshort        0407        PDP-11 executable
  2152. >8    leshort        >0        not stripped
  2153. >15    byte        >0        - version %ld
  2154.  
  2155. 0    leshort        0401        PDP-11 UNIX/RT ldp
  2156. 0    leshort        0405        PDP-11 old overlay
  2157.  
  2158. 0    leshort        0410        PDP-11 pure executable
  2159. >8    leshort        >0        not stripped
  2160. >15    byte        >0        - version %ld
  2161.  
  2162. 0    leshort        0411        PDP-11 separate I&D executable
  2163. >8    leshort        >0        not stripped
  2164. >15    byte        >0        - version %ld
  2165.  
  2166. 0    leshort        0437        PDP-11 kernel overlay
  2167.  
  2168. #------------------------------------------------------------------------------
  2169. # pgp:  file(1) magic for Pretty Good Privacy
  2170. #
  2171. 0       beshort         0x9900                  pgp key public ring
  2172. 0       beshort         0x9501                  pgp key security ring
  2173. 0       beshort         0x9500                  pgp key security ring
  2174. 0       string          -----BEGIN\040PGP       pgp armored data
  2175. >15     string          PUBLIC\040KEY\040BLOCK- public key blocK
  2176. >15     string          MESSAGE-                message
  2177. >15     string          SIGNED\040MESSAGE-      signed message
  2178. >15     string          PGP\040SIGNATURE-       signature
  2179.  
  2180. #------------------------------------------------------------------------------
  2181. # pkgadd:  file(1) magic for SysV R4 PKG Datastreams
  2182. #
  2183. 0       string          #\ PaCkAgE\ DaTaStReAm  pkg Datastream (SVR4)
  2184.  
  2185. #------------------------------------------------------------------------------
  2186. # plus5:  file(1) magic for Plus Five's UNIX MUMPS
  2187. #
  2188. # XXX - byte order?  Paging Hokey....
  2189. #
  2190. 0    short        0x259        mumps avl global
  2191. >2    byte        >0        (V%d)
  2192. >6    byte        >0        with %d byte name
  2193. >7    byte        >0        and %d byte data cells
  2194. 0    short        0x25a        mumps blt global
  2195. >2    byte        >0        (V%d)
  2196. >8    short        >0        - %d byte blocks
  2197. >15    byte        0x00        - P/D format
  2198. >15    byte        0x01        - P/K/D format
  2199. >15    byte        0x02        - K/D format
  2200. >15    byte        >0x02        - Bad Flags
  2201.  
  2202. #------------------------------------------------------------------------------
  2203. # printer:  file(1) magic for printer-formatted files
  2204. #
  2205.  
  2206. # PostScript, updated by Daniel Quinlan (quinlan@yggdrasil.com)
  2207. 0    string        %!        PostScript document
  2208. >2    string        PS-Adobe-    conforming
  2209. >>11    string        >\0        at level %.3s
  2210. >>>15    string        EPS        - type %s
  2211. >>>15    string        Query        - type %s
  2212. >>>15    string        ExitServer    - type %s
  2213. # Some PCs have the annoying habit of adding a ^D as a document separator
  2214. 0    string        \004%!        PostScript document
  2215. >3    string        PS-Adobe-    conforming
  2216. >>12    string        >\0        at level %.3s
  2217. >>>16    string        EPS        - type %s
  2218. >>>16    string        Query        - type %s
  2219. >>>16    string        ExitServer    - type %s
  2220.  
  2221. # HP Printer Job Language
  2222. 0    string        \033%-12345X@PJL    HP Printer Job Language data
  2223.  
  2224. # HP Printer Control Language, Daniel Quinlan (quinlan@yggdrasil.com)
  2225. 0    string        \033E\033    HP PCL printer data
  2226. >3    string        \&l0A        - default page size
  2227. >3    string        \&l1A        - US executive page size
  2228. >3    string        \&l2A        - US letter page size
  2229. >3    string        \&l3A        - US legal page size
  2230. >3    string        \&l26A        - A4 page size
  2231. >3    string        \&l80A        - Monarch envelope size
  2232. >3    string        \&l81A        - No. 10 envelope size
  2233. >3    string        \&l90A        - Intl. DL envelope size
  2234. >3    string        \&l91A        - Intl. C5 envelope size
  2235. >3    string        \&l100A        - Intl. B5 envelope size
  2236. >3    string        \&l-81A        - No. 10 envelope size (landscape)
  2237. >3    string        \&l-90A        - Intl. DL envelope size (landscape)
  2238.  
  2239. # IMAGEN printer-ready files:
  2240. 0    string    @document(        Imagen printer
  2241. # this only works if "language xxx" is first item in Imagen header.
  2242. >10    string    language\ impress    (imPRESS data)
  2243. >10    string    language\ daisy        (daisywheel text)
  2244. >10    string    language\ diablo    (daisywheel text)
  2245. >10    string    language\ printer    (line printer emulation)
  2246. >10    string    language\ tektronix    (Tektronix 4014 emulation)
  2247. # Add any other languages that your Imagen uses - remember
  2248. # to keep the word `text' if the file is human-readable.
  2249. # [GRR 950115:  missing "postscript" or "ultrascript" (whatever it was called)]
  2250. #
  2251. # Now magic for IMAGEN font files...
  2252. 0    string        Rast        RST-format raster font data
  2253. >45    string        >0        face %
  2254.  
  2255. #------------------------------------------------------------------------------
  2256. # psdbms:  file(1) magic for psdatabase
  2257. #
  2258. 0    belong&0xff00ffff    0x56000000    ps database
  2259. >1    string    >\0    version %s
  2260. >4    string    >\0    from kernel %s
  2261.  
  2262. #------------------------------------------------------------------------------
  2263. # compress:  file(1) magic for Pyramids
  2264. #
  2265. # XXX - byte order?
  2266. #
  2267. 0    long        0x50900107    Pyramid 90x family executable
  2268. 0    long        0x50900108    Pyramid 90x family pure executable
  2269. >16    long        >0        not stripped
  2270. 0    long        0x5090010b    Pyramid 90x family demand paged pure executable
  2271. >16    long        >0        not stripped
  2272.  
  2273. #------------------------------------------------------------------------------
  2274. # rtf:    file(1) magic for Rich Text Format (RTF)
  2275. #
  2276. # Duncan P. Simpson, D.P.Simpson@dcs.warwick.ac.uk
  2277. #
  2278. 0    string        {\\rtf        Rich Text Format data,
  2279. >5    byte        x        version %c,
  2280. >6    string        \\ansi        ANSI
  2281. >6    string        \\mac        Apple Macintosh
  2282. >6    string        \\pc        IBM PC code page 437
  2283. >6    string        \\pca        IBM PC code page 850
  2284.  
  2285. #------------------------------------------------------------------------------
  2286. # sc:  file(1) magic for "sc" spreadsheet
  2287. #
  2288. 38    string        Spreadsheet    sc spreadsheet file
  2289.  
  2290. #------------------------------------------------------------------------------
  2291. # sccs:  file(1) magic for SCCS archives
  2292. #
  2293. # SCCS archive structure:
  2294. # \001h01207
  2295. # \001s 00276/00000/00000
  2296. # \001d D 1.1 87/09/23 08:09:20 ian 1 0
  2297. # \001c date and time created 87/09/23 08:09:20 by ian
  2298. # \001e
  2299. # \001u
  2300. # \001U
  2301. # ... etc.
  2302. # Now '\001h' happens to be the same as the 3B20's a.out magic number (0550).
  2303. # *Sigh*. And these both came from various parts of the USG.
  2304. # Maybe we should just switch everybody from SCCS to RCS!
  2305. # Further, you can't just say '\001h0', because the five-digit number
  2306. # is a checksum that could (presumably) have any leading digit,
  2307. # and we don't have regular expression matching yet. 
  2308. # Hence the following official kludge:
  2309. 8    string        \001s\             SCCS archive.
  2310.  
  2311. #------------------------------------------------------------------------------
  2312. # sendmail:  file(1) magic for sendmail config files
  2313. #
  2314. # XXX - byte order?
  2315. #
  2316. 0    byte    046      Sendmail frozen configuration 
  2317. >16    string    >\0      - version %s
  2318. 0    short    0x271c      Sendmail frozen configuration
  2319. >16    string    >\0      - version %s
  2320.  
  2321. #------------------------------------------------------------------------------
  2322. # sequent:  file(1) magic for Sequent machines
  2323. #
  2324. # Sequent information updated by Don Dwiggins <atsun!dwiggins>.
  2325. # For Sequent's multiprocessor systems (incomplete).
  2326. 0    lelong    0x00ea            BALANCE NS32000 .o
  2327. >16    lelong    >0        not stripped
  2328. >124    lelong    >0        version %ld
  2329. 0    lelong    0x10ea            BALANCE NS32000 executable (0 @ 0)
  2330. >16    lelong  >0                not stripped
  2331. >124    lelong    >0        version %ld
  2332. 0    lelong    0x20ea            BALANCE NS32000 executable (invalid @ 0)
  2333. >16    lelong  >0                not stripped
  2334. >124    lelong    >0        version %ld
  2335. 0    lelong    0x30ea            BALANCE NS32000 standalone executable
  2336. >16    lelong  >0              not stripped
  2337. >124    lelong    >0        version %ld
  2338. #
  2339. # Symmetry information added by Jason Merrill <jason@jarthur.claremont.edu>.
  2340. # Symmetry magic nums will not be reached if DOS COM comes before them;
  2341. # byte 0xeb is matched before these get a chance.
  2342. 0    leshort    0x12eb        SYMMETRY i386 .o
  2343. >16    lelong    >0        not stripped
  2344. >124    lelong    >0        version %ld
  2345. 0    leshort    0x22eb        SYMMETRY i386 executable (0 @ 0)
  2346. >16    lelong    >0        not stripped
  2347. >124    lelong    >0        version %ld
  2348. 0    leshort    0x32eb        SYMMETRY i386 executable (invalid @ 0)
  2349. >16    lelong    >0        not stripped
  2350. >124    lelong    >0        version %ld
  2351. 0    leshort    0x42eb        SYMMETRY i386 standalone executable
  2352. >16    lelong    >0        not stripped
  2353. >124    lelong    >0        version %ld
  2354.  
  2355. #------------------------------------------------------------------------------
  2356. # sgi:  file(1) magic for Silicon Graphics (MIPS, IRIS, IRIX, etc.)
  2357. #
  2358. # all of SGI's *current* machines and OSes run in big-endian mode on the
  2359. # MIPS machines, as far as I know.
  2360. #
  2361. # XXX - what is the blank "-" line?
  2362. #
  2363. 0    belong    0407        old SGI 68020 executable
  2364. 0    belong    0410        old SGI 68020 pure executable
  2365. 0    beshort    0x8765        disk quotas file
  2366. 0    beshort    0x0506        IRIS Showcase file
  2367. >2    byte    0x49        -
  2368. >3    byte    x        - version %ld
  2369. 0    beshort    0x0226        IRIS Showcase template
  2370. >2    byte    0x63        -
  2371. >3    byte    x        - version %ld
  2372. 0    belong    0x5343464d    IRIS Showcase file
  2373. >4    byte    x        - version %ld
  2374. 0    belong    0x5443464d    IRIS Showcase template
  2375. >4    byte    x        - version %ld
  2376. 0    belong    0xdeadbabe    IRIX Parallel Arena
  2377. >8    belong    >0        - version %ld
  2378. #
  2379. 0    beshort    0x0160        MIPSEB COFF executable
  2380. >20    beshort    0407        (impure)
  2381. >20    beshort    0410        (swapped)
  2382. >20    beshort    0413        (paged)
  2383. >8    belong    >0        not stripped
  2384. >8    belong    0        stripped
  2385. >22    byte    x        - version %ld
  2386. >23    byte    x        .%ld
  2387. #
  2388. 0    beshort    0x0162        MIPSEL COFF executable
  2389. >20    beshort    0407        (impure)
  2390. >20    beshort    0410        (swapped)
  2391. >20    beshort    0413        (paged)
  2392. >8    belong    >0        not stripped
  2393. >8    belong    0        stripped
  2394. >23    byte    x        - version %d
  2395. >22    byte    x        .%ld
  2396. #
  2397. 0    beshort    0x6001        MIPSEB-LE COFF executable
  2398. >20    beshort    03401        (impure)
  2399. >20    beshort    04001        (swapped)
  2400. >20    beshort    05401        (paged)
  2401. >8    belong    >0        not stripped
  2402. >8    belong    0        stripped
  2403. >22    byte    x        - version %d
  2404. >23    byte    x        .%ld
  2405. #
  2406. 0    beshort    0x6201        MIPSEL-LE COFF executable
  2407. >20    beshort    03401        (impure)
  2408. >20    beshort    04001        (swapped)
  2409. >20    beshort    05401        (paged)
  2410. >8    belong    >0        not stripped
  2411. >8    belong    0        stripped
  2412. >22    byte    x        - version %ld
  2413. >23    byte    x        .%ld
  2414. #
  2415. # MIPS 2 additions
  2416. #
  2417. 0    beshort    0x0163        MIPSEB MIPS-II COFF executable
  2418. >20    beshort    0407        (impure)
  2419. >20    beshort    0410        (swapped)
  2420. >20    beshort    0413        (paged)
  2421. >8    belong    >0        not stripped
  2422. >8    belong    0        stripped
  2423. >22    byte    x        - version %ld
  2424. >23    byte    x        .%ld
  2425. #
  2426. 0    beshort    0x0166        MIPSEL MIPS-II COFF executable
  2427. >20    beshort    0407        (impure)
  2428. >20    beshort    0410        (swapped)
  2429. >20    beshort    0413        (paged)
  2430. >8    belong    >0        not stripped
  2431. >8    belong    0        stripped
  2432. >22    byte    x        - version %ld
  2433. >23    byte    x        .%ld
  2434. #
  2435. 0    beshort    0x6301        MIPSEB-LE MIPS-II COFF executable
  2436. >20    beshort    03401        (impure)
  2437. >20    beshort    04001        (swapped)
  2438. >20    beshort    05401        (paged)
  2439. >8    belong    >0        not stripped
  2440. >8    belong    0        stripped
  2441. >23    byte    x        - version %ld
  2442. >23    byte    x        .%ld
  2443. #
  2444. 0    beshort    0x6601        MIPSEL-LE MIPS-II COFF executable
  2445. >20    beshort    03401        (impure)
  2446. >20    beshort    04001        (swapped)
  2447. >20    beshort    05401        (paged)
  2448. >8    belong    >0        not stripped
  2449. >8    belong    0        stripped
  2450. >23    byte    x        - version %ld
  2451. >23    byte    x        .%ld
  2452. #
  2453. # MIPS 3 additions
  2454. #
  2455. 0    beshort    0x0140        MIPSEB MIPS-III COFF executable
  2456. >20    beshort    0407        (impure)
  2457. >20    beshort    0410        (swapped)
  2458. >20    beshort    0413        (paged)
  2459. >8    belong    >0        not stripped
  2460. >8    belong    0        stripped
  2461. >22    byte    x        - version %ld
  2462. >23    byte    x        .%ld
  2463. #
  2464. 0    beshort    0x0142        MIPSEL MIPS-III COFF executable
  2465. >20    beshort    0407        (impure)
  2466. >20    beshort    0410        (swapped)
  2467. >20    beshort    0413        (paged)
  2468. >8    belong    >0        not stripped
  2469. >8    belong    0        stripped
  2470. >22    byte    x        - version %ld
  2471. >23    byte    x        .%ld
  2472. #
  2473. 0    beshort    0x4001        MIPSEB-LE MIPS-III COFF executable
  2474. >20    beshort    03401        (impure)
  2475. >20    beshort    04001        (swapped)
  2476. >20    beshort    05401        (paged)
  2477. >8    belong    >0        not stripped
  2478. >8    belong    0        stripped
  2479. >23    byte    x        - version %ld
  2480. >23    byte    x        .%ld
  2481. #
  2482. 0    beshort    0x4201        MIPSEL-LE MIPS-III COFF executable
  2483. >20    beshort    03401        (impure)
  2484. >20    beshort    04001        (swapped)
  2485. >20    beshort    05401        (paged)
  2486. >8    belong    >0        not stripped
  2487. >8    belong    0        stripped
  2488. >23    byte    x        - version %ld
  2489. >23    byte    x        .%ld
  2490. #
  2491. 0    beshort    0x180        MIPSEB Ucode
  2492. 0    beshort    0x182        MIPSEL Ucode
  2493. # 32bit core file
  2494. 0    belong    0xdeadadb0    IRIX core dump
  2495. >4    belong    1        of
  2496. >16    string    >\0        '%s'
  2497. # 64bit core file
  2498. 0    belong    0xdeadad40    IRIX 64-bit core dump
  2499. >4    belong    1        of
  2500. >16    string    >\0        '%s'
  2501. # New style crash dump file
  2502. 0    string    \x43\x72\x73\x68\x44\x75\x6d\x70    IRIX vmcore dump of
  2503. >36    string    >\0                    '%s'
  2504. # Trusted IRIX info
  2505. 0    string    SGIAUDIT    SGI Audit file
  2506. >8    byte    x        - version %d
  2507. >9    byte    x        .%ld
  2508. # Are these three SGI-based file types or general ones?
  2509. 0    string    WNGZWZSC    Wingz compiled script
  2510. 0    string    WNGZWZSS    Wingz spreadsheet
  2511. 0    string    WNGZWZHP    Wingz help file
  2512. #
  2513. 0    string    \#Inventor V    IRIS Inventor file
  2514. # XXX - I don't know what next thing is!  It is likely to be an image
  2515. # (or movie) format
  2516. 0    string    glfHeadMagic();        GLF_TEXT
  2517. 4    belong    0x41010000        GLF_BINARY_LSB_FIRST
  2518. 4    belong    0x00000141        GLF_BINARY_MSB_FIRST
  2519.  
  2520. #------------------------------------------------------------------------------
  2521. # sgml:  file(1) magic for Standard(?) Generalized Mark-up Language
  2522. #
  2523. # $Id: sgml,v 1.3 1995/04/28 19:24:37 christos Exp $
  2524. # SGML goop, mostly from rph@sq.
  2525. 0    string        \<!DOCTYPE    Exported SGML document
  2526. 0    string        \<!doctype    Exported SGML document
  2527. 0    string        \<!SUBDOC    Exported SGML subdocument
  2528. 0    string        \<!subdoc    Exported SGML subdocument
  2529. 0    string        \<!--        Exported SGML document
  2530.  
  2531. #------------------------------------------------------------------------------
  2532. # softquad:  file(1) magic for SoftQuad Publishing Software
  2533. #
  2534. # $Id: softquad,v 1.4 1995/04/28 19:24:38 christos Exp $
  2535. # Author/Editor and RulesBuilder
  2536. #
  2537. # XXX - byte order?
  2538. #
  2539. 0    string        \<!SQ\ DTD>    Compiled SGML rules file
  2540. >9    string        >\0         Type %s
  2541. 0    string        \<!SQ\ A/E>    A/E SGML Document binary
  2542. >9    string        >\0         Type %s
  2543. 0    string        \<!SQ\ STS>    A/E SGML binary styles file
  2544. >9    string        >\0         Type %s
  2545. 0    short        0xc0de        Compiled PSI (v1) data
  2546. 0    short        0xc0da        Compiled PSI (v2) data
  2547. >3    string        >\0        (%s)
  2548. # Binary sqtroff font/desc files...
  2549. 0    short        0125252        SoftQuad DESC or font file binary
  2550. >2    short        >0        - version %d
  2551. # Bitmaps...
  2552. 0    string        SQ\ BITMAP1    SoftQuad Raster Format text
  2553. #0    string        SQ\ BITMAP2    SoftQuad Raster Format data
  2554. # sqtroff intermediate language (replacement for ditroff int. lang.)
  2555. 0    string        X\         SoftQuad troff Context intermediate
  2556. >2    string        495        for AT&T 495 laser printer
  2557. >2    string        hp        for Hewlett-Packard LaserJet
  2558. >2    string        impr        for IMAGEN imPRESS
  2559. >2    string        ps        for PostScript
  2560.  
  2561. #------------------------------------------------------------------------------
  2562. # sun:  file(1) magic for Sun machines
  2563. #
  2564. # Values for big-endian Sun (MC680x0, SPARC) binaries on pre-5.x
  2565. # releases.  (5.x uses ELF.)
  2566. #
  2567. 0    belong&077777777    0600413        sparc demand paged
  2568. >0    byte        &0x80
  2569. >>20    belong        <4096        shared library
  2570. >>20    belong        =4096        dynamically linked executable
  2571. >>20    belong        >4096        dynamically linked executable
  2572. >0    byte        ^0x80        executable
  2573. >16    belong        >0        not stripped
  2574. 0    belong&077777777    0600410        sparc pure
  2575. >0    byte        &0x80        dynamically linked executable
  2576. >0    byte        ^0x80        executable
  2577. >16    belong        >0        not stripped
  2578. 0    belong&077777777    0600407        sparc
  2579. >0    byte        &0x80        dynamically linked executable
  2580. >0    byte        ^0x80        executable
  2581. >16    belong        >0        not stripped
  2582.  
  2583. 0    belong&077777777    0400413        mc68020 demand paged
  2584. >0    byte        &0x80
  2585. >>20    belong        <4096        shared library
  2586. >>20    belong        =4096        dynamically linked executable
  2587. >>20    belong        >4096        dynamically linked executable
  2588. >16    belong        >0        not stripped
  2589. 0    belong&077777777    0400410        mc68020 pure
  2590. >0    byte        &0x80        dynamically linked executable
  2591. >0    byte        ^0x80        executable
  2592. >16    belong        >0        not stripped
  2593. 0    belong&077777777    0400407        mc68020
  2594. >0    byte        &0x80        dynamically linked executable
  2595. >0    byte        ^0x80        executable
  2596. >16    belong        >0        not stripped
  2597.  
  2598. 0    belong&077777777    0200413        mc68010 demand paged
  2599. >0    byte        &0x80
  2600. >>20    belong        <4096        shared library
  2601. >>20    belong        =4096        dynamically linked executable
  2602. >>20    belong        >4096        dynamically linked executable
  2603. >16    belong        >0        not stripped
  2604. 0    belong&077777777    0200410        mc68010 pure
  2605. >0    byte        &0x80        dynamically linked executable
  2606. >0    byte        ^0x80        executable
  2607. >16    belong        >0        not stripped
  2608. 0    belong&077777777    0200407        mc68010
  2609. >0    byte        &0x80        dynamically linked executable
  2610. >0    byte        ^0x80        executable
  2611. >16    belong        >0        not stripped
  2612.  
  2613. # reworked these to avoid anything beginning with zero becoming "old sun-2"
  2614. 0    belong        0407        old sun-2 executable
  2615. >16    belong        >0        not stripped
  2616. 0    belong        0410        old sun-2 pure executable
  2617. >16    belong        >0        not stripped
  2618. 0    belong        0413        old sun-2 demand paged executable
  2619. >16    belong        >0        not stripped
  2620.  
  2621. #
  2622. # Core files.  "SPARC 4.x BCP" means "core file from a SunOS 4.x SPARC
  2623. # binary executed in compatibility mode under SunOS 5.x".
  2624. #
  2625. 0    belong        0x080456    SunOS core file
  2626. >4    belong        432        (SPARC)
  2627. >>132    string        >\0        from '%s'
  2628. >>116    belong        =3        (quit)
  2629. >>116    belong        =4        (illegal instruction)
  2630. >>116    belong        =5        (trace trap)
  2631. >>116    belong        =6        (abort)
  2632. >>116    belong        =7        (emulator trap)
  2633. >>116    belong        =8        (arithmetic exception)
  2634. >>116    belong        =9        (kill)
  2635. >>116    belong        =10        (bus error)
  2636. >>116    belong        =11        (segmentation violation)
  2637. >>116    belong        =12        (bad argument to system call)
  2638. >>116    belong        =29        (resource lost)
  2639. >>120    belong        x        (T=%dK,
  2640. >>124    belong        x        D=%dK,
  2641. >>128    belong        x        S=%dK)
  2642. >4    belong        826        (68K)
  2643. >>128    string        >\0        from '%s'
  2644. >4    belong        456        (SPARC 4.x BCP)
  2645. >>152    string        >\0        from '%s'
  2646.  
  2647. #------------------------------------------------------------------------------
  2648. # terminfo:  file(1) magic for terminfo
  2649. #
  2650. # XXX - byte order for screen images?
  2651. #
  2652. 0    string        \032\001    Compiled terminfo entry
  2653. 0    short        0433        Curses screen image
  2654. 0    short        0434        Curses screen image
  2655.  
  2656. #------------------------------------------------------------------------------
  2657. # tex:  file(1) magic for TeX files
  2658. #
  2659. # From <conklin@talisman.kaleida.com>
  2660.  
  2661. # Although we may know the offset of certain text fields in TeX DVI
  2662. # and font files, we can't use them reliably because they are not
  2663. # zero terminated. [but we do anyway, christos]
  2664. 0    string        \367\002    TeX DVI file
  2665. >16    string        >\0        (%s)
  2666. 0    string        \367\203    TeX generic font data
  2667. 0    string        \367\131    TeX packed font data
  2668. >3    string        >\0        (%s)
  2669. 0    string        \367\312    TeX virtual font data
  2670. 0    string        This\ is\ TeX,    TeX transcript text
  2671. 0    string        This\ is\ METAFONT,    METAFONT transcript text
  2672.  
  2673. # There is no way to detect TeX Font Metric (*.tfm) files without
  2674. # breaking them apart and reading the data.  The following patterns
  2675. # match most *.tfm files generated by METAFONT or afm2tfm.
  2676. 2    string        \000\021    TeX font metric data
  2677. 2    string        \000\022    TeX font metric data
  2678. >33    string        >\0        (%s)
  2679.  
  2680. # Texinfo and GNU Info, from Daniel Quinlan (quinlan@yggdrasil.com)
  2681. 0    string        \\input\ texinfo    Texinfo source text
  2682. 0    string        This\ is\ Info\ file    GNU Info text
  2683.  
  2684. # TeX document additions from Daniel Quinlan, quinlan@yggdrasil.com
  2685. 0    string        \\input        TeX or TeX-derivative document text
  2686. 0    string        \\chapter    TeX or TeX-derivative document text
  2687. 0    string        \\documentstyle    TeX or TeX-derivative document text
  2688. 0    string        \\section    TeX or TeX-derivative document text
  2689. 0    string        \\setlength    TeX or TeX-derivative document text
  2690.  
  2691. #------------------------------------------------------------------------------
  2692. # timezone:  file(1) magic for timezone data
  2693. #
  2694. # from Daniel Quinlan (quinlan@yggdrasil.com)
  2695. # this should work on Linux, SunOS, and maybe others
  2696. 0    string    \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\1\0    timezone data
  2697. 0    string    \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\2\0    timezone data
  2698. 0    string  \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\3\0    timezone data
  2699. 0    string    \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4\0    timezone data
  2700. 0    string    \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\5\0    timezone data
  2701.  
  2702. #------------------------------------------------------------------------------
  2703. # troff:  file(1) magic for *roff
  2704. #
  2705. # updated by Daniel Quinlan (quinlan@yggdrasil.com)
  2706.  
  2707. # troff input
  2708. 0    string        .\\"        troff or preprocessor input text
  2709. 0    string        '\\"        troff or preprocessor input text
  2710. 0    string        '.\\"        troff or preprocessor input text
  2711. 0    string        \\"        troff or preprocessor input text
  2712.  
  2713. # ditroff intermediate output text
  2714. 0    string        x\ T        ditroff text
  2715. >4    string        cat        for the C/A/T phototypesetter
  2716. >4    string        ps        for PostScript
  2717. >4    string        dvi        for DVI
  2718. >4    string        ascii        for ASCII
  2719. >4    string        lj4        for LaserJet 4
  2720. >4    string        latin1        for ISO 8859-1 (Latin 1)
  2721. >4    string        X75        for xditview at 75dpi
  2722. >>7    string        -12        (12pt)
  2723. >4    string        X100        for xditview at 100dpi
  2724. >>8    string        -12        (12pt)
  2725.  
  2726. # output data formats
  2727. 0    string        \100\357    very old (C/A/T) troff output data
  2728.  
  2729. #------------------------------------------------------------------------------
  2730. # typeset:  file(1) magic for other typesetting
  2731. #
  2732. 0    string        Interpress/Xerox    Xerox InterPress data
  2733. >16    string        /            (version
  2734. >>17    string        >\0            %s)
  2735.  
  2736. #------------------------------------------------------------------------------
  2737. # unknown:  file(1) magic for unknown machines
  2738. #
  2739. # XXX - this probably should be pruned, as it'll match PDP-11 and
  2740. # VAX image formats.
  2741. #
  2742. # 0x107 is 0407; 0x108 is 0410; both are PDP-11 (executable and pure,
  2743. # respectively).
  2744. #
  2745. # 0x109 is 0411; that's PDP-11 split I&D, but the PDP-11 version doesn't
  2746. # have the "version %ld", which may be a bogus COFFism (I don't think
  2747. # there ever was COFF for the PDP-11).
  2748. #
  2749. # 0x10B is 0413; that's VAX demand-paged, but this is a short, not a
  2750. # long, as it would be on a VAX.
  2751. #
  2752. # 0x10C is 0414, 0x10D is 0415, and 0x10E is 416; those *are* unknown.
  2753. #
  2754. 0    short        0x107        unknown machine executable
  2755. >8    short        >0        not stripped
  2756. >15    byte        >0        - version %ld
  2757. 0    short        0x108        unknown pure executable
  2758. >8    short        >0        not stripped
  2759. >15    byte        >0        - version %ld
  2760. 0    short        0x109        PDP-11 separate I&D
  2761. >8    short        >0        not stripped
  2762. >15    byte        >0        - version %ld
  2763. 0    short        0x10b        unknown pure executable
  2764. >8    short        >0        not stripped
  2765. >15    byte        >0        - version %ld
  2766. 0    long        0x10c        unknown demand paged pure executable
  2767. >16    long        >0        not stripped
  2768. 0    long        0x10d        unknown demand paged pure executable
  2769. >16    long        >0        not stripped
  2770. 0    long        0x10e        unknown readable demand paged pure executable
  2771.  
  2772. #------------------------------------------------------------------------------
  2773. # uuencoded:  file(1) magic for ASCII-encoded files
  2774. #
  2775. 0    string        begin         uuencoded mail text
  2776. # Btoa(1) is an alternative to uuencode that requires less space.
  2777. 0    string        xbtoa\ Begin    btoa'd text
  2778.  
  2779. #------------------------------------------------------------------------------
  2780. # varied.out:  file(1) magic for various USG systems
  2781. #
  2782. #    Herewith many of the object file formats used by USG systems.
  2783. #    Most have been moved to files for a particular processor,
  2784. #    and deleted if they duplicate other entries.
  2785. #
  2786. 0    short        0610        Perkin-Elmer executable
  2787. # AMD 29K
  2788. 0    beshort        0572        amd 29k coff noprebar executable
  2789. 0    beshort        01572        amd 29k coff prebar executable
  2790. 0    beshort        0160007        amd 29k coff archive
  2791. # Cray
  2792. 6    beshort        0407        unicos (cray) executable
  2793.  
  2794.  
  2795. #------------------------------------------------------------------------------
  2796. # vax:  file(1) magic for VAX executable/object and APL workspace
  2797. #
  2798. 0    lelong        0101557        VAX single precision APL workspace
  2799. 0    lelong        0101556        VAX double precision APL workspace
  2800.  
  2801. #
  2802. # VAX a.out (32V, BSD)
  2803. #
  2804. 0    lelong        0407        VAX executable
  2805. >16    lelong        >0        not stripped
  2806.  
  2807. 0    lelong        0410        VAX pure executable
  2808. >16    lelong        >0        not stripped
  2809.  
  2810. 0    lelong        0413        VAX demand paged pure executable
  2811. >16    lelong        >0        not stripped
  2812.  
  2813. 0    lelong        0420        VAX demand paged (first page unmapped) pure executable
  2814. >16    lelong        >0        not stripped
  2815.  
  2816. #
  2817. # VAX COFF
  2818. #
  2819. # The `versions' should be un-commented if they work for you.
  2820. # (Was the problem just one of endianness?)
  2821. #
  2822. 0    leshort        0570        VAX COFF executable
  2823. >12    lelong        >0        not stripped
  2824. >22    leshort        >0        - version %ld
  2825. 0    leshort        0575        VAX COFF pure executable
  2826. >12    lelong        >0        not stripped
  2827. >22    leshort        >0        - version %ld
  2828.  
  2829. #------------------------------------------------------------------------------
  2830. # visx:  file(1) magic for Visx format files
  2831. #
  2832. 0    short        0x5555        VISX image file
  2833. >2    byte        0        (zero)
  2834. >2    byte        1        (unsigned char)
  2835. >2    byte        2        (short integer)
  2836. >2    byte        3        (float 32)
  2837. >2    byte        4        (float 64)
  2838. >2    byte        5        (signed char)
  2839. >2    byte        6        (bit-plane)
  2840. >2    byte        7        (classes)
  2841. >2    byte        8        (statistics)
  2842. >2    byte        10        (ascii text)
  2843. >2    byte        15        (image segments)
  2844. >2    byte        100        (image set)
  2845. >2    byte        101        (unsigned char vector)
  2846. >2    byte        102        (short integer vector)
  2847. >2    byte        103        (float 32 vector)
  2848. >2    byte        104        (float 64 vector)
  2849. >2    byte        105        (signed char vector)
  2850. >2    byte        106        (bit plane vector)
  2851. >2    byte        121        (feature vector)
  2852. >2    byte        122        (feature vector library)
  2853. >2    byte        124        (chain code)
  2854. >2    byte        126        (bit vector)
  2855. >2    byte        130        (graph)
  2856. >2    byte        131        (adjacency graph)
  2857. >2    byte        132        (adjacency graph library)
  2858. >2    string        .VISIX        (ascii text)
  2859.  
  2860. #------------------------------------------------------------------------------
  2861. # vms:  file(1) magic for VMS executables (experimental)
  2862. #
  2863. # VMS .exe formats, both VAX and AXP (Greg Roelofs, newt@uchicago.edu)
  2864.  
  2865. # GRR 950122:  I'm just guessing on these, based on inspection of the headers
  2866. # of three executables each for Alpha and VAX architectures.  The VAX files
  2867. # all had headers similar to this:
  2868. #
  2869. #   00000  b0 00 30 00 44 00 60 00  00 00 00 00 30 32 30 35  ..0.D.`.....0205
  2870. #   00010  01 01 00 00 ff ff ff ff  ff ff ff ff 00 00 00 00  ................
  2871. #
  2872. 0    string    \xb0\x00\x30\x00    VMS VAX executable
  2873. >44032    string    PK\003\004        (Info-ZIP SFX archive v5.12 w/decryption)
  2874. #
  2875. # The AXP files all looked like this, except that the byte at offset 0x22
  2876. # was 06 in some of them and 07 in others:
  2877. #
  2878. #   00000  03 00 00 00 00 00 00 00  ec 02 00 00 10 01 00 00  ................
  2879. #   00010  68 00 00 00 98 00 00 00  b8 00 00 00 00 00 00 00  h...............
  2880. #   00020  00 00 07 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
  2881. #   00030  00 00 00 00 01 00 00 00  00 00 00 00 00 00 00 00  ................
  2882. #   00040  00 00 00 00 ff ff ff ff  ff ff ff ff 02 00 00 00  ................
  2883. #
  2884. 0    belong    0x03000000    VMS Alpha executable
  2885. >75264    string    PK\003\004    (Info-ZIP SFX archive v5.12 w/decryption)
  2886.  
  2887. #------------------------------------------------------------------------------
  2888. # zilog:  file(1) magic for Zilog Z8000.
  2889. #
  2890. # Was it big-endian or little-endian?  My Product Specification doesn't
  2891. # say.
  2892. #
  2893. 0    long        0xe807        object file (z8000 a.out)
  2894. 0    long        0xe808        pure object file (z8000 a.out)
  2895. 0    long        0xe809        separate object file (z8000 a.out)
  2896. 0    long        0xe805        overlay object file (z8000 a.out)
  2897.  
  2898.  
  2899. #------------------------------------------------------------------------------
  2900. # zyxel:  file(1) magic for ZyXEL modems
  2901. #
  2902. # From <rob@pe1chl.ampr.org>
  2903. # These are the /etc/magic entries to decode datafiles as used for the
  2904. # ZyXEL U-1496E DATA/FAX/VOICE modems.  (This header conforms to a
  2905. # ZyXEL-defined standard)
  2906.  
  2907. 0    string        ZyXEL\002    ZyXEL voice data
  2908. >10    byte        0        - CELP encoding
  2909. >10    byte&0x0B    1        - ADPCM2 encoding
  2910. >10    byte&0x0B    2        - ADPCM3 encoding
  2911. >10    byte&0x0B    3        - ADPCM4 encoding
  2912. >10    byte&0x0B    8        - New ADPCM3 encoding
  2913. >10    byte&0x04    4        with resync
  2914.