home *** CD-ROM | disk | FTP | other *** search
/ H4CK3R 4 / hacker04 / 04_HACK04.ISO / darwin / darwinx86.iso / private / etc / magic < prev    next >
Encoding:
Text File  |  2001-09-14  |  128.8 KB  |  3,838 lines

  1. #! file
  2. #    $OpenBSD: Header,v 1.2 1996/06/26 05:33:03 deraadt Exp $
  3.  
  4. # Magic data for file(1) command.
  5. # Machine-genererated from src/cmd/file/magdir/*; edit there only!
  6. # Format is described in magic(files), where:
  7. # files is 4 on V7 and BSD, 4 on SV, and ?? in the SVID.
  8. #------------------------------------------------------------------------------
  9. # Localstuff:  file(1) magic for locally observed files
  10. #
  11. # $OpenBSD: Localstuff,v 1.3 1997/02/09 23:58:40 millert Exp $
  12. # Add any locally observed files here.  Remember:
  13. # text if readable, executable if runnable binary, data if unreadable.
  14.  
  15. #------------------------------------------------------------------------------
  16. # OpenBSD:  file(1) magic for OpenBSD objects
  17. #
  18. # All new-style magic numbers are in network byte order.
  19. #
  20.  
  21. 0    lelong            000000407    OpenBSD little-endian object file
  22. >16    lelong            >0        not stripped
  23. 0    belong            000000407    OpenBSD big-endian object file
  24. >16    belong            >0        not stripped
  25.  
  26. 0    belong&0377777777    041400413    OpenBSD/i386 demand paged
  27. >0    byte            &0x80        
  28. >>20    lelong            <4096        shared library
  29. >>20    lelong            =4096        dynamically linked executable
  30. >>20    lelong            >4096        dynamically linked executable
  31. >0    byte            ^0x80        executable
  32. >16    lelong            >0        not stripped
  33. 0    belong&0377777777    041400410    OpenBSD/i386 pure
  34. >0    byte            &0x80        dynamically linked executable
  35. >0    byte            ^0x80        executable
  36. >16    lelong            >0        not stripped
  37. 0    belong&0377777777    041400407    OpenBSD/i386
  38. >0    byte            &0x80        dynamically linked executable
  39. >0    byte            ^0x80
  40. >>0    byte            &0x40        position independent
  41. >>20    lelong            !0        executable
  42. >>20    lelong            =0        object file
  43. >16    lelong            >0        not stripped
  44. 0    belong&0377777777    041400507    OpenBSD/i386 core
  45. >12    string            >\0        from '%s'
  46.  
  47. 0    belong&0377777777    041600413    OpenBSD/m68k demand paged
  48. >0    byte            &0x80        
  49. >>20    belong            <8192        shared library
  50. >>20    belong            =8192        dynamically linked executable
  51. >>20    belong            >8192        dynamically linked executable
  52. >0    byte            ^0x80        executable
  53. >16    belong            >0        not stripped
  54. 0    belong&0377777777    041600410    OpenBSD/m68k pure
  55. >0    byte            &0x80        dynamically linked executable
  56. >0    byte            ^0x80        executable
  57. >16    belong            >0        not stripped
  58. 0    belong&0377777777    041600407    OpenBSD/m68k
  59. >0    byte            &0x80        dynamically linked executable
  60. >0    byte            ^0x80
  61. >>0    byte            &0x40        position independent
  62. >>20    belong            !0        executable
  63. >>20    belong            =0        object file
  64. >16    belong            >0        not stripped
  65. 0    belong&0377777777    041600507    OpenBSD/m68k core
  66. >12    string            >\0        from '%s'
  67.  
  68. 0    belong&0377777777    042000413    OpenBSD/m68k4k demand paged
  69. >0    byte            &0x80        
  70. >>20    belong            <4096        shared library
  71. >>20    belong            =4096        dynamically linked executable
  72. >>20    belong            >4096        dynamically linked executable
  73. >0    byte            ^0x80        executable
  74. >16    belong            >0        not stripped
  75. 0    belong&0377777777    042000410    OpenBSD/m68k4k pure
  76. >0    byte            &0x80        dynamically linked executable
  77. >0    byte            ^0x80        executable
  78. >16    belong            >0        not stripped
  79. 0    belong&0377777777    042000407    OpenBSD/m68k4k
  80. >0    byte            &0x80        dynamically linked executable
  81. >0    byte            ^0x80
  82. >>0    byte            &0x40        position independent
  83. >>20    belong            !0        executable
  84. >>20    belong            =0        object file
  85. >16    belong            >0        not stripped
  86. 0    belong&0377777777    042000507    OpenBSD/m68k4k core
  87. >12    string            >\0        from '%s'
  88.  
  89. 0    belong&0377777777    042200413    OpenBSD/ns32532 demand paged
  90. >0    byte            &0x80        
  91. >>20    lelong            <4096        shared library
  92. >>20    lelong            =4096        dynamically linked executable
  93. >>20    lelong            >4096        dynamically linked executable
  94. >0    byte            ^0x80        executable
  95. >16    lelong            >0        not stripped
  96. 0    belong&0377777777    042200410    OpenBSD/ns32532 pure
  97. >0    byte            &0x80        dynamically linked executable
  98. >0    byte            ^0x80        executable
  99. >16    lelong            >0        not stripped
  100. 0    belong&0377777777    042200407    OpenBSD/ns32532
  101. >0    byte            &0x80        dynamically linked executable
  102. >0    byte            ^0x80
  103. >>0    byte            &0x40        position independent
  104. >>20    lelong            !0        executable
  105. >>20    lelong            =0        object file
  106. >16    lelong            >0        not stripped
  107. 0    belong&0377777777    042200507    OpenBSD/ns32532 core
  108. >12    string            >\0        from '%s'
  109.  
  110. 0    belong&0377777777    042400413    OpenBSD/sparc demand paged
  111. >0    byte            &0x80        
  112. >>20    belong            <8192        shared library
  113. >>20    belong            =8192        dynamically linked executable
  114. >>20    belong            >8192        dynamically linked executable
  115. >0    byte            ^0x80        executable
  116. >16    belong            >0        not stripped
  117. 0    belong&0377777777    042400410    OpenBSD/sparc pure
  118. >0    byte            &0x80        dynamically linked executable
  119. >0    byte            ^0x80        executable
  120. >16    belong            >0        not stripped
  121. 0    belong&0377777777    042400407    OpenBSD/sparc
  122. >0    byte            &0x80        dynamically linked executable
  123. >0    byte            ^0x80
  124. >>0    byte            &0x40        position independent
  125. >>20    belong            !0        executable
  126. >>20    belong            =0        object file
  127. >16    belong            >0        not stripped
  128. 0    belong&0377777777    042400507    OpenBSD/sparc core
  129. >12    string            >\0        from '%s'
  130.  
  131. 0    belong&0377777777    042600413    OpenBSD/pmax demand paged
  132. >0    byte            &0x80        
  133. >>20    lelong            <4096        shared library
  134. >>20    lelong            =4096        dynamically linked executable
  135. >>20    lelong            >4096        dynamically linked executable
  136. >0    byte            ^0x80        executable
  137. >16    lelong            >0        not stripped
  138. 0    belong&0377777777    042600410    OpenBSD/pmax pure
  139. >0    byte            &0x80        dynamically linked executable
  140. >0    byte            ^0x80        executable
  141. >16    lelong            >0        not stripped
  142. 0    belong&0377777777    042600407    OpenBSD/pmax
  143. >0    byte            &0x80        dynamically linked executable
  144. >0    byte            ^0x80
  145. >>0    byte            &0x40        position independent
  146. >>20    lelong            !0        executable
  147. >>20    lelong            =0        object file
  148. >16    lelong            >0        not stripped
  149. 0    belong&0377777777    042600507    OpenBSD/pmax core
  150. >12    string            >\0        from '%s'
  151.  
  152. 0    belong&0377777777    043000413    OpenBSD/vax demand paged
  153. >0    byte            &0x80        
  154. >>20    lelong            <4096        shared library
  155. >>20    lelong            =4096        dynamically linked executable
  156. >>20    lelong            >4096        dynamically linked executable
  157. >0    byte            ^0x80        executable
  158. >16    lelong            >0        not stripped
  159. 0    belong&0377777777    043000410    OpenBSD/vax pure
  160. >0    byte            &0x80        dynamically linked executable
  161. >0    byte            ^0x80        executable
  162. >16    lelong            >0        not stripped
  163. 0    belong&0377777777    043000407    OpenBSD/vax
  164. >0    byte            &0x80        dynamically linked executable
  165. >0    byte            ^0x80
  166. >>0    byte            &0x40        position independent
  167. >>20    lelong            !0        executable
  168. >>20    lelong            =0        object file
  169. >16    lelong            >0        not stripped
  170. 0    belong&0377777777    043000507    OpenBSD/vax core
  171. >12    string            >\0        from '%s'
  172.  
  173. # OpenBSD/alpha does not support (and has never supported) a.out objects,
  174. # so no rules are provided for them.  OpenBSD/alpha ELF objects are 
  175. # dealt with in "elf".
  176. 0    leshort        0x00070185        ECOFF OpenBSD/alpha binary
  177. >10    leshort        0x0001            not stripped
  178. >10    leshort        0x0000            stripped
  179. 0    belong&0377777777    043200507    OpenBSD/alpha core
  180. >12    string            >\0        from '%s'
  181.  
  182. 0    belong&0377777777    043400413    OpenBSD/mips demand paged
  183. >0    byte            &0x80        
  184. >>20    belong            <8192        shared library
  185. >>20    belong            =8192        dynamically linked executable
  186. >>20    belong            >8192        dynamically linked executable
  187. >0    byte            ^0x80        executable
  188. >16    belong            >0        not stripped
  189. 0    belong&0377777777    043400410    OpenBSD/mips pure
  190. >0    byte            &0x80        dynamically linked executable
  191. >0    byte            ^0x80        executable
  192. >16    belong            >0        not stripped
  193. 0    belong&0377777777    043400407    OpenBSD/mips
  194. >0    byte            &0x80        dynamically linked executable
  195. >0    byte            ^0x80
  196. >>0    byte            &0x40        position independent
  197. >>20    belong            !0        executable
  198. >>20    belong            =0        object file
  199. >16    belong            >0        not stripped
  200. 0    belong&0377777777    043400507    OpenBSD/mips core
  201. >12    string            >\0        from '%s'
  202.  
  203. 0    belong&0377777777    043600413    OpenBSD/arm32 demand paged
  204. >0    byte            &0x80
  205. >>20    lelong            <8192        shared library
  206. >>20    lelong            =8192        dynamically linked executable
  207. >>20    lelong            >8192        dynamically linked executable
  208. >0    byte            ^0x80        executable
  209. >16    lelong            >0        not stripped
  210. 0    belong&0377777777    043600410    OpenBSD/arm32 pure
  211. >0    byte            &0x80        dynamically linked executable
  212. >0    byte            ^0x80        executable
  213. >16    lelong            >0        not stripped
  214. 0    belong&0377777777    043600407    OpenBSD/arm32
  215. >0    byte            &0x80        dynamically linked executable
  216. >0    byte            ^0x80
  217. >>0    byte            &0x40        position independent
  218. >>20    lelong            !0        executable
  219. >>20    lelong            =0        object file
  220. >16    lelong            >0        not stripped
  221. 0    belong&0377777777    043600507    OpenBSD/arm32 core
  222. >12    string            >\0        from '%s'
  223.  
  224. #------------------------------------------------------------------------------
  225. # alliant:  file(1) magic for Alliant FX series a.out files
  226. #
  227. # If the FX series is the one that had a processor with a 68K-derived
  228. # instruction set, the "short" should probably become "beshort" and the
  229. # "long" should probably become "belong".
  230. # If it's the i860-based one, they should probably become either the
  231. # big-endian or little-endian versions, depending on the mode they ran
  232. # the 860 in....
  233. #
  234. 0    short        0420        0420 Alliant virtual executable
  235. >2    short        &0x0020        common library
  236. >16    long        >0        not stripped
  237. 0    short        0421        0421 Alliant compact executable
  238. >2    short        &0x0020        common library
  239. >16    long        >0        not stripped
  240. #------------------------------------------------------------------------------
  241. # alpha architecture description
  242. #
  243.  
  244. 0    leshort        0603        COFF format alpha
  245. >22    leshort&030000    !020000        executable
  246. >24    leshort        0410        pure
  247. >24    leshort        0413        paged
  248. >22    leshort&020000    !0        dynamically linked
  249. >16    lelong        !0        not stripped
  250. >16    lelong        0        stripped
  251. >22    leshort&030000    020000        shared library
  252. >24    leshort        0407        object
  253. >27    byte        x        - version %d
  254. >26    byte        x        .%d
  255. >28    byte        x        -%d
  256.  
  257. # Basic recognition of Digital UNIX core dumps - Mike Bremford <mike@opac.bl.uk>
  258. #
  259. 0    string        Core\001    Alpha COFF format core dump (Digital UNIX)
  260. >24    string        >\0        \b, from '%s'
  261. #------------------------------------------------------------------------------
  262. # amanda:  file(1) magic for amanda file format
  263. #
  264. 0       string          AMANDA:\ TAPESTART\ DATE     AMANDA dump header file,
  265. >23     string          X
  266. >>25    string          >\                           Unused %s
  267. >23     string          >\                           DATE %s
  268. #------------------------------------------------------------------------------
  269. # amigaos:  file(1) magic for AmigaOS binary formats:
  270.  
  271. #
  272. # From ignatios@cs.uni-bonn.de (Ignatios Souvatzis)
  273. # Some formats are still missing: AmigaOS special IFF's, e.g.: FORM....CTLG
  274. # (the others should be seperate, anyway)
  275. #
  276. 0    belong        0x000003f3    AmigaOS loadseg()ble executable/binary
  277. 0    belong        0x000003e7    AmigaOS object/library data
  278.  
  279. #------------------------------------------------------------------------------
  280. # animation:  file(1) magic for animation/movie formats
  281. #
  282. # animation formats
  283. # MPEG, FLI, DL originally from vax@ccwf.cc.utexas.edu (VaX#n8)
  284. # FLC, SGI, Apple originally from Daniel Quinlan (quinlan@yggdrasil.com)
  285.  
  286. # MPEG animation format
  287. 0    string        \000\000\001\263    MPEG file
  288.  
  289. # FLI animation format
  290. 4    leshort        0xAF11            FLI file
  291. >6    leshort        x            - %d frames,
  292. >8    leshort        x            width=%d pixels,
  293. >10    leshort        x            height=%d pixels,
  294. >12    leshort        x            depth=%d,
  295. >16    leshort        x            ticks/frame=%d
  296. # FLC animation format
  297. 4    leshort        0xAF12            FLC file
  298. >6    leshort        x            - %d frames
  299. >8    leshort        x            width=%d pixels,
  300. >10    leshort        x            height=%d pixels,
  301. >12    leshort        x            depth=%d,
  302. >16    leshort        x            ticks/frame=%d
  303.  
  304. # DL animation format
  305. # XXX - collision with most `mips' magic
  306. #
  307. # I couldn't find a real magic number for these, however, this
  308. # -appears- to work.  Note that it might catch other files, too, so be
  309. # careful!
  310. #
  311. # Note that title and author appear in the two 20-byte chunks
  312. # at decimal offsets 2 and 22, respectively, but they are XOR'ed with
  313. # 255 (hex FF)!  The DL format is really bad.
  314. #
  315. #0    byte    1    DL version 1, medium format (160x100, 4 images/screen)
  316. #>42    byte    x    - %d screens,
  317. #>43    byte    x    %d commands
  318. #0    byte    2    DL version 2
  319. #>1    byte    1    - large format (320x200,1 image/screen),
  320. #>1    byte    2    - medium format (160x100,4 images/screen),
  321. #>1    byte    >2    - unknown format,
  322. #>42    byte    x    %d screens,
  323. #>43    byte    x    %d commands
  324. # Based on empirical evidence, DL version 3 have several nulls following the
  325. # \003.  Most of them start with non-null values at hex offset 0x34 or so.
  326. #0    string    \3\0\0\0\0\0\0\0\0\0\0\0    DL version 3
  327.  
  328. # SGI and Apple formats
  329. 0    string        MOVI        Silicon Graphics movie file
  330. 4    string        moov        Apple QuickTime movie file (moov)
  331. 4    string        mdat        Apple QuickTime movie file (mdat)
  332.  
  333. #------------------------------------------------------------------------------
  334. # apl:  file(1) magic for APL (see also "pdp" and "vax" for other APL
  335. #       workspaces)
  336. #
  337. 0    long        0100554        APL workspace (Ken's original?)
  338.  
  339. #------------------------------------------------------------------------------
  340. # apple:  file(1) magic for Apple II file formats
  341. #
  342. 0    string        FiLeStArTfIlEsTaRt    binscii (apple ][) text
  343. 0    string        \x0aGL            Binary II (apple ][) data
  344. 0    string        \x76\xff        Squeezed (apple ][) data
  345. 0    string        N\365F\351l\345        NuFile archive (apple ][) data
  346. # apple: PEF
  347. 0    string        Joy!            CFM binary
  348.  
  349. #------------------------------------------------------------------------------
  350. # archive:  file(1) magic for archive formats (see also "msdos" for self-
  351. #           extracting compressed archives)
  352. #
  353. # cpio, ar, arc, arj, hpack, lha/lharc, rar, squish, uc2, zip, zoo, etc.
  354. # pre-POSIX "tar" archives are handled in the C code.
  355.  
  356. # POSIX tar archives
  357. 257    string        ustar\0        POSIX tar archive
  358. 257    string        ustar\040\040\0    GNU tar archive
  359.  
  360. # cpio archives
  361. #
  362. # Yes, the top two "cpio archive" formats *are* supposed to just be "short".
  363. # The idea is to indicate archives produced on machines with the same
  364. # byte order as the machine running "file" with "cpio archive", and
  365. # to indicate archives produced on machines with the opposite byte order
  366. # from the machine running "file" with "byte-swapped cpio archive".
  367. #
  368. # The SVR4 "cpio(4)" hints that there are additional formats, but they
  369. # are defined as "short"s; I think all the new formats are
  370. # character-header formats and thus are strings, not numbers.
  371. 0    short        070707        cpio archive
  372. 0    short        0143561        byte-swapped cpio archive
  373. 0    string        070707        ASCII cpio archive (pre-SVR4 or odc)
  374. 0    string        070701        ASCII cpio archive (SVR4 with no CRC)
  375. 0    string        070702        ASCII cpio archive (SVR4 with CRC)
  376.  
  377. # other archives
  378. 0    long        0177555        very old archive
  379. 0    short        0177555        very old PDP-11 archive
  380. 0    long        0177545        old archive
  381. 0    short        0177545        old PDP-11 archive
  382. 0    long        0100554        apl workspace
  383. 0    string        =<ar>        archive
  384.  
  385. # MIPS archive (needs to go first)
  386. #
  387. 0    string    !<arch>\n__________E    MIPS archive
  388. >20    string    U            with MIPS Ucode members
  389. >21    string    L            with MIPSEL members
  390. >21    string    B            with MIPSEB members
  391. >19    string    L            and an EL hash table
  392. >19    string    B            and an EB hash table
  393. >22    string    X            -- out of date
  394.  
  395. 0    string        -h-        Software Tools format archive text
  396.  
  397. #
  398. # XXX - why are there multiple <ar> thingies?  Note that 0x213c6172 is
  399. # "!<ar", so, for new-style (4.xBSD/SVR2andup) archives, we have:
  400. #
  401. # 0    string        !<arch>        current ar archive
  402. # 0    long        0x213c6172    archive file
  403. #
  404. # and for SVR1 archives, we have:
  405. #
  406. # 0    string        \<ar>        System V Release 1 ar archive
  407. # 0    string        =<ar>        archive
  408. #
  409. # XXX - did Aegis really store shared libraries, breakpointed modules,
  410. # and absolute code program modules in the same format as new-style
  411. # "ar" archives?
  412. #
  413. 0    string        !<arch>        current ar archive
  414. >8    string        __.SYMDEF    random library
  415. >8    string        debian-split    part of multipart Debian package
  416. >8    string        debian-binary    Debian binary package
  417. >0    belong        =65538        - pre SR9.5
  418. >0    belong        =65539        - post SR9.5
  419. >0    beshort        2        - object archive
  420. >0    beshort        3        - shared library module
  421. >0    beshort        4        - debug break-pointed module
  422. >0    beshort        5        - absolute code program module
  423. 0    string        \<ar>        System V Release 1 ar archive
  424. 0    string        =<ar>        archive
  425. #
  426. # XXX - from "vax", which appears to collect a bunch of byte-swapped
  427. # thingies, to help you recognize VAX files on big-endian machines;
  428. # with "leshort", "lelong", and "string", that's no longer necessary....
  429. #
  430. 0    belong        0x65ff0000    VAX 3.0 archive
  431. 0    belong        0x3c61723e    VAX 5.0 archive
  432. #
  433. 0    long        0x213c6172    archive file
  434. 0    lelong        0177555        very old VAX archive
  435. 0    leshort        0177555        very old PDP-11 archive
  436. #
  437. # XXX - "pdp" claims that 0177545 can have an __.SYMDEF member and thus
  438. # be a random library (it said 0xff65 rather than 0177545).
  439. #
  440. 0    lelong        0177545        old VAX archive
  441. >8    string        __.SYMDEF    random library
  442. 0    leshort        0177545        old PDP-11 archive
  443. >8    string        __.SYMDEF    random library
  444. #
  445. # From "pdp" (but why a 4-byte quantity?)
  446. #
  447. 0    lelong        0x39bed        PDP-11 old archive
  448. 0    lelong        0x39bee        PDP-11 4.0 archive
  449.  
  450. # ARC archiver, from Daniel Quinlan (quinlan@yggdrasil.com)
  451. #
  452. # The first byte is the magic (0x1a), byte 2 is the compression type for
  453. # the first file (0x01 through 0x09), and bytes 3 to 15 are the MS-DOS
  454. # filename of the first file (null terminated).  Since some types collide
  455. # we only test some types on basis of frequency: 0x08 (83%), 0x09 (5%),
  456. # 0x02 (5%), 0x03 (3%), 0x04 (2%), 0x06 (2%).  0x01 collides with terminfo.
  457. 0    lelong&0x8080ffff    0x0000081a    ARC archive data, dynamic LZW
  458. 0    lelong&0x8080ffff    0x0000091a    ARC archive data, squashed
  459. 0    lelong&0x8080ffff    0x0000021a    ARC archive data, uncompressed
  460. 0    lelong&0x8080ffff    0x0000031a    ARC archive data, packed
  461. 0    lelong&0x8080ffff    0x0000041a    ARC archive data, squeezed
  462. 0    lelong&0x8080ffff    0x0000061a    ARC archive data, crunched
  463.  
  464. # Acorn archive formats (Disaster prone simpleton, m91dps@ecs.ox.ac.uk)
  465. # I can't create either SPARK or ArcFS archives so I have not tested this stuff
  466. # [GRR:  the original entries collide with ARC, above; replaced with combined
  467. #  version (not tested)]
  468. #0    byte        0x1a        RISC OS archive
  469. #>1    string        archive        (ArcFS format)
  470. 0    string        \032archive    RISC OS archive (ArcFS format)
  471.  
  472. # ARJ archiver (jason@jarthur.Claremont.EDU)
  473. 0    leshort        0xea60        ARJ archive data
  474. >5    byte        x        \b, v%d,
  475. >8    byte        &0x04        multi-volume,
  476. >8    byte        &0x10        slash-switched,
  477. >8    byte        &0x20        backup,
  478. >34    string        x        original name: %s,
  479. >7    byte        0        os: MS-DOS
  480. >7    byte        1        os: PRIMOS
  481. >7    byte        2        os: Unix
  482. >7    byte        3        os: Amiga
  483. >7    byte        4        os: Macintosh
  484. >7    byte        5        os: OS/2
  485. >7    byte        6        os: Apple ][ GS
  486. >7    byte        7        os: Atari ST
  487. >7    byte        8        os: NeXT
  488. >7    byte        9        os: VAX/VMS
  489. >3    byte        >0        %d]
  490.  
  491. # HA archiver (Greg Roelofs, newt@uchicago.edu)
  492. # This is a really bad format. A file containing HAWAII will match this...
  493. #0    string        HA        HA archive data,
  494. #>2    leshort        =1        1 file,
  495. #>2    leshort        >1        %u files,
  496. #>4    byte&0x0f    =0        first is type CPY
  497. #>4    byte&0x0f    =1        first is type ASC
  498. #>4    byte&0x0f    =2        first is type HSC
  499. #>4    byte&0x0f    =0x0e        first is type DIR
  500. #>4    byte&0x0f    =0x0f        first is type SPECIAL
  501.  
  502. # HPACK archiver (Peter Gutmann, pgut1@cs.aukuni.ac.nz)
  503. 0    string        HPAK        HPACK archive data
  504.  
  505. # JAM Archive volume format, by Dmitry.Kohmanyuk@UA.net
  506. 0    string        \351,\001JAM\        JAM archive,
  507. >7    string        >\0            version %.4s
  508. >0x26    byte        =0x27            -
  509. >>0x2b    string          >\0            label %.11s,
  510. >>0x27    lelong        x            serial %08x,
  511. >>0x36    string        >\0            fstype %.8s
  512.  
  513. # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
  514. 2    string        -lh0-        LHarc 1.x archive data [lh0]
  515. 2    string        -lh1-        LHarc 1.x archive data [lh1]
  516. 2    string        -lz4-        LHarc 1.x archive data [lz4]
  517. 2    string        -lz5-        LHarc 1.x archive data [lz5]
  518. #    [never seen any but the last; -lh4- reported in comp.compression:]
  519. 2    string        -lzs-        LHa 2.x? archive data [lzs]
  520. 2    string        -lh -        LHa 2.x? archive data [lh ]
  521. 2    string        -lhd-        LHa 2.x? archive data [lhd]
  522. 2    string        -lh2-        LHa 2.x? archive data [lh2]
  523. 2    string        -lh3-        LHa 2.x? archive data [lh3]
  524. 2    string        -lh4-        LHa (2.x) archive data [lh4]
  525. 2    string        -lh5-        LHa (2.x) archive data [lh5]
  526. >20    byte        x        - header level %d
  527.  
  528. # RAR archiver (Greg Roelofs, newt@uchicago.edu)
  529. 0    string        Rar!        RAR archive data
  530.  
  531. # SQUISH archiver (Greg Roelofs, newt@uchicago.edu)
  532. 0    string        SQSH        squished archive data (Acorn RISCOS)
  533.  
  534. # UC2 archiver (Greg Roelofs, newt@uchicago.edu)
  535. # I can't figure out the self-extracting form of these buggers...
  536. 0    string        UC2\x1a        UC2 archive data
  537.  
  538. # ZIP archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu)
  539. 0    string        PK\003\004    Zip archive data
  540. >4    byte        0x09        \b, at least v0.9 to extract
  541. >4    byte        0x0a        \b, at least v1.0 to extract
  542. >4    byte        0x0b        \b, at least v1.1 to extract
  543. >4    byte        0x14        \b, at least v2.0 to extract
  544.  
  545. # Zoo archiver
  546. 20    lelong        0xfdc4a7dc    Zoo archive data
  547. >4    byte        >48        \b, v%c.
  548. >>6    byte        >47        \b%c
  549. >>>7    byte        >47        \b%c
  550. >32    byte        >0        \b, modify: v%d
  551. >>33    byte        x        \b.%d+
  552. >42    lelong        0xfdc4a7dc    \b,
  553. >>70    byte        >0        extract: v%d
  554. >>>71    byte        x        \b.%d+
  555.  
  556. # Shell archives
  557. 10    string        #\ This\ is\ a\ shell\ archive    shell archive text
  558.  
  559. #------------------------------------------------------------------------------
  560. # asterix:  file(1) magic for Aster*x; SunOS 5.5.1 gave the 4-character
  561. # strings as "long" - we assume they're just strings:
  562. # From: guy@netapp.com (Guy Harris)
  563. #
  564. 0    string        *STA        Aster*x
  565. >7    string        WORD            Words Document
  566. >7    string        GRAP            Graphic
  567. >7    string        SPRE            Spreadsheet
  568. >7    string        MACR            Macro
  569. 0    string        2278        Aster*x Version 2
  570. >29    byte        0x36            Words Document
  571. >29    byte        0x35            Graphic
  572. >29    byte        0x32            Spreadsheet
  573. >29    byte        0x38            Macro
  574.  
  575.  
  576. #------------------------------------------------------------------------------
  577. # att3b:  file(1) magic for AT&T 3B machines
  578. #
  579. # The `versions' should be un-commented if they work for you.
  580. # (Was the problem just one of endianness?)
  581. #
  582. # 3B20
  583. #
  584. 0    beshort        0550        3b20 COFF executable
  585. >12    belong        >0        not stripped
  586. #>22    beshort        >0        - version %ld
  587. 0    beshort        0551        3b20 COFF executable (TV)
  588. >12    belong        >0        not stripped
  589. #>22    beshort        >0        - version %ld
  590. #
  591. # WE32K
  592. #
  593. 0    beshort        0560        WE32000 COFF
  594. >18    beshort        ^00000020    object
  595. >18    beshort        &00000020    executable
  596. >12    belong        >0        not stripped
  597. >18    beshort        ^00010000    N/A on 3b2/300 w/paging
  598. >18    beshort        &00020000    32100 required
  599. >18    beshort        &00040000    and MAU hardware required
  600. >20    beshort        0407        (impure)
  601. >20    beshort        0410        (pure)
  602. >20    beshort        0413        (demand paged)
  603. >20    beshort        0443        (target shared library)
  604. >22    beshort        >0        - version %ld
  605. 0    beshort        0561        WE32000 COFF executable (TV)
  606. >12    belong        >0        not stripped
  607. #>18    beshort        &00020000    - 32100 required
  608. #>18    beshort        &00040000    and MAU hardware required
  609. #>22    beshort        >0        - version %ld
  610. #
  611. # core file for 3b2 
  612. 0    string        \000\004\036\212\200    3b2 core file
  613. >364    string        >\0        of '%s'
  614.  
  615. #------------------------------------------------------------------------------
  616. # audio:  file(1) magic for sound formats (see also "iff")
  617. #
  618. # Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
  619. # and others
  620. #
  621.  
  622. # Sun/NeXT audio data
  623. 0    string        .snd        Sun/NeXT audio data:
  624. >12    belong        1        8-bit ISDN u-law,
  625. >12    belong        2        8-bit linear PCM [REF-PCM],
  626. >12    belong        3        16-bit linear PCM,
  627. >12    belong        4        24-bit linear PCM,
  628. >12    belong        5        32-bit linear PCM,
  629. >12    belong        6        32-bit IEEE floating point,
  630. >12    belong        7        64-bit IEEE floating point,
  631. >12    belong        23        8-bit ISDN u-law compressed (CCITT G.721 ADPCM voice data encoding),
  632. >12    belong        24        compressed (8-bit G.722 ADPCM)
  633. >12    belong        25        compressed (3-bit G.723 ADPCM),
  634. >12    belong        26        compressed (5-bit G.723 ADPCM),
  635. >12    belong        27        8-bit A-law,
  636. >20    belong        1        mono,
  637. >20    belong        2        stereo,
  638. >20    belong        4        quad,
  639. >16    belong        >0        %d Hz
  640.  
  641. # DEC systems (e.g. DECstation 5000) use a variant of the Sun/NeXT format
  642. # that uses little-endian encoding and has a different magic number
  643. 0    lelong        0x0064732E    DEC audio data:
  644. >12    lelong        1        8-bit ISDN u-law,
  645. >12    lelong        2        8-bit linear PCM [REF-PCM],
  646. >12    lelong        3        16-bit linear PCM,
  647. >12    lelong        4        24-bit linear PCM,
  648. >12    lelong        5        32-bit linear PCM,
  649. >12    lelong        6        32-bit IEEE floating point,
  650. >12    lelong        7        64-bit IEEE floating point,
  651. >12    lelong        23        8-bit ISDN u-law compressed (CCITT G.721 ADPCM voice data encoding),
  652. >20    lelong        1        mono,
  653. >20    lelong        2        stereo,
  654. >20    lelong        4        quad,
  655. >16    lelong        >0        %d Hz
  656.  
  657. # Creative Labs AUDIO stuff
  658. 0    string    MThd            Standard MIDI data
  659. >9     byte    >0            (format %d)
  660. >11    byte    >1            using %d channels
  661. 0    string    CTMF            Creative Music (CMF) data
  662. 0    string    SBI            SoundBlaster instrument data
  663. 0    string    Creative\ Voice\ File    Creative Labs voice data
  664. # is this next line right?  it came this way...
  665. >19    byte    0x1A
  666. >23    byte    >0            - version %d
  667. >22    byte    >0            \b.%d
  668.  
  669. # first entry is also the string "NTRK"
  670. 0    belong        0x4e54524b    MultiTrack sound data
  671. >4    belong        x        - version %ld
  672.  
  673. # Microsoft WAVE format (*.wav)
  674. 0    string        RIFF        Microsoft RIFF
  675. >8    string        WAVE        \b, WAVE audio data
  676. >>34    leshort        >0        \b, %d bit
  677. >>22    leshort        =1        \b, mono
  678. >>22    leshort        =2        \b, stereo
  679. >>22    leshort        >2        \b, %d channels
  680. >>24    lelong        >0        %d Hz
  681. # AVI == Audio Video Interleave
  682. >8    string        AVI\        \b, AVI data
  683.  
  684. # Extended MOD format (*.emd) (Greg Roelofs, newt@uchicago.edu); NOT TESTED
  685. # [based on posting 940824 by "Dirk/Elastik", husberg@lehtori.cc.tut.fi]
  686. 0    string        EMOD        Extended MOD sound data,
  687. >4    byte&0xf0    x        version %d
  688. >4    byte&0x0f    x        \b.%d,
  689. >45    byte        x        %d instruments
  690. >83    byte        0        (module)
  691. >83    byte        1        (song)
  692.  
  693. # Real Audio (Magic .ra\0375)
  694. 0    belong        0x2e7261fd    realaudio sound file
  695.  
  696. # MTM/669/FAR/S3M/ULT/XM format checking [Aaron Eppert, aeppert@dialin.ind.net]
  697. # Oct 31, 1995
  698. 0    string        MTM        MultiTracker Module sound file
  699. 0    string        if        Composer 669 Module sound data
  700. 0    string        FAR        Module sound data
  701. 0    string        MAS_U        ULT(imate) Module sound data
  702. 0x2c    string        SCRM        ScreamTracker III Module sound data
  703. 0    string        Extended Module    Extended Module sound data
  704.  
  705. #------------------------------------------------------------------------------
  706. # blit:  file(1) magic for 68K Blit stuff as seen from 680x0 machine
  707. #
  708. # Note that this 0407 conflicts with several other a.out formats...
  709. #
  710. # XXX - should this be redone with "be" and "le", so that it works on
  711. # little-endian machines as well?  If so, what's the deal with
  712. # "VAX-order" and "VAX-order2"?
  713. #
  714. #0    long        0407        68K Blit (standalone) executable
  715. #0    short        0407        VAX-order2 68K Blit (standalone) executable
  716. 0    short        03401        VAX-order 68K Blit (standalone) executable
  717. 0    long        0406        68k Blit mpx/mux executable
  718. 0    short        0406        VAX-order2 68k Blit mpx/mux executable
  719. 0    short        03001        VAX-order 68k Blit mpx/mux executable
  720. # Need more values for WE32 DMD executables.
  721. # Note that 0520 is the same as COFF
  722. #0    short        0520        tty630 layers executable
  723.  
  724. #------------------------------------------------------------------------------
  725. # bsdi:  file(1) magic for BSD/OS (from BSDI) objects
  726. #
  727. 0    lelong            000000314    BSD/OS i386 compact demand paged executable
  728. >16    lelong            >0        not stripped
  729. >32    byte            0x6a        (uses shared libs)
  730.  
  731. #------------------------------------------------------------------------------
  732. # c-lang:  file(1) magic for C programs (or REXX)
  733. #
  734.  
  735. # XPM icons (Greg Roelofs, newt@uchicago.edu)
  736. # if you uncomment "/*" for C/REXX below, also uncomment this entry
  737. #0    string        /*\ XPM\ */    X pixmap image data
  738.  
  739. # this first will upset you if you're a PL/1 shop...
  740. # in which case rm it; ascmagic will catch real C programs
  741. #0    string        /*        C or REXX program text
  742. 0    string        //        C++ program text
  743.  
  744. #------------------------------------------------------------------------------
  745. # chi:  file(1) magic for ChiWriter files
  746. #
  747. 0       string          \\1cw\          ChiWriter file
  748. >5      string          >\0             version %s
  749. 0       string          \\1cw           ChiWriter file
  750.  
  751. #------------------------------------------------------------------------------
  752. # clipper:  file(1) magic for Intergraph (formerly Fairchild) Clipper.
  753. #
  754. # XXX - what byte order does the Clipper use?
  755. #
  756. # XXX - what's the "!" stuff:
  757. #
  758. # >18    short        !074000,000000    C1 R1 
  759. # >18    short        !074000,004000    C2 R1
  760. # >18    short        !074000,010000    C3 R1
  761. # >18    short        !074000,074000    TEST
  762. #
  763. # I shall assume it's ANDing the field with the first value and
  764. # comparing it with the second, and rewrite it as:
  765. #
  766. # >18    short&074000    000000        C1 R1 
  767. # >18    short&074000    004000        C2 R1
  768. # >18    short&074000    010000        C3 R1
  769. # >18    short&074000    074000        TEST
  770. #
  771. # as SVR3.1's "file" doesn't support anything of the "!074000,000000"
  772. # sort, nor does SunOS 4.x, so either it's something Intergraph added
  773. # in CLIX, or something AT&T added in SVR3.2 or later, or something
  774. # somebody else thought was a good idea; it's not documented in the
  775. # man page for this version of "magic", nor does it appear to be
  776. # implemented (at least not after I blew off the bogus code to turn
  777. # old-style "&"s into new-style "&"s, which just didn't work at all).
  778. #
  779. 0    short        0575        CLIPPER COFF executable (VAX #)
  780. >20    short        0407        (impure)
  781. >20    short        0410        (5.2 compatible)
  782. >20    short        0411        (pure)
  783. >20    short        0413        (demand paged)
  784. >20    short        0443        (target shared library)
  785. >12    long        >0        not stripped
  786. >22    short        >0        - version %ld
  787. 0    short        0577        CLIPPER COFF executable
  788. >18    short&074000    000000        C1 R1 
  789. >18    short&074000    004000        C2 R1
  790. >18    short&074000    010000        C3 R1
  791. >18    short&074000    074000        TEST
  792. >20    short        0407        (impure)
  793. >20    short        0410        (pure)
  794. >20    short        0411        (separate I&D)
  795. >20    short        0413        (paged)
  796. >20    short        0443        (target shared library)
  797. >12    long        >0        not stripped
  798. >22    short        >0        - version %ld
  799. >48    long&01        01        alignment trap enabled
  800. >52    byte        1        -Ctnc
  801. >52    byte        2        -Ctsw
  802. >52    byte        3        -Ctpw
  803. >52    byte        4        -Ctcb
  804. >53    byte        1        -Cdnc
  805. >53    byte        2        -Cdsw
  806. >53    byte        3        -Cdpw
  807. >53    byte        4        -Cdcb
  808. >54    byte        1        -Csnc
  809. >54    byte        2        -Cssw
  810. >54    byte        3        -Cspw
  811. >54    byte        4        -Cscb
  812. 4    string        pipe        CLIPPER instruction trace
  813. 4    string        prof        CLIPPER instruction profile
  814.  
  815. #------------------------------------------------------------------------------
  816. # commands:  file(1) magic for various shells and interpreters
  817. #
  818. 0    string        :\ shell archive or commands for antique kernel text
  819. 0    string        #!/bin/sh        Bourne shell script text
  820. 0    string        #!\ /bin/sh        Bourne shell script text
  821. 0    string        #!/bin/csh        C shell script text
  822. 0    string        #!\ /bin/csh        C shell script text
  823. # korn shell magic, sent by George Wu, gwu@clyde.att.com
  824. 0    string        #!/bin/ksh        Korn shell script text
  825. 0    string        #!\ /bin/ksh        Korn shell script text
  826. 0    string         #!/bin/tcsh        Tenex C shell script text
  827. 0    string         #!\ /bin/tcsh        Tenex C shell script text
  828. 0    string        #!/usr/local/tcsh    Tenex C shell script text
  829. 0    string         #!\ /usr/local/tcsh    Tenex C shell script text
  830. 0    string        #!/usr/local/bin/tcsh    Tenex C shell script text
  831. 0    string        #!\ /usr/local/bin/tcsh    Tenex C shell script text
  832. #
  833. # zsh/ash/ae/nawk/gawk magic from cameron@cs.unsw.oz.au (Cameron Simpson)
  834. 0    string        #!/usr/local/bin/zsh    Paul Falstad's zsh
  835. 0    string        #!\ /usr/local/bin/zsh    Paul Falstad's zsh
  836. 0    string        #!/usr/local/bin/ash    Neil Brown's ash
  837. 0    string        #!\ /usr/local/bin/ash    Neil Brown's ash
  838. 0    string        #!/usr/local/bin/ae    Neil Brown's ae
  839. 0    string        #!\ /usr/local/bin/ae    Neil Brown's ae
  840. 0    string        #!/bin/nawk        new awk script text
  841. 0    string        #!\ /bin/nawk        new awk script text
  842. 0    string        #!/usr/bin/nawk        new awk script text
  843. 0    string        #!\ /usr/bin/nawk    new awk script text
  844. 0    string        #!/usr/local/bin/nawk    new awk script text
  845. 0    string        #!\ /usr/local/bin/nawk    new awk script text
  846. 0    string        #!/bin/gawk        GNU awk script text
  847. 0    string        #!\ /bin/gawk        GNU awk script text
  848. 0    string        #!/usr/bin/gawk        GNU awk script text
  849. 0    string        #!\ /usr/bin/gawk    GNU awk script text
  850. 0    string        #!/usr/local/bin/gawk    GNU awk script text
  851. 0    string        #!\ /usr/local/bin/gawk    GNU awk script text
  852. #
  853. 0    string        #!/bin/awk        awk commands text
  854. 0    string        #!\ /bin/awk        awk commands text
  855. 0    string        #!/usr/bin/awk        awk commands text
  856. 0    string        #!\ /usr/bin/awk    awk commands text
  857. 0    string        BEGIN            awk commands text
  858.  
  859. # For Larry Wall's perl language.  The ``eval'' line recognizes an
  860. # outrageously clever hack for USG systems.
  861. #                Keith Waclena <keith@cerberus.uchicago.edu>
  862. 0    string        #!/bin/perl            perl commands text
  863. 0    string        #!\ /bin/perl            perl commands text
  864. 0    string        eval\ "exec\ /bin/perl        perl commands text
  865. 0    string        #!/usr/bin/perl            perl commands text
  866. 0    string        #!\ /usr/bin/perl        perl commands text
  867. 0    string        eval\ "exec\ /usr/bin/perl    perl commands text
  868. 0    string        #!/usr/local/bin/perl        perl commands text
  869. 0    string        #!\ /usr/local/bin/perl        perl commands text
  870. 0    string        eval\ "exec\ /usr/local/bin/perl    perl commands text
  871.  
  872. # AT&T Bell Labs' Plan 9 shell
  873. 0    string        #!/bin/rc    Plan 9 rc shell script text
  874. 0    string        #!\ /bin/rc    Plan 9 rc shell script text
  875.  
  876. # bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de)
  877. 0    string        #!/bin/bash    Bourne-Again shell script text
  878. 0    string        #!\ /bin/bash    Bourne-Again shell script text
  879. 0    string        #!/usr/local/bin/bash    Bourne-Again shell script text
  880. 0    string        #!\ /usr/local/bin/bash    Bourne-Again shell script text
  881.  
  882. # generic shell magic
  883. 0    string        #!\ /            a
  884. >3    string        >\0            %s script text
  885. 0    string        #!/            a
  886. >2    string        >\0            %s script text
  887. 0    string        #!\             commands text
  888. >3    string        >\0            for %s
  889.  
  890. #------------------------------------------------------------------------------
  891. # compress:  file(1) magic for pure-compression formats (no archives)
  892. #
  893. # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc.
  894. #
  895. # Formats for various forms of compressed data
  896. # Formats for "compress" proper have been moved into "compress.c",
  897. # because it tries to uncompress it to figure out what's inside.
  898.  
  899. # standard unix compress
  900. 0    string        \037\235    compress'd data
  901. >2    byte&0x80    >0        block compressed
  902. >2    byte&0x1f    x        %d bits
  903.  
  904. # gzip (GNU zip, not to be confused with Info-ZIP or PKWARE zip archiver)
  905. 0       string          \037\213        gzip compressed data
  906. >2      byte            <8              \b, reserved method,
  907. >2      byte            8               \b, deflated,
  908. >3    byte        &0x01        ASCII,
  909. >3    byte        &0x02        continuation,
  910. >3    byte        &0x04        extra field,
  911. >3    byte        &0x08        original filename,
  912. >3    byte        &0x10        comment,
  913. >3    byte        &0x20        encrypted,
  914. >4    ledate        x        last modified: %s,
  915. >8    byte        2        max compression,
  916. >8    byte        4        max speed,
  917. >9    byte        =0x00        os: MS-DOS
  918. >9    byte        =0x01        os: Amiga
  919. >9    byte        =0x02        os: VMS
  920. >9    byte        =0x03        os: Unix
  921. >9    byte        =0x05        os: Atari
  922. >9    byte        =0x06        os: OS/2
  923. >9    byte        =0x07        os: MacOS
  924. >9    byte        =0x0A        os: Tops/20
  925. >9    byte        =0x0B        os: Win/32
  926.  
  927. # packed data, Huffman (minimum redundancy) codes on a byte-by-byte basis
  928. 0    string        \037\036    packed data
  929. >2    belong        >1        \b, %d characters originally
  930. >2    belong        =1        \b, %d character originally
  931. #
  932. # This magic number is byte-order-independent.  XXX - Does that mean this
  933. # is big-endian, little-endian, either, or that you can't tell?
  934. # this short is valid for SunOS
  935. 0    short        017437        old packed data
  936.  
  937. # XXX - why *two* entries for "compacted data", one of which is
  938. # byte-order independent, and one of which is byte-order dependent?
  939. #
  940. 0    short        0x1fff        compacted data
  941. # This string is valid for SunOS (BE) and a matching "short" is listed
  942. # in the Ultrix (LE) magic file.
  943. 0    string        \377\037    compacted data
  944. 0    short        0145405        huf output
  945.  
  946. # Squeeze and Crunch...
  947. # These numbers were gleaned from the Unix versions of the programs to
  948. # handle these formats.  Note that I can only uncrunch, not crunch, and
  949. # I didn't have a crunched file handy, so the crunch number is untested.
  950. #                Keith Waclena <keith@cerberus.uchicago.edu>
  951. 0    leshort        0x76FF        squeezed data (CP/M, DOS)
  952. 0    leshort        0x76FE        crunched data (CP/M, DOS)
  953.  
  954. # Freeze
  955. 0    string        \037\237    frozen file 2.1
  956. 0    string        \037\236    frozen file 1.0 (or gzip 0.5)
  957.  
  958. # SCO compress -H (LZH)
  959. 0    string        \037\240    SCO compress -H (LZH) data
  960.  
  961. # European GSM 06.10 is a provisional standard for full-rate speech
  962. # transcoding, prI-ETS 300 036, which uses RPE/LTP (residual pulse
  963. # excitation/long term prediction) coding at 13 kbit/s.
  964. #
  965. # There's only a magic nibble (4 bits); that nibble repeats every 33
  966. # bytes.  This isn't suited for use, but maybe we can use it someday.
  967. #
  968. # This will cause very short GSM files to be declared as data and
  969. # mismatches to be declared as data too!
  970. #0    byte&0xF0    0xd0        data
  971. #>33    byte&0xF0    0xd0
  972. #>66    byte&0xF0    0xd0
  973. #>99    byte&0xF0    0xd0
  974. #>132    byte&0xF0    0xd0        GSM 06.10 compressed audio
  975.  
  976. # Bzip from ulmo@Q.Net
  977. 0    string        BZ        bzip compressed    data,
  978. >2    byte        x        format v. %c,
  979. >3    byte        x        block size indicator %c
  980.  
  981. #------------------------------------------------------------------------------
  982. # convex:  file(1) magic for Convex boxes
  983. #
  984. # Convexes are big-endian.
  985. #
  986. # /*\
  987. #  * Below are the magic numbers and tests added for Convex.
  988. #  * Added at beginning, because they are expected to be used most.
  989. # \*/
  990. 0    belong    0507    Convex old-style object
  991. >16    belong    >0    not stripped
  992. 0    belong    0513    Convex old-style demand paged executable
  993. >16    belong    >0    not stripped
  994. 0    belong    0515    Convex old-style pre-paged executable
  995. >16    belong    >0    not stripped
  996. 0    belong    0517    Convex old-style pre-paged, non-swapped executable
  997. >16    belong    >0    not stripped
  998. 0    belong    0x011257    Core file
  999. #
  1000. # The following are a series of dump format magic numbers.  Each one
  1001. # corresponds to a drastically different dump format.  The first on is
  1002. # the original dump format on a 4.1 BSD or earlier file system.  The
  1003. # second marks the change between the 4.1 file system and the 4.2 file
  1004. # system.  The Third marks the changing of the block size from 1K
  1005. # to 2K to be compatible with an IDC file system.  The fourth indicates
  1006. # a dump that is dependent on Convex Storage Manager, because data in
  1007. # secondary storage is not physically contained within the dump.
  1008. # The restore program uses these number to determine how the data is
  1009. # to be extracted.
  1010. #
  1011. 24    belong    =60011    dump format, 4.1 BSD or earlier
  1012. 24    belong    =60012    dump format, 4.2 or 4.3 BSD without IDC
  1013. 24    belong    =60013    dump format, 4.2 or 4.3 BSD (IDC compatible)
  1014. 24    belong    =60014    dump format, Convex Storage Manager by-reference dump
  1015. #
  1016. # what follows is a bunch of bit-mask checks on the flags field of the opthdr.
  1017. # If there is no `=' sign, assume just checking for whether the bit is set?
  1018. #
  1019. 0    belong    0601        Convex SOFF
  1020. >88    belong&0x000f0000    =0x00000000    c1
  1021. >88    belong            &0x00010000    c2
  1022. >88    belong            &0x00020000    c2mp
  1023. >88    belong            &0x00040000    parallel
  1024. >88    belong            &0x00080000    intrinsic
  1025. >88    belong            &0x00000001    demand paged
  1026. >88    belong            &0x00000002    pre-paged
  1027. >88    belong            &0x00000004    non-swapped
  1028. >88    belong            &0x00000008    POSIX
  1029. #
  1030. >84    belong            &0x80000000    executable
  1031. >84    belong            &0x40000000    object
  1032. >84    belong&0x20000000    =0        not stripped
  1033. >84    belong&0x18000000    =0x00000000    native fpmode
  1034. >84    belong&0x18000000    =0x10000000    ieee fpmode
  1035. >84    belong&0x18000000    =0x18000000    undefined fpmode
  1036. #
  1037. 0    belong            0605        Convex SOFF core
  1038. #
  1039. 0    belong            0607        Convex SOFF checkpoint
  1040. >88    belong&0x000f0000    =0x00000000    c1
  1041. >88    belong            &0x00010000    c2
  1042. >88    belong            &0x00020000    c2mp
  1043. >88    belong            &0x00040000    parallel
  1044. >88    belong            &0x00080000    intrinsic
  1045. >88    belong            &0x00000008    POSIX
  1046. #
  1047. >84    belong&0x18000000    =0x00000000    native fpmode
  1048. >84    belong&0x18000000    =0x10000000    ieee fpmode
  1049. >84    belong&0x18000000    =0x18000000    undefined fpmode
  1050.  
  1051. #------------------------------------------------------------------------------
  1052. # database:  file(1) magic for various databases
  1053. #
  1054. # extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
  1055. #
  1056. #
  1057. # GDBM magic numbers
  1058. #  Will be maintained as part of the GDBM distribution in the future.
  1059. #  <downsj@teeny.org>
  1060. 0    belong    0x13579ace    GNU dbm 1.x or ndbm database, big endian
  1061. 0    lelong    0x13579ace    GNU dbm 1.x or ndbm database, little endian
  1062. 0    string    GDBM        GNU dbm 2.x database
  1063. #
  1064. 0    belong    0x061561    Berkeley DB Hash file
  1065. >4    belong    >0        (Version %d,
  1066. >8    belong    1234        Little Endian,
  1067. >8    belong    4321        Big Endian,
  1068. >12    belong    x        Bucket Size %d,
  1069. >16    belong    x        Bucket Shift %d,
  1070. >20    belong    x        Directory Size %d,
  1071. >24    belong    x        Segment Size %d,
  1072. >28    belong    x        Segment Shift %d,
  1073. >32    belong    x        Overflow Point %d,
  1074. >36    belong    x        Last Freed %d,
  1075. >40    belong    x        Max Bucket %d,
  1076. >44    belong    x        High Mask 0x%x,
  1077. >48    belong    x        Low Mask 0x%x,
  1078. >52    belong    x        Fill Factor %d,
  1079. >56    belong    x        Number of Keys %d)
  1080. #
  1081. #
  1082. 0    belong    0x053162    Berkeley DB Btree file
  1083. >4    belong    >0        (Version %d,
  1084. >8    belong    x        Page Size %d,
  1085. >12    belong    x        Free Page %d,
  1086. >16    belong    x        Number of Records %d,
  1087. >20    belong    x        Flags 0x%x)
  1088.  
  1089. #------------------------------------------------------------------------------
  1090. # diamond:  file(1) magic for Diamond system
  1091. #
  1092. # ... diamond is a multi-media mail and electronic conferencing system....
  1093. #
  1094. # XXX - I think it was either renamed Slate, or replaced by Slate....
  1095. #
  1096. #    The full deal is too long...
  1097. #0    string    <list>\n<protocol\ bbn-multimedia-format>    Diamond Multimedia Document
  1098. 0    string    =<list>\n<protocol\ bbn-m    Diamond Multimedia Document
  1099.  
  1100. #------------------------------------------------------------------------------
  1101. # diff:  file(1) magic for diff(1) output
  1102. #
  1103. 0    string        diff\     'diff' output text
  1104. 0    string        ***\         'diff' output text
  1105. 0    string        Only\ in\     'diff' output text
  1106. 0    string        Common\ subdirectories:\     'diff' output text
  1107. #  Digital UNIX - Info
  1108. #
  1109. 0    string    !<arch>\n________64E    Alpha archive
  1110. >22    string    X            -- out of date
  1111. #
  1112. # Alpha COFF Based Executables
  1113. # The stripped stuff really needs to be an 8 byte (64 bit) compare,
  1114. # but this works
  1115. 0    leshort        0x183        COFF format alpha
  1116. >22    leshort&020000    &010000        sharable library,
  1117. >22    leshort&020000    ^010000        dynamically linked,
  1118. >24    leshort        0410        pure
  1119. >24    leshort        0413        demand paged
  1120. >8    lelong        >0        executable or object module, not stripped
  1121. >8    lelong        0
  1122. >>12    lelong        0        executable or object module, stripped
  1123. >>12    lelong        >0        executable or object module, not stripped
  1124. >27     byte            >0              - version %d.
  1125. >26     byte            >0              %d-
  1126. >28     leshort         >0              %d
  1127. #
  1128. # The next is incomplete, we could tell more about this format,
  1129. # but its not worth it.
  1130. 0    leshort        0x188    Alpha compressed COFF
  1131. 0    leshort        0x18f    Alpha u-code object
  1132. #
  1133. #
  1134. # Some other interesting Digital formats,
  1135. 0    string    \377\377\177        ddis/ddif
  1136. 0    string    \377\377\174        ddis/dots archive
  1137. 0    string    \377\377\176        ddis/dtif table data
  1138. 0    string    \033c\033        LN03 output
  1139. 0    long    04553207        X image
  1140. #
  1141. 0    string    !<PDF>!\n        profiling data file
  1142. #
  1143. # Locale data tables (MIPS and Alpha).
  1144. #
  1145. 0    short        0x0501        locale data table
  1146. >6    short        0x24        for MIPS
  1147. >6    short        0x40        for Alpha
  1148.  
  1149. #------------------------------------------------------------------------------
  1150. # dump:  file(1) magic for dump file format--for new and old dump filesystems
  1151. #
  1152. # We specify both byte orders in order to recognize byte-swapped dumps.
  1153. #
  1154. 24    belong    60012        new-fs dump file (big endian),
  1155. >4    bedate    x        Previous dump %s,
  1156. >8    bedate    x        This dump %s,
  1157. >12    belong    >0        Volume %ld,
  1158. >692    belong    0        Level zero, type:
  1159. >692    belong    >0        Level %d, type:
  1160. >0    belong    1        tape header,
  1161. >0    belong    2        beginning of file record,
  1162. >0    belong    3        map of inodes on tape,
  1163. >0    belong    4        continuation of file record,
  1164. >0    belong    5        end of volume,
  1165. >0    belong    6        map of inodes deleted,
  1166. >0    belong    7        end of medium (for floppy),
  1167. >676    string    >\0        Label %s,
  1168. >696    string    >\0        Filesystem %s,
  1169. >760    string    >\0        Device %s,
  1170. >824    string    >\0        Host %s,
  1171. >888    belong    >0        Flags %x
  1172.  
  1173. 24    belong    60011        old-fs dump file (big endian),
  1174. #>4    bedate    x        Previous dump %s,
  1175. #>8    bedate    x        This dump %s,
  1176. >12    belong    >0        Volume %ld,
  1177. >692    belong    0        Level zero, type:
  1178. >692    belong    >0        Level %d, type:
  1179. >0    belong    1        tape header,
  1180. >0    belong    2        beginning of file record,
  1181. >0    belong    3        map of inodes on tape,
  1182. >0    belong    4        continuation of file record,
  1183. >0    belong    5        end of volume,
  1184. >0    belong    6        map of inodes deleted,
  1185. >0    belong    7        end of medium (for floppy),
  1186. >676    string    >\0        Label %s,
  1187. >696    string    >\0        Filesystem %s,
  1188. >760    string    >\0        Device %s,
  1189. >824    string    >\0        Host %s,
  1190. >888    belong    >0        Flags %x
  1191.  
  1192. 24    lelong    60012        new-fs dump file (little endian),
  1193. >4    ledate    x        This dump %s,
  1194. >8    ledate    x        Previous dump %s,
  1195. >12    lelong    >0        Volume %ld,
  1196. >692    lelong    0        Level zero, type:
  1197. >692    lelong    >0        Level %d, type:
  1198. >0    lelong    1        tape header,
  1199. >0    lelong    2        beginning of file record,
  1200. >0    lelong    3        map of inodes on tape,
  1201. >0    lelong    4        continuation of file record,
  1202. >0    lelong    5        end of volume,
  1203. >0    lelong    6        map of inodes deleted,
  1204. >0    lelong    7        end of medium (for floppy),
  1205. >676    string    >\0        Label %s,
  1206. >696    string    >\0        Filesystem %s,
  1207. >760    string    >\0        Device %s,
  1208. >824    string    >\0        Host %s,
  1209. >888    lelong    >0        Flags %x
  1210.  
  1211. 24    lelong    60011        old-fs dump file (little endian),
  1212. #>4    ledate    x        Previous dump %s,
  1213. #>8    ledate    x        This dump %s,
  1214. >12    lelong    >0        Volume %ld,
  1215. >692    lelong    0        Level zero, type:
  1216. >692    lelong    >0        Level %d, type:
  1217. >0    lelong    1        tape header,
  1218. >0    lelong    2        beginning of file record,
  1219. >0    lelong    3        map of inodes on tape,
  1220. >0    lelong    4        continuation of file record,
  1221. >0    lelong    5        end of volume,
  1222. >0    lelong    6        map of inodes deleted,
  1223. >0    lelong    7        end of medium (for floppy),
  1224. >676    string    >\0        Label %s,
  1225. >696    string    >\0        Filesystem %s,
  1226. >760    string    >\0        Device %s,
  1227. >824    string    >\0        Host %s,
  1228. >888    lelong    >0        Flags %x
  1229.  
  1230. #------------------------------------------------------------------------------
  1231. # elf:  file(1) magic for ELF executables
  1232. #
  1233. # We have to check the byte order flag to see what byte order all the
  1234. # other stuff in the header is in.
  1235. #
  1236. # MIPS RS3000 may also be for MIPS RS2000.
  1237. # What're the correct byte orders for the nCUBE and the Fujitsu VPP500?
  1238. #
  1239. # updated by Daniel Quinlan (quinlan@yggdrasil.com)
  1240. 0    string        \177ELF        ELF
  1241. >4    byte        0        invalid class
  1242. >4    byte        1        32-bit
  1243. >4    byte        2        64-bit
  1244. >5    byte        0        invalid byte order
  1245. >5    byte        1        LSB
  1246. >>16    leshort        0        no file type,
  1247. >>16    leshort        1        relocatable,
  1248. >>16    leshort        2        executable,
  1249. >>16    leshort        3        shared object,
  1250. # Core handling from Peter Tobias <tobias@server.et-inf.fho-emden.de>
  1251. >>16    leshort        4        core file
  1252. >>>400  lelong          >0              (signal %d),
  1253. >>16    leshort        &0xff00        processor-specific,
  1254. >>18    leshort        0        no machine,
  1255. >>18    leshort        1        AT&T WE32100 - invalid byte order,
  1256. >>18    leshort        2        SPARC - invalid byte order,
  1257. >>18    leshort        3        Intel 80386,
  1258. >>18    leshort        4        Motorola 68000 - invalid byte order,
  1259. >>18    leshort        5        Motorola 88000 - invalid byte order,
  1260. >>18    leshort        6        Intel 80486,
  1261. >>18    leshort        7        Intel 80860,
  1262. >>18    leshort        8        MIPS RS3000_BE - invalid byte order,
  1263. >>18    leshort        9        Amdahl - invalid byte order,
  1264. >>18    leshort        10        MIPS RS3000_LE,
  1265. >>18    leshort        11        RS6000 - invalid byte order,
  1266. >>18    leshort        15        PA-RISC - invalid byte order,
  1267. >>18    leshort        16        nCUBE,
  1268. >>18    leshort        17        VPP500,
  1269. >>18    leshort        18        SPARC32PLUS,
  1270. >>18    leshort        20        PowerPC,
  1271. >>18    leshort        0x9026        Alpha,
  1272. >>20    lelong        0        invalid version
  1273. >>20    lelong        1        version 1
  1274. >>36    lelong        1        MathCoPro/FPU/MAU Required
  1275. >5    byte        2        MSB
  1276. >>16    beshort        0        no file type,
  1277. >>16    beshort        1        relocatable,
  1278. >>16    beshort        2        executable,
  1279. >>16    beshort        3        shared object,
  1280. >>16    beshort        4        core file,
  1281. >>>400    lelong        >0        (signal %d),
  1282. >>16    beshort        &0xff00        processor-specific,
  1283. >>18    beshort        0        no machine,
  1284. >>18    beshort        1        AT&T WE32100,
  1285. >>18    beshort        2        SPARC,
  1286. >>18    beshort        3        Intel 80386 - invalid byte order,
  1287. >>18    beshort        4        Motorola 68000,
  1288. >>18    beshort        5        Motorola 88000,
  1289. >>18    beshort        6        Intel 80486 - invalid byte order,
  1290. >>18    beshort        7        Intel 80860,
  1291. >>18    beshort        8        MIPS RS3000_BE,
  1292. >>18    beshort        9        Amdahl,
  1293. >>18    beshort        10        MIPS RS3000_LE - invalid byte order,
  1294. >>18    beshort        11        RS6000,
  1295. >>18    beshort        15        PA-RISC,
  1296. >>18    beshort        16        nCUBE,
  1297. >>18    beshort        17        VPP500,
  1298. >>18    beshort        18        SPARC32PLUS,
  1299. >>18    beshort        20        PowerPC,
  1300. >>18    beshort        0x9026        Alpha,
  1301. >>20    belong        0        invalid version
  1302. >>20    belong        1        version 1
  1303. >>36    belong        1        MathCoPro/FPU/MAU Required
  1304.  
  1305. #------------------------------------------------------------------------------
  1306. # encore:  file(1) magic for Encore machines
  1307. #
  1308. # XXX - needs to have the byte order specified (NS32K was little-endian,
  1309. # dunno whether they run the 88K in little-endian mode or not).
  1310. #
  1311. 0    short        0x154        Encore
  1312. >20    short        0x107        executable
  1313. >20    short        0x108        pure executable
  1314. >20    short        0x10b        demand-paged executable
  1315. >20    short        0x10f        unsupported executable
  1316. >12    long        >0        not stripped
  1317. >22    short        >0        - version %ld
  1318. >22    short        0        -
  1319. #>4    date        x        stamp %s
  1320. 0    short        0x155        Encore unsupported executable
  1321. >12    long        >0        not stripped
  1322. >22    short        >0        - version %ld
  1323. >22    short        0        -
  1324. #>4    date        x        stamp %s
  1325.  
  1326. #------------------------------------------------------------------------------
  1327. # filesystems:  file(1) magic for different filesystems
  1328. #
  1329. 0x438    leshort    0xEF53            Linux/i386 ext2 filesystem
  1330. 0    string    \366\366\366\366    PC formatted floppy with no filesystem
  1331.  
  1332. #------------------------------------------------------------------------------
  1333. # fonts:  file(1) magic for font data
  1334. #
  1335. 0    string        FONT        ASCII vfont text
  1336. 0    short        0436        Berkeley vfont data
  1337. 0    short        017001        byte-swapped Berkeley vfont data
  1338.  
  1339. # PostScript fonts (must precede "printer" entries), quinlan@yggdrasil.com
  1340. 0    string        %!PS-AdobeFont-1.0    PostScript Type 1 font text
  1341. >20    string        >\0            (%s)
  1342. 6    string        %!PS-AdobeFont-1.0    PostScript Type 1 font program data
  1343.  
  1344. # X11 font files in SNF (Server Natural Format) format
  1345. 0    belong        00000004        X11 SNF font data, MSB first
  1346. 0    lelong        00000004        X11 SNF font data, LSB first
  1347.  
  1348. # X11 Bitmap Distribution Format, from Daniel Quinlan (quinlan@yggdrasil.com)
  1349. 0    string        STARTFONT\040        X11 BDF font text
  1350.  
  1351. # X11 fonts, from Daniel Quinlan (quinlan@yggdrasil.com)
  1352. # PCF must come before SGI additions ("MIPSEL MIPS-II COFF" collides)
  1353. 0    string        \001fcp            X11 Portable Compiled Font data
  1354. >12    byte        0x02            \b, LSB first
  1355. >12    byte        0x0a            \b, MSB first
  1356. 0    string        D1.0\015        X11 Speedo font data
  1357.  
  1358. #------------------------------------------------------------------------------
  1359. # frame:  file(1) magic for FrameMaker files
  1360. #
  1361. # This stuff came on a FrameMaker demo tape, most of which is
  1362. # copyright, but this file is "published" as witness the following:
  1363. #
  1364. 0    string        \<MakerFile    FrameMaker document
  1365. >11    string        4.0         (4.0
  1366. >11    string        3.0         (3.0
  1367. >11    string        2.0         (2.0
  1368. >11    string        1.0         (1.0
  1369. >14    byte        x          %c)
  1370. 0    string        \<MIFFile    FrameMaker MIF (ASCII) file
  1371. >9    string        4.0         (4.0)
  1372. >9    string        3.0         (3.0)
  1373. >9    string        2.0         (2.0)
  1374. >9    string        1.0         (1.x)
  1375. 0    string        \<MakerDictionary    FrameMaker Dictionary text
  1376. >17    string        3.0         (3.0)
  1377. >17    string        2.0         (2.0)
  1378. >17    string        1.0         (1.x)
  1379. 0    string        \<MakerScreenFont    FrameMaker Font file
  1380. >17    string        1.01         (%s)
  1381. 0    string        \<MML        FrameMaker MML file
  1382. 0    string        \<BookFile    FrameMaker Book file
  1383. >10    string        3.0         (3.0
  1384. >10    string        2.0         (2.0
  1385. >10    string        1.0         (1.0
  1386. >13    byte        x          %c)
  1387. # XXX - this book entry should be verified, if you find one, uncomment this
  1388. #0    string        \<Book\     FrameMaker Book (ASCII) file
  1389. #>6    string        3.0         (3.0)
  1390. #>6    string        2.0         (2.0)
  1391. #>6    string        1.0         (1.0)
  1392. 0    string        \<Maker    Intermediate Print File    FrameMaker IPL file
  1393.  
  1394. #------------------------------------------------------------------------------
  1395. # freebsd:  file(1) magic for FreeBSD objects
  1396. #
  1397. # All new-style FreeBSD magic numbers are in host byte order (i.e.,
  1398. # little-endian on x86).
  1399. #
  1400. # XXX - this comes from the file "freebsd" in a recent FreeBSD version of
  1401. # "file"; it, and the NetBSD stuff in "netbsd", appear to use different
  1402. # schemes for distinguishing between executable images, shared libraries,
  1403. # and object files.
  1404. #
  1405. # FreeBSD says:
  1406. #
  1407. #    Regardless of whether it's pure, demand-paged, or none of the
  1408. #    above:
  1409. #
  1410. #    if the entry point is < 4096, then it's a shared library if
  1411. #    the "has run-time loader information" bit is set, and is
  1412. #    position-independent if the "is position-independent" bit
  1413. #    is set;
  1414. #
  1415. #    if the entry point is >= 4096 (or >4095, same thing), then it's
  1416. #    an executable, and is dynamically-linked if the "has run-time
  1417. #    loader information" bit is set.
  1418. #
  1419. # On x86, NetBSD says:
  1420. #
  1421. #    If it's neither pure nor demand-paged:
  1422. #
  1423. #    if it has the "has run-time loader information" bit set, it's
  1424. #    a dynamically-linked executable;
  1425. #
  1426. #    if it doesn't have that bit set, then:
  1427. #
  1428. #        if it has the "is position-independent" bit set, it's
  1429. #        position-independent;
  1430. #
  1431. #        if the entry point is non-zero, it's an executable, otherwise
  1432. #        it's an object file.
  1433. #
  1434. #    If it's pure:
  1435. #
  1436. #    if it has the "has run-time loader information" bit set, it's
  1437. #    a dynamically-linked executable, otherwise it's just an
  1438. #    executable.
  1439. #
  1440. #    If it's demand-paged:
  1441. #
  1442. #    if it has the "has run-time loader information" bit set,
  1443. #    then:
  1444. #
  1445. #        if the entry point is < 4096, it's a shared library;
  1446. #
  1447. #        if the entry point is = 4096 or > 4096 (i.e., >= 4096),
  1448. #        it's a dynamically-linked executable);
  1449. #
  1450. #    if it doesn't have the "has run-time loader information" bit
  1451. #    set, then it's just an executable.
  1452. #
  1453. # (On non-x86, NetBSD does much the same thing, except that it uses
  1454. # 8192 on 68K - except for "68k4k", which is presumably "68K with 4K
  1455. # pages - SPARC, and MIPS, presumably because Sun-3's and Sun-4's
  1456. # had 8K pages; dunno about MIPS.)
  1457. #
  1458. # I suspect the two will differ only in perverse and uninteresting cases
  1459. # ("shared" libraries that aren't demand-paged and whose pages probably
  1460. # won't actually be shared, executables with entry points <4096).
  1461. #
  1462. # I leave it to those more familiar with FreeBSD and NetBSD to figure out
  1463. # what the right answer is (although using ">4095", FreeBSD-style, is
  1464. # probably better than separately checking for "=4096" and ">4096",
  1465. # NetBSD-style).  (The old "netbsd" file analyzed FreeBSD demand paged
  1466. # executables using the NetBSD technique.)
  1467. #
  1468. 0    lelong&0377777777    041400407    FreeBSD/i386
  1469. >20    lelong            <4096
  1470. >>3    byte&0xC0        &0x80        shared library
  1471. >>3    byte&0xC0        0x40        PIC object
  1472. >>3    byte&0xC0        0x00        object
  1473. >20    lelong            >4095
  1474. >>3    byte&0x80        0x80        dynamically linked executable
  1475. >>3    byte&0x80        0x00        executable
  1476. >16    lelong            >0        not stripped
  1477.  
  1478. 0    lelong&0377777777    041400410    FreeBSD/i386 pure
  1479. >20    lelong            <4096
  1480. >>3    byte&0xC0        &0x80        shared library
  1481. >>3    byte&0xC0        0x40        PIC object
  1482. >>3    byte&0xC0        0x00        object
  1483. >20    lelong            >4095
  1484. >>3    byte&0x80        0x80        dynamically linked executable
  1485. >>3    byte&0x80        0x00        executable
  1486. >16    lelong            >0        not stripped
  1487.  
  1488. 0    lelong&0377777777    041400413    FreeBSD/i386 demand paged
  1489. >20    lelong            <4096
  1490. >>3    byte&0xC0        &0x80        shared library
  1491. >>3    byte&0xC0        0x40        PIC object
  1492. >>3    byte&0xC0        0x00        object
  1493. >20    lelong            >4095
  1494. >>3    byte&0x80        0x80        dynamically linked executable
  1495. >>3    byte&0x80        0x00        executable
  1496. >16    lelong            >0        not stripped
  1497.  
  1498. 0    lelong&0377777777    041400314    FreeBSD/i386 compact demand paged
  1499. >20    lelong            <4096
  1500. >>3    byte&0xC0        &0x80        shared library
  1501. >>3    byte&0xC0        0x40        PIC object
  1502. >>3    byte&0xC0        0x00        object
  1503. >20    lelong            >4095
  1504. >>3    byte&0x80        0x80        dynamically linked executable
  1505. >>3    byte&0x80        0x00        executable
  1506. >16    lelong            >0        not stripped
  1507.  
  1508. # XXX gross hack to identify core files
  1509. # cores start with a struct tss; we take advantage of the following:
  1510. # byte 7:     highest byte of the kernel stack pointer, always 0xfe
  1511. #      8/9:   kernel (ring 0) ss value, always 0x0010
  1512. #      10 - 27: ring 1 and 2 ss/esp, unused, thus always 0
  1513. #      28:    low order byte of the current PTD entry, always 0 since the
  1514. #             PTD is page-aligned
  1515. #
  1516. 7    string    \357\020\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0    FreeBSD/i386 a.out core file
  1517. >1039    string    >\0    from '%s'
  1518.  
  1519. # /var/run/ld.so.hints
  1520. # What are you laughing about?
  1521. 0    lelong            011421044151    ld.so hints file
  1522. >4    lelong            >0        (version %d)
  1523.  
  1524. #------------------------------------------------------------------------------
  1525. # hp:  file(1) magic for Hewlett Packard machines (see also "printer")
  1526. #
  1527. # XXX - somebody should figure out whether any byte order needs to be
  1528. # applied to the "TML" stuff; I'm assuming the Apollo stuff is
  1529. # big-endian as it was mostly 68K-based.
  1530. #
  1531. # I think the 500 series was the old stack-based machines, running a
  1532. # UNIX environment atop the "SUN kernel"; dunno whether it was
  1533. # big-endian or little-endian.
  1534. #
  1535. # Daniel Quinlan (quinlan@yggdrasil.com): hp200 machines are 68010 based;
  1536. # hp300 are 68020+68881 based; hp400 are also 68k.  The following basic
  1537. # HP magic is useful for reference, but using "long" magic is a better
  1538. # practice in order to avoid collisions.
  1539. #
  1540. # Guy Harris (guy@netapp.com): some additions to this list came from
  1541. # HP-UX 10.0's "/usr/include/sys/unistd.h" (68030, 68040, PA-RISC 1.1,
  1542. # 1.2, and 2.0).  The 1.2 and 2.0 stuff isn't in the HP-UX 10.0
  1543. # "/etc/magic", though, except for the "archive file relocatable library"
  1544. # stuff, and the 68030 and 68040 stuff isn't there at all - are they not
  1545. # used in executables, or have they just not yet updated "/etc/magic"
  1546. # completely?
  1547. #
  1548. # 0    beshort        200        hp200 (68010) BSD binary
  1549. # 0    beshort        300        hp300 (68020+68881) BSD binary
  1550. # 0    beshort        0x20c        hp200/300 HP-UX binary
  1551. # 0    beshort        0x20d        hp400 (68030) HP-UX binary
  1552. # 0    beshort        0x20e        hp400 (68040?) HP-UX binary
  1553. # 0    beshort        0x20b        PA-RISC1.0 HP-UX binary
  1554. # 0    beshort        0x210        PA-RISC1.1 HP-UX binary
  1555. # 0    beshort        0x211        PA-RISC1.2 HP-UX binary
  1556. # 0    beshort        0x214        PA-RISC2.0 HP-UX binary
  1557.  
  1558. #
  1559. # The "misc" stuff needs a byte order; the archives look suspiciously
  1560. # like the old 177545 archives (0xff65 = 0177545).
  1561. #
  1562. #### Old Apollo stuff
  1563. 0    beshort        0627        Apollo m68k COFF executable
  1564. >18    beshort        ^040000        not stripped
  1565. >22    beshort        >0        - version %ld
  1566. 0    beshort        0624        apollo a88k COFF executable
  1567. >18    beshort        ^040000        not stripped
  1568. >22    beshort        >0        - version %ld
  1569. 0       long            01203604016     TML 0123 byte-order format
  1570. 0       long            01702407010     TML 1032 byte-order format
  1571. 0       long            01003405017     TML 2301 byte-order format
  1572. 0       long            01602007412     TML 3210 byte-order format
  1573. #### PA-RISC
  1574. 0    belong         0x02100106    PA-RISC1.1 relocatable object
  1575. 0    belong         0x02100107    PA-RISC1.1 executable
  1576. >168    belong        &=0x00000004    dynamically linked
  1577. >(144)    belong        0x054ef630    dynamically linked
  1578. >96    belong        >0        - not stripped
  1579.  
  1580. 0    belong         0x02100108    PA-RISC1.1 shared executable
  1581. >168    belong&0x4    0x4        dynamically linked
  1582. >(144)    belong        0x054ef630    dynamically linked
  1583. >96    belong        >0        - not stripped
  1584.  
  1585. 0    belong         0x0210010b    PA-RISC1.1 demand-load executable
  1586. >168    belong&0x4    0x4        dynamically linked
  1587. >(144)    belong        0x054ef630    dynamically linked
  1588. >96    belong        >0        - not stripped
  1589.  
  1590. 0    belong         0x0210010e    PA-RISC1.1 shared library
  1591. >96    belong        >0        - not stripped
  1592.  
  1593. 0    belong         0x0210010d    PA-RISC1.1 dynamic load library
  1594. >96    belong        >0        - not stripped
  1595.  
  1596. #### 800
  1597. 0    belong         0x020b0106    PA-RISC1.0 relocatable object
  1598.  
  1599. 0    belong         0x020b0107    PA-RISC1.0 executable
  1600. >168    belong&0x4    0x4        dynamically linked
  1601. >(144)    belong        0x054ef630    dynamically linked
  1602. >96    belong        >0        - not stripped
  1603.  
  1604. 0    belong         0x020b0108    PA-RISC1.0 shared executable
  1605. >168    belong&0x4    0x4        dynamically linked
  1606. >(144)    belong        0x054ef630    dynamically linked
  1607. >96    belong        >0        - not stripped
  1608.  
  1609. 0    belong         0x020b010b    PA-RISC1.0 demand-load executable
  1610. >168    belong&0x4    0x4        dynamically linked
  1611. >(144)    belong        0x054ef630    dynamically linked
  1612. >96    belong        >0        - not stripped
  1613.  
  1614. 0    belong         0x020b010e    PA-RISC1.0 shared library
  1615. >96    belong        >0        - not stripped
  1616.  
  1617. 0    belong         0x020b010d    PA-RISC1.0 dynamic load library
  1618. >96    belong        >0        - not stripped
  1619.  
  1620. 0    belong        0x213c6172    archive file
  1621. >68    belong         0x020b0619    - PA-RISC1.0 relocatable library
  1622. >68    belong         0x02100619    - PA-RISC1.1 relocatable library
  1623. >68    belong         0x02110619    - PA-RISC1.2 relocatable library
  1624. >68    belong         0x02140619    - PA-RISC2.0 relocatable library
  1625.  
  1626. #### 500
  1627. 0    long        0x02080106    HP s500 relocatable executable
  1628. >16    long        >0        - version %ld
  1629.  
  1630. 0    long        0x02080107    HP s500 executable
  1631. >16    long        >0        - version %ld
  1632.  
  1633. 0    long        0x02080108    HP s500 pure executable
  1634. >16    long        >0        - version %ld
  1635.  
  1636. #### 200
  1637. 0    belong         0x020c0108    HP s200 pure executable
  1638. >4    beshort        >0        - version %ld
  1639. >8    belong        &0x80000000    save fp regs
  1640. >8    belong        &0x40000000    dynamically linked
  1641. >8    belong        &0x20000000    debuggable
  1642. >36    belong        >0        not stripped
  1643.  
  1644. 0    belong        0x020c0107    HP s200 executable
  1645. >4    beshort        >0        - version %ld
  1646. >8    belong        &0x80000000    save fp regs
  1647. >8    belong        &0x40000000    dynamically linked
  1648. >8    belong        &0x20000000    debuggable
  1649. >36    belong        >0        not stripped
  1650.  
  1651. 0    belong        0x020c010b    HP s200 demand-load executable
  1652. >4    beshort        >0        - version %ld
  1653. >8    belong        &0x80000000    save fp regs
  1654. >8    belong        &0x40000000    dynamically linked
  1655. >8    belong        &0x20000000    debuggable
  1656. >36    belong        >0        not stripped
  1657.  
  1658. 0    belong        0x020c0106    HP s200 relocatable executable
  1659. >4    beshort        >0        - version %ld
  1660. >6    beshort        >0        - highwater %d
  1661. >8    belong        &0x80000000    save fp regs
  1662. >8    belong        &0x20000000    debuggable
  1663. >8    belong        &0x10000000    PIC
  1664.  
  1665. 0    belong         0x020a0108    HP s200 (2.x release) pure executable
  1666. >4    beshort        >0        - version %ld
  1667. >36    belong        >0        not stripped
  1668.  
  1669. 0    belong        0x020a0107    HP s200 (2.x release) executable
  1670. >4    beshort        >0        - version %ld
  1671. >36    belong        >0        not stripped
  1672.  
  1673. 0    belong        0x020c010e    HP s200 shared library
  1674. >4    beshort        >0        - version %ld
  1675. >6    beshort        >0        - highwater %d
  1676. >36    belong        >0        not stripped
  1677.  
  1678. 0    belong        0x020c010d    HP s200 dynamic load library
  1679. >4    beshort        >0        - version %ld
  1680. >6    beshort        >0        - highwater %d
  1681. >36    belong        >0        not stripped
  1682.  
  1683. #### MISC
  1684. 0    long        0x0000ff65    HP old archive
  1685. 0    long        0x020aff65    HP s200 old archive
  1686. 0    long        0x020cff65    HP s200 old archive
  1687. 0    long        0x0208ff65    HP s500 old archive
  1688.  
  1689. 0    long        0x015821a6    HP core file
  1690.  
  1691. 0    long        0x4da7eee8    HP-WINDOWS font
  1692. >8    byte        >0        - version %ld
  1693. 0    string        Bitmapfile    HP Bitmapfile
  1694.  
  1695. 0    string        IMGfile    CIS     compimg HP Bitmapfile
  1696. # XXX - see "lif"
  1697. #0    short        0x8000        lif file
  1698. 0    long        0x020c010c    compiled Lisp
  1699.  
  1700. 0    string        msgcat01    HP NLS message catalog,
  1701. >8    long        >0        %d messages
  1702.  
  1703. # addendum to /etc/magic with HP-48sx file-types by phk@data.fls.dk 1jan92
  1704. 0    string        HPHP48-        HP48 binary
  1705. >7    byte        >0        - Rev %c
  1706. >8    short        0x1129        (ADR)
  1707. >8    short        0x3329        (REAL)
  1708. >8    short        0x5529        (LREAL)
  1709. >8    short        0x7729        (COMPLX)
  1710. >8    short        0x9d29        (LCOMPLX)
  1711. >8    short        0xbf29        (CHAR)
  1712. >8    short        0xe829        (ARRAY)
  1713. >8    short        0x0a2a        (LNKARRAY)
  1714. >8    short        0x2c2a        (STRING)
  1715. >8    short        0x4e2a        (HXS)
  1716. >8    short        0x742a        (LIST)
  1717. >8    short        0x962a        (DIR)
  1718. >8    short        0xb82a        (ALG)
  1719. >8    short        0xda2a        (UNIT)
  1720. >8    short        0xfc2a        (TAGGED)
  1721. >8    short        0x1e2b        (GROB)
  1722. >8    short        0x402b        (LIB)
  1723. >8    short        0x622b        (BACKUP)
  1724. >8    short        0x882b        (LIBDATA)
  1725. >8    short        0x9d2d        (PROG)
  1726. >8    short        0xcc2d        (CODE)
  1727. >8    short        0x482e        (GNAME)
  1728. >8    short        0x6d2e        (LNAME)
  1729. >8    short        0x922e        (XLIB)
  1730. 0    string        %%HP:        HP48 text
  1731. >6    string        T(0)        - T(0)
  1732. >6    string        T(1)        - T(1)
  1733. >6    string        T(2)        - T(2)
  1734. >6    string        T(3)        - T(3)
  1735. >10    string        A(D)        A(D)
  1736. >10    string        A(R)        A(R)
  1737. >10    string        A(G)        A(G)
  1738. >14    string        F(.)        F(.);
  1739. >14    string        F(,)        F(,);
  1740.  
  1741. # hpBSD magic numbers
  1742. 0    beshort        200        hp200 (68010) BSD
  1743. >2    beshort        0407        impure binary
  1744. >2    beshort        0410        read-only binary
  1745. >2    beshort        0413        demand paged binary
  1746. 0    beshort        300        hp300 (68020+68881) BSD
  1747. >2    beshort        0407        impure binary
  1748. >2    beshort        0410        read-only binary
  1749. >2    beshort        0413        demand paged binary
  1750.  
  1751.  
  1752. #------------------------------------------------------------------------------
  1753. # ibm370:  file(1) magic for IBM 370 and compatibles.
  1754. #
  1755. # "ibm370" said that 0x15d == 0535 was "ibm 370 pure executable".
  1756. # What the heck *is* "USS/370"?
  1757. # AIX 4.1's "/etc/magic" has
  1758. #
  1759. #    0    short        0535        370 sysV executable 
  1760. #    >12    long        >0        not stripped
  1761. #    >22    short        >0        - version %d
  1762. #    >30    long        >0        - 5.2 format
  1763. #    0    short        0530        370 sysV pure executable 
  1764. #    >12    long        >0        not stripped
  1765. #    >22    short        >0        - version %d
  1766. #    >30    long        >0        - 5.2 format
  1767. #
  1768. # instead of the "USS/370" versions of the same magic numbers.
  1769. #
  1770. 0    beshort        0537        370 XA sysV executable 
  1771. >12    belong        >0        not stripped
  1772. >22    beshort        >0        - version %d
  1773. >30    belong        >0        - 5.2 format
  1774. 0    beshort        0532        370 XA sysV pure executable 
  1775. >12    belong        >0        not stripped
  1776. >22    beshort        >0        - version %d
  1777. >30    belong        >0        - 5.2 format
  1778. 0    beshort        054001        370 sysV pure executable
  1779. >12    belong        >0        not stripped
  1780. 0    beshort        055001        370 XA sysV pure executable
  1781. >12    belong        >0        not stripped
  1782. 0    beshort        056401        370 sysV executable
  1783. >12    belong        >0        not stripped
  1784. 0    beshort        057401        370 XA sysV executable
  1785. >12    belong        >0        not stripped
  1786. 0       beshort        0531        SVR2 executable (Amdahl-UTS)
  1787. >12    belong        >0        not stripped
  1788. >24     belong        >0        - version %ld
  1789. 0    beshort        0534        SVR2 pure executable (Amdahl-UTS)
  1790. >12    belong        >0        not stripped
  1791. >24    belong        >0        - version %ld
  1792. 0    beshort        0530        SVR2 pure executable (USS/370)
  1793. >12    belong        >0        not stripped
  1794. >24    belong        >0        - version %ld
  1795. 0    beshort        0535        SVR2 executable (USS/370)
  1796. >12    belong        >0        not stripped
  1797. >24    belong        >0        - version %ld
  1798.  
  1799. #------------------------------------------------------------------------------
  1800. # ibm6000:  file(1) magic for RS/6000 and the RT PC.
  1801. #
  1802. 0    beshort        0x01df        executable (RISC System/6000 V3.1) or obj module
  1803. >12    belong        >0        not stripped
  1804. # Breaks sun4 statically linked execs.
  1805. #0      beshort        0x0103        executable (RT Version 2) or obj module
  1806. #>2    byte        0x50        pure
  1807. #>28    belong        >0        not stripped
  1808. #>6    beshort        >0        - version %ld
  1809. 0    beshort        0x0104        shared library
  1810. 0    beshort        0x0105        ctab data
  1811. 0    beshort        0xfe04        structured file
  1812. 0    string        0xabcdef    AIX message catalog
  1813. 0    belong        0x000001f9    AIX compiled message catalog
  1814. 0    string        \<aiaff>    archive
  1815.  
  1816. #------------------------------------------------------------------------------
  1817. # iff:    file(1) magic for Interchange File Format (see also "audio" & "images")
  1818. #
  1819. # Daniel Quinlan (quinlan@yggdrasil.com) -- IFF was designed by Electronic
  1820. # Arts for file interchange.  It has also been used by Apple, SGI, and
  1821. # especially Commodore-Amiga.
  1822. #
  1823. # IFF files begin with an 8 byte FORM header, followed by a 4 character
  1824. # FORM type, which is followed by the first chunk in the FORM.
  1825.  
  1826. 0    string        FORM        IFF data
  1827. #>4    belong        x        \b, FORM is %d bytes long
  1828. # audio formats
  1829. >8    string        AIFF        \b, AIFF audio
  1830. >8    string        AIFC        \b, AIFF-C compressed audio
  1831. >8    string        8SVX        \b, 8SVX 8-bit sampled sound voice
  1832. >8    string        SAMP        \b, SAMP sampled audio
  1833. # image formats
  1834. >8    string        ILBMBMHD    \b, ILBM interleaved image
  1835. >>20    beshort        x        \b, %d x
  1836. >>22    beshort        x        %d
  1837. >8    string        RGBN        \b, RGBN 12-bit RGB image
  1838. >8    string        RGB8        \b, RGB8 24-bit RGB image
  1839. >8    string        DR2D        \b, DR2D 2-D object
  1840. >8    string        TDDD        \b, TDDD 3-D rendering
  1841. # other formats
  1842. >8    string        FTXT        \b, FTXT formatted text
  1843.  
  1844. #------------------------------------------------------------------------------
  1845. # images:  file(1) magic for image formats (see also "iff")
  1846. #
  1847. # originally from jef@helios.ee.lbl.gov (Jef Poskanzer),
  1848. # additions by janl@ifi.uio.no as well as others. Jan also suggested
  1849. # merging several one- and two-line files into here.
  1850. #
  1851. # little magic: PCX (first byte is 0x0a)
  1852. # no magic: Targa
  1853.  
  1854. # PBMPLUS images
  1855. # The next byte following the magic is always whitespace.
  1856. 0    string        P1        PBM image text
  1857. 0    string        P2        PGM image text
  1858. 0    string        P3        PPM image text
  1859. 0    string        P4        PBM "rawbits" image data
  1860. 0    string        P5        PGM "rawbits" image data
  1861. 0    string        P6        PPM "rawbits" image data
  1862.  
  1863. # NIFF (Navy Interchange File Format, a modification of TIFF) images
  1864. 0    string        IIN1        NIFF image data
  1865.  
  1866. # Tag Image File Format, from Daniel Quinlan (quinlan@yggdrasil.com)
  1867. # The second word of TIFF files is the TIFF version number, 42, which has
  1868. # never changed.  The TIFF specification recommends testing for it.
  1869. 0    string        MM\x00\x2a    TIFF image data, big-endian
  1870. 0    string        II\x2a\x00    TIFF image data, little-endian
  1871.  
  1872. # PNG [Portable Network Graphics, or "PNG's Not GIF"] images
  1873. # (Greg Roelofs, newt@uchicago.edu)
  1874. #
  1875. # 137 P N G \r \n ^Z \n [4-byte length] H E A D [HEAD data] [HEAD crc] ...
  1876. #
  1877. 0    string        \x89PNG        PNG image data,
  1878. >4    belong        !0x0d0a1a0a    CORRUPTED,
  1879. >16    belong        x        %ld x
  1880. >20    belong        x        %ld,
  1881. >24    byte        x        %d-bit
  1882. >25    byte        0        grayscale,
  1883. >25    byte        2        \b/color RGB,
  1884. >25    byte        3        colormap,
  1885. >25    byte        4        gray+alpha,
  1886. >25    byte        6        \b/color RGBA,
  1887. #>26    byte        0        deflate/32K,
  1888. >28    byte        0        non-interlaced
  1889. >28    byte        1        interlaced
  1890.  
  1891. # GIF
  1892. 0    string        GIF8        GIF image data
  1893. >4    string        7a        \b, version 8%s,
  1894. >4    string        9a        \b, version 8%s,
  1895. >6    leshort        >0        %hd x
  1896. >8    leshort        >0        %hd,
  1897. #>10    byte        &0x80        color mapped,
  1898. #>10    byte&0x07    =0x00        2 colors
  1899. #>10    byte&0x07    =0x01        4 colors
  1900. #>10    byte&0x07    =0x02        8 colors
  1901. #>10    byte&0x07    =0x03        16 colors
  1902. #>10    byte&0x07    =0x04        32 colors
  1903. #>10    byte&0x07    =0x05        64 colors
  1904. #>10    byte&0x07    =0x06        128 colors
  1905. #>10    byte&0x07    =0x07        256 colors
  1906.  
  1907. # ITC (CMU WM) raster files.  It is essentially a byte-reversed Sun raster,
  1908. # 1 plane, no encoding.
  1909. 0    string        \361\0\100\273    CMU window manager raster image data
  1910. >4    lelong        >0        %d x
  1911. >8    lelong        >0        %d,
  1912. >12    lelong        >0        %d-bit
  1913.  
  1914. # Magick Image File Format
  1915. 0    string        id=ImageMagick    MIFF image data
  1916.  
  1917. # Artisan
  1918. 0    long        1123028772    Artisan image data
  1919. >4    long        1        \b, rectangular 24-bit
  1920. >4    long        2        \b, rectangular 8-bit with colormap
  1921. >4    long        3        \b, rectangular 32-bit (24-bit with matte)
  1922.  
  1923. # FIG (Facility for Interactive Generation of figures), an object-based format
  1924. 0    string        #FIG        FIG image text
  1925. >5    string        x        \b, version %.3s
  1926.  
  1927. # PHIGS
  1928. 0    string        ARF_BEGARF        PHIGS clear text archive
  1929. 0    string        @(#)SunPHIGS        SunPHIGS
  1930. # version number follows, in the form m.n
  1931. >40    string        SunBin            binary
  1932. >32    string        archive            archive
  1933.  
  1934. # GKS (Graphics Kernel System)
  1935. 0    string        GKSM        GKS Metafile
  1936. >24    string        SunGKS        \b, SunGKS
  1937.  
  1938. # CGM image files
  1939. 0    string        BEGMF        clear text Computer Graphics Metafile
  1940. # XXX - questionable magic
  1941. 0    beshort&0xffe0    0x0020        binary Computer Graphics Metafile
  1942. 0    beshort        0x3020        character Computer Graphics Metafile
  1943.  
  1944. # MGR bitmaps  (Michael Haardt, u31b3hs@pool.informatik.rwth-aachen.de)
  1945. 0    string    yz    MGR bitmap, modern format, 8-bit aligned
  1946. 0    string    zz    MGR bitmap, old format, 1-bit deep, 16-bit aligned
  1947. 0    string    xz    MGR bitmap, old format, 1-bit deep, 32-bit aligned
  1948. 0    string    yx    MGR bitmap, modern format, squeezed
  1949.  
  1950. # Fuzzy Bitmap (FBM) images
  1951. 0    string        %bitmap\0    FBM image data
  1952. >30    long        0x31        \b, mono
  1953. >30    long        0x33        \b, color
  1954.  
  1955. # facsimile data
  1956. 1    string        PC\ Research,\ Inc    group 3 fax data
  1957. >29    byte        0        \b, normal resolution (204x98 DPI)
  1958. >29    byte        1        \b, fine resolution (204x196 DPI)
  1959.  
  1960. # JPEG images
  1961. # SunOS 5.5.1 had
  1962. #
  1963. #    0    string        \377\330\377\340    JPEG file
  1964. #    0    string        \377\330\377\356    JPG file
  1965. #
  1966. # both of which turn into "JPEG image data" here.
  1967. #
  1968. 0    beshort        0xffd8        JPEG image data
  1969. >6    string        JFIF        \b, JFIF standard
  1970. # HSI is Handmade Software's proprietary JPEG encoding scheme
  1971. 0    string        hsi1        JPEG image data, HSI proprietary
  1972.  
  1973. # PC bitmaps (OS/2, Windoze BMP files)  (Greg Roelofs, newt@uchicago.edu)
  1974. 0    string        BM        PC bitmap data
  1975. >14    leshort        12        \b, OS/2 1.x format
  1976. >>18    leshort        x        \b, %d x
  1977. >>20    leshort        x        %d
  1978. >14    leshort        64        \b, OS/2 2.x format
  1979. >>18    leshort        x        \b, %d x
  1980. >>20    leshort        x        %d
  1981. >14    leshort        40        \b, Windows 3.x format
  1982. >>18    lelong        x        \b, %d x
  1983. >>22    lelong        x        %d x
  1984. >>28    leshort        x        %d
  1985. 0    string        IC        PC icon data
  1986. 0    string        PI        PC pointer image data
  1987. 0    string        CI        PC color icon data
  1988. 0    string        CP        PC color pointer image data
  1989. # Conflicts with other entries [BABYL]
  1990. #0    string        BA        PC bitmap array data
  1991.  
  1992. # XPM icons (Greg Roelofs, newt@uchicago.edu)
  1993. # note possible collision with C/REXX entry in c-lang; currently commented out
  1994. 0    string        /*\ XPM\ */    X pixmap image text
  1995.  
  1996. # Utah Raster Toolkit RLE images (janl@ifi.uio.no)
  1997. 0    leshort        0xcc52        RLE image data,
  1998. >6    leshort        x        %d x
  1999. >8    leshort        x        %d
  2000. >2    leshort        >0        \b, lower left corner: %d
  2001. >4    leshort        >0        \b, lower right corner: %d
  2002. >10    byte&0x1    =0x1        \b, clear first
  2003. >10    byte&0x2    =0x2        \b, no background
  2004. >10    byte&0x4    =0x4        \b, alpha channel
  2005. >10    byte&0x8    =0x8        \b, comment
  2006. >11    byte        >0        \b, %d color channels
  2007. >12    byte        >0        \b, %d bits per pixel
  2008. >13    byte        >0        \b, %d color map channels
  2009.  
  2010. # image file format (Robert Potter, potter@cs.rochester.edu)
  2011. 0    string        Imagefile\ version-    iff image data
  2012. # this adds the whole header (inc. version number), informative but longish
  2013. >10    string        >\0        %s
  2014.  
  2015. # Sun raster images, from Daniel Quinlan (quinlan@yggdrasil.com)
  2016. 0    belong        0x59a66a95    Sun raster image data
  2017. >4    belong        >0        \b, %d x
  2018. >8    belong        >0        %d,
  2019. >12    belong        >0        %d-bit,
  2020. #>16    belong        >0        %d bytes long,
  2021. >20    belong        0        old format,
  2022. #>20    belong        1        standard,
  2023. >20    belong        2        compressed,
  2024. >20    belong        3        RGB,
  2025. >20    belong        4        TIFF,
  2026. >20    belong        5        IFF,
  2027. >20    belong        0xffff        reserved for testing,
  2028. >24    belong        0        no colormap
  2029. >24    belong        1        RGB colormap
  2030. >24    belong        2        raw colormap
  2031. #>28    belong        >0        colormap is %d bytes long
  2032.  
  2033. # SGI image file format, from Daniel Quinlan (quinlan@yggdrasil.com)
  2034. # file://sgi.com/graphics/SGIIMAGESPEC
  2035. 0    beshort        474        SGI image data
  2036. #>2    byte        0        \b, verbatim
  2037. >2    byte        1        \b, RLE
  2038. #>3    byte        1        \b, normal precision
  2039. >3    byte        2        \b, high precision
  2040. >4    beshort        x        \b, %d-D
  2041. >6    beshort        x        \b, %d x
  2042. >8    beshort        x        %d
  2043. >10    beshort        x        \b, %d channel
  2044. >10    beshort        !1        \bs
  2045. >80    string        >0        \b, "%s"
  2046.  
  2047. 0    string        IT01        FIT image data
  2048. >4    belong        x        \b, %d x
  2049. >8    belong        x        %d x
  2050. >12    belong        x        %d
  2051. #
  2052. 0    string        IT02        FIT image data
  2053. >4    belong        x        \b, %d x
  2054. >8    belong        x        %d x
  2055. >12    belong        x        %d
  2056. #
  2057. 2048    string        PCD_IPI        Kodak Photo CD image pack file
  2058. 0    string        PCD_OPA        Kodak Photo CD overview pack file
  2059.  
  2060. # FITS format.  Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>
  2061. # FITS is the Flexible Image Transport System, the de facto standard for
  2062. # data and image transfer, storage, etc., for the astronomical community.
  2063. # (FITS floating point formats are big-endian.)
  2064. 0    string    SIMPLE\ \ =    FITS image data
  2065. >109    string    8        \b, 8-bit, character or unsigned binary integer
  2066. >108    string    16        \b, 16-bit, two's complement binary integer
  2067. >107    string    \ 32        \b, 32-bit, two's complement binary integer
  2068. >107    string    -32        \b, 32-bit, floating point, single precision
  2069. >107    string    -64        \b, 64-bit, floating point, double precision
  2070.  
  2071. # other images
  2072. 0    string    This\ is\ a\ BitMap\ file    Lisp Machine bit-array-file
  2073. 0    string        !!        Bennet Yee's "face" format
  2074.  
  2075. # From SunOS 5.5.1 "/etc/magic" - appeared right before Sun raster image
  2076. # stuff.
  2077. #
  2078. 0    beshort        0x1010        PEX Binary Archive
  2079.  
  2080. #------------------------------------------------------------------------------
  2081. # intel:  file(1) magic for x86 Unix
  2082. #
  2083. # Various flavors of x86 UNIX executable/object (other than Xenix, which
  2084. # is in "microsoft").  DOS is in "msdos"; the ambitious soul can do
  2085. # Windows as well.
  2086. #
  2087. # Windows NT belongs elsewhere, as you need x86 and MIPS and Alpha and
  2088. # whatever comes next (HP-PA Hummingbird?).  OS/2 may also go elsewhere
  2089. # as well, if, as, and when IBM makes it portable.
  2090. #
  2091. # The `versions' should be un-commented if they work for you.
  2092. # (Was the problem just one of endianness?)
  2093. #
  2094. 0    leshort        0502        basic-16 executable
  2095. >12    lelong        >0        not stripped
  2096. #>22    leshort        >0        - version %ld
  2097. 0    leshort        0503        basic-16 executable (TV)
  2098. >12    lelong        >0        not stripped
  2099. #>22    leshort        >0        - version %ld
  2100. 0    leshort        0510        x86 executable
  2101. >12    lelong        >0        not stripped
  2102. 0    leshort        0511        x86 executable (TV)
  2103. >12    lelong        >0        not stripped
  2104. 0    leshort        =0512        iAPX 286 executable small model (COFF)
  2105. >12    lelong        >0        not stripped
  2106. #>22    leshort        >0        - version %ld
  2107. 0    leshort        =0522        iAPX 286 executable large model (COFF)
  2108. >12    lelong        >0        not stripped
  2109. #>22    leshort        >0        - version %ld
  2110. # SGI labeled the next entry as "iAPX 386 executable" --Dan Quinlan
  2111. 0    leshort        =0514        80386 COFF executable
  2112. >12    lelong        >0        not stripped
  2113. >22    leshort        >0        - version %ld
  2114.  
  2115. #------------------------------------------------------------------------------
  2116. # interleaf:  file(1) magic for InterLeaf TPS:
  2117. #
  2118. 0    string        =\210OPS    Interleaf saved data
  2119. 0    string        =<!OPS        Interleaf document text
  2120. >5    string        ,\ Version\ =    \b, version
  2121. >>17    string        >\0        %.3s
  2122.  
  2123. #------------------------------------------------------------------------------
  2124. # ispell:  file(1) magic for ispell
  2125. #
  2126. # Ispell 3.0 has a magic of 0x9601 and ispell 3.1 has 0x9602.  This magic
  2127. # will match 0x9600 through 0x9603 in *both* little endian and big endian.
  2128. # (No other current magic entries collide.)
  2129. #
  2130. # Updated by Daniel Quinlan (quinlan@yggdrasil.com)
  2131. #
  2132. 0    leshort&0xFFFC    0x9600        little endian ispell
  2133. >0    byte        0        hash file (?),
  2134. >0    byte        1        3.0 hash file,
  2135. >0    byte        2        3.1 hash file,
  2136. >0    byte        3        hash file (?),
  2137. >2    leshort        0x00        8-bit, no capitalization, 26 flags
  2138. >2    leshort        0x01        7-bit, no capitalization, 26 flags
  2139. >2    leshort        0x02        8-bit, capitalization, 26 flags
  2140. >2    leshort        0x03        7-bit, capitalization, 26 flags
  2141. >2    leshort        0x04        8-bit, no capitalization, 52 flags
  2142. >2    leshort        0x05        7-bit, no capitalization, 52 flags
  2143. >2    leshort        0x06        8-bit, capitalization, 52 flags
  2144. >2    leshort        0x07        7-bit, capitalization, 52 flags
  2145. >2    leshort        0x08        8-bit, no capitalization, 128 flags
  2146. >2    leshort        0x09        7-bit, no capitalization, 128 flags
  2147. >2    leshort        0x0A        8-bit, capitalization, 128 flags
  2148. >2    leshort        0x0B        7-bit, capitalization, 128 flags
  2149. >2    leshort        0x0C        8-bit, no capitalization, 256 flags
  2150. >2    leshort        0x0D        7-bit, no capitalization, 256 flags
  2151. >2    leshort        0x0E        8-bit, capitalization, 256 flags
  2152. >2    leshort        0x0F        7-bit, capitalization, 256 flags
  2153. >4    leshort        >0        and %d string characters
  2154. 0    beshort&0xFFFC    0x9600        big endian ispell
  2155. >1    byte        0        hash file (?),
  2156. >1    byte        1        3.0 hash file,
  2157. >1    byte        2        3.1 hash file,
  2158. >1    byte        3        hash file (?),
  2159. >2    beshort        0x00        8-bit, no capitalization, 26 flags
  2160. >2    beshort        0x01        7-bit, no capitalization, 26 flags
  2161. >2    beshort        0x02        8-bit, capitalization, 26 flags
  2162. >2    beshort        0x03        7-bit, capitalization, 26 flags
  2163. >2    beshort        0x04        8-bit, no capitalization, 52 flags
  2164. >2    beshort        0x05        7-bit, no capitalization, 52 flags
  2165. >2    beshort        0x06        8-bit, capitalization, 52 flags
  2166. >2    beshort        0x07        7-bit, capitalization, 52 flags
  2167. >2    beshort        0x08        8-bit, no capitalization, 128 flags
  2168. >2    beshort        0x09        7-bit, no capitalization, 128 flags
  2169. >2    beshort        0x0A        8-bit, capitalization, 128 flags
  2170. >2    beshort        0x0B        7-bit, capitalization, 128 flags
  2171. >2    beshort        0x0C        8-bit, no capitalization, 256 flags
  2172. >2    beshort        0x0D        7-bit, no capitalization, 256 flags
  2173. >2    beshort        0x0E        8-bit, capitalization, 256 flags
  2174. >2    beshort        0x0F        7-bit, capitalization, 256 flags
  2175. >4    beshort        >0        and %d string characters
  2176. #------------------------------------------------------------
  2177. # Java ByteCode
  2178. # From Larry Schwimmer (schwim@cs.stanford.edu)
  2179. #
  2180. # The Java magic number is the same as the Mach-O fat file magic number.
  2181. # Interestingly the the same guy, Mike DeMoney, of NeXT Inc. then of First
  2182. # Person (Sun) picked both numbers only a couple of years apart.  To make
  2183. # the file(1) command work with both the Java Bytecode magic was merged with
  2184. # the Mach-O magic in the file mach.
  2185. #
  2186. #0    belong        0xcafebabe
  2187. #>4    belong        0x0003002d    Java bytecode
  2188.  
  2189. #------------------------------------------------------------------------------
  2190. # karma:  file(1) magic for Karma data files
  2191. #
  2192. # From <rgooch@atnf.csiro.au>
  2193.  
  2194. 0    string        KarmaRHD Version    Karma Data Structure Version
  2195. >16    long        x        %lu
  2196.  
  2197. #------------------------------------------------------------------------------
  2198. # lex:  file(1) magic for lex
  2199. #
  2200. #    derived empirically, your offsets may vary!
  2201. 53    string        yyprevious    C program text (from lex)
  2202. >3    string        >\0         for %s
  2203. # C program text from GNU flex, from Daniel Quinlan <quinlan@yggdrasil.com>
  2204. 21    string        generated\ by\ flex    C program text (from flex)
  2205. # lex description file, from Daniel Quinlan <quinlan@yggdrasil.com>
  2206. 0    string        %{        lex description text
  2207.  
  2208. #------------------------------------------------------------------------------
  2209. # lif:  file(1) magic for lif
  2210. #
  2211. # XXX - byte order?  (Probably beshort, Daniel Quinlan <quinlan@yggdrasil.com>)
  2212. #
  2213. 0    short        0x8000        lif file
  2214.  
  2215. #------------------------------------------------------------------------------
  2216. # linux:  file(1) magic for Linux files
  2217. #
  2218. # Values for Linux/i386 binaries, from Daniel Quinlan <quinlan@yggdrasil.com>
  2219. # The following basic Linux magic is useful for reference, but using
  2220. # "long" magic is a better practice in order to avoid collisions.
  2221. #
  2222. # 2    leshort        100        Linux/i386
  2223. # >0    leshort        0407        impure executable (OMAGIC)
  2224. # >0    leshort        0410        pure executable (NMAGIC)
  2225. # >0    leshort        0413        demand-paged executable (ZMAGIC)
  2226. # >0    leshort        0314        demand-paged executable (QMAGIC)
  2227. #
  2228. 0    lelong        0x00640107    Linux/i386 impure executable (OMAGIC)
  2229. >16    lelong        0        \b, stripped
  2230. 0    lelong        0x00640108    Linux/i386 pure executable (NMAGIC)
  2231. >16    lelong        0        \b, stripped
  2232. 0    lelong        0x0064010b    Linux/i386 demand-paged executable (ZMAGIC)
  2233. >16    lelong        0        \b, stripped
  2234. 0    lelong        0x006400cc    Linux/i386 demand-paged executable (QMAGIC)
  2235. >16    lelong        0        \b, stripped
  2236. #
  2237. 0    string        \007\001\000    Linux/i386 object file
  2238. >20    lelong        >0x1020        \b, DLL library
  2239. # message catalogs, from Mitchum DSouza <m.dsouza@mrc-apu.cam.ac.uk>
  2240. 0    string        *nazgul*    Linux compiled message catalog
  2241. >8    lelong        >0        \b, version %ld
  2242. # core dump file, from Bill Reynolds <bill@goshawk.lanl.gov>
  2243. 216    lelong        0421        Linux/i386 core file
  2244. >220    string        >\0        of '%s'
  2245. >200    lelong        >0        (signal %d)
  2246. #
  2247. # LILO boot/chain loaders, from Daniel Quinlan <quinlan@yggdrasil.com>
  2248. # this can be overridden by the DOS executable (COM) entry
  2249. 2    string        LILO        Linux/i386 LILO boot/chain loader
  2250. #
  2251. # Debian Packages, from Peter Tobias <tobias@server.et-inf.fho-emden.de>
  2252. 0    string        0.9
  2253. >8    byte        0x0a        Debian Binary Package
  2254. >>3    byte        >0        \b, created by dpkg 0.9%c
  2255. >>4    byte        >0        pl%c
  2256. # PSF fonts, from H. Peter Anvin <hpa@yggdrasil.com>
  2257. 0    leshort        0x0436        Linux/i386 PC Screen Font data,
  2258. >2    byte        0        256 characters, no directory,
  2259. >2    byte        1        512 characters, no directory,
  2260. >2    byte        2        256 characters, Unicode directory,
  2261. >2    byte        3        512 characters, Unicode directory,
  2262. >3    byte        >0        8x%d
  2263. # Linux swap file, from Daniel Quinlan <quinlan@yggdrasil.com>
  2264. 4086    string        SWAP-SPACE    Linux/i386 swap file
  2265. # ECOFF magic for OSF/1 and Linux (only tested under Linux though)
  2266. #
  2267. #    from Erik Troan (ewt@redhat.com) examining od dumps, so this
  2268. #        could be wrong
  2269. #      updated by David Mosberger (davidm@azstarnet.com) based on
  2270. #      GNU BFD and MIPS info found below.
  2271. #
  2272. 0    leshort        0x0183        ECOFF alpha
  2273. >24    leshort        0407        executable
  2274. >24    leshort        0410        pure
  2275. >24    leshort        0413        demand paged
  2276. >8    long        >0        not stripped
  2277. >8    long        0        stripped
  2278. >23    leshort        >0        - version %ld.
  2279. # linux Kernel images version 1.3.80 - ?
  2280. # from Axel Kohlmeyer <akohlmey@rincewind.chemie.uni-ulm.de>
  2281. 0       belong          0xb8c0078e      Linux/x86 kernel image,
  2282. >0x048c byte            0x31
  2283. >>0x048c string         x               version %s
  2284. >0x0493 byte            0x31
  2285. >>0x0493 string         x               version %s
  2286. #
  2287.  
  2288. #------------------------------------------------------------------------------
  2289. # lisp:  file(1) magic for lisp programs
  2290. #
  2291. # various lisp types, from Daniel Quinlan (quinlan@yggdrasil.com)
  2292. 0    string    ;;            Lisp/Scheme program text
  2293. # Emacs 18 - this is always correct, but not very magical.
  2294. 0    string    \012(            byte-compiled Emacs-Lisp program data
  2295. # Emacs 19
  2296. 0    string    ;ELC\023\000\000\000    byte-compiled Emacs-Lisp program data
  2297. #------------------------------------------------------------------------------
  2298. # mach file description
  2299. #
  2300. # Since Java bytecode and Mach-O fat-files have the same magic number the test
  2301. # must be preformed in the same "magic" sequence to get both right.  The long
  2302. # at offset 4 in a fat file tells the number of architectures.  The short at
  2303. # offset 4 in a Java bytecode file is the compiler minor version and the
  2304. # short at offset 6 is the compiler major version.  Since the minor version is
  2305. # never to be non-zero then the hack of testing for the number of architectures
  2306. # to be less that the maximum short is done here.
  2307. #
  2308. 0    belong        0xcafebabe
  2309. >4    belong        0x0003002d    Java bytecode
  2310. >4    belong        1        Mach-O fat file with 1 architecture
  2311. >4    belong        >1
  2312. >>4    belong        <0xffff        Mach-O fat file with %ld architectures
  2313. #
  2314. 0    lelong        0xfeedface    Mach-O
  2315. >12    lelong        1        object
  2316. >12    lelong        2        executable
  2317. >12    lelong        3        fixed virtual memory shared library
  2318. >12    lelong        4        core
  2319. >12    lelong        5        preload executable
  2320. >12    lelong        6        dynamically linked shared library
  2321. >12    lelong        7        dynamic linker
  2322. >12    lelong        8        bundle
  2323. >12    lelong        >8
  2324. >>12    lelong        x        filetype=%ld
  2325. >4    lelong        <0
  2326. >>4    lelong        x        architecture=%ld
  2327. >4    lelong        1        vax
  2328. >4    lelong        2        romp
  2329. >4    lelong        3        architecture=3
  2330. >4    lelong        4        ns32032
  2331. >4    lelong        5        ns32332
  2332. >4    lelong        6        m68k
  2333. >4    lelong        7        i386
  2334. >4    lelong        8        mips
  2335. >4    lelong        9        ns32532
  2336. >4    lelong        10        architecture=10
  2337. >4    lelong        11        hppa
  2338. >4    lelong        12        acorn
  2339. >4    lelong        13        m88k
  2340. >4    lelong        14        sparc
  2341. >4    lelong        15        i860-big
  2342. >4    lelong        16        i860
  2343. >4    lelong        17        rs6000
  2344. >4    lelong        18        ppc
  2345. >4    lelong        >18
  2346. >>4    lelong        x        architecture=%ld
  2347. #
  2348. 0    belong        0xfeedface    Mach-O
  2349. >12    belong        1        object
  2350. >12    belong        2        executable
  2351. >12    belong        3        fixed virtual memory shared library
  2352. >12    belong        4        core
  2353. >12    belong        5        preload executable
  2354. >12    belong        6        dynamically linked shared library
  2355. >12    belong        7        dynamic linker
  2356. >12    belong        8        bundle
  2357. >12    belong        >8
  2358. >>12    belong        x        filetype=%ld
  2359. >4    belong        <0
  2360. >>4    belong        x        architecture=%ld
  2361. >4    belong        1        vax
  2362. >4    belong        2        romp
  2363. >4    belong        3        architecture=3
  2364. >4    belong        4        ns32032
  2365. >4    belong        5        ns32332
  2366. >4    belong        6        m68k
  2367. >4    belong        7        i386
  2368. >4    belong        8        mips
  2369. >4    belong        9        ns32532
  2370. >4    belong        10        architecture=10
  2371. >4    belong        11        hppa
  2372. >4    belong        12        acorn
  2373. >4    belong        13        m88k
  2374. >4    belong        14        sparc
  2375. >4    belong        15        i860-big
  2376. >4    belong        16        i860
  2377. >4    belong        17        rs6000
  2378. >4    belong        18        ppc
  2379. >4    belong        >18
  2380. >>4    belong        x        architecture=%ld
  2381.  
  2382. #------------------------------------------------------------------------------
  2383. # macintosh:  file(1) magic for Apple Macintosh file formats
  2384.  
  2385. # Stuffit archives are the de facto standard of compression for Macintosh
  2386. # files obtained from most archives. (franklsm@tuns.ca)
  2387. 0    string        SIT!            StuffIt Archive (data)
  2388. >2    string        x            : %s
  2389. 65    string        SIT!            StuffIt Archive (rsrc + data)
  2390. >2    string        x            : %s
  2391. 0    string        SITD            StuffIt Deluxe (data)
  2392. >2    string        x            : %s
  2393. 65    string        SITD            StuffIt Deluxe (rsrc + data)
  2394. >2    string        x            : %s
  2395. 0    string        Seg            StuffIt Deluxe Segment (data)
  2396. >2    string        x            : %s
  2397. 65    string        Seg            StuffIt Deluxe Segment (rsrc + data)
  2398. >2    string        x            : %s
  2399.  
  2400. # Macintosh Applications and Installation binaries (franklsm@tuns.ca)
  2401. 0    string        APPL            Macintosh Application (data)
  2402. >2    string        x            : %s
  2403. 65    string        APPL            Macintosh Application (rsrc + data)
  2404. >2    string        x            : %s
  2405.  
  2406. # Macintosh System files (franklsm@tuns.ca)
  2407. 0    string        zsys            Macintosh System File (data)
  2408. 65    string        zsys            Macintosh System File(rsrc + data)
  2409. 0    string        FNDR            Macintosh Finder (data)
  2410. 65    string        FNDR            Macintosh Finder(rsrc + data)
  2411. 0    string        libr            Macintosh Library (data)
  2412. >2    string        x            : %s
  2413. 65    string        libr            Macintosh Library(rsrc + data)
  2414. >2    string        x            : %s
  2415. 0    string        shlb            Macintosh Shared Library (data)
  2416. >2    string        x            : %s
  2417. 65    string        shlb            Macintosh Shared Library(rsrc + data)
  2418. >2    string        x            : %s
  2419. 0    string        cdev            Macintosh Control Panel (data)
  2420. >2    string        x            : %s
  2421. 65    string        cdev            Macintosh Control Panel(rsrc + data)
  2422. >2    string        x            : %s
  2423. 0    string        INIT            Macintosh Extension (data)
  2424. >2    string        x            : %s
  2425. 65    string        INIT            Macintosh Extension(rsrc + data)
  2426. >2    string        x            : %s
  2427. 0    string        FFIL            Macintosh Truetype Font (data)
  2428. >2    string        x            : %s
  2429. 65    string        FFIL            Macintosh Truetype Font(rsrc + data)
  2430. >2    string        x            : %s
  2431. 0    string        LWFN            Macintosh Postscript Font (data)
  2432. >2    string        x            : %s
  2433. 65    string        LWFN            Macintosh Postscript Font(rsrc + data)
  2434. >2    string        x            : %s
  2435.  
  2436. # Additional Macintosh Files (franklsm@tuns.ca)
  2437. 0    string        PACT            Macintosh Compact Pro Archive (data)
  2438. >2    string        x            : %s
  2439. 65    string        PACT            Macintosh Compact Pro Archive(rsrc + data)
  2440. >2    string        x            : %s
  2441. 0    string        ttro            Macintosh TeachText File (data)
  2442. >2    string        x            : %s
  2443. 65    string        ttro            Macintosh TeachText File(rsrc + data)
  2444. >2    string        x            : %s
  2445. 0    string        TEXT            Macintosh TeachText File (data)
  2446. >2    string        x            : %s
  2447. 65    string        TEXT            Macintosh TeachText File(rsrc + data)
  2448. >2    string        x            : %s
  2449. 0    string        PDF            Macintosh PDF File (data)
  2450. >2    string        x            : %s
  2451. 65    string        PDF            Macintosh PDF File(rsrc + data)
  2452. >2    string        x            : %s
  2453.  
  2454. #------------------------------------------------------------------------------
  2455. # magic:  file(1) magic for magic files
  2456. #
  2457. 0    string        #\ Magic    magic text file for file(1) cmd
  2458.  
  2459. #------------------------------------------------------------------------------
  2460. # mail.news:  file(1) magic for mail and news
  2461. #
  2462. # Unfortunately, saved netnews also has From line added in some news software.
  2463. #0    string        From         mail text
  2464. # There are tests to ascmagic.c to cope with mail and news.
  2465. 0    string        Relay-Version:     old news text
  2466. 0    string        #!\ rnews    batched news text
  2467. 0    string        N#!\ rnews    mailed, batched news text
  2468. 0    string        Forward\ to     mail forwarding text
  2469. 0    string        Pipe\ to     mail piping text
  2470. 0    string        Return-Path:    smtp mail text
  2471. 0    string        Path:        news text
  2472. 0    string        Xref:        news text
  2473. 0    string        From:        news or mail text
  2474. 0    string        Article     saved news text
  2475. 0    string        BABYL        Emacs RMAIL text
  2476. 0    string        Received:    RFC 822 mail text
  2477. 0    string        MIME-Version:    MIME entity text
  2478. 0    string        Content-    MIME entity text
  2479.  
  2480. #------------------------------------------------------------------------------
  2481. # mirage:  file(1) magic for Mirage executables
  2482. #
  2483. # XXX - byte order?
  2484. #
  2485. 0    long    31415        Mirage Assembler m.out executable
  2486.  
  2487. #------------------------------------------------------------------------------
  2488. # mkid:  file(1) magic for mkid(1) databases
  2489. #
  2490. # ID is the binary tags database produced by mkid(1).
  2491. #
  2492. # XXX - byte order?
  2493. #
  2494. 0    string        \311\304    ID tags data
  2495. >2    short        >0        version %d
  2496.  
  2497. #------------------------------------------------------------------------------
  2498. # mmdf:  file(1) magic for MMDF mail files
  2499. #
  2500. 0    string    \001\001\001\001    MMDF mailbox
  2501.  
  2502. #------------------------------------------------------------------------------
  2503. # motorola:  file(1) magic for Motorola 68K and 88K binaries
  2504. #
  2505. # 68K
  2506. #
  2507. 0    beshort        0520        mc68k COFF
  2508. >18    beshort        ^00000020    object
  2509. >18    beshort        &00000020    executable
  2510. >12    belong        >0        not stripped
  2511. >168    string        .lowmem        Apple toolbox
  2512. >20    beshort        0407        (impure)
  2513. >20    beshort        0410        (pure)
  2514. >20    beshort        0413        (demand paged)
  2515. >20    beshort        0421        (standalone)
  2516. 0    beshort        0521        mc68k executable (shared)
  2517. >12    belong        >0        not stripped
  2518. 0    beshort        0522        mc68k executable (shared demand paged)
  2519. >12    belong        >0        not stripped
  2520. #
  2521. # Motorola/UniSoft 68K Binary Compatibility Standard (BCS)
  2522. #
  2523. 0    beshort        0554        68K BCS executable
  2524. #
  2525. # 88K
  2526. #
  2527. # Motorola/88Open BCS
  2528. #
  2529. 0    beshort        0555        88K BCS executable
  2530. #
  2531. # Motorola S-Records, from Gerd Truschinski <gt@freebsd.first.gmd.de>
  2532. 0   string      S0          Motorola S-Record; binary data in text format
  2533.  
  2534. #------------------------------------------------------------------------------
  2535. # msdos:  file(1) magic for MS-DOS files
  2536. #
  2537.  
  2538. # .BAT files (Daniel Quinlan, quinlan@yggdrasil.com)
  2539. 0    string    @echo\ off    MS-DOS batch file text
  2540.  
  2541. # .EXE formats (Greg Roelofs, newt@uchicago.edu)
  2542. #
  2543. 0    string    MZ        MS-DOS executable (EXE)
  2544. >24    string    @        \b, OS/2 or Windows
  2545. >1638    string    -lh5-        \b, LHa SFX archive v2.13S
  2546. >7195    string    Rar!        \b, RAR self-extracting archive
  2547. #
  2548. # [GRR 950118:  file 3.15 has a buffer-size limitation; offsets bigger than
  2549. #   8161 bytes are ignored.  To make the following entries work, increase
  2550. #   HOWMANY in file.h to 32K at least, and maybe to 70K or more for OS/2,
  2551. #   NT/Win32 and VMS.]
  2552. # [GRR:  some company sells a self-extractor/displayer for image data(!)]
  2553. #
  2554. >11696    string    PK\003\004    \b, PKZIP SFX archive v1.1
  2555. >13297    string    PK\003\004    \b, PKZIP SFX archive v1.93a
  2556. >15588    string    PK\003\004    \b, PKZIP2 SFX archive v1.09
  2557. >15770    string    PK\003\004    \b, PKZIP SFX archive v2.04g
  2558. >28374    string    PK\003\004    \b, PKZIP2 SFX archive v1.02
  2559. #
  2560. # Info-ZIP self-extractors
  2561. #    these are the DOS versions:
  2562. >25115    string    PK\003\004    \b, Info-ZIP SFX archive v5.12
  2563. >26331    string    PK\003\004    \b, Info-ZIP SFX archive v5.12 w/decryption
  2564. #    these are the OS/2 versions (OS/2 is flagged above):
  2565. >47031    string    PK\003\004    \b, Info-ZIP SFX archive v5.12
  2566. >49845    string    PK\003\004    \b, Info-ZIP SFX archive v5.12 w/decryption
  2567. #    this is the NT/Win32 version:
  2568. >69120    string    PK\003\004    \b, Info-ZIP NT SFX archive v5.12 w/decryption
  2569. #
  2570. # TELVOX Teleinformatica CODEC self-extractor for OS/2:
  2571. >49801    string    \x79\xff\x80\xff\x76\xff    \b, CODEC archive v3.21
  2572. >>49824    leshort        =1            \b, 1 file
  2573. >>49824    leshort        >1            \b, %u files
  2574.  
  2575. # .COM formats (Daniel Quinlan, quinlan@yggdrasil.com)
  2576. # Uncommenting only the first two lines will cover about 2/3 of COM files,
  2577. # but it isn't feasible to match all COM files since there must be at least
  2578. # two dozen different one-byte "magics".
  2579. #0    byte        0xe9        MS-DOS executable (COM)
  2580. #0    byte        0x8c        MS-DOS executable (COM)
  2581. # 0xeb conflicts with "sequent" magic
  2582. #0    byte        0xeb        MS-DOS executable (COM)
  2583. #0    byte        0xb8        MS-DOS executable (COM)
  2584.  
  2585. # miscellaneous formats
  2586. 0    string        LZ        MS-DOS executable (built-in)
  2587. #0    byte        0xf0        MS-DOS program library data
  2588. #
  2589.  
  2590. # Popular applications
  2591. 2080    string    Microsoft\ Word\ 6.0\ Document    %s
  2592. #
  2593. 0    belong    0x31be0000    Microsoft Word Document
  2594. #
  2595. 2080    string    Microsoft\ Excel\ 5.0\ Worksheet    %s
  2596. #
  2597. 0    belong    0x00001a00    Lotus 1-2-3
  2598. >4    belong    0x00100400    wk3 document
  2599. >4    belong    0x02100400    wk4 document
  2600. >4    belong    0x07800100    fm3 or fmb document
  2601. >4    belong    0x07800000    fm3 or fmb document
  2602. #
  2603. 0    belong    0x00000200     Lotus 1-2-3
  2604. >4    belong    0x06040600    wk1 document
  2605. >4    belong    0x06800200    fmt document
  2606.  
  2607. #------------------------------------------------------------------------------
  2608. # ncr:  file(1) magic for NCR Tower objects
  2609. #
  2610. # contributed by
  2611. # Michael R. Wayne  ***  TMC & Associates  ***  INTERNET: wayne@ford-vax.arpa
  2612. # uucp: {philabs | pyramid} !fmsrl7!wayne   OR   wayne@fmsrl7.UUCP
  2613. #
  2614. 0    beshort        000610    Tower/XP rel 2 object
  2615. >12       belong        >0    not stripped
  2616. >20       beshort        0407    executable
  2617. >20       beshort        0410    pure executable
  2618. >22       beshort        >0    - version %ld
  2619. 0    beshort        000615    Tower/XP rel 2 object
  2620. >12       belong        >0    not stripped
  2621. >20       beshort        0407    executable
  2622. >20       beshort        0410    pure executable
  2623. >22       beshort        >0    - version %ld
  2624. 0    beshort        000620    Tower/XP rel 3 object
  2625. >12       belong        >0    not stripped
  2626. >20       beshort        0407    executable
  2627. >20       beshort        0410    pure executable
  2628. >22       beshort        >0    - version %ld
  2629. 0    beshort        000625    Tower/XP rel 3 object
  2630. >12       belong        >0    not stripped
  2631. >20       beshort        0407    executable
  2632. >20       beshort        0410    pure executable
  2633. >22       beshort        >0    - version %ld
  2634. 0    beshort        000630    Tower32/600/400 68020 object
  2635. >12       belong        >0    not stripped
  2636. >20       beshort        0407    executable
  2637. >20       beshort        0410    pure executable
  2638. >22       beshort        >0    - version %ld
  2639. 0    beshort        000640    Tower32/800 68020
  2640. >18       beshort        &020000    w/68881 object
  2641. >18       beshort        &040000    compatible object
  2642. >18       beshort        &~060000    object
  2643. >20       beshort        0407    executable
  2644. >20       beshort        0413    pure executable
  2645. >12       belong        >0    not stripped
  2646. >22       beshort        >0    - version %ld
  2647. 0    beshort        000645    Tower32/800 68010
  2648. >18       beshort        &040000    compatible object
  2649. >18       beshort        &~060000 object
  2650. >20       beshort        0407    executable
  2651. >20       beshort        0413    pure executable
  2652. >12       belong        >0    not stripped
  2653. >22       beshort        >0    - version %ld
  2654.  
  2655. #------------------------------------------------------------------------------
  2656. # news:  file(1) magic for SunOS NeWS fonts (not "news" as in "netnews")
  2657. #
  2658. 0    string        StartFontMetrics    ASCII font metrics
  2659. 0    string        StartFont    ASCII font bits
  2660. 0    belong        0x137A2944    NeWS bitmap font
  2661. 0    belong        0x137A2947    NeWS font family
  2662. 0    belong        0x137A2950    scalable OpenFont binary
  2663. 0    belong        0x137A2951    encrypted scalable OpenFont binary
  2664. 8    belong        0x137A2B45    X11/NeWS bitmap font
  2665. 8    belong        0x137A2B48    X11/NeWS font family
  2666.  
  2667. #------------------------------------------------------------------------------
  2668. # olf:  file(1) magic for OLF executables
  2669. #
  2670. # We have to check the byte order flag to see what byte order all the
  2671. # other stuff in the header is in.
  2672. #
  2673. # Byte order is probably big-endian for MIPS R3000 and Amdahl.
  2674. # MIPS R3000 may also be for MIPS R2000.
  2675. #
  2676. # Created by Erik Theisen <etheisen@openbsd.org>
  2677. # Based on elf from Daniel Quinlan <quinlan@yggdrasil.com>
  2678. 0    string        \177OLF        OLF
  2679. >4    byte        0        invalid class
  2680. >4    byte        1        32-bit
  2681. >4    byte        2        64-bit
  2682. >7    byte        0        invalid os
  2683. >7    byte        1        OpenBSD
  2684. >7    byte        2        NetBSD
  2685. >7    byte        3        FreeBSD
  2686. >7    byte        4        4.4BSD
  2687. >7    byte        5        Linux
  2688. >7    byte        6        Mach
  2689. >7    byte        7        SVR4
  2690. >7    byte        8        esix
  2691. >7    byte        9        Solaris
  2692. >7    byte        10        Irix
  2693. >7    byte        11        SCO
  2694. >7    byte        12        Dell
  2695. >8    byte        1        dynamically linked
  2696. >9    byte        1        unstripped
  2697. >5    byte        0        invalid byte order
  2698. >5    byte        1        LSB
  2699. >>16    leshort        0        no file type,
  2700. >>16    leshort        1        relocatable,
  2701. >>16    leshort        2        executable,
  2702. >>16    leshort        3        shared object,
  2703. >>16    leshort        4        core file,
  2704. >>16    leshort        &0xff00        processor-specific,
  2705. >>18    leshort        0        no machine,
  2706. >>18    leshort        1        AT&T WE32100 - invalid byte order,
  2707. >>18    leshort        2        SPARC - invalid byte order,
  2708. >>18    leshort        3        Intel 80386,
  2709. >>18    leshort        4        Motorola 68000 - invalid byte order,
  2710. >>18    leshort        5        Motorola 88000 - invalid byte order,
  2711. >>18    leshort        6        Intel 80486,
  2712. >>18    leshort        7        Intel 80860,
  2713. >>18    leshort        8        MIPS R3000,
  2714. >>18    leshort        9        Amdahl,
  2715. >>20    lelong        0        invalid version
  2716. >>20    lelong        1        version 1
  2717. >>36    lelong        1        MathCoPro/FPU/MAU Required
  2718. >5    byte        2        MSB
  2719. >>16    beshort        0        no file type,
  2720. >>16    beshort        1        relocatable,
  2721. >>16    beshort        2        executable,
  2722. >>16    beshort        3        shared object,
  2723. >>16    beshort        4        core file,
  2724. >>16    beshort        &0xff00        processor-specific,
  2725. >>18    beshort        0        no machine,
  2726. >>18    beshort        1        AT&T WE32100,
  2727. >>18    beshort        2        SPARC,
  2728. >>18    beshort        3        Intel 80386 - invalid byte order,
  2729. >>18    beshort        4        Motorola 68000,
  2730. >>18    beshort        5        Motorola 88000,
  2731. >>18    beshort        6        Intel 80486 - invalid byte order,
  2732. >>18    beshort        7        Intel 80860,
  2733. >>18    beshort        8        MIPS R3000,
  2734. >>18    leshort        9        Amdahl,
  2735. >>20    belong        0        invalid version
  2736. >>20    belong        1        version 1
  2737. >>36    belong        1        MathCoPro/FPU/MAU Required
  2738. #
  2739. # $OpenBSD: os9,v 1.2 1996/06/26 05:33:04 deraadt Exp $
  2740. # $NetBSD: os9,v 1.1 1996/05/06 18:24:01 is Exp $
  2741. #
  2742. # Copyright (c) 1996 Ignatios Souvatzis. All rights reserved.
  2743. #
  2744. # Redistribution and use in source and binary forms, with or without
  2745. # modification, are permitted provided that the following conditions
  2746. # are met:
  2747. # 1. Redistributions of source code must retain the above copyright
  2748. #    notice, this list of conditions and the following disclaimer.
  2749. # 2. Redistributions in binary form must reproduce the above copyright
  2750. #    notice, this list of conditions and the following disclaimer in the
  2751. #    documentation and/or other materials provided with the distribution.
  2752. # 3. All advertising materials mentioning features or use of this software
  2753. #    must display the following acknowledgement:
  2754. #      This product includes software developed by Ignatios Souvatzis for
  2755. #      the NetBSD project.
  2756. # 4. The name of the author may not be used to endorse or promote products
  2757. #    derived from this software without specific prior written permission.
  2758. #
  2759. #
  2760. # THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  2761. # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
  2762. # OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  
  2763. # IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  2764. # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
  2765. # PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
  2766. # OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  2767. # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  2768. # OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  2769. # ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2770. #
  2771. #
  2772. #
  2773. # OS9/6809 module descriptions:
  2774. #
  2775. 0    beshort        0x87CD    OS9/6809 module:
  2776. #
  2777. >6    byte&0x0f    0x00    non-executable
  2778. >6    byte&0x0f    0x01    machine language
  2779. >6    byte&0x0f    0x02    BASIC I-code
  2780. >6    byte&0x0f    0x03    P-code
  2781. >6    byte&0x0f    0x04    C I-code
  2782. >6    byte&0x0f    0x05    COBOL I-code
  2783. >6    byte&0x0f    0x06    FORTRAN I-code
  2784. #
  2785. >6    byte&0xf0    0x10    program executable
  2786. >6    byte&0xf0    0x20    subroutine
  2787. >6    byte&0xf0    0x30    multi-module
  2788. >6    byte&0xf0    0x40    data module
  2789. #
  2790. >6    byte&0xf0    0xC0    system module
  2791. >6    byte&0xf0    0xD0    file manager
  2792. >6    byte&0xf0    0xE0    device driver
  2793. >6    byte&0xf0    0xF0    device descriptor
  2794. #
  2795. # OS9/m68k stuff (to be continued)
  2796. #
  2797. 0    beshort        0x4AFC    OS9/68K module:
  2798. #
  2799. # attr
  2800. >14    byte&0x80    0x80    re-entrant
  2801. >14    byte&0x40    0x40    ghost
  2802. >14    byte&0x20    0x20    system-state
  2803. #
  2804. # lang:
  2805. #
  2806. >13    byte        1    machine language
  2807. >13    byte        2    BASIC I-code
  2808. >13    byte        3    P-code
  2809. >13    byte        4    C I-code
  2810. >13    byte        5    COBOL I-code
  2811. >13    byte        6    Fortran I-code
  2812. #
  2813. #
  2814. # type:
  2815. #
  2816. >12    byte        1    program executable
  2817. >12    byte        2    subroutine
  2818. >12    byte        3    multi-module
  2819. >12    byte        4    data module
  2820. >12    byte        11    trap library
  2821. >12    byte        12    system module
  2822. >12    byte        13    file manager
  2823. >12    byte        14    device driver
  2824. >12    byte        15    device descriptor
  2825. #
  2826. # Mach magic number info
  2827. #
  2828. 0    long        0xefbe    OSF/Rose object
  2829. # I386 magic number info
  2830. #
  2831. 0    short        0565    i386 COFF object
  2832.  
  2833. #------------------------------------------------------------------------------
  2834. # pbm:  file(1) magic for Portable Bitmap files
  2835. #
  2836. # XXX - byte order?
  2837. #
  2838. 0    short    0x2a17    "compact bitmap" format (Poskanzer)
  2839. #------------------------------------------------------------------------------
  2840. # pdf:  file(1) magic for Portable Document Format
  2841. #
  2842.  
  2843. 0    string        %PDF-        PDF document
  2844. >5    byte        x        \b, version %c
  2845. >7    byte        x        \b.%c
  2846.  
  2847. #------------------------------------------------------------------------------
  2848. # pdp:  file(1) magic for PDP-11 executable/object and APL workspace
  2849. #
  2850. 0    lelong        0101555        PDP-11 single precision APL workspace
  2851. 0    lelong        0101554        PDP-11 double precision APL workspace
  2852. #
  2853. # PDP-11 a.out
  2854. #
  2855. 0    leshort        0407        PDP-11 executable
  2856. >8    leshort        >0        not stripped
  2857. >15    byte        >0        - version %ld
  2858.  
  2859. 0    leshort        0401        PDP-11 UNIX/RT ldp
  2860. 0    leshort        0405        PDP-11 old overlay
  2861.  
  2862. 0    leshort        0410        PDP-11 pure executable
  2863. >8    leshort        >0        not stripped
  2864. >15    byte        >0        - version %ld
  2865.  
  2866. 0    leshort        0411        PDP-11 separate I&D executable
  2867. >8    leshort        >0        not stripped
  2868. >15    byte        >0        - version %ld
  2869.  
  2870. 0    leshort        0437        PDP-11 kernel overlay
  2871.  
  2872. #------------------------------------------------------------------------------
  2873. # pgp:  file(1) magic for Pretty Good Privacy
  2874. #
  2875. 0       beshort         0x9900                  PGP key public ring
  2876. 0       beshort         0x9501                  PGP key security ring
  2877. 0       beshort         0x9500                  PGP key security ring
  2878. 0    beshort        0xa600            PGP encrypted data
  2879. 0       string          -----BEGIN\040PGP       PGP armored data
  2880. >15     string          PUBLIC\040KEY\040BLOCK- public key block
  2881. >15     string          MESSAGE-                message
  2882. >15     string          SIGNED\040MESSAGE-      signed message
  2883. >15     string          PGP\040SIGNATURE-       signature
  2884.  
  2885. #------------------------------------------------------------------------------
  2886. # pkgadd:  file(1) magic for SysV R4 PKG Datastreams
  2887. #
  2888. 0       string          #\ PaCkAgE\ DaTaStReAm  pkg Datastream (SVR4)
  2889.  
  2890. #------------------------------------------------------------------------------
  2891. # plus5:  file(1) magic for Plus Five's UNIX MUMPS
  2892. #
  2893. # XXX - byte order?  Paging Hokey....
  2894. #
  2895. 0    short        0x259        mumps avl global
  2896. >2    byte        >0        (V%d)
  2897. >6    byte        >0        with %d byte name
  2898. >7    byte        >0        and %d byte data cells
  2899. 0    short        0x25a        mumps blt global
  2900. >2    byte        >0        (V%d)
  2901. >8    short        >0        - %d byte blocks
  2902. >15    byte        0x00        - P/D format
  2903. >15    byte        0x01        - P/K/D format
  2904. >15    byte        0x02        - K/D format
  2905. >15    byte        >0x02        - Bad Flags
  2906.  
  2907. #------------------------------------------------------------------------------
  2908. # printer:  file(1) magic for printer-formatted files
  2909. #
  2910.  
  2911. # PostScript, updated by Daniel Quinlan (quinlan@yggdrasil.com)
  2912. 0    string        %!        PostScript document text
  2913. >2    string        PS-Adobe-    conforming
  2914. >>11    string        >\0        at level %.3s
  2915. >>>15    string        EPS        - type %s
  2916. >>>15    string        Query        - type %s
  2917. >>>15    string        ExitServer    - type %s
  2918. # Some PCs have the annoying habit of adding a ^D as a document separator
  2919. 0    string        \004%!        PostScript document text
  2920. >3    string        PS-Adobe-    conforming
  2921. >>12    string        >\0        at level %.3s
  2922. >>>16    string        EPS        - type %s
  2923. >>>16    string        Query        - type %s
  2924. >>>16    string        ExitServer    - type %s
  2925.  
  2926. # HP Printer Job Language
  2927. 0    string        \033%-12345X@PJL    HP Printer Job Language data
  2928. >15    string        \ ENTER\ LANGUAGE\ =
  2929. >31    string        PostScript        PostScript
  2930.  
  2931. # HP Printer Control Language, Daniel Quinlan (quinlan@yggdrasil.com)
  2932. 0    string        \033E\033    HP PCL printer data
  2933. >3    string        \&l0A        - default page size
  2934. >3    string        \&l1A        - US executive page size
  2935. >3    string        \&l2A        - US letter page size
  2936. >3    string        \&l3A        - US legal page size
  2937. >3    string        \&l26A        - A4 page size
  2938. >3    string        \&l80A        - Monarch envelope size
  2939. >3    string        \&l81A        - No. 10 envelope size
  2940. >3    string        \&l90A        - Intl. DL envelope size
  2941. >3    string        \&l91A        - Intl. C5 envelope size
  2942. >3    string        \&l100A        - Intl. B5 envelope size
  2943. >3    string        \&l-81A        - No. 10 envelope size (landscape)
  2944. >3    string        \&l-90A        - Intl. DL envelope size (landscape)
  2945.  
  2946. # IMAGEN printer-ready files:
  2947. 0    string    @document(        Imagen printer
  2948. # this only works if "language xxx" is first item in Imagen header.
  2949. >10    string    language\ impress    (imPRESS data)
  2950. >10    string    language\ daisy        (daisywheel text)
  2951. >10    string    language\ diablo    (daisywheel text)
  2952. >10    string    language\ printer    (line printer emulation)
  2953. >10    string    language\ tektronix    (Tektronix 4014 emulation)
  2954. # Add any other languages that your Imagen uses - remember
  2955. # to keep the word `text' if the file is human-readable.
  2956. # [GRR 950115:  missing "postscript" or "ultrascript" (whatever it was called)]
  2957. #
  2958. # Now magic for IMAGEN font files...
  2959. 0    string        Rast        RST-format raster font data
  2960. >45    string        >0        face %
  2961.  
  2962. #------------------------------------------------------------------------------
  2963. # psdbms:  file(1) magic for psdatabase
  2964. #
  2965. 0    belong&0xff00ffff    0x56000000    ps database
  2966. >1    string    >\0    version %s
  2967. >4    string    >\0    from kernel %s
  2968.  
  2969. #------------------------------------------------------------------------------
  2970. # pyramid:  file(1) magic for Pyramids
  2971. #
  2972. # XXX - byte order?
  2973. #
  2974. 0    long        0x50900107    Pyramid 90x family executable
  2975. 0    long        0x50900108    Pyramid 90x family pure executable
  2976. >16    long        >0        not stripped
  2977. 0    long        0x5090010b    Pyramid 90x family demand paged pure executable
  2978. >16    long        >0        not stripped
  2979. #------------------------------------------------------------------------------
  2980. #
  2981. # RPM: file(1) magic for Red Hat Packages   Erik Troan (ewt@redhat.com)
  2982. #
  2983. 0    beshort        0xedab        
  2984. >2    beshort        0xeedb        RPM
  2985. >>4    byte        x        v%d
  2986. >>6    beshort        0        bin
  2987. >>6    beshort        1        src
  2988. >>8    beshort        1        i386
  2989. >>8    beshort        2        Alpha
  2990. >>8    beshort        3        Sparc
  2991. >>8    beshort        4        MIPS
  2992. >>8    beshort        5        PowerPC
  2993. >>8    beshort        6        68000
  2994. >>8     beshort         7               SGI
  2995. >>10    string        x        %s
  2996.  
  2997. #------------------------------------------------------------------------------
  2998. # rtf:    file(1) magic for Rich Text Format (RTF)
  2999. #
  3000. # Duncan P. Simpson, D.P.Simpson@dcs.warwick.ac.uk
  3001. #
  3002. 0    string        {\\rtf        Rich Text Format data,
  3003. >5    byte        x        version %c,
  3004. >6    string        \\ansi        ANSI
  3005. >6    string        \\mac        Apple Macintosh
  3006. >6    string        \\pc        IBM PC, code page 437
  3007. >6    string        \\pca        IBM PS/2, code page 850
  3008.  
  3009. #------------------------------------------------------------------------------
  3010. # sc:  file(1) magic for "sc" spreadsheet
  3011. #
  3012. 38    string        Spreadsheet    sc spreadsheet file
  3013.  
  3014. #------------------------------------------------------------------------------
  3015. # sccs:  file(1) magic for SCCS archives
  3016. #
  3017. # SCCS archive structure:
  3018. # \001h01207
  3019. # \001s 00276/00000/00000
  3020. # \001d D 1.1 87/09/23 08:09:20 ian 1 0
  3021. # \001c date and time created 87/09/23 08:09:20 by ian
  3022. # \001e
  3023. # \001u
  3024. # \001U
  3025. # ... etc.
  3026. # Now '\001h' happens to be the same as the 3B20's a.out magic number (0550).
  3027. # *Sigh*. And these both came from various parts of the USG.
  3028. # Maybe we should just switch everybody from SCCS to RCS!
  3029. # Further, you can't just say '\001h0', because the five-digit number
  3030. # is a checksum that could (presumably) have any leading digit,
  3031. # and we don't have regular expression matching yet. 
  3032. # Hence the following official kludge:
  3033. 8    string        \001s\             SCCS archive data
  3034.  
  3035. #------------------------------------------------------------------------------
  3036. # sendmail:  file(1) magic for sendmail config files
  3037. #
  3038. # XXX - byte order?
  3039. #
  3040. 0    byte    046      Sendmail frozen configuration 
  3041. >16    string    >\0      - version %s
  3042. 0    short    0x271c      Sendmail frozen configuration
  3043. >16    string    >\0      - version %s
  3044.  
  3045. #------------------------------------------------------------------------------
  3046. # sequent:  file(1) magic for Sequent machines
  3047. #
  3048. # Sequent information updated by Don Dwiggins <atsun!dwiggins>.
  3049. # For Sequent's multiprocessor systems (incomplete).
  3050. 0    lelong    0x00ea            BALANCE NS32000 .o
  3051. >16    lelong    >0        not stripped
  3052. >124    lelong    >0        version %ld
  3053. 0    lelong    0x10ea            BALANCE NS32000 executable (0 @ 0)
  3054. >16    lelong  >0                not stripped
  3055. >124    lelong    >0        version %ld
  3056. 0    lelong    0x20ea            BALANCE NS32000 executable (invalid @ 0)
  3057. >16    lelong  >0                not stripped
  3058. >124    lelong    >0        version %ld
  3059. 0    lelong    0x30ea            BALANCE NS32000 standalone executable
  3060. >16    lelong  >0              not stripped
  3061. >124    lelong    >0        version %ld
  3062. #
  3063. # Symmetry information added by Jason Merrill <jason@jarthur.claremont.edu>.
  3064. # Symmetry magic nums will not be reached if DOS COM comes before them;
  3065. # byte 0xeb is matched before these get a chance.
  3066. 0    leshort    0x12eb        SYMMETRY i386 .o
  3067. >16    lelong    >0        not stripped
  3068. >124    lelong    >0        version %ld
  3069. 0    leshort    0x22eb        SYMMETRY i386 executable (0 @ 0)
  3070. >16    lelong    >0        not stripped
  3071. >124    lelong    >0        version %ld
  3072. 0    leshort    0x32eb        SYMMETRY i386 executable (invalid @ 0)
  3073. >16    lelong    >0        not stripped
  3074. >124    lelong    >0        version %ld
  3075. 0    leshort    0x42eb        SYMMETRY i386 standalone executable
  3076. >16    lelong    >0        not stripped
  3077. >124    lelong    >0        version %ld
  3078.  
  3079. #------------------------------------------------------------------------------
  3080. # sgi:  file(1) magic for Silicon Graphics (MIPS, IRIS, IRIX, etc.)
  3081. #                         Dec Ultrix (MIPS)
  3082. # all of SGI's *current* machines and OSes run in big-endian mode on the
  3083. # MIPS machines, as far as I know.
  3084. #
  3085. # XXX - what is the blank "-" line?
  3086. #
  3087. # kbd file definitions
  3088. 0    string    kbd!map        kbd map file
  3089. >8    byte    >0        Ver %d:
  3090. >10    short    >0        with %d table(s)
  3091. 0    belong    0407        old SGI 68020 executable
  3092. 0    belong    0410        old SGI 68020 pure executable
  3093. 0    beshort    0x8765        disk quotas file
  3094. 0    beshort    0x0506        IRIS Showcase file
  3095. >2    byte    0x49        -
  3096. >3    byte    x        - version %ld
  3097. 0    beshort    0x0226        IRIS Showcase template
  3098. >2    byte    0x63        -
  3099. >3    byte    x        - version %ld
  3100. 0    belong    0x5343464d    IRIS Showcase file
  3101. >4    byte    x        - version %ld
  3102. 0    belong    0x5443464d    IRIS Showcase template
  3103. >4    byte    x        - version %ld
  3104. 0    belong    0xdeadbabe    IRIX Parallel Arena
  3105. >8    belong    >0        - version %ld
  3106. #
  3107. 0    beshort    0x0160        MIPSEB COFF executable
  3108. >20    beshort    0407        (impure)
  3109. >20    beshort    0410        (swapped)
  3110. >20    beshort    0413        (paged)
  3111. >8    belong    >0        not stripped
  3112. >8    belong    0        stripped
  3113. >22    byte    x        - version %ld
  3114. >23    byte    x        .%ld
  3115. #
  3116. 0    beshort    0x0162        MIPSEL COFF executable
  3117. >20    beshort    0407        (impure)
  3118. >20    beshort    0410        (swapped)
  3119. >20    beshort    0413        (paged)
  3120. >8    belong    >0        not stripped
  3121. >8    belong    0        stripped
  3122. >23    byte    x        - version %d
  3123. >22    byte    x        .%ld
  3124. #
  3125. 0    beshort    0x6001        MIPSEB-LE COFF executable
  3126. >20    beshort    03401        (impure)
  3127. >20    beshort    04001        (swapped)
  3128. >20    beshort    05401        (paged)
  3129. >8    belong    >0        not stripped
  3130. >8    belong    0        stripped
  3131. >23    byte    x        - version %d
  3132. >22    byte    x        .%ld
  3133. #
  3134. 0    beshort    0x6201        MIPSEL-LE COFF executable
  3135. >20    beshort    03401        (impure)
  3136. >20    beshort    04001        (swapped)
  3137. >20    beshort    05401        (paged)
  3138. >8    belong    >0        not stripped
  3139. >8    belong    0        stripped
  3140. >23    byte    x        - version %ld
  3141. >22    byte    x        .%ld
  3142. #
  3143. # MIPS 2 additions
  3144. #
  3145. 0    beshort    0x0163        MIPSEB MIPS-II COFF executable
  3146. >20    beshort    0407        (impure)
  3147. >20    beshort    0410        (swapped)
  3148. >20    beshort    0413        (paged)
  3149. >8    belong    >0        not stripped
  3150. >8    belong    0        stripped
  3151. >22    byte    x        - version %ld
  3152. >23    byte    x        .%ld
  3153. #
  3154. 0    beshort    0x0166        MIPSEL MIPS-II COFF executable
  3155. >20    beshort    0407        (impure)
  3156. >20    beshort    0410        (swapped)
  3157. >20    beshort    0413        (paged)
  3158. >8    belong    >0        not stripped
  3159. >8    belong    0        stripped
  3160. >22    byte    x        - version %ld
  3161. >23    byte    x        .%ld
  3162. #
  3163. 0    beshort    0x6301        MIPSEB-LE MIPS-II COFF executable
  3164. >20    beshort    03401        (impure)
  3165. >20    beshort    04001        (swapped)
  3166. >20    beshort    05401        (paged)
  3167. >8    belong    >0        not stripped
  3168. >8    belong    0        stripped
  3169. >23    byte    x        - version %ld
  3170. >22    byte    x        .%ld
  3171. #
  3172. 0    beshort    0x6601        MIPSEL-LE MIPS-II COFF executable
  3173. >20    beshort    03401        (impure)
  3174. >20    beshort    04001        (swapped)
  3175. >20    beshort    05401        (paged)
  3176. >8    belong    >0        not stripped
  3177. >8    belong    0        stripped
  3178. >23    byte    x        - version %ld
  3179. >22    byte    x        .%ld
  3180. #
  3181. # MIPS 3 additions
  3182. #
  3183. 0    beshort    0x0140        MIPSEB MIPS-III COFF executable
  3184. >20    beshort    0407        (impure)
  3185. >20    beshort    0410        (swapped)
  3186. >20    beshort    0413        (paged)
  3187. >8    belong    >0        not stripped
  3188. >8    belong    0        stripped
  3189. >22    byte    x        - version %ld
  3190. >23    byte    x        .%ld
  3191. #
  3192. 0    beshort    0x0142        MIPSEL MIPS-III COFF executable
  3193. >20    beshort    0407        (impure)
  3194. >20    beshort    0410        (swapped)
  3195. >20    beshort    0413        (paged)
  3196. >8    belong    >0        not stripped
  3197. >8    belong    0        stripped
  3198. >22    byte    x        - version %ld
  3199. >23    byte    x        .%ld
  3200. #
  3201. 0    beshort    0x4001        MIPSEB-LE MIPS-III COFF executable
  3202. >20    beshort    03401        (impure)
  3203. >20    beshort    04001        (swapped)
  3204. >20    beshort    05401        (paged)
  3205. >8    belong    >0        not stripped
  3206. >8    belong    0        stripped
  3207. >23    byte    x        - version %ld
  3208. >22    byte    x        .%ld
  3209. #
  3210. 0    beshort    0x4201        MIPSEL-LE MIPS-III COFF executable
  3211. >20    beshort    03401        (impure)
  3212. >20    beshort    04001        (swapped)
  3213. >20    beshort    05401        (paged)
  3214. >8    belong    >0        not stripped
  3215. >8    belong    0        stripped
  3216. >23    byte    x        - version %ld
  3217. >22    byte    x        .%ld
  3218. #
  3219. 0    beshort    0x180        MIPSEB Ucode
  3220. 0    beshort    0x182        MIPSEL Ucode
  3221. # 32bit core file
  3222. 0    belong    0xdeadadb0    IRIX core dump
  3223. >4    belong    1        of
  3224. >16    string    >\0        '%s'
  3225. # 64bit core file
  3226. 0    belong    0xdeadad40    IRIX 64-bit core dump
  3227. >4    belong    1        of
  3228. >16    string    >\0        '%s'
  3229. # New style crash dump file
  3230. 0    string    \x43\x72\x73\x68\x44\x75\x6d\x70    IRIX vmcore dump of
  3231. >36    string    >\0                    '%s'
  3232. # Trusted IRIX info
  3233. 0    string    SGIAUDIT    SGI Audit file
  3234. >8    byte    x        - version %d
  3235. >9    byte    x        .%ld
  3236. # Are these three SGI-based file types or general ones?
  3237. 0    string    WNGZWZSC    Wingz compiled script
  3238. 0    string    WNGZWZSS    Wingz spreadsheet
  3239. 0    string    WNGZWZHP    Wingz help file
  3240. #
  3241. 0    string    \#Inventor V    IRIS Inventor 1.0 file
  3242. 0    string    \#Inventor V2    Open Inventor 2.0 file
  3243. # XXX - I don't know what next thing is!  It is likely to be an image
  3244. # (or movie) format
  3245. 0    string    glfHeadMagic();        GLF_TEXT
  3246. 4    belong    0x41010000        GLF_BINARY_LSB_FIRST
  3247. 4    belong    0x00000141        GLF_BINARY_MSB_FIRST
  3248.  
  3249. #------------------------------------------------------------------------------
  3250. # sgml:  file(1) magic for Standard Generalized Markup Language
  3251.  
  3252. # HyperText Markup Language (HTML) is an SGML document type,
  3253. # from Daniel Quinlan (quinlan@yggdrasil.com)
  3254. 0    string        \<!DOCTYPE\ HTML    HTML document text
  3255. 0    string        \<!doctype\ html    HTML document text
  3256. 0    string        \<HEAD        HTML document text
  3257. 0    string        \<head        HTML document text
  3258. 0    string        \<TITLE        HTML document text
  3259. 0    string        \<title        HTML document text
  3260. 0    string        \<html        HTML document text
  3261. 0    string        \<HTML        HTML document text
  3262.  
  3263. # SGML, mostly from rph@sq
  3264. 0    string        \<!DOCTYPE    exported SGML document text
  3265. 0    string        \<!doctype    exported SGML document text
  3266. 0    string        \<!SUBDOC    exported SGML subdocument text
  3267. 0    string        \<!subdoc    exported SGML subdocument text
  3268. 0    string        \<!--        exported SGML document text
  3269.  
  3270. #------------------------------------------------------------------------------
  3271. # sniffer:  file(1) magic for packet captured files
  3272. #
  3273. # From: guy@netapp.com (Guy Harris)
  3274. #
  3275. # Microsoft NetMon (packet capture/display program) capture files.
  3276. #
  3277. 0    string        RTSS        NetMon capture file
  3278. >4    byte        x        - version %d
  3279. >5    byte        x        \b.%d
  3280. #
  3281. # Network General Sniffer capture files.
  3282. #
  3283. 0    string        TRSNIFF\ data\ \ \ \ \032    Sniffer capture file
  3284. >23    leshort        x        - version %d
  3285. >25    leshort        x        \b.%d
  3286. >33    byte        x        (Format %d,
  3287. >32    byte        0        Token ring)
  3288. >32    byte        1        Ethernet)
  3289. >32    byte        2        ARCnet)
  3290. >32    byte        3        StarLAN)
  3291. >32    byte        4        PC Network broadband)
  3292. >32    byte        5        LocalTalk)
  3293. >32    byte        6        Znet)
  3294. #
  3295. # "libpcap" capture files.
  3296. # (We call them "tcpdump capture file(s)" for now, as "tcpdump" is
  3297. # the main program that uses that format, but there's also "tcpview",
  3298. # and there may be others in the future.)
  3299. #
  3300. 0    ubelong        0xa1b2c3d4    tcpdump capture file (big-endian)
  3301. >4    beshort        x        - version %d
  3302. >6    beshort        x        \b.%d
  3303. >20    belong        0        (No link-layer encapsulation
  3304. >20    belong        1        (Ethernet
  3305. >20    belong        2        (3Mb Ethernet
  3306. >20    belong        3        (AX.25
  3307. >20    belong        4        (ProNet
  3308. >20    belong        5        (Chaos
  3309. >20    belong        6        (IEEE 802.x network
  3310. >20    belong        7        (ARCnet
  3311. >20    belong        8        (SLIP
  3312. >20    belong        9        (PPP
  3313. >20    belong        10        (FDDI
  3314. >20    belong        11        (RFC 1483 ATM
  3315. >16    belong        x        \b, capture length %d)
  3316. 0    ulelong        0xa1b2c3d4    tcpdump capture file (little-endian)
  3317. >4    leshort        x        - version %d
  3318. >6    leshort        x        \b.%d
  3319. >20    lelong        0        (No link-layer encapsulation
  3320. >20    lelong        1        (Ethernet
  3321. >20    lelong        2        (3Mb Ethernet
  3322. >20    lelong        3        (AX.25
  3323. >20    lelong        4        (ProNet
  3324. >20    lelong        5        (Chaos
  3325. >20    lelong        6        (IEEE 802.x network
  3326. >20    lelong        7        (ARCnet
  3327. >20    lelong        8        (SLIP
  3328. >20    lelong        9        (PPP
  3329. >20    lelong        10        (FDDI
  3330. >20    lelong        11        (RFC 1483 ATM
  3331. >16    lelong        x        \b, capture length %d)
  3332. # $OpenBSD: softquad,v 1.3 1996/06/26 05:33:05 deraadt Exp $
  3333.  
  3334. #------------------------------------------------------------------------------
  3335. # softquad:  file(1) magic for SoftQuad Publishing Software
  3336. #
  3337. # Author/Editor and RulesBuilder
  3338. #
  3339. # XXX - byte order?
  3340. #
  3341. 0    string        \<!SQ\ DTD>    Compiled SGML rules file
  3342. >9    string        >\0         Type %s
  3343. 0    string        \<!SQ\ A/E>    A/E SGML Document binary
  3344. >9    string        >\0         Type %s
  3345. 0    string        \<!SQ\ STS>    A/E SGML binary styles file
  3346. >9    string        >\0         Type %s
  3347. 0    short        0xc0de        Compiled PSI (v1) data
  3348. 0    short        0xc0da        Compiled PSI (v2) data
  3349. >3    string        >\0        (%s)
  3350. # Binary sqtroff font/desc files...
  3351. 0    short        0125252        SoftQuad DESC or font file binary
  3352. >2    short        >0        - version %d
  3353. # Bitmaps...
  3354. 0    string        SQ\ BITMAP1    SoftQuad Raster Format text
  3355. #0    string        SQ\ BITMAP2    SoftQuad Raster Format data
  3356. # sqtroff intermediate language (replacement for ditroff int. lang.)
  3357. 0    string        X\         SoftQuad troff Context intermediate
  3358. >2    string        495        for AT&T 495 laser printer
  3359. >2    string        hp        for Hewlett-Packard LaserJet
  3360. >2    string        impr        for IMAGEN imPRESS
  3361. >2    string        ps        for PostScript
  3362.  
  3363. #------------------------------------------------------------------------------
  3364. # sun:  file(1) magic for Sun machines
  3365. #
  3366. # Values for big-endian Sun (MC680x0, SPARC) binaries on pre-5.x
  3367. # releases.  (5.x uses ELF.)
  3368. #
  3369. 0    belong&077777777    0600413        sparc demand paged
  3370. >0    byte        &0x80
  3371. >>20    belong        <4096        shared library
  3372. >>20    belong        =4096        dynamically linked executable
  3373. >>20    belong        >4096        dynamically linked executable
  3374. >0    byte        ^0x80        executable
  3375. >16    belong        >0        not stripped
  3376. 0    belong&077777777    0600410        sparc pure
  3377. >0    byte        &0x80        dynamically linked executable
  3378. >0    byte        ^0x80        executable
  3379. >16    belong        >0        not stripped
  3380. 0    belong&077777777    0600407        sparc
  3381. >0    byte        &0x80        dynamically linked executable
  3382. >0    byte        ^0x80        executable
  3383. >16    belong        >0        not stripped
  3384.  
  3385. 0    belong&077777777    0400413        mc68020 demand paged
  3386. >0    byte        &0x80
  3387. >>20    belong        <4096        shared library
  3388. >>20    belong        =4096        dynamically linked executable
  3389. >>20    belong        >4096        dynamically linked executable
  3390. >16    belong        >0        not stripped
  3391. 0    belong&077777777    0400410        mc68020 pure
  3392. >0    byte        &0x80        dynamically linked executable
  3393. >0    byte        ^0x80        executable
  3394. >16    belong        >0        not stripped
  3395. 0    belong&077777777    0400407        mc68020
  3396. >0    byte        &0x80        dynamically linked executable
  3397. >0    byte        ^0x80        executable
  3398. >16    belong        >0        not stripped
  3399.  
  3400. 0    belong&077777777    0200413        mc68010 demand paged
  3401. >0    byte        &0x80
  3402. >>20    belong        <4096        shared library
  3403. >>20    belong        =4096        dynamically linked executable
  3404. >>20    belong        >4096        dynamically linked executable
  3405. >16    belong        >0        not stripped
  3406. 0    belong&077777777    0200410        mc68010 pure
  3407. >0    byte        &0x80        dynamically linked executable
  3408. >0    byte        ^0x80        executable
  3409. >16    belong        >0        not stripped
  3410. 0    belong&077777777    0200407        mc68010
  3411. >0    byte        &0x80        dynamically linked executable
  3412. >0    byte        ^0x80        executable
  3413. >16    belong        >0        not stripped
  3414.  
  3415. # reworked these to avoid anything beginning with zero becoming "old sun-2"
  3416. 0    belong        0407        old sun-2 executable
  3417. >16    belong        >0        not stripped
  3418. 0    belong        0410        old sun-2 pure executable
  3419. >16    belong        >0        not stripped
  3420. 0    belong        0413        old sun-2 demand paged executable
  3421. >16    belong        >0        not stripped
  3422.  
  3423. #
  3424. # Core files.  "SPARC 4.x BCP" means "core file from a SunOS 4.x SPARC
  3425. # binary executed in compatibility mode under SunOS 5.x".
  3426. #
  3427. 0    belong        0x080456    SunOS core file
  3428. >4    belong        432        (SPARC)
  3429. >>132    string        >\0        from '%s'
  3430. >>116    belong        =3        (quit)
  3431. >>116    belong        =4        (illegal instruction)
  3432. >>116    belong        =5        (trace trap)
  3433. >>116    belong        =6        (abort)
  3434. >>116    belong        =7        (emulator trap)
  3435. >>116    belong        =8        (arithmetic exception)
  3436. >>116    belong        =9        (kill)
  3437. >>116    belong        =10        (bus error)
  3438. >>116    belong        =11        (segmentation violation)
  3439. >>116    belong        =12        (bad argument to system call)
  3440. >>116    belong        =29        (resource lost)
  3441. >>120    belong        x        (T=%dK,
  3442. >>124    belong        x        D=%dK,
  3443. >>128    belong        x        S=%dK)
  3444. >4    belong        826        (68K)
  3445. >>128    string        >\0        from '%s'
  3446. >4    belong        456        (SPARC 4.x BCP)
  3447. >>152    string        >\0        from '%s'
  3448. # Sun SunPC
  3449. 0    long        0xfa33c08e    SunPC 4.0 Hard Disk
  3450. 0    string        #SUNPC_CONFIG    SunPC 4.0 Properties Values
  3451. # Sun snoop
  3452. #
  3453. # XXX - are numbers stored in big-endian format, or in host byte order?
  3454. # They're the same on SPARC, but not the same on x86.
  3455. #
  3456. 0    string        snoop        Snoop capture file
  3457. >8    long        >0        - version %ld
  3458. >12    long        0        (IEEE 802.3)
  3459. >12    long        1        (IEEE 802.4)
  3460. >12    long        2        (IEEE 802.5)
  3461. >12    long        3        (IEEE 802.6)
  3462. >12    long        4        (Ethernet)
  3463. >12    long        5        (HDLC)
  3464. >12    long        6        (Character synchronous)
  3465. >12    long        7        (IBM channel-to-channel adapter)
  3466. >12    long        8        (FDDI)
  3467. >12    long        9        (Unknown)
  3468. # Sun KCMS
  3469. 36    string        acsp        Kodak Color Management System, ICC Profile
  3470.  
  3471.  
  3472.  
  3473. #------------------------------------------------------------------------------
  3474. # terminfo:  file(1) magic for terminfo
  3475. #
  3476. # XXX - byte order for screen images?
  3477. #
  3478. 0    string        \032\001    Compiled terminfo entry
  3479. 0    short        0433        Curses screen image
  3480. 0    short        0434        Curses screen image
  3481.  
  3482. #------------------------------------------------------------------------------
  3483. # tex:  file(1) magic for TeX files
  3484. #
  3485. # From <conklin@talisman.kaleida.com>
  3486.  
  3487. # Although we may know the offset of certain text fields in TeX DVI
  3488. # and font files, we can't use them reliably because they are not
  3489. # zero terminated. [but we do anyway, christos]
  3490. 0    string        \367\002    TeX DVI file
  3491. >16    string        >\0        (%s)
  3492. 0    string        \367\203    TeX generic font data
  3493. 0    string        \367\131    TeX packed font data
  3494. >3    string        >\0        (%s)
  3495. 0    string        \367\312    TeX virtual font data
  3496. 0    string        This\ is\ TeX,    TeX transcript text
  3497. 0    string        This\ is\ METAFONT,    METAFONT transcript text
  3498.  
  3499. # There is no way to detect TeX Font Metric (*.tfm) files without
  3500. # breaking them apart and reading the data.  The following patterns
  3501. # match most *.tfm files generated by METAFONT or afm2tfm.
  3502. 2    string        \000\021    TeX font metric data
  3503. >33    string        >\0        (%s)
  3504. 2    string        \000\022    TeX font metric data
  3505. >33    string        >\0        (%s)
  3506.  
  3507. # Texinfo and GNU Info, from Daniel Quinlan (quinlan@yggdrasil.com)
  3508. 0    string        \\input\ texinfo    Texinfo source text
  3509. 0    string        This\ is\ Info\ file    GNU Info text
  3510.  
  3511. # TeX documents, from Daniel Quinlan (quinlan@yggdrasil.com)
  3512. 0    string        \\input        TeX document text
  3513. 0    string        \\section    LaTeX document text
  3514. 0    string        \\setlength    LaTeX document text
  3515. 0    string        \\documentstyle    LaTeX document text
  3516. 0    string        \\chapter    LaTeX document text
  3517.  
  3518. #------------------------------------------------------------------------------
  3519. # timezone:  file(1) magic for timezone data
  3520. #
  3521. # from Daniel Quinlan (quinlan@yggdrasil.com)
  3522. # this should work on Linux, SunOS, and maybe others
  3523. 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
  3524. 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
  3525. 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
  3526. 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
  3527. 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
  3528. 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\6\0    timezone data
  3529.  
  3530. #------------------------------------------------------------------------------
  3531. # troff:  file(1) magic for *roff
  3532. #
  3533. # updated by Daniel Quinlan (quinlan@yggdrasil.com)
  3534.  
  3535. # troff input
  3536. 0    string        .\\"        troff or preprocessor input text
  3537. 0    string        '\\"        troff or preprocessor input text
  3538. 0    string        '.\\"        troff or preprocessor input text
  3539. 0    string        \\"        troff or preprocessor input text
  3540.  
  3541. # ditroff intermediate output text
  3542. 0    string        x\ T        ditroff text
  3543. >4    string        cat        for the C/A/T phototypesetter
  3544. >4    string        ps        for PostScript
  3545. >4    string        dvi        for DVI
  3546. >4    string        ascii        for ASCII
  3547. >4    string        lj4        for LaserJet 4
  3548. >4    string        latin1        for ISO 8859-1 (Latin 1)
  3549. >4    string        X75        for xditview at 75dpi
  3550. >>7    string        -12        (12pt)
  3551. >4    string        X100        for xditview at 100dpi
  3552. >>8    string        -12        (12pt)
  3553.  
  3554. # output data formats
  3555. 0    string        \100\357    very old (C/A/T) troff output data
  3556.  
  3557. #------------------------------------------------------------------------------
  3558. # typeset:  file(1) magic for other typesetting
  3559. #
  3560. 0    string        Interpress/Xerox    Xerox InterPress data
  3561. >16    string        /            (version
  3562. >>17    string        >\0            %s)
  3563.  
  3564. #------------------------------------------------------------------------------
  3565. # unknown:  file(1) magic for unknown machines
  3566. #
  3567. # XXX - this probably should be pruned, as it'll match PDP-11 and
  3568. # VAX image formats.
  3569. #
  3570. # 0x107 is 0407; 0x108 is 0410; both are PDP-11 (executable and pure,
  3571. # respectively).
  3572. #
  3573. # 0x109 is 0411; that's PDP-11 split I&D, but the PDP-11 version doesn't
  3574. # have the "version %ld", which may be a bogus COFFism (I don't think
  3575. # there ever was COFF for the PDP-11).
  3576. #
  3577. # 0x10B is 0413; that's VAX demand-paged, but this is a short, not a
  3578. # long, as it would be on a VAX.
  3579. #
  3580. # 0x10C is 0414, 0x10D is 0415, and 0x10E is 416; those *are* unknown.
  3581. #
  3582. 0    short        0x107        unknown machine executable
  3583. >8    short        >0        not stripped
  3584. >15    byte        >0        - version %ld
  3585. 0    short        0x108        unknown pure executable
  3586. >8    short        >0        not stripped
  3587. >15    byte        >0        - version %ld
  3588. 0    short        0x109        PDP-11 separate I&D
  3589. >8    short        >0        not stripped
  3590. >15    byte        >0        - version %ld
  3591. 0    short        0x10b        unknown pure executable
  3592. >8    short        >0        not stripped
  3593. >15    byte        >0        - version %ld
  3594. 0    long        0x10c        unknown demand paged pure executable
  3595. >16    long        >0        not stripped
  3596. 0    long        0x10d        unknown demand paged pure executable
  3597. >16    long        >0        not stripped
  3598. 0    long        0x10e        unknown readable demand paged pure executable
  3599.  
  3600. #------------------------------------------------------------------------------
  3601. # uuencode:  file(1) magic for ASCII-encoded files
  3602. #
  3603.  
  3604. # GRR:  the first line of xxencoded files is identical to that in uuencoded
  3605. # files, but the first character in most subsequent lines is 'h' instead of
  3606. # 'M'.  (xxencoding uses lowercase letters in place of most of uuencode's
  3607. # punctuation and survives BITNET gateways better.)  If regular expressions
  3608. # were supported, this entry could possibly be split into two with
  3609. # "begin\040\.\*\012M" or "begin\040\.\*\012h" (where \. and \* are REs).
  3610. 0    string        begin\040    uuencoded or xxencoded text
  3611.  
  3612. # btoa(1) is an alternative to uuencode that requires less space.
  3613. 0    string        xbtoa\ Begin    btoa'd text
  3614.  
  3615. # ship(1) is another, much cooler alternative to uuencode.
  3616. # Greg Roelofs, newt@uchicago.edu
  3617. 0    string        $\012ship    ship'd binary text
  3618.  
  3619. # bencode(8) is used to encode compressed news batches (Bnews/Cnews only?)
  3620. # Greg Roelofs, newt@uchicago.edu
  3621. 0    string    Decode\ the\ following\ with\ bdeco    bencoded News text
  3622.  
  3623. # BinHex is the Macintosh ASCII-encoded file format (see also "apple")
  3624. # Daniel Quinlan, quinlan@yggdrasil.com
  3625. 11    string    must\ be\ converted\ with\ BinHex    BinHex binary text
  3626. >41    string    x                    \b, version %.3s
  3627.  
  3628. # GRR:  is MIME BASE64 encoding handled somewhere?
  3629.  
  3630. #------------------------------------------------------------------------------
  3631. # varied.out:  file(1) magic for various USG systems
  3632. #
  3633. #    Herewith many of the object file formats used by USG systems.
  3634. #    Most have been moved to files for a particular processor,
  3635. #    and deleted if they duplicate other entries.
  3636. #
  3637. 0    short        0610        Perkin-Elmer executable
  3638. # AMD 29K
  3639. 0    beshort        0572        amd 29k coff noprebar executable
  3640. 0    beshort        01572        amd 29k coff prebar executable
  3641. 0    beshort        0160007        amd 29k coff archive
  3642. # Cray
  3643. 6    beshort        0407        unicos (cray) executable
  3644. # Ultrix 4.3
  3645. 596    string        \130\337\377\377    Ultrix core file
  3646. >600    string        >\0    '%s'
  3647.  
  3648. #------------------------------------------------------------------------------
  3649. # vax:  file(1) magic for VAX executable/object and APL workspace
  3650. #
  3651. 0    lelong        0101557        VAX single precision APL workspace
  3652. 0    lelong        0101556        VAX double precision APL workspace
  3653.  
  3654. #
  3655. # VAX a.out (32V, BSD)
  3656. #
  3657. 0    lelong        0407        VAX executable
  3658. >16    lelong        >0        not stripped
  3659.  
  3660. 0    lelong        0410        VAX pure executable
  3661. >16    lelong        >0        not stripped
  3662.  
  3663. 0    lelong        0413        VAX demand paged pure executable
  3664. >16    lelong        >0        not stripped
  3665.  
  3666. 0    lelong        0420        VAX demand paged (first page unmapped) pure executable
  3667. >16    lelong        >0        not stripped
  3668.  
  3669. #
  3670. # VAX COFF
  3671. #
  3672. # The `versions' should be un-commented if they work for you.
  3673. # (Was the problem just one of endianness?)
  3674. #
  3675. 0    leshort        0570        VAX COFF executable
  3676. >12    lelong        >0        not stripped
  3677. >22    leshort        >0        - version %ld
  3678. 0    leshort        0575        VAX COFF pure executable
  3679. >12    lelong        >0        not stripped
  3680. >22    leshort        >0        - version %ld
  3681.  
  3682. #------------------------------------------------------------------------------
  3683. # visx:  file(1) magic for Visx format files
  3684. #
  3685. 0    short        0x5555        VISX image file
  3686. >2    byte        0        (zero)
  3687. >2    byte        1        (unsigned char)
  3688. >2    byte        2        (short integer)
  3689. >2    byte        3        (float 32)
  3690. >2    byte        4        (float 64)
  3691. >2    byte        5        (signed char)
  3692. >2    byte        6        (bit-plane)
  3693. >2    byte        7        (classes)
  3694. >2    byte        8        (statistics)
  3695. >2    byte        10        (ascii text)
  3696. >2    byte        15        (image segments)
  3697. >2    byte        100        (image set)
  3698. >2    byte        101        (unsigned char vector)
  3699. >2    byte        102        (short integer vector)
  3700. >2    byte        103        (float 32 vector)
  3701. >2    byte        104        (float 64 vector)
  3702. >2    byte        105        (signed char vector)
  3703. >2    byte        106        (bit plane vector)
  3704. >2    byte        121        (feature vector)
  3705. >2    byte        122        (feature vector library)
  3706. >2    byte        124        (chain code)
  3707. >2    byte        126        (bit vector)
  3708. >2    byte        130        (graph)
  3709. >2    byte        131        (adjacency graph)
  3710. >2    byte        132        (adjacency graph library)
  3711. >2    string        .VISIX        (ascii text)
  3712.  
  3713. #------------------------------------------------------------------------------
  3714. # vms:  file(1) magic for VMS executables (experimental)
  3715. #
  3716. # VMS .exe formats, both VAX and AXP (Greg Roelofs, newt@uchicago.edu)
  3717.  
  3718. # GRR 950122:  I'm just guessing on these, based on inspection of the headers
  3719. # of three executables each for Alpha and VAX architectures.  The VAX files
  3720. # all had headers similar to this:
  3721. #
  3722. #   00000  b0 00 30 00 44 00 60 00  00 00 00 00 30 32 30 35  ..0.D.`.....0205
  3723. #   00010  01 01 00 00 ff ff ff ff  ff ff ff ff 00 00 00 00  ................
  3724. #
  3725. 0    string    \xb0\0\x30\0    VMS VAX executable
  3726. >44032    string    PK\003\004    \b, Info-ZIP SFX archive v5.12 w/decryption
  3727. #
  3728. # The AXP files all looked like this, except that the byte at offset 0x22
  3729. # was 06 in some of them and 07 in others:
  3730. #
  3731. #   00000  03 00 00 00 00 00 00 00  ec 02 00 00 10 01 00 00  ................
  3732. #   00010  68 00 00 00 98 00 00 00  b8 00 00 00 00 00 00 00  h...............
  3733. #   00020  00 00 07 00 00 00 00 00  00 00 00 00 00 00 00 00  ................
  3734. #   00030  00 00 00 00 01 00 00 00  00 00 00 00 00 00 00 00  ................
  3735. #   00040  00 00 00 00 ff ff ff ff  ff ff ff ff 02 00 00 00  ................
  3736. #
  3737. 0    belong    0x03000000    VMS Alpha executable
  3738. >75264    string    PK\003\004    \b, Info-ZIP SFX archive v5.12 w/decryption
  3739.  
  3740. #------------------------------------------------------------------------------
  3741. # xenix:  file(1) magic for Microsoft Xenix
  3742. #
  3743. # "Middle model" stuff, and "Xenix 8086 relocatable or 80286 small
  3744. # model" lifted from "magic.xenix", with comment "derived empirically;
  3745. # treat as folklore until proven"
  3746. #
  3747. # "small model", "large model", "huge model" stuff lifted from XXX
  3748. #
  3749. # XXX - "x.out" collides with PDP-11 archives
  3750. #
  3751. 0    string        core        core file (Xenix)
  3752. 0    byte        0x80        8086 relocatable (Microsoft)
  3753. 0    leshort        0xff65        x.out
  3754. >2    string        __.SYMDEF     randomized
  3755. >0    byte        x        archive
  3756. 0    leshort        0x206        Microsoft a.out
  3757. >8    leshort        1        Middle model
  3758. >0x1e    leshort        &0x10        overlay
  3759. >0x1e    leshort        &0x2        separate
  3760. >0x1e    leshort        &0x4        pure
  3761. >0x1e    leshort        &0x800        segmented
  3762. >0x1e    leshort        &0x400        standalone
  3763. >0x1e    leshort        &0x8        fixed-stack
  3764. >0x1c    byte        &0x80        byte-swapped
  3765. >0x1c    byte        &0x40        word-swapped
  3766. >0x10    lelong        >0        not-stripped
  3767. >0x1e    leshort        ^0xc000        pre-SysV
  3768. >0x1e    leshort        &0x4000        V2.3
  3769. >0x1e    leshort        &0x8000        V3.0
  3770. >0x1c    byte        &0x4        86
  3771. >0x1c    byte        &0xb        186
  3772. >0x1c    byte        &0x9        286
  3773. >0x1c    byte        &0xa        386
  3774. >0x1f    byte        <0x040        small model
  3775. >0x1f    byte        =0x048        large model    
  3776. >0x1f    byte        =0x049        huge model 
  3777. >0x1e    leshort        &0x1        executable
  3778. >0x1e    leshort        ^0x1        object file
  3779. >0x1e    leshort        &0x40        Large Text
  3780. >0x1e    leshort        &0x20        Large Data
  3781. >0x1e    leshort        &0x120        Huge Objects Enabled
  3782. >0x10    lelong        >0        not stripped
  3783.  
  3784. 0    leshort        0x140        old Microsoft 8086 x.out
  3785. >0x3    byte        &0x4        separate
  3786. >0x3    byte        &0x2        pure
  3787. >0    byte        &0x1        executable
  3788. >0    byte        ^0x1        relocatable
  3789. >0x14    lelong        >0        not stripped
  3790.  
  3791. 0    lelong        0x206        b.out
  3792. >0x1e    leshort        &0x10        overlay
  3793. >0x1e    leshort        &0x2        separate
  3794. >0x1e    leshort        &0x4        pure
  3795. >0x1e    leshort        &0x800        segmented
  3796. >0x1e    leshort        &0x400        standalone
  3797. >0x1e    leshort        &0x1        executable
  3798. >0x1e    leshort        ^0x1        object file
  3799. >0x1e    leshort        &0x4000        V2.3
  3800. >0x1e    leshort        &0x8000        V3.0
  3801. >0x1c    byte        &0x4        86
  3802. >0x1c    byte        &0xb        186
  3803. >0x1c    byte        &0x9        286
  3804. >0x1c    byte        &0x29        286
  3805. >0x1c    byte        &0xa        386
  3806. >0x1e    leshort        &0x4        Large Text
  3807. >0x1e    leshort        &0x2        Large Data
  3808. >0x1e    leshort        &0x102        Huge Objects Enabled
  3809.  
  3810. 0    leshort        0x580        XENIX 8086 relocatable or 80286 small model
  3811.  
  3812. #------------------------------------------------------------------------------
  3813. # zilog:  file(1) magic for Zilog Z8000.
  3814. #
  3815. # Was it big-endian or little-endian?  My Product Specification doesn't
  3816. # say.
  3817. #
  3818. 0    long        0xe807        object file (z8000 a.out)
  3819. 0    long        0xe808        pure object file (z8000 a.out)
  3820. 0    long        0xe809        separate object file (z8000 a.out)
  3821. 0    long        0xe805        overlay object file (z8000 a.out)
  3822.  
  3823. #------------------------------------------------------------------------------
  3824. # zyxel:  file(1) magic for ZyXEL modems
  3825. #
  3826. # From <rob@pe1chl.ampr.org>
  3827. # These are the /etc/magic entries to decode datafiles as used for the
  3828. # ZyXEL U-1496E DATA/FAX/VOICE modems.  (This header conforms to a
  3829. # ZyXEL-defined standard)
  3830.  
  3831. 0    string        ZyXEL\002    ZyXEL voice data
  3832. >10    byte        0        - CELP encoding
  3833. >10    byte&0x0B    1        - ADPCM2 encoding
  3834. >10    byte&0x0B    2        - ADPCM3 encoding
  3835. >10    byte&0x0B    3        - ADPCM4 encoding
  3836. >10    byte&0x0B    8        - New ADPCM3 encoding
  3837. >10    byte&0x04    4        with resync
  3838.