781528621609854d44ce46605cc84f0e3a422e3b
[dragonfly.git] / contrib / file-4 / magic / 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/B        AVI             video/x-msvideo
188 #
189 >8      string          CDRA            image/x-coreldraw
190
191 # AAC (aka MPEG-2 NBC)
192 0       beshort&0xfff6    0xfff0          audio/X-HX-AAC-ADTS
193 0       string          ADIF            audio/X-HX-AAC-ADIF
194 0       beshort&0xffe0  0x56e0          audio/MP4A-LATM
195 0       beshort         0x4De1          audio/MP4A-LATM
196
197 # MPEG Layer 3 sound files
198 0       beshort         &0xffe0         audio/mpeg
199 #MP3 with ID3 tag
200 0       string          ID3             audio/mpeg
201 # Ogg/Vorbis
202 0       string          OggS            application/ogg
203
204 #------------------------------------------------------------------------------
205 # c-lang:  file(1) magic for C programs or various scripts
206 #
207
208 # XPM icons (Greg Roelofs, newt@uchicago.edu)
209 # ideally should go into "images", but entries below would tag XPM as C source
210 0       string          /*\ XPM         image/x-xpmi 7bit
211
212 # 3DS (3d Studio files) Conflicts with diff output 0x3d '='
213 #16     beshort         0x3d3d          image/x-3ds
214
215 # this first will upset you if you're a PL/1 shop... (are there any left?)
216 # in which case rm it; ascmagic will catch real C programs
217 #                                       C or REXX program text
218 #0      string          /*              text/x-c
219 #                                       C++ program text
220 #0      string          //              text/x-c++
221
222 #------------------------------------------------------------------------------
223 # commands:  file(1) magic for various shells and interpreters
224 #
225 #0       string          :\ shell archive or commands for antique kernel text
226 0       string          #!/bin/sh               application/x-shellscript
227 0       string          #!\ /bin/sh             application/x-shellscript
228 0       string          #!/bin/csh              application/x-shellscript
229 0       string          #!\ /bin/csh            application/x-shellscript
230 # korn shell magic, sent by George Wu, gwu@clyde.att.com
231 0       string          #!/bin/ksh              application/x-shellscript
232 0       string          #!\ /bin/ksh            application/x-shellscript
233 0       string          #!/bin/tcsh             application/x-shellscript
234 0       string          #!\ /bin/tcsh           application/x-shellscript
235 0       string          #!/usr/local/tcsh       application/x-shellscript
236 0       string          #!\ /usr/local/tcsh     application/x-shellscript
237 0       string          #!/usr/local/bin/tcsh   application/x-shellscript
238 0       string          #!\ /usr/local/bin/tcsh application/x-shellscript
239 # bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de)
240 0       string          #!/bin/bash                     application/x-shellscript
241 0       string          #!\ /bin/bash           application/x-shellscript
242 0       string          #!/usr/local/bin/bash   application/x-shellscript
243 0       string          #!\ /usr/local/bin/bash application/x-shellscript
244
245 #
246 # zsh/ash/ae/nawk/gawk magic from cameron@cs.unsw.oz.au (Cameron Simpson)
247 0       string          #!/bin/zsh              application/x-shellscript
248 0       string          #!/usr/bin/zsh          application/x-shellscript
249 0       string          #!/usr/local/bin/zsh    application/x-shellscript
250 0       string          #!\ /usr/local/bin/zsh  application/x-shellscript
251 0       string          #!/usr/local/bin/ash    application/x-shellscript
252 0       string          #!\ /usr/local/bin/ash  application/x-shellscript
253 #0       string          #!/usr/local/bin/ae     Neil Brown's ae
254 #0       string          #!\ /usr/local/bin/ae   Neil Brown's ae
255 0       string          #!/bin/nawk             application/x-nawk
256 0       string          #!\ /bin/nawk           application/x-nawk
257 0       string          #!/usr/bin/nawk         application/x-nawk
258 0       string          #!\ /usr/bin/nawk       application/x-nawk
259 0       string          #!/usr/local/bin/nawk   application/x-nawk
260 0       string          #!\ /usr/local/bin/nawk application/x-nawk
261 0       string          #!/bin/gawk             application/x-gawk
262 0       string          #!\ /bin/gawk           application/x-gawk
263 0       string          #!/usr/bin/gawk         application/x-gawk
264 0       string          #!\ /usr/bin/gawk       application/x-gawk
265 0       string          #!/usr/local/bin/gawk   application/x-gawk
266 0       string          #!\ /usr/local/bin/gawk application/x-gawk
267 #
268 0       string          #!/bin/awk              application/x-awk
269 0       string          #!\ /bin/awk            application/x-awk
270 0       string          #!/usr/bin/awk          application/x-awk
271 0       string          #!\ /usr/bin/awk        application/x-awk
272 # update to distinguish from *.vcf files by Joerg Jenderek: joerg dot jenderek at web dot de
273 0       regex           BEGIN[[:space:]]*[{]    application/x-awk
274
275 # For Larry Wall's perl language.  The ``eval'' line recognizes an
276 # outrageously clever hack for USG systems.
277 #                               Keith Waclena <keith@cerberus.uchicago.edu>
278 0       string          #!/bin/perl                     application/x-perl
279 0       string          #!\ /bin/perl                   application/x-perl
280 0       string          eval\ "exec\ /bin/perl          application/x-perl
281 0       string          #!/usr/bin/perl                 application/x-perl
282 0       string          #!\ /usr/bin/perl               application/x-perl
283 0       string          eval\ "exec\ /usr/bin/perl      application/x-perl
284 0       string          #!/usr/local/bin/perl           application/x-perl
285 0       string          #!\ /usr/local/bin/perl         application/x-perl
286 0       string          eval\ "exec\ /usr/local/bin/perl application/x-perl
287
288 #------------------------------------------------------------------------------
289 # compress:  file(1) magic for pure-compression formats (no archives)
290 #
291 # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, whap, etc.
292 #
293 # Formats for various forms of compressed data
294 # Formats for "compress" proper have been moved into "compress.c",
295 # because it tries to uncompress it to figure out what's inside.
296
297 # standard unix compress
298 0       string          \037\235        application/x-compress
299
300 # gzip (GNU zip, not to be confused with [Info-ZIP/PKWARE] zip archiver)
301 0       string          \037\213        application/x-gzip
302
303 0               string                  PK\003\004              application/x-zip
304
305 # RAR archiver (Greg Roelofs, newt@uchicago.edu)
306 0       string          Rar!            application/x-rar
307
308 # According to gzip.h, this is the correct byte order for packed data.
309 0       string          \037\036        application/octet-stream
310 #
311 # This magic number is byte-order-independent.
312 #
313 0       short           017437          application/octet-stream
314
315 # XXX - why *two* entries for "compacted data", one of which is
316 # byte-order independent, and one of which is byte-order dependent?
317 #
318 # compacted data
319 0       short           0x1fff          application/octet-stream
320 0       string          \377\037        application/octet-stream
321 # huf output
322 0       short           0145405         application/octet-stream
323
324 # Squeeze and Crunch...
325 # These numbers were gleaned from the Unix versions of the programs to
326 # handle these formats.  Note that I can only uncrunch, not crunch, and
327 # I didn't have a crunched file handy, so the crunch number is untested.
328 #                               Keith Waclena <keith@cerberus.uchicago.edu>
329 #0      leshort         0x76FF          squeezed data (CP/M, DOS)
330 #0      leshort         0x76FE          crunched data (CP/M, DOS)
331
332 # Freeze
333 #0      string          \037\237        Frozen file 2.1
334 #0      string          \037\236        Frozen file 1.0 (or gzip 0.5)
335
336 # lzh?
337 #0      string          \037\240        LZH compressed data
338
339 257     string          ustar\0         application/x-tar       posix
340 257     string          ustar\040\040\0         application/x-tar       gnu
341
342 0       short           070707          application/x-cpio
343 0       short           0143561         application/x-cpio      swapped
344
345 0       string          =<ar>           application/x-archive
346 0       string          \!<arch>        application/x-archive
347 >8      string          debian          application/x-debian-package
348
349 #------------------------------------------------------------------------------
350 #
351 # RPM: file(1) magic for Red Hat Packages   Erik Troan (ewt@redhat.com)
352 #
353 0       beshort         0xedab
354 >2      beshort         0xeedb          application/x-rpm
355
356 0       lelong&0x8080ffff       0x0000081a      application/x-arc       lzw
357 0       lelong&0x8080ffff       0x0000091a      application/x-arc       squashed
358 0       lelong&0x8080ffff       0x0000021a      application/x-arc       uncompressed
359 0       lelong&0x8080ffff       0x0000031a      application/x-arc       packed
360 0       lelong&0x8080ffff       0x0000041a      application/x-arc       squeezed
361 0       lelong&0x8080ffff       0x0000061a      application/x-arc       crunched
362
363 0       leshort 0xea60  application/x-arj
364
365 # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
366 2       string  -lh0-   application/x-lharc     lh0
367 2       string  -lh1-   application/x-lharc     lh1
368 2       string  -lz4-   application/x-lharc     lz4
369 2       string  -lz5-   application/x-lharc     lz5
370 #       [never seen any but the last; -lh4- reported in comp.compression:]
371 2       string  -lzs-   application/x-lha       lzs
372 2       string  -lh\ -  application/x-lha       lh
373 2       string  -lhd-   application/x-lha       lhd
374 2       string  -lh2-   application/x-lha       lh2
375 2       string  -lh3-   application/x-lha       lh3
376 2       string  -lh4-   application/x-lha       lh4
377 2       string  -lh5-   application/x-lha       lh5
378 2       string  -lh6-   application/x-lha       lh6
379 2       string  -lh7-   application/x-lha       lh7
380 # Shell archives
381 10      string  #\ This\ is\ a\ shell\ archive  application/octet-stream        x-shell
382
383 #------------------------------------------------------------------------------
384 # frame:  file(1) magic for FrameMaker files
385 #
386 # This stuff came on a FrameMaker demo tape, most of which is
387 # copyright, but this file is "published" as witness the following:
388 #
389 0       string          \<MakerFile     application/x-frame
390 0       string          \<MIFFile       application/x-frame
391 0       string          \<MakerDictionary       application/x-frame
392 0       string          \<MakerScreenFon        application/x-frame
393 0       string          \<MML           application/x-frame
394 0       string          \<Book          application/x-frame
395 0       string          \<Maker         application/x-frame
396
397 #------------------------------------------------------------------------------
398 # html:  file(1) magic for HTML (HyperText Markup Language) docs
399 #
400 # from Daniel Quinlan <quinlan@yggdrasil.com>
401 #
402 0       string          \<HEAD  text/html
403 0       string          \<head  text/html
404 0       string          \<TITLE text/html
405 0       string          \<title text/html
406 0       string          \<html  text/html
407 0       string          \<HTML  text/html
408 0       string          \<!--   text/html
409 0       string          \<h1    text/html
410 0       string          \<H1    text/html
411 0       string          \<!doctype\ HTML        text/html
412 0       string          \<!DOCTYPE\ HTML        text/html
413 0       string          \<!doctype\ html        text/html
414 0       string          \<!doctype\ HTML        text/html
415
416 #------------------------------------------------------------------------------
417 # images:  file(1) magic for image formats (see also "c-lang" for XPM bitmaps)
418 #
419 # originally from jef@helios.ee.lbl.gov (Jef Poskanzer),
420 # additions by janl@ifi.uio.no as well as others. Jan also suggested
421 # merging several one- and two-line files into here.
422 #
423 # XXX - byte order for GIF and TIFF fields?
424 # [GRR:  TIFF allows both byte orders; GIF is probably little-endian]
425 #
426
427 # [GRR:  what the hell is this doing in here?]
428 #0      string          xbtoa           btoa'd file
429
430 # PBMPLUS
431 #                                       PBM file
432 0       string          P1              image/x-portable-bitmap 7bit
433 #                                       PGM file
434 0       string          P2              image/x-portable-greymap        7bit
435 #                                       PPM file
436 0       string          P3              image/x-portable-pixmap 7bit
437 #                                       PBM "rawbits" file
438 0       string          P4              image/x-portable-bitmap
439 #                                       PGM "rawbits" file
440 0       string          P5              image/x-portable-greymap
441 #                                       PPM "rawbits" file
442 0       string          P6              image/x-portable-pixmap
443
444 # NIFF (Navy Interchange File Format, a modification of TIFF)
445 # [GRR:  this *must* go before TIFF]
446 0       string          IIN1            image/x-niff
447
448 # TIFF and friends
449 #                                       TIFF file, big-endian
450 0       string          MM              image/tiff
451 #                                       TIFF file, little-endian
452 0       string          II              image/tiff
453
454 # possible GIF replacements; none yet released!
455 # (Greg Roelofs, newt@uchicago.edu)
456 #
457 # GRR 950115:  this was mine ("Zip GIF"):
458 #                                       ZIF image (GIF+deflate alpha)
459 0       string          GIF94z          image/unknown
460 #
461 # GRR 950115:  this is Jeremy Wohl's Free Graphics Format (better):
462 #                                       FGF image (GIF+deflate beta)
463 0       string          FGF95a          image/unknown
464 #
465 # GRR 950115:  this is Thomas Boutell's Portable Bitmap Format proposal
466 # (best; not yet implemented):
467 #                                       PBF image (deflate compression)
468 0       string          PBF             image/unknown
469
470 # GIF
471 0       string          GIF             image/gif
472
473 # JPEG images
474 0       beshort         0xffd8          image/jpeg
475
476 # PC bitmaps (OS/2, Windoze BMP files)  (Greg Roelofs, newt@uchicago.edu)
477 0       string          BM              image/bmp
478 #>14    byte            12              (OS/2 1.x format)
479 #>14    byte            64              (OS/2 2.x format)
480 #>14    byte            40              (Windows 3.x format)
481 #0      string          IC              icon
482 #0      string          PI              pointer
483 #0      string          CI              color icon
484 #0      string          CP              color pointer
485 #0      string          BA              bitmap array
486
487 # CDROM Filesystems
488 32769    string    CD001     application/x-iso9660
489
490 # Newer StuffIt archives (grant@netbsd.org)
491 0       string          StuffIt                 application/x-stuffit
492 #>162   string          >0                      : %s
493
494 # BinHex is the Macintosh ASCII-encoded file format (see also "apple")
495 # Daniel Quinlan, quinlan@yggdrasil.com
496 11      string  must\ be\ converted\ with\ BinHex\ 4    application/mac-binhex40
497 ##>41   string  x                                       \b, version %.3s
498
499
500 #------------------------------------------------------------------------------
501 # lisp:  file(1) magic for lisp programs
502 #
503 # various lisp types, from Daniel Quinlan (quinlan@yggdrasil.com)
504 0       string  ;;                      text/plain      8bit
505 # Emacs 18 - this is always correct, but not very magical.
506 0       string  \012(                   application/x-elc
507 # Emacs 19
508 0       string  ;ELC\023\000\000\000    application/x-elc
509
510 #------------------------------------------------------------------------------
511 # mail.news:  file(1) magic for mail and news
512 #
513 # There are tests to ascmagic.c to cope with mail and news.
514 0       string          Relay-Version:  message/rfc822  7bit
515 0       string          #!\ rnews       message/rfc822  7bit
516 0       string          N#!\ rnews      message/rfc822  7bit
517 0       string          Forward\ to     message/rfc822  7bit
518 0       string          Pipe\ to        message/rfc822  7bit
519 0       string          Return-Path:    message/rfc822  7bit
520 0       string          Received:       message/rfc822
521 0       string          Path:           message/news    8bit
522 0       string          Xref:           message/news    8bit
523 0       string          From:           message/rfc822  7bit
524 0       string          Article         message/news    8bit
525 #------------------------------------------------------------------------------
526 # msword: file(1) magic for MS Word files
527 #
528 # Contributor claims:
529 # Reversed-engineered MS Word magic numbers
530 #
531
532 0       string          \376\067\0\043                  application/msword
533 0       string          \320\317\021\340\241\261        application/msword
534 0       string          \333\245-\0\0\0                 application/msword
535
536
537
538 #------------------------------------------------------------------------------
539 # printer:  file(1) magic for printer-formatted files
540 #
541
542 # PostScript
543 0       string          %!              application/postscript
544 0       string          \004%!          application/postscript
545
546 # Acrobat
547 # (due to clamen@cs.cmu.edu)
548 0       string          %PDF-           application/pdf
549
550 #------------------------------------------------------------------------------
551 # sc:  file(1) magic for "sc" spreadsheet
552 #
553 38      string          Spreadsheet     application/x-sc
554
555 #------------------------------------------------------------------------------
556 # tex:  file(1) magic for TeX files
557 #
558 # XXX - needs byte-endian stuff (big-endian and little-endian DVI?)
559 #
560 # From <conklin@talisman.kaleida.com>
561
562 # Although we may know the offset of certain text fields in TeX DVI
563 # and font files, we can't use them reliably because they are not
564 # zero terminated. [but we do anyway, christos]
565 0       string          \367\002        application/x-dvi
566 #0      string          \367\203        TeX generic font data
567 #0      string          \367\131        TeX packed font data
568 #0      string          \367\312        TeX virtual font data
569 #0      string          This\ is\ TeX,  TeX transcript text     
570 #0      string          This\ is\ METAFONT,     METAFONT transcript text
571
572 # There is no way to detect TeX Font Metric (*.tfm) files without
573 # breaking them apart and reading the data.  The following patterns
574 # match most *.tfm files generated by METAFONT or afm2tfm.
575 2       string          \000\021        application/x-tex-tfm
576 2       string          \000\022        application/x-tex-tfm
577 #>34    string          >\0             (%s)
578
579 # Texinfo and GNU Info, from Daniel Quinlan (quinlan@yggdrasil.com)
580 0       string          \\input\ texinfo                text/x-texinfo
581 0       string          This\ is\ Info\ file    text/x-info
582
583 # correct TeX magic for Linux (and maybe more)
584 # from Peter Tobias (tobias@server.et-inf.fho-emden.de)
585 #
586 0       leshort         0x02f7          application/x-dvi
587
588 # RTF - Rich Text Format
589 0       string          {\\rtf          text/rtf
590
591 #------------------------------------------------------------------------------
592 # animation:  file(1) magic for animation/movie formats
593 #
594 # animation formats, originally from vax@ccwf.cc.utexas.edu (VaX#n8)
595 #                                               MPEG file
596 # MPEG sequences
597 0       belong             0x000001BA
598 >4      byte               &0x40          video/mp2p
599 >4      byte               ^0x40          video/mpeg
600 0       belong             0x000001BB     video/mpeg
601 0       belong             0x000001B0     video/mp4v-es
602 0       belong             0x000001B5     video/mp4v-es
603 0       belong             0x000001B3     video/mpv
604 0       belong&0xFF5FFF1F  0x47400010     video/mp2t
605 0       belong             0x00000001
606 >4      byte&1F            0x07           video/h264
607
608 # FLI animation format
609 0       leshort         0xAF11                          video/fli
610 # FLC animation format
611 0       leshort         0xAF12                          video/flc
612 #
613 # SGI and Apple formats
614 # Added ISO mimes
615 0       string          MOVI          video/sgi
616 4       string          moov          video/quicktime
617 4       string          mdat          video/quicktime
618 4       string          wide          video/quicktime
619 4       string          skip          video/quicktime
620 4       string          free          video/quicktime
621 4       string          idsc          image/x-quicktime
622 4       string          idat          image/x-quicktime
623 4       string          pckg          application/x-quicktime
624 4       string/B        jP            image/jp2
625 4       string          ftyp
626 >8      string          isom          video/mp4
627 >8      string          mp41          video/mp4
628 >8      string          mp42          video/mp4
629 >8      string/B        jp2           image/jp2
630 >8      string          3gp           video/3gpp
631 >8      string          avc1          video/3gpp
632 >8      string          mmp4          video/mp4
633 >8      string/B        M4A           audio/mp4
634 >8      string/B        qt            video/quicktime
635 # The contributor claims:
636 #   I couldn't find a real magic number for these, however, this
637 #   -appears- to work.  Note that it might catch other files, too,
638 #   so BE CAREFUL!
639 #
640 # Note that title and author appear in the two 20-byte chunks
641 # at decimal offsets 2 and 22, respectively, but they are XOR'ed with
642 # 255 (hex FF)! DL format SUCKS BIG ROCKS.
643 #
644 #                                               DL file version 1 , medium format (160x100, 4 images/screen)
645 0       byte            1                       video/unknown
646 0       byte            2                       video/unknown
647 #
648 # Databases
649 #
650 # GDBM magic numbers
651 #  Will be maintained as part of the GDBM distribution in the future.
652 #  <downsj@teeny.org>
653 0       belong  0x13579ace      application/x-gdbm
654 0       lelong  0x13579ace      application/x-gdbm
655 0       string  GDBM            application/x-gdbm
656 #
657 0       belong  0x061561        application/x-dbm
658 #
659 # Executables
660 #
661 0       string          \177ELF 
662 >16     leshort         0               application/octet-stream
663 >16     leshort         1               application/x-object
664 >16     leshort         2               application/x-executable
665 >16     leshort         3               application/x-sharedlib
666 >16     leshort         4               application/x-coredump
667 >16     beshort         0               application/octet-stream
668 >16     beshort         1               application/x-object
669 >16     beshort         2               application/x-executable
670 >16     beshort         3               application/x-sharedlib
671 >16     beshort         4               application/x-coredump
672 #
673 # DOS
674 0               string                  MZ                              application/x-dosexec
675 #
676 # KDE
677 0               string  [KDE\ Desktop\ Entry]   application/x-kdelnk
678 0               string  \#\ KDE\ Config\ File   application/x-kdelnk
679 # xmcd database file for kscd
680 0               string  \#\ xmcd                text/xmcd
681
682 #------------------------------------------------------------------------------
683 # pkgadd:  file(1) magic for SysV R4 PKG Datastreams
684 #
685 0       string          #\ PaCkAgE\ DaTaStReAm  application/x-svr4-package
686
687 #PNG Image Format
688 0       string          \x89PNG                 image/png
689
690 # MNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
691 0       string          \x8aMNG                 video/x-mng
692 0       string          \x8aJNG                 video/x-jng
693
694 #------------------------------------------------------------------------------
695 # Hierarchical Data Format, used to facilitate scientific data exchange
696 # specifications at http://hdf.ncsa.uiuc.edu/
697 0       belong          0x0e031301      Hierarchical Data Format (version 4) data
698 0       string          \211HDF\r\n\032 Hierarchical Data Format (version 5) data
699
700 # Adobe Photoshop
701 0       string          8BPS                    image/x-photoshop
702
703 # Felix von Leitner <felix-file@fefe.de>
704 0       string          d8:announce             application/x-bittorrent
705
706
707 # lotus 1-2-3 document
708 0       belong  0x00001a00      application/x-123
709 0       belong  0x00000200      application/x-123
710
711 # MS Access database
712 4       string  Standard\ Jet\ DB       application/msaccess
713
714 ## magic for XBase files
715 #0      byte       0x02 
716 #>8     leshort   >0
717 #>>12   leshort    0    application/x-dbf
718 #
719 #0      byte       0x03 
720 #>8     leshort   >0
721 #>>12   leshort    0    application/x-dbf
722 #
723 #0      byte       0x04 
724 #>8     leshort   >0
725 #>>12   leshort    0    application/x-dbf
726 #
727 #0      byte       0x05 
728 #>8     leshort   >0
729 #>>12   leshort    0    application/x-dbf
730 #
731 #0      byte       0x30
732 #>8     leshort   >0
733 #>>12   leshort    0    application/x-dbf
734 #
735 #0      byte       0x43
736 #>8     leshort   >0
737 #>>12   leshort    0    application/x-dbf
738 #
739 #0      byte       0x7b
740 #>8     leshort   >0
741 #>>12   leshort    0    application/x-dbf
742 #
743 #0      byte       0x83 
744 #>8     leshort   >0
745 #>>12   leshort    0    application/x-dbf
746 #
747 #0      byte       0x8b
748 #>8     leshort   >0
749 #>>12   leshort    0    application/x-dbf
750 #
751 #0      byte       0x8e 
752 #>8     leshort   >0
753 #>>12   leshort    0    application/x-dbf
754 #
755 #0      byte       0xb3
756 #>8     leshort   >0
757 #>>12   leshort    0    application/x-dbf
758 #
759 #0      byte       0xf5
760 #>8     leshort   >0
761 #>>12   leshort    0    application/x-dbf
762 #
763 #0      leshort         0x0006          application/x-dbt
764
765 # Debian has entries for the old PGP formats:
766 # pgp:  file(1) magic for Pretty Good Privacy
767 # see http://lists.gnupg.org/pipermail/gnupg-devel/1999-September/016052.html
768 0       beshort         0x9900                  text/PGP key public ring
769 0       beshort         0x9501                  text/PGP key security ring
770 0       beshort         0x9500                  text/PGP key security ring
771 0       beshort         0xa600                  text/PGP encrypted data
772 0       string          -----BEGIN\040PGP       text/PGP armored data 
773 >15     string          PUBLIC\040KEY\040BLOCK- public key block
774 >15     string          MESSAGE-                message
775 >15     string          SIGNED\040MESSAGE-      signed message
776 >15     string          PGP\040SIGNATURE-       signature
777 0       beshort         0x8501                  data
778 #
779 # GnuPG Magic:
780
781 0       beshort         0x9901                  text/GnuPG key public ring
782 0       beshort         0x8501                  text/OpenPGP data
783
784 # flash:        file(1) magic for Macromedia Flash file format
785 #
786 # See
787 #
788 #       http://www.macromedia.com/software/flash/open/
789 #
790 0       string          FWS             
791 >3      byte            x                       application/x-shockwave-flash
792
793 # The following paramaters are created for Namazu.
794 # <http://www.namazu.org/>
795 #
796 # 1999/08/13
797 #0      string          \<!--\ MHonArc          text/html; x-type=mhonarc
798 0       string          BZh                     application/x-bzip2
799
800 # 1999/09/09
801 # VRML (suggested by Masao Takaku)
802 0       string          #VRML\ V1.0\ ascii      model/vrml
803 0       string          #VRML\ V2.0\ utf8       model/vrml
804
805 #------------------------------------------------------------------------------
806 # ichitaro456: file(1) magic for Just System Word Processor Ichitaro
807 #
808 # Contributor kenzo-:
809 # Reversed-engineered JS Ichitaro magic numbers
810 #
811
812 0       string          DOC
813 >43     byte            0x14            application/ichitaro4
814 >144    string  JDASH           application/ichitaro4
815
816 0       string          DOC
817 >43     byte            0x15            application/ichitaro5
818
819 0       string          DOC
820 >43     byte            0x16            application/ichitaro6
821
822 #------------------------------------------------------------------------------
823 # office97: file(1) magic for MicroSoft Office files
824 #
825 # Contributor kenzo-:
826 # Reversed-engineered MS Office magic numbers
827 #
828
829 #0       string          \320\317\021\340\241\261\032\341
830 #>48     byte            0x1B            application/excel
831
832 2080    string  Microsoft\ Excel\ 5.0\ Worksheet        application/excel
833 2114    string  Biff5                                   application/excel
834
835 0       string  \224\246\056            application/msword
836
837 0       belong  0x31be0000              application/msword
838
839 0       string  PO^Q`                   application/msword
840
841 0       string  \320\317\021\340\241\261\032\341
842 >546    string  bjbj                    application/msword
843 >546    string  jbjb                    application/msword
844
845 512     string  R\0o\0o\0t\0\ \0E\0n\0t\0r\0y   application/msword
846
847 2080    string  Microsoft\ Word\ 6.0\ Document  application/msword
848 2080    string  Documento\ Microsoft\ Word\ 6   application/msword
849 2112    string  MSWordDoc                       application/msword
850
851 #0      string  \320\317\021\340\241\261\032\341        application/powerpoint
852 0       string  \320\317\021\340\241\261\032\341        application/msword
853
854 0       string  #\ PaCkAgE\ DaTaStReAm  application/x-svr4-package
855
856
857 # WinNT/WinCE PE files (Warner Losh, imp@village.org)
858 #
859 128             string  PE\000\000      application/octet-stream
860 0               string  PE\000\000      application/octet-stream
861
862 # miscellaneous formats
863 0               string  LZ              application/octet-stream
864
865
866 # .EXE formats (Greg Roelofs, newt@uchicago.edu)
867 #
868 0               string  MZ
869 >24             string  @               application/octet-stream
870
871 0               string  MZ
872 >30             string  Copyright\ 1989-1990\ PKWARE\ Inc.      application/x-zip
873
874 0               string  MZ
875 >30             string  PKLITE\ Copr.   application/x-zip
876
877 0               string  MZ
878 >36             string  LHa's\ SFX      application/x-lha
879
880 0               string  MZ              application/octet-stream
881
882 # LHA archiver
883 2               string  -lh
884 >6              string  -               application/x-lha
885
886
887 # Zoo archiver
888 20              lelong  0xfdc4a7dc      application/x-zoo
889
890 # ARC archiver
891 0               lelong&0x8080ffff       0x0000081a      application/x-arc
892 0               lelong&0x8080ffff       0x0000091a      application/x-arc
893 0               lelong&0x8080ffff       0x0000021a      application/x-arc
894 0               lelong&0x8080ffff       0x0000031a      application/x-arc
895 0               lelong&0x8080ffff       0x0000041a      application/x-arc
896 0               lelong&0x8080ffff       0x0000061a      application/x-arc
897
898 # Microsoft Outlook's Transport Neutral Encapsulation Format (TNEF)
899 0               lelong  0x223e9f78      application/ms-tnef
900
901 # From: stephane.loeuillet@tiscali.f
902 # http://www.djvuzone.org/
903 0       string          AT&TFORM        image/x.djvu
904
905 # Danny Milosavljevic <danny.milo@gmx.net>
906 # this are adrift (adventure game standard) game files, extension .taf
907 # depending on version magic continues with 0x93453E6139FA (V 4.0)
908 # 0x9445376139FA (V 3.90)
909 # 0x9445366139FA (V 3.80)
910 # this is from source (http://www.adrift.org.uk/) and I have some taf
911 # files, and checked them.
912 #0      belong  0x3C423FC9
913 #>4     belong  0x6A87C2CF      application/x-adrift
914 #0      string  \000\000\001\000        image/x-ico
915
916 # Quark Xpress 3 Files:
917 # (made the mimetype up) 
918 0       string  \0\0MMXPR3\0    application/x-quark-xpress-3
919
920 # EET archive
921 # From: Tilman Sauerbeck <tilman@code-monkey.de>
922 0       belong  0x1ee7ff00      application/x-eet
923
924 # From: Denis Knauf, via gentoo.
925 0       string  fLaC            audio/x-flac
926 0       string  CWS             application/x-shockwave-flash