]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/file/magic.mime
Virgin import of Christos Zoulas's FILE 4.10.
[FreeBSD/FreeBSD.git] / contrib / file / magic.mime
1 # Magic data for KMimeMagic (originally for file(1) command)
2 #
3 # The format is 4-5 columns:
4 #    Column #1: byte number to begin checking from, ">" indicates continuation
5 #    Column #2: type of data to match
6 #    Column #3: contents of data to match
7 #    Column #4: MIME type of result
8 #    Column #5: MIME encoding of result (optional)
9
10 #------------------------------------------------------------------------------
11 # Localstuff:  file(1) magic for locally observed files
12 # Add any locally observed files here.
13
14 # Real Audio (Magic .ra\0375)
15 0       belong          0x2e7261fd      audio/x-pn-realaudio
16 0       string          .RMF            application/vnd.rn-realmedia
17
18 #video/x-pn-realvideo
19 #video/vnd.rn-realvideo
20 #application/vnd.rn-realmedia
21 #       sigh, there are many mimes for that but the above are the most common.
22
23 # Taken from magic, converted to magic.mime
24 # mime types according to http://www.geocities.com/nevilo/mod.htm:
25 #       audio/it        .it
26 #       audio/x-zipped-it       .itz
27 #       audio/xm        fasttracker modules
28 #       audio/x-s3m     screamtracker modules
29 #       audio/s3m       screamtracker modules
30 #       audio/x-zipped-mod      mdz
31 #       audio/mod       mod
32 #       audio/x-mod     All modules (mod, s3m, 669, mtm, med, xm, it, mdz, stm, itz, xmz, s3z)
33
34 # Taken from loader code from mikmod version 2.14
35 # by Steve McIntyre (stevem@chiark.greenend.org.uk)
36 # <doj@cubic.org> added title printing on 2003-06-24
37 0       string  MAS_UTrack_V00
38 >14     string  >/0             audio/x-mod
39 #audio/x-tracker-module
40
41 #0      string  UN05            MikMod UNI format module sound data
42
43 0       string  Extended\ Module: audio/x-mod
44 #audio/x-tracker-module
45 ##>17   string  >\0             Title: "%s"
46
47 21      string/c        !SCREAM!        audio/x-mod
48 #audio/x-screamtracker-module
49 21      string  BMOD2STM        audio/x-mod
50 #audio/x-screamtracker-module
51 1080    string  M.K.            audio/x-mod
52 #audio/x-protracker-module
53 #>0     string  >\0             Title: "%s"
54 1080    string  M!K!            audio/x-mod
55 #audio/x-protracker-module
56 #>0     string  >\0             Title: "%s"
57 1080    string  FLT4            audio/x-mod
58 #audio/x-startracker-module
59 #>0     string  >\0             Title: "%s"
60 1080    string  FLT8            audio/x-mod
61 #audio/x-startracker-module
62 #>0     string  >\0             Title: "%s"
63 1080    string  4CHN            audio/x-mod
64 #audio/x-fasttracker-module
65 #>0     string  >\0             Title: "%s"
66 1080    string  6CHN            audio/x-mod
67 #audio/x-fasttracker-module
68 #>0     string  >\0             Title: "%s"
69 1080    string  8CHN            audio/x-mod
70 #audio/x-fasttracker-module
71 #>0     string  >\0             Title: "%s"
72 1080    string  CD81            audio/x-mod
73 #audio/x-oktalyzer-tracker-module
74 #>0     string  >\0             Title: "%s"
75 1080    string  OKTA            audio/x-mod
76 #audio/x-oktalyzer-tracker-module
77 #>0     string  >\0             Title: "%s"
78 # Not good enough.
79 #1082   string  CH
80 #>1080  string  >/0             %.2s-channel Fasttracker "oktalyzer" module sound data
81 1080    string  16CN            audio/x-mod
82 #audio/x-taketracker-module
83 #>0     string  >\0             Title: "%s"
84 1080    string  32CN            audio/x-mod
85 #audio/x-taketracker-module
86 #>0     string  >\0             Title: "%s"
87
88 # Impuse tracker module (it)
89 0       string          IMPM            audio/x-mod
90 #>4     string          >\0             "%s"
91 #>40    leshort         !0              compatible w/ITv%x
92 #>42    leshort         !0              created w/ITv%x
93
94 #------------------------------------------------------------------------------
95 # end local stuff
96 #------------------------------------------------------------------------------
97
98 # xml based formats!
99
100 # svg
101
102 0       string          \<?xml
103 #                       text/xml
104 >38     string          \<\!DOCTYPE\040svg      image/svg+xml
105
106
107 # xml
108 0       string          \<?xml                  text/xml
109
110
111 #------------------------------------------------------------------------------
112 # Java
113
114 0       short           0xcafe
115 >2      short           0xbabe          application/java
116
117 #------------------------------------------------------------------------------
118 # audio:  file(1) magic for sound formats
119 #
120 # from Jan Nicolai Langfeldt <janl@ifi.uio.no>,
121 #
122
123 # Sun/NeXT audio data
124 0       string          .snd
125 >12     belong          1               audio/basic
126 >12     belong          2               audio/basic
127 >12     belong          3               audio/basic
128 >12     belong          4               audio/basic
129 >12     belong          5               audio/basic
130 >12     belong          6               audio/basic
131 >12     belong          7               audio/basic
132
133 >12     belong          23              audio/x-adpcm
134
135 # DEC systems (e.g. DECstation 5000) use a variant of the Sun/NeXT format
136 # that uses little-endian encoding and has a different magic number
137 # (0x0064732E in little-endian encoding).
138 0       lelong          0x0064732E      
139 >12     lelong          1               audio/x-dec-basic
140 >12     lelong          2               audio/x-dec-basic
141 >12     lelong          3               audio/x-dec-basic
142 >12     lelong          4               audio/x-dec-basic
143 >12     lelong          5               audio/x-dec-basic
144 >12     lelong          6               audio/x-dec-basic
145 >12     lelong          7               audio/x-dec-basic
146 #                                       compressed (G.721 ADPCM)
147 >12     lelong          23              audio/x-dec-adpcm
148
149 # Bytes 0-3 of AIFF, AIFF-C, & 8SVX audio files are "FORM"
150 #                                       AIFF audio data
151 8       string          AIFF            audio/x-aiff    
152 #                                       AIFF-C audio data
153 8       string          AIFC            audio/x-aiff    
154 #                                       IFF/8SVX audio data
155 8       string          8SVX            audio/x-aiff    
156
157
158
159 # Creative Labs AUDIO stuff
160 #                                       Standard MIDI data
161 0       string  MThd                    audio/unknown   
162 #>9     byte    >0                      (format %d)
163 #>11    byte    >1                      using %d channels
164 #                                       Creative Music (CMF) data
165 0       string  CTMF                    audio/unknown   
166 #                                       SoundBlaster instrument data
167 0       string  SBI                     audio/unknown   
168 #                                       Creative Labs voice data
169 0       string  Creative\ Voice\ File   audio/unknown   
170 ## is this next line right?  it came this way...
171 #>19    byte    0x1A
172 #>23    byte    >0                      - version %d
173 #>22    byte    >0                      \b.%d
174
175 # [GRR 950115:  is this also Creative Labs?  Guessing that first line
176 #  should be string instead of unknown-endian long...]
177 #0      long            0x4e54524b      MultiTrack sound data
178 #0      string          NTRK            MultiTrack sound data
179 #>4     long            x               - version %ld
180
181 # Microsoft WAVE format (*.wav)
182 # [GRR 950115:  probably all of the shorts and longs should be leshort/lelong]
183 #                                       Microsoft RIFF
184 0       string          RIFF
185 #                                       - WAVE format
186 >8      string          WAVE            audio/x-wav
187 >8      string          AVI             video/x-msvideo
188 #
189 0       belong          0x2e7261fd      application/x-realaudio
190 >8      string          CDRA            image/x-coreldraw
191
192
193 # MPEG Layer 3 sound files
194 0       beshort         &0xffe0         audio/mpeg
195 #MP3 with ID3 tag
196 0       string          ID3             audio/mpeg
197 # Ogg/Vorbis
198 0       string          OggS            application/ogg
199
200 #------------------------------------------------------------------------------
201 # c-lang:  file(1) magic for C programs or various scripts
202 #
203
204 # XPM icons (Greg Roelofs, newt@uchicago.edu)
205 # ideally should go into "images", but entries below would tag XPM as C source
206 0       string          /*\ XPM         image/x-xpm     7bit
207
208 # 3DS (3d Studio files)
209 16      beshort         0x3d3d          image/x-3ds
210
211 # this first will upset you if you're a PL/1 shop... (are there any left?)
212 # in which case rm it; ascmagic will catch real C programs
213 #                                       C or REXX program text
214 #0      string          /*              text/x-c
215 #                                       C++ program text
216 #0      string          //              text/x-c++
217
218 #------------------------------------------------------------------------------
219 # commands:  file(1) magic for various shells and interpreters
220 #
221 #0       string          :\ shell archive or commands for antique kernel text
222 0       string          #!/bin/sh               application/x-shellscript
223 0       string          #!\ /bin/sh             application/x-shellscript
224 0       string          #!/bin/csh              application/x-shellscript
225 0       string          #!\ /bin/csh            application/x-shellscript
226 # korn shell magic, sent by George Wu, gwu@clyde.att.com
227 0       string          #!/bin/ksh              application/x-shellscript
228 0       string          #!\ /bin/ksh            application/x-shellscript
229 0       string          #!/bin/tcsh             application/x-shellscript
230 0       string          #!\ /bin/tcsh           application/x-shellscript
231 0       string          #!/usr/local/tcsh       application/x-shellscript
232 0       string          #!\ /usr/local/tcsh     application/x-shellscript
233 0       string          #!/usr/local/bin/tcsh   application/x-shellscript
234 0       string          #!\ /usr/local/bin/tcsh application/x-shellscript
235 # bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de)
236 0       string          #!/bin/bash                     application/x-shellscript
237 0       string          #!\ /bin/bash           application/x-shellscript
238 0       string          #!/usr/local/bin/bash   application/x-shellscript
239 0       string          #!\ /usr/local/bin/bash application/x-shellscript
240
241 #
242 # zsh/ash/ae/nawk/gawk magic from cameron@cs.unsw.oz.au (Cameron Simpson)
243 0       string          #!/bin/zsh              application/x-shellscript
244 0       string          #!/usr/bin/zsh          application/x-shellscript
245 0       string          #!/usr/local/bin/zsh    application/x-shellscript
246 0       string          #!\ /usr/local/bin/zsh  application/x-shellscript
247 0       string          #!/usr/local/bin/ash    application/x-shellscript
248 0       string          #!\ /usr/local/bin/ash  application/x-shellscript
249 #0       string          #!/usr/local/bin/ae     Neil Brown's ae
250 #0       string          #!\ /usr/local/bin/ae   Neil Brown's ae
251 0       string          #!/bin/nawk             application/x-nawk
252 0       string          #!\ /bin/nawk           application/x-nawk
253 0       string          #!/usr/bin/nawk         application/x-nawk
254 0       string          #!\ /usr/bin/nawk       application/x-nawk
255 0       string          #!/usr/local/bin/nawk   application/x-nawk
256 0       string          #!\ /usr/local/bin/nawk application/x-nawk
257 0       string          #!/bin/gawk             application/x-gawk
258 0       string          #!\ /bin/gawk           application/x-gawk
259 0       string          #!/usr/bin/gawk         application/x-gawk
260 0       string          #!\ /usr/bin/gawk       application/x-gawk
261 0       string          #!/usr/local/bin/gawk   application/x-gawk
262 0       string          #!\ /usr/local/bin/gawk application/x-gawk
263 #
264 0       string          #!/bin/awk              application/x-awk
265 0       string          #!\ /bin/awk            application/x-awk
266 0       string          #!/usr/bin/awk          application/x-awk
267 0       string          #!\ /usr/bin/awk        application/x-awk
268 0       string          BEGIN                   application/x-awk
269
270 # For Larry Wall's perl language.  The ``eval'' line recognizes an
271 # outrageously clever hack for USG systems.
272 #                               Keith Waclena <keith@cerberus.uchicago.edu>
273 0       string          #!/bin/perl                     application/x-perl
274 0       string          #!\ /bin/perl                   application/x-perl
275 0       string          eval\ "exec\ /bin/perl          application/x-perl
276 0       string          #!/usr/bin/perl                 application/x-perl
277 0       string          #!\ /usr/bin/perl               application/x-perl
278 0       string          eval\ "exec\ /usr/bin/perl      application/x-perl
279 0       string          #!/usr/local/bin/perl           application/x-perl
280 0       string          #!\ /usr/local/bin/perl         application/x-perl
281 0       string          eval\ "exec\ /usr/local/bin/perl application/x-perl
282
283 #------------------------------------------------------------------------------
284 # compress:  file(1) magic for pure-compression formats (no archives)
285 #
286 # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, whap, etc.
287 #
288 # Formats for various forms of compressed data
289 # Formats for "compress" proper have been moved into "compress.c",
290 # because it tries to uncompress it to figure out what's inside.
291
292 # standard unix compress
293 0       string          \037\235        application/x-compress
294
295 # gzip (GNU zip, not to be confused with [Info-ZIP/PKWARE] zip archiver)
296 0       string          \037\213        application/x-gzip
297
298 0               string                  PK\003\004              application/x-zip
299
300 # RAR archiver (Greg Roelofs, newt@uchicago.edu)
301 0       string          Rar!            application/x-rar
302
303 # According to gzip.h, this is the correct byte order for packed data.
304 0       string          \037\036        application/octet-stream
305 #
306 # This magic number is byte-order-independent.
307 #
308 0       short           017437          application/octet-stream
309
310 # XXX - why *two* entries for "compacted data", one of which is
311 # byte-order independent, and one of which is byte-order dependent?
312 #
313 # compacted data
314 0       short           0x1fff          application/octet-stream
315 0       string          \377\037        application/octet-stream
316 # huf output
317 0       short           0145405         application/octet-stream
318
319 # Squeeze and Crunch...
320 # These numbers were gleaned from the Unix versions of the programs to
321 # handle these formats.  Note that I can only uncrunch, not crunch, and
322 # I didn't have a crunched file handy, so the crunch number is untested.
323 #                               Keith Waclena <keith@cerberus.uchicago.edu>
324 #0      leshort         0x76FF          squeezed data (CP/M, DOS)
325 #0      leshort         0x76FE          crunched data (CP/M, DOS)
326
327 # Freeze
328 #0      string          \037\237        Frozen file 2.1
329 #0      string          \037\236        Frozen file 1.0 (or gzip 0.5)
330
331 # lzh?
332 #0      string          \037\240        LZH compressed data
333
334 257     string          ustar\0         application/x-tar       posix
335 257     string          ustar\040\040\0         application/x-tar       gnu
336
337 0       short           070707          application/x-cpio
338 0       short           0143561         application/x-cpio      swapped
339
340 0       string          =<ar>           application/x-archive
341 0       string          !<arch>         application/x-archive
342 >8      string          debian          application/x-debian-package
343
344 #------------------------------------------------------------------------------
345 #
346 # RPM: file(1) magic for Red Hat Packages   Erik Troan (ewt@redhat.com)
347 #
348 0       beshort         0xedab
349 >2      beshort         0xeedb          application/x-rpm
350
351 0       lelong&0x8080ffff       0x0000081a      application/x-arc       lzw
352 0       lelong&0x8080ffff       0x0000091a      application/x-arc       squashed
353 0       lelong&0x8080ffff       0x0000021a      application/x-arc       uncompressed
354 0       lelong&0x8080ffff       0x0000031a      application/x-arc       packed
355 0       lelong&0x8080ffff       0x0000041a      application/x-arc       squeezed
356 0       lelong&0x8080ffff       0x0000061a      application/x-arc       crunched
357
358 0       leshort 0xea60  application/x-arj
359
360 # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
361 2       string  -lh0-   application/x-lharc     lh0
362 2       string  -lh1-   application/x-lharc     lh1
363 2       string  -lz4-   application/x-lharc     lz4
364 2       string  -lz5-   application/x-lharc     lz5
365 #       [never seen any but the last; -lh4- reported in comp.compression:]
366 2       string  -lzs-   application/x-lha       lzs
367 2       string  -lh\ -  application/x-lha       lh
368 2       string  -lhd-   application/x-lha       lhd
369 2       string  -lh2-   application/x-lha       lh2
370 2       string  -lh3-   application/x-lha       lh3
371 2       string  -lh4-   application/x-lha       lh4
372 2       string  -lh5-   application/x-lha       lh5
373 2       string  -lh6-   application/x-lha       lh6
374 2       string  -lh7-   application/x-lha       lh7
375 # Shell archives
376 10      string  #\ This\ is\ a\ shell\ archive  application/octet-stream        x-shell
377
378 #------------------------------------------------------------------------------
379 # frame:  file(1) magic for FrameMaker files
380 #
381 # This stuff came on a FrameMaker demo tape, most of which is
382 # copyright, but this file is "published" as witness the following:
383 #
384 0       string          \<MakerFile     application/x-frame
385 0       string          \<MIFFile       application/x-frame
386 0       string          \<MakerDictionary       application/x-frame
387 0       string          \<MakerScreenFon        application/x-frame
388 0       string          \<MML           application/x-frame
389 0       string          \<Book          application/x-frame
390 0       string          \<Maker         application/x-frame
391
392 #------------------------------------------------------------------------------
393 # html:  file(1) magic for HTML (HyperText Markup Language) docs
394 #
395 # from Daniel Quinlan <quinlan@yggdrasil.com>
396 #
397 0       string          \<HEAD  text/html
398 0       string          \<head  text/html
399 0       string          \<TITLE text/html
400 0       string          \<title text/html
401 0       string          \<html  text/html
402 0       string          \<HTML  text/html
403 0       string          \<!--   text/html
404 0       string          \<h1    text/html
405 0       string          \<H1    text/html
406 0       string          \<!doctype\ HTML        text/html
407 0       string          \<!DOCTYPE\ HTML        text/html
408 0       string          \<!doctype\ html        text/html
409 0       string          \<!doctype\ HTML        text/html
410
411 #------------------------------------------------------------------------------
412 # images:  file(1) magic for image formats (see also "c-lang" for XPM bitmaps)
413 #
414 # originally from jef@helios.ee.lbl.gov (Jef Poskanzer),
415 # additions by janl@ifi.uio.no as well as others. Jan also suggested
416 # merging several one- and two-line files into here.
417 #
418 # XXX - byte order for GIF and TIFF fields?
419 # [GRR:  TIFF allows both byte orders; GIF is probably little-endian]
420 #
421
422 # [GRR:  what the hell is this doing in here?]
423 #0      string          xbtoa           btoa'd file
424
425 # PBMPLUS
426 #                                       PBM file
427 0       string          P1              image/x-portable-bitmap 7bit
428 #                                       PGM file
429 0       string          P2              image/x-portable-greymap        7bit
430 #                                       PPM file
431 0       string          P3              image/x-portable-pixmap 7bit
432 #                                       PBM "rawbits" file
433 0       string          P4              image/x-portable-bitmap
434 #                                       PGM "rawbits" file
435 0       string          P5              image/x-portable-greymap
436 #                                       PPM "rawbits" file
437 0       string          P6              image/x-portable-pixmap
438
439 # NIFF (Navy Interchange File Format, a modification of TIFF)
440 # [GRR:  this *must* go before TIFF]
441 0       string          IIN1            image/x-niff
442
443 # TIFF and friends
444 #                                       TIFF file, big-endian
445 0       string          MM              image/tiff
446 #                                       TIFF file, little-endian
447 0       string          II              image/tiff
448
449 # possible GIF replacements; none yet released!
450 # (Greg Roelofs, newt@uchicago.edu)
451 #
452 # GRR 950115:  this was mine ("Zip GIF"):
453 #                                       ZIF image (GIF+deflate alpha)
454 0       string          GIF94z          image/unknown
455 #
456 # GRR 950115:  this is Jeremy Wohl's Free Graphics Format (better):
457 #                                       FGF image (GIF+deflate beta)
458 0       string          FGF95a          image/unknown
459 #
460 # GRR 950115:  this is Thomas Boutell's Portable Bitmap Format proposal
461 # (best; not yet implemented):
462 #                                       PBF image (deflate compression)
463 0       string          PBF             image/unknown
464
465 # GIF
466 0       string          GIF             image/gif
467
468 # JPEG images
469 0       beshort         0xffd8          image/jpeg
470
471 # PC bitmaps (OS/2, Windoze BMP files)  (Greg Roelofs, newt@uchicago.edu)
472 0       string          BM              image/bmp
473 #>14    byte            12              (OS/2 1.x format)
474 #>14    byte            64              (OS/2 2.x format)
475 #>14    byte            40              (Windows 3.x format)
476 #0      string          IC              icon
477 #0      string          PI              pointer
478 #0      string          CI              color icon
479 #0      string          CP              color pointer
480 #0      string          BA              bitmap array
481
482 # CDROM Filesystems
483 32769    string    CD001     application/x-iso9660
484
485 # Newer StuffIt archives (grant@netbsd.org)
486 0       string          StuffIt                 application/x-stuffit
487 #>162   string          >0                      : %s
488
489 # BinHex is the Macintosh ASCII-encoded file format (see also "apple")
490 # Daniel Quinlan, quinlan@yggdrasil.com
491 11      string  must\ be\ converted\ with\ BinHex\ 4    application/mac-binhex40
492 ##>41   string  x                                       \b, version %.3s
493
494
495 #------------------------------------------------------------------------------
496 # lisp:  file(1) magic for lisp programs
497 #
498 # various lisp types, from Daniel Quinlan (quinlan@yggdrasil.com)
499 0       string  ;;                      text/plain      8bit
500 # Emacs 18 - this is always correct, but not very magical.
501 0       string  \012(                   application/x-elc
502 # Emacs 19
503 0       string  ;ELC\023\000\000\000    application/x-elc
504
505 #------------------------------------------------------------------------------
506 # mail.news:  file(1) magic for mail and news
507 #
508 # There are tests to ascmagic.c to cope with mail and news.
509 0       string          Relay-Version:  message/rfc822  7bit
510 0       string          #!\ rnews       message/rfc822  7bit
511 0       string          N#!\ rnews      message/rfc822  7bit
512 0       string          Forward\ to     message/rfc822  7bit
513 0       string          Pipe\ to        message/rfc822  7bit
514 0       string          Return-Path:    message/rfc822  7bit
515 0       string          Received:       message/rfc822
516 0       string          Path:           message/news    8bit
517 0       string          Xref:           message/news    8bit
518 0       string          From:           message/rfc822  7bit
519 0       string          Article         message/news    8bit
520 #------------------------------------------------------------------------------
521 # msword: file(1) magic for MS Word files
522 #
523 # Contributor claims:
524 # Reversed-engineered MS Word magic numbers
525 #
526
527 0       string          \376\067\0\043                  application/msword
528 0       string          \320\317\021\340\241\261        application/msword
529 0       string          \333\245-\0\0\0                 application/msword
530
531
532
533 #------------------------------------------------------------------------------
534 # printer:  file(1) magic for printer-formatted files
535 #
536
537 # PostScript
538 0       string          %!              application/postscript
539 0       string          \004%!          application/postscript
540
541 # Acrobat
542 # (due to clamen@cs.cmu.edu)
543 0       string          %PDF-           application/pdf
544
545 #------------------------------------------------------------------------------
546 # sc:  file(1) magic for "sc" spreadsheet
547 #
548 38      string          Spreadsheet     application/x-sc
549
550 #------------------------------------------------------------------------------
551 # tex:  file(1) magic for TeX files
552 #
553 # XXX - needs byte-endian stuff (big-endian and little-endian DVI?)
554 #
555 # From <conklin@talisman.kaleida.com>
556
557 # Although we may know the offset of certain text fields in TeX DVI
558 # and font files, we can't use them reliably because they are not
559 # zero terminated. [but we do anyway, christos]
560 0       string          \367\002        application/x-dvi
561 #0      string          \367\203        TeX generic font data
562 #0      string          \367\131        TeX packed font data
563 #0      string          \367\312        TeX virtual font data
564 #0      string          This\ is\ TeX,  TeX transcript text     
565 #0      string          This\ is\ METAFONT,     METAFONT transcript text
566
567 # There is no way to detect TeX Font Metric (*.tfm) files without
568 # breaking them apart and reading the data.  The following patterns
569 # match most *.tfm files generated by METAFONT or afm2tfm.
570 2       string          \000\021        application/x-tex-tfm
571 2       string          \000\022        application/x-tex-tfm
572 #>34    string          >\0             (%s)
573
574 # Texinfo and GNU Info, from Daniel Quinlan (quinlan@yggdrasil.com)
575 0       string          \\input\ texinfo                text/x-texinfo
576 0       string          This\ is\ Info\ file    text/x-info
577
578 # correct TeX magic for Linux (and maybe more)
579 # from Peter Tobias (tobias@server.et-inf.fho-emden.de)
580 #
581 0       leshort         0x02f7          application/x-dvi
582
583 # RTF - Rich Text Format
584 0       string          {\\rtf          text/rtf
585
586 #------------------------------------------------------------------------------
587 # animation:  file(1) magic for animation/movie formats
588 #
589 # animation formats, originally from vax@ccwf.cc.utexas.edu (VaX#n8)
590 #                                               MPEG file
591 0       belong          0x000001b3                      video/mpeg
592 0       belong          0x000001ba                      video/mpeg
593 # FLI animation format
594 0       leshort         0xAF11                          video/fli
595 # FLC animation format
596 0       leshort         0xAF12                          video/flc
597 # AVI
598 >8      string          AVI\                            video/avi
599 #
600 # SGI and Apple formats
601 #
602 0       string          MOVI                            video/sgi
603 4       string          moov                            video/quicktime moov
604 4       string          mdat                            video/quicktime mdat
605 # The contributor claims:
606 #   I couldn't find a real magic number for these, however, this
607 #   -appears- to work.  Note that it might catch other files, too,
608 #   so BE CAREFUL!
609 #
610 # Note that title and author appear in the two 20-byte chunks
611 # at decimal offsets 2 and 22, respectively, but they are XOR'ed with
612 # 255 (hex FF)! DL format SUCKS BIG ROCKS.
613 #
614 #                                               DL file version 1 , medium format (160x100, 4 images/screen)
615 0       byte            1                       video/unknown
616 0       byte            2                       video/unknown
617 #
618 # Databases
619 #
620 # GDBM magic numbers
621 #  Will be maintained as part of the GDBM distribution in the future.
622 #  <downsj@teeny.org>
623 0       belong  0x13579ace      application/x-gdbm
624 0       lelong  0x13579ace      application/x-gdbm
625 0       string  GDBM            application/x-gdbm
626 #
627 0       belong  0x061561        application/x-dbm
628 #
629 # Executables
630 #
631 0       string          \177ELF 
632 >4      byte            0
633 >4      byte            1
634 >4      byte            2
635 >5      byte            0
636 >5      byte            1
637 >>16    leshort         0
638 >>16    leshort         1               application/x-object
639 >>16    leshort         2               application/x-executable
640 >>16    leshort         3               application/x-sharedlib
641 >>16    leshort         4               application/x-coredump
642 #
643 # DOS
644 0               string                  MZ                              application/x-dosexec
645 #
646 # KDE
647 0               string  [KDE\ Desktop\ Entry]   application/x-kdelnk
648 0               string  \#\ KDE\ Config\ File   application/x-kdelnk
649 # xmcd database file for kscd
650 0               string  \#\ xmcd                text/xmcd
651
652 #------------------------------------------------------------------------------
653 # pkgadd:  file(1) magic for SysV R4 PKG Datastreams
654 #
655 0       string          #\ PaCkAgE\ DaTaStReAm  application/x-svr4-package
656
657 #PNG Image Format
658 0       string          \x89PNG                 image/png
659
660 # MNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
661 0       string          \x8aMNG                 video/x-mng
662 0       string          \x8aJNG                 video/x-jng
663
664 #------------------------------------------------------------------------------
665 # Hierarchical Data Format, used to facilitate scientific data exchange
666 # specifications at http://hdf.ncsa.uiuc.edu/
667 0       belong          0x0e031301      Hierarchical Data Format (version 4) data
668 0       string          \211HDF\r\n\032 Hierarchical Data Format (version 5) data
669
670 # Adobe Photoshop
671 0       string          8BPS                    image/x-photoshop
672
673 # Felix von Leitner <felix-file@fefe.de>
674 0       string          d8:announce             application/x-bittorrent
675
676
677 # lotus 1-2-3 document
678 0       belong  0x00001a00      application/x-123
679 0       belong  0x00000200      application/x-123
680
681 # MS Access database
682 4       string  Standard\ Jet\ DB       application/msaccess
683
684 ## magic for XBase files
685 #0      byte       0x02 
686 #>8     leshort   >0
687 #>>12   leshort    0    application/x-dbf
688 #
689 #0      byte       0x03 
690 #>8     leshort   >0
691 #>>12   leshort    0    application/x-dbf
692 #
693 #0      byte       0x04 
694 #>8     leshort   >0
695 #>>12   leshort    0    application/x-dbf
696 #
697 #0      byte       0x05 
698 #>8     leshort   >0
699 #>>12   leshort    0    application/x-dbf
700 #
701 #0      byte       0x30
702 #>8     leshort   >0
703 #>>12   leshort    0    application/x-dbf
704 #
705 #0      byte       0x43
706 #>8     leshort   >0
707 #>>12   leshort    0    application/x-dbf
708 #
709 #0      byte       0x7b
710 #>8     leshort   >0
711 #>>12   leshort    0    application/x-dbf
712 #
713 #0      byte       0x83 
714 #>8     leshort   >0
715 #>>12   leshort    0    application/x-dbf
716 #
717 #0      byte       0x8b
718 #>8     leshort   >0
719 #>>12   leshort    0    application/x-dbf
720 #
721 #0      byte       0x8e 
722 #>8     leshort   >0
723 #>>12   leshort    0    application/x-dbf
724 #
725 #0      byte       0xb3
726 #>8     leshort   >0
727 #>>12   leshort    0    application/x-dbf
728 #
729 #0      byte       0xf5
730 #>8     leshort   >0
731 #>>12   leshort    0    application/x-dbf
732 #
733 #0      leshort         0x0006          application/x-dbt
734
735 # Debian has entries for the old PGP formats:
736 # pgp:  file(1) magic for Pretty Good Privacy
737 # see http://lists.gnupg.org/pipermail/gnupg-devel/1999-September/016052.html
738 0       beshort         0x9900                  text/PGP key public ring
739 0       beshort         0x9501                  text/PGP key security ring
740 0       beshort         0x9500                  text/PGP key security ring
741 0       beshort         0xa600                  text/PGP encrypted data
742 0       string          -----BEGIN\040PGP       text/PGP armored data 
743 >15     string          PUBLIC\040KEY\040BLOCK- public key block
744 >15     string          MESSAGE-                message
745 >15     string          SIGNED\040MESSAGE-      signed message
746 >15     string          PGP\040SIGNATURE-       signature
747 0       beshort         0x8501                  data
748 #
749 # GnuPG Magic:
750
751 0       beshort         0x9901                  text/GnuPG key public ring
752 0       beshort         0x8501                  text/OpenPGP data
753
754 # flash:        file(1) magic for Macromedia Flash file format
755 #
756 # See
757 #
758 #       http://www.macromedia.com/software/flash/open/
759 #
760 0       string          FWS             
761 >3      byte            x                       application/x-shockwave-flash
762
763 # The following paramaters are created for Namazu.
764 # <http://www.namazu.org/>
765 #
766 # 1999/08/13
767 #0      string          \<!--\ MHonArc          text/html; x-type=mhonarc
768 0       string          BZh                     application/x-bzip2
769
770 # 1999/09/09
771 # VRML (suggested by Masao Takaku)
772 0       string          #VRML\ V1.0\ ascii      model/vrml
773 0       string          #VRML\ V2.0\ utf8       model/vrml
774
775 #------------------------------------------------------------------------------
776 # ichitaro456: file(1) magic for Just System Word Processor Ichitaro
777 #
778 # Contributor kenzo-:
779 # Reversed-engineered JS Ichitaro magic numbers
780 #
781
782 0       string          DOC
783 >43     byte            0x14            application/ichitaro4
784 >144    string  JDASH           application/ichitaro4
785
786 0       string          DOC
787 >43     byte            0x15            application/ichitaro5
788
789 0       string          DOC
790 >43     byte            0x16            application/ichitaro6
791
792 #------------------------------------------------------------------------------
793 # office97: file(1) magic for MicroSoft Office files
794 #
795 # Contributor kenzo-:
796 # Reversed-engineered MS Office magic numbers
797 #
798
799 #0       string          \320\317\021\340\241\261\032\341
800 #>48     byte            0x1B            application/excel
801
802 2080    string  Microsoft\ Excel\ 5.0\ Worksheet        application/excel
803 2114    string  Biff5                                   application/excel
804
805 0       string  \224\246\056            application/msword
806
807 0       belong  0x31be0000              application/msword
808
809 0       string  PO^Q`                   application/msword
810
811 0       string  \320\317\021\340\241\261\032\341
812 >546    string  bjbj                    application/msword
813 >546    string  jbjb                    application/msword
814
815 512     string  R\0o\0o\0t\0\ \0E\0n\0t\0r\0y   application/msword
816
817 2080    string  Microsoft\ Word\ 6.0\ Document  application/msword
818 2080    string  Documento\ Microsoft\ Word\ 6   application/msword
819 2112    string  MSWordDoc                       application/msword
820
821 #0      string  \320\317\021\340\241\261\032\341        application/powerpoint
822 0       string  \320\317\021\340\241\261\032\341        application/msword
823
824 0       string  #\ PaCkAgE\ DaTaStReAm  application/x-svr4-package
825
826
827 # WinNT/WinCE PE files (Warner Losh, imp@village.org)
828 #
829 128             string  PE\000\000      application/octet-stream
830 0               string  PE\000\000      application/octet-stream
831
832 # miscellaneous formats
833 0               string  LZ              application/octet-stream
834
835
836 # .EXE formats (Greg Roelofs, newt@uchicago.edu)
837 #
838 0               string  MZ
839 >24             string  @               application/octet-stream
840
841 0               string  MZ
842 >30             string  Copyright\ 1989-1990\ PKWARE\ Inc.      application/x-zip
843
844 0               string  MZ
845 >30             string  PKLITE\ Copr.   application/x-zip
846
847 0               string  MZ
848 >36             string  LHa's\ SFX      application/x-lha
849
850 0               string  MZ              application/octet-stream
851
852 # LHA archiver
853 2               string  -lh
854 >6              string  -               application/x-lha
855
856
857 # Zoo archiver
858 20              lelong  0xfdc4a7dc      application/x-zoo
859
860 # ARC archiver
861 0               lelong&0x8080ffff       0x0000081a      application/x-arc
862 0               lelong&0x8080ffff       0x0000091a      application/x-arc
863 0               lelong&0x8080ffff       0x0000021a      application/x-arc
864 0               lelong&0x8080ffff       0x0000031a      application/x-arc
865 0               lelong&0x8080ffff       0x0000041a      application/x-arc
866 0               lelong&0x8080ffff       0x0000061a      application/x-arc
867
868 # Microsoft Outlook's Transport Neutral Encapsulation Format (TNEF)
869 0               lelong  0x223e9f78      application/ms-tnef
870
871
872 #
873 # QuickTime format
874 # Contributer: Peter Breton
875 #
876
877 0       string          MOVI            video/quicktime
878 4       string          moov            video/quicktime
879 4       string          mdat            video/quicktime
880
881 # Video Formate
882 0       string          RIFF
883 # AVI == Audio Video Interleave
884 >8      string          AVI\            
885 #>0xbc   string         >\0             video/x-%s
886
887 >>0xbc  string          DIV3            video/x-DivX-3
888 >>0xbc  string          div3            video/x-divX-3
889 >>0xbc  string          DIV4            video/x-DivX-4
890 >>0x70  string          DX50            video/x-DIVX-5
891 >>0x70  string          MP4             video/x-MPEG-4
892 >>0xbc  string          DIVX            video/x-DivX
893 >8      string          WAVE            audio/x-wav
894
895 # From: stephane.loeuillet@tiscali.f
896 # http://www.djvuzone.org/
897 0       string          AT&TFORM        image/x.djvu
898
899 # Danny Milosavljevic <danny.milo@gmx.net>
900 # this are adrift (adventure game standard) game files, extension .taf
901 # depending on version magic continues with 0x93453E6139FA (V 4.0)
902 # 0x9445376139FA (V 3.90)
903 # 0x9445366139FA (V 3.80)
904 # this is from source (http://www.adrift.org.uk/) and I have some taf
905 # files, and checked them.
906 #0       belong          0x3C423FC9
907 #>4      belong          0x6A87C2CF application/x-adrift