]> granicus.if.org Git - file/commitdiff
more magic fixes.
authorChristos Zoulas <christos@zoulas.com>
Sat, 24 Jul 2004 20:38:54 +0000 (20:38 +0000)
committerChristos Zoulas <christos@zoulas.com>
Sat, 24 Jul 2004 20:38:54 +0000 (20:38 +0000)
23 files changed:
ChangeLog
magic/Magdir/adventure
magic/Magdir/amigaos
magic/Magdir/apple
magic/Magdir/archive
magic/Magdir/audio
magic/Magdir/claris
magic/Magdir/communications
magic/Magdir/diff
magic/Magdir/gnu
magic/Magdir/iff
magic/Magdir/images
magic/Magdir/jpeg
magic/Magdir/matroska [new file with mode: 0644]
magic/Magdir/msdos
magic/Magdir/spec [new file with mode: 0644]
magic/Magdir/vorbis
magic/Makefile.am
magic/Makefile.in
magic/magic.mime
src/apprentice.c
src/readelf.c
src/softmagic.c

index aeeabe7f9ba74d767d8b94f4c67c924866dd7179..1239626af45dc42fa845b02f78123888653ec811 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+
+2004-07-24 16:33  Christos Zoulas  <christos@zoulas.com>
+
+       * magic.mime update Danny Milosavljevic <danny.milo@gmx.net> 
+
+       * FreeBSD version update Oliver Eikemeier <eikemeier@fillmore-labs.com>
+
+       * utime/utimes detection Ian Lance Taylor <ian@wasabisystems.com>
+
+       * errors reading elf magic Jakub Bogusz <qboosh@pld-linux.org>
+
 2004-04-12 10:55  Christos Zoulas  <christos@zoulas.com>
 
        * make sure that magic formats match magic types during compilation
index 864712f6da1ab25ac2ee2cfb8c03efe3b8314ad1..fb05cbe9658843f9bbf54b753840b4aa36226924 100644 (file)
@@ -16,7 +16,7 @@
 # Infocom
 # (Note: to avoid false matches Z-machine version 1 and 2 are not
 # recognized since only the oldest Zork I and II used them.  Similarly
-# there are 4 Infocom games that use verion 4 that are not recognized.)
+# there are 4 Infocom games that use version 4 that are not recognized.)
 #0     byte    3       Infocom game data (Z-machine 3,
 #>2    beshort <0x7fff Release %3d,
 #>26   beshort >0      Size %d*2
index f7acbcf0f173f64d12dde5218becbe36a4b9fbc4..ba2366c7ed59df8aa02069ca703915de63038963 100644 (file)
@@ -3,9 +3,8 @@
 
 #
 # From ignatios@cs.uni-bonn.de (Ignatios Souvatzis)
-# Some formats are still missing: AmigaOS special IFF's, e.g.: FORM....CTLG
-# (the others should be separate, anyway)
 #
+0      belong          0x000003fa      AmigaOS shared library
 0      belong          0x000003f3      AmigaOS loadseg()ble executable/binary
 0      belong          0x000003e7      AmigaOS object/library data
 #
 0      belong          0x80001001      AmigaOS outline tag
 0      string          ##\ version     catalog translation
 
-0      string          FORM            IFF data
->8     string          CTLG            \b, CTLG message catalog
->8     string          PREF            \b, PREF preferences
-
-0      string          Rar!            RAR archive data,
->44    byte            x               v%0x,
->35    byte            0               os: MS-DOS
->35    byte            1               os: OS/2
->35    byte            2               os: Win32
->35    byte            3               os: Unix
-
-0      belong          0x000003fa      AmigaOS shared library
-
 # Amiga disk types
 # 
 0      string          RDSK            Rigid Disk Block
index 659043c4bed8ddfde93fe5847d5f3374de71c479..2b0a290ca85b09f45d7a09d7d2a6821d1ae7188c 100644 (file)
 # Beagle Bros. Apple Mechanic fonts
 
 0      belong&0xFF00FFFF       0x6400D000      Apple Mechanic font
+
+# Apple Universal Disk Image Format (UDIF) - dmg files.
+# From Johan Gade.
+# These entries are disabled for now until we fix the following issues.
+#
+# Note there might be some problems with the "VAX COFF executable" 
+# entry. Note this entry should be placed before the mac filesystem section, 
+# particularly the "Apple Partition data" entry.
+#
+# The intended meaning of these tests is, that the file is only of the 
+# specified type if both of the lines are correct - i.e. if the first
+# line matches and the second doesn't then it is not of that type.
+#
+#0     long    0x7801730d
+#>4    long    0x62626060      UDIF read-only zlib-compressed image (UDZO)
+#
+# Note that this entry is recognized correctly by the "Apple Partition 
+# data" entry - however since this entry is more specific - this
+# information seems to be more useful.
+#0     long    0x45520200
+#>0x410        string  disk\ image     UDIF read/write image (UDRW)
index d27e39b7fc1dab18494d9e474f4992439473952a..070feab6f9d91ef5dfc938878a330af59740075f 100644 (file)
 >20    byte            x               - header level %d
 
 # RAR archiver (Greg Roelofs, newt@uchicago.edu)
-0      string          Rar!            RAR archive data
+0      string          Rar!            RAR archive data,
+>44    byte            x               v%0x,
+>35    byte            0               os: MS-DOS
+>35    byte            1               os: OS/2
+>35    byte            2               os: Win32
+>35    byte            3               os: Unix
 
 # SQUISH archiver (Greg Roelofs, newt@uchicago.edu)
 0      string          SQSH            squished archive data (Acorn RISCOS)
 >5     leshort &0x8000         \b, solid
 # Date in MS-DOS format (whatever that is)
 #>18   lelong  x               Created on
+
+# sfArk : compression program for Soundfonts (sf2) by Dirk Jagdmann
+# <doj@cubic.org>
+0x1A   string  sfArk           sfArk compressed Soundfont
+>0x15  string  2
+>>0x1  string  >\0             Version %s
+>>0x2A string  >\0             : %s
+
index 70db774c79654a9cc897768bdf5a8eb30a614edd..6a4ef95a94ccf836746330b104c7791003df7b2d 100644 (file)
 >12    belong          5               32-bit linear PCM,
 >12    belong          6               32-bit IEEE floating point,
 >12    belong          7               64-bit IEEE floating point,
+>12    belong          8               Fragmented sample data,
+>12    belong          10              DSP program,
+>12    belong          11              8-bit fixed point,
+>12    belong          12              16-bit fixed point,
+>12    belong          13              24-bit fixed point,
+>12    belong          14              32-bit fixed point,
+>12    belong          18              16-bit linear with emphasis,
+>12    belong          19              16-bit linear compressed,
+>12    belong          20              16-bit linear with emphasis and compression,
+>12    belong          21              Music kit DSP commands,
 >12    belong          23              8-bit ISDN mu-law compressed (CCITT G.721 ADPCM voice data encoding),
->12    belong          24              compressed (8-bit G.722 ADPCM)
->12    belong          25              compressed (3-bit G.723 ADPCM),
->12    belong          26              compressed (5-bit G.723 ADPCM),
->12    belong          27              8-bit A-law,
+>12    belong          24              compressed (8-bit CCITT G.722 ADPCM)
+>12    belong          25              compressed (3-bit CCITT G.723.3 ADPCM),
+>12    belong          26              compressed (5-bit CCITT G.723.5 ADPCM),
+>12    belong          27              8-bit A-law (CCITT G.711),
 >20    belong          1               mono,
 >20    belong          2               stereo,
 >20    belong          4               quad,
 >12    lelong          5               32-bit linear PCM,
 >12    lelong          6               32-bit IEEE floating point,
 >12    lelong          7               64-bit IEEE floating point,
+>12    belong          8               Fragmented sample data,
+>12    belong          10              DSP program,
+>12    belong          11              8-bit fixed point,
+>12    belong          12              16-bit fixed point,
+>12    belong          13              24-bit fixed point,
+>12    belong          14              32-bit fixed point,
+>12    belong          18              16-bit linear with emphasis,
+>12    belong          19              16-bit linear compressed,
+>12    belong          20              16-bit linear with emphasis and compression,
+>12    belong          21              Music kit DSP commands,
 >12    lelong          23              8-bit ISDN mu-law compressed (CCITT G.721 ADPCM voice data encoding),
+>12    belong          24              compressed (8-bit CCITT G.722 ADPCM)
+>12    belong          25              compressed (3-bit CCITT G.723.3 ADPCM),
+>12    belong          26              compressed (5-bit CCITT G.723.5 ADPCM),
+>12    belong          27              8-bit A-law (CCITT G.711),
 >20    lelong          1               mono,
 >20    lelong          2               stereo,
 >20    lelong          4               quad,
index b18bd915d5ed6fda130b303ecc66b08519cb07f4..368b473260eca2fabbd2c24e13882dd0b1ec90b8 100644 (file)
@@ -32,7 +32,7 @@
 #          a   t   r   i   s   t  sp   ^   S  cr  nl   d   i   v  sp   #
 
 # .mth Thesaurus
-# statrts with \0 but no magic header
+# starts with \0 but no magic header
 
 # .chy Hyphenation file
 # I am not sure: 000 210 034 000 000
index bdc19d88e0ba84d948af311de4315d1ac781bbef..81417ec08371dc3d29b97b209dc97e359d05ca00 100644 (file)
@@ -1,6 +1,6 @@
 
 #----------------------------------------------------------------------------
-# communcation
+# communication
 
 # TTCN is the Tree and Tabular Combined Notation described in ISO 9646-3.
 # It is used for conformance testing of communication protocols.
index 81a9b82ab8d87860b4109d376cea29d2b88d9139..9e651465efd1b6a296cf75f798e8ae3b5bc4f4ad 100644 (file)
@@ -6,8 +6,3 @@
 0      string          ***\            'diff' output text
 0      string          Only\ in\       'diff' output text
 0      string          Common\ subdirectories:\        'diff' output text
-
-# xdelta is like diff(1) for binary files (works for text, too).
-# Available from: ftp://ftp.xcf.berkeley.edu/pub/xdelta/
-0       string          %XDZ            xdelta diff file
->4      string          >%              version %.3s
index e84695a551b0e15d9e312341d98be901b6131fea..99b9830eb2225dfa4e6e4459f70b05ebca855d74 100644 (file)
 # This entry is only semi-helpful, as Gnumeric compresses its files, so
 # they will ordinarily reported as "compressed", but at least -z helps
 39      string          =<gmr:Workbook           Gnumeric spreadsheet
-
-#------------------------------------------------------------------------------
-# gcc:  file(1) magic for GCC special files
-#
-0       string          gpch            GCC precompiled header
-
-# The version field is annoying.  It's 3 characters, not zero-terminated.
->5      byte            x                       (version %c
->6      byte            x                       \b%c
->7      byte            x                       \b%c)
-
-# 67 = 'C', 111 = 'o', 43 = '+', 79 = 'O'
->4      byte            67                      for C
->4      byte            111                     for Objective C
->4      byte            43                      for C++
->4      byte            79                      for Objective C++
-
-
index 319e71689543138a598cbbdf4a88fd6c029e269e..334d71e6c039ba71d72038773bbabacc01d870b3 100644 (file)
@@ -28,3 +28,5 @@
 >8     string          TDDD            \b, TDDD 3-D rendering
 # other formats
 >8     string          FTXT            \b, FTXT formatted text
+>8     string          CTLG            \b, CTLG message catalog
+>8     string          PREF            \b, PREF preferences
index 0ed435d3ecb2ce20a05c20947bd068128a8e2e3b..b992a92bac918eba46c9a712739df11baddd4a11 100644 (file)
 # From: Jason Bacon <bacon@smithers.neuro.mcw.edu>
 0      beshort 0x3020                  character Computer Graphics Metafile
 
+
+
+# From: Tom Hilinski <tom.hilinski@comcast.net>
+# http://www.unidata.ucar.edu/packages/netcdf/
+0      string  CDF\001                 netcdf file
index e118846cbacbf276724262fda638f11f8bb0e277..af646d6fb92010b1271ca4ce8091367c58814190 100644 (file)
 #
 0      beshort         0xffd8          JPEG image data
 >6     string          JFIF            \b, JFIF standard
->6     string          Exif            \b, EXIF standard
 # The following added by Erik Rossen <rossen@freesurf.ch> 1999-09-06
 # in a vain attempt to add image size reporting for JFIF.  Note that these
 # tests are not fool-proof since some perfectly valid JPEGs are currently
 # impossible to specify in magic(4) format.
 # First, a little JFIF version info:
->11    byte            x               \b %d.
->12    byte            x               \b%02d
+>>11   byte            x               \b %d.
+>>12   byte            x               \b%02d
 # Next, the resolution or aspect ratio of the image:
-#>13   byte            0               \b, aspect ratio
-#>13   byte            1               \b, resolution (DPI)
-#>13   byte            2               \b, resolution (DPCM)
-#>   beshort         x               \b, segment length %d
+#>>13  byte            0               \b, aspect ratio
+#>>13  byte            1               \b, resolution (DPI)
+#>>13  byte            2               \b, resolution (DPCM)
+#>>4   beshort         x               \b, segment length %d
 # Next, show thumbnail info, if it exists:
->18    byte            !0              \b, thumbnail %dx
->>19   byte            x               \b%d
+>>18   byte            !0              \b, thumbnail %dx
+>>>19  byte            x               \b%d
+
+# EXIF moved down here to avoid reporting a bogus version number,
+# and EXIF version number printing added.
+#   - Patrik R=E5dman <patrik+file-magic@iki.fi>
+>6     string          Exif            \b, EXIF standard
+# Look for EXIF IFD offset in IFD 0, and then look for EXIF version tag in EXIF IFD.
+# All possible combinations of entries have to be enumerated, since no looping
+# is possible. And both endians are possible...
+# The combinations included below are from real-world JPEGs.
+# Little-endian
+>>12   string          II              
+# IFD 0 Entry #5:
+>>>70  leshort         0x8769          
+# EXIF IFD Entry #1:
+>>>>(78.l+14)  leshort 0x9000          
+>>>>>(78.l+23) byte    x               %c
+>>>>>(78.l+24) byte    x               \b.%c
+>>>>>(78.l+25) byte    !0x30           \b%c
+# IFD 0 Entry #9:
+>>>118 leshort         0x8769          
+# EXIF IFD Entry #3:
+>>>>(126.l+38) leshort 0x9000          
+>>>>>(126.l+47)        byte    x               %c
+>>>>>(126.l+48)        byte    x               \b.%c
+>>>>>(126.l+49)        byte    !0x30           \b%c
+# IFD 0 Entry #10
+>>>130 leshort         0x8769          
+# EXIF IFD Entry #3:
+>>>>(138.l+38) leshort 0x9000          
+>>>>>(138.l+47)        byte    x               %c
+>>>>>(138.l+48)        byte    x               \b.%c
+>>>>>(138.l+49)        byte    !0x30           \b%c
+# EXIF IFD Entry #4:
+>>>>(138.l+50) leshort 0x9000          
+>>>>>(138.l+59)        byte    x               %c
+>>>>>(138.l+60)        byte    x               \b.%c
+>>>>>(138.l+61)        byte    !0x30           \b%c
+# EXIF IFD Entry #5:
+>>>>(138.l+62) leshort 0x9000          
+>>>>>(138.l+71)        byte    x               %c
+>>>>>(138.l+72)        byte    x               \b.%c
+>>>>>(138.l+73)        byte    !0x30           \b%c
+# IFD 0 Entry #11
+>>>142 leshort         0x8769          
+# EXIF IFD Entry #3:
+>>>>(150.l+38) leshort 0x9000          
+>>>>>(150.l+47)        byte    x               %c
+>>>>>(150.l+48)        byte    x               \b.%c
+>>>>>(150.l+49)        byte    !0x30           \b%c
+# EXIF IFD Entry #4:
+>>>>(150.l+50) leshort 0x9000          
+>>>>>(150.l+59)        byte    x               %c
+>>>>>(150.l+60)        byte    x               \b.%c
+>>>>>(150.l+61)        byte    !0x30           \b%c
+# EXIF IFD Entry #5:
+>>>>(150.l+62) leshort 0x9000          
+>>>>>(150.l+71)        byte    x               %c
+>>>>>(150.l+72)        byte    x               \b.%c
+>>>>>(150.l+73)        byte    !0x30           \b%c
+# Big-endian
+>>12   string          MM              
+# IFD 0 Entry #9:
+>>>118 beshort         0x8769          
+# EXIF IFD Entry #1:
+>>>>(126.L+14) beshort 0x9000          
+>>>>>(126.L+23)        byte    x               %c
+>>>>>(126.L+24)        byte    x               \b.%c
+>>>>>(126.L+25)        byte    !0x30           \b%c
+# EXIF IFD Entry #3:
+>>>>(126.L+38) beshort 0x9000          
+>>>>>(126.L+47)        byte    x               %c
+>>>>>(126.L+48)        byte    x               \b.%c
+>>>>>(126.L+49)        byte    !0x30           \b%c
+# IFD 0 Entry #10
+>>>130 beshort         0x8769          
+# EXIF IFD Entry #3:
+>>>>(138.L+38) beshort 0x9000          
+>>>>>(138.L+47)        byte    x               %c
+>>>>>(138.L+48)        byte    x               \b.%c
+>>>>>(138.L+49)        byte    !0x30           \b%c
+# EXIF IFD Entry #5:
+>>>>(138.L+62) beshort 0x9000          
+>>>>>(138.L+71)        byte    x               %c
+>>>>>(138.L+72)        byte    x               \b.%c
+>>>>>(138.L+73)        byte    !0x30           \b%c
+# IFD 0 Entry #11
+>>>142 beshort         0x8769          
+# EXIF IFD Entry #4:
+>>>>(150.L+50) beshort 0x9000          
+>>>>>(150.L+59)        byte    x               %c
+>>>>>(150.L+60)        byte    x               \b.%c
+>>>>>(150.L+61)        byte    !0x30           \b%c
 # Here things get sticky.  We can do ONE MORE marker segment with
 # indirect addressing, and that's all.  It would be great if we could
 # do pointer arithemetic like in an assembler language.  Christos?
 # named accumulators, it would be even more effective...
 # At least we can show a comment if no other segments got inserted before:
 >(4.S+5)       byte            0xFE
->>(4.S+8)      string          >\0             \b, "%s"
+>>(4.S+8)      string          >\0             \b, comment: "%s"
 #>(4.S+5)      byte            0xFE            \b, comment
 #>>(4.S+6)     beshort         x               \b length=%d
 #>>(4.S+8)     string          >\0             \b, "%s"
diff --git a/magic/Magdir/matroska b/magic/Magdir/matroska
new file mode 100644 (file)
index 0000000..ca00db4
--- /dev/null
@@ -0,0 +1,14 @@
+
+#------------------------------------------------------------------------------
+# matroska:  file(1) magic for Matroska files
+#
+# See http://www.matroska.org/
+#
+
+# EBML id:
+0              belong          0x1a45dfa3
+# DocType id:
+>5             beshort         0x4282
+# DocType contents:
+>>8            string          matroska        Matroska data
+
index 987dcf1f9bdf8639ae141d81cad49d19215fe48d..1c707d46724983fc4fbcc630da46f58479a95997 100644 (file)
 0      string  \333\245-\0\0\0                 Microsoft Office Document
 #
 2080   string  Microsoft\ Excel\ 5.0\ Worksheet        %s
+2080   string  Foglio\ di\ lavoro\ Microsoft\ Exce     %s
 #
 # Pawel Wiecek <coven@i17linuxb.ists.pwr.wroc.pl> (for polish Excel)
 2114   string  Biff5           Microsoft Excel 5.0 Worksheet
+# Italian MS-Excel
+2121   string  Biff5           Microsoft Excel 5.0 Worksheet
+0      string  \x09\x04\x06\x00\x00\x00\x10\x00        Microsoft Excel Worksheet
 #
 0      belong  0x00001a00      Lotus 1-2-3
 >4     belong  0x00100400      wk3 document data
 # From: Dirk Jagdmann <doj@cubic.org>
 0      lelong  0x00035f3f      Windows 3.x help file
 
+# Christophe Monniez
+0      string  Client\ UrlCache\ MMF   Microsoft Internet Explorer Cache File
+>20    string  >\0                     Version %s
+0      string  \xCF\xAD\x12\xFE        Microsoft Outlook Express DBX File
+>4     byte    =0xC5                   Message database
+>4     byte    =0xC6                   Folder database
+>4     byte    =0xC7                   Accounts informations
+>4     byte    =0x30                   Offline database
diff --git a/magic/Magdir/spec b/magic/Magdir/spec
new file mode 100644 (file)
index 0000000..bfda306
--- /dev/null
@@ -0,0 +1,20 @@
+
+#------------------------------------------------------------------------------
+# spec:  file(1) magic for SPEC raw results (*.raw, *.rsf)
+#
+# Cloyce D. Spradling <cloyce@headgear.org>
+
+0      string  spec                    SPEC
+>4     string  .cpu                    CPU
+>>8    string  <:                      \b%.4s
+>>12   string  .                       raw result text
+
+17     string  version=SPECjbb         SPECjbb
+>32    string  <:                      \b%.4s
+>>37   string  <:                      v%.4s raw result text
+
+0      string  BEGIN\040SPECWEB        SPECweb
+>13    string  <:                      \b%.2s
+>>15   string  _SSL                    \b_SSL
+>>>20  string  <:                      v%.4s raw result text
+>>16   string  <:                      v%.4s raw result text
index e2596cbc897ae9caa3dc0449359f81879f386a5a..5957ea0d2782edf15467c9662f995341649aaf13 100644 (file)
 ##>4           byte            0               revision 0
 >4             byte            0
 ##>>14         lelong          x               (Serial %lX)
-# non-Vorbis content: FLAC (Free Loss-lessy Audio Codec,
-# http://flac.sourceforge.net)
+# non-Vorbis content: FLAC (Free Lossless Audio Codec, http://flac.sourceforge.net)
 >>28           string          fLaC            \b, FLAC audio
+# non-Vorbis content: Theora
+>>28           string          \x80theora      \b, Theora video
+# non-Vorbis content: Speex
+>>28           string          Speex\ \ \      \b, Speex audio
+# non-Vorbis content: OGM
+>>28           string          \x01video\0\0\0 \b, OGM video
+>>>37          string/c        div3            (DivX 3)
+>>>37          string/c        divx            (DivX 4)
+>>>37          string/c        dx50            (DivX 5)
+>>>37          string/c        xvid            (XviD)
 # --- First vorbis packet - general header ---
 >>28           string          \x01vorbis      \b, Vorbis audio,
 >>>35          lelong          !0              UNKNOWN VERSION %lu,
 >>>>(84.b+96)          string/c        Xiphophorus\ libVorbis\ I       \b, created by: Xiphophorus libVorbis I
 >>>>>(84.b+120)                string          >00000000       
 # Map to beta version numbers:
->>>>>>(84.b+120)       string          <20000508       (<beta1 - prepublic)
->>>>>>(84.b+120)       string          20000508        (beta1/2)
+>>>>>>(84.b+120)       string          <20000508       (<beta1, prepublic)
+>>>>>>(84.b+120)       string          20000508        (1.0 beta 1 or beta 2)
 >>>>>>(84.b+120)       string          >20000508
 >>>>>>>(84.b+120)      string          <20001031       (beta2-3)
->>>>>>(84.b+120)       string          20001031        (beta3)
+>>>>>>(84.b+120)       string          20001031        (1.0 beta 3)
 >>>>>>(84.b+120)       string          >20001031
 >>>>>>>(84.b+120)      string          <20010225       (beta3-4)
->>>>>>(84.b+120)       string          20010225        (beta4)
+>>>>>>(84.b+120)       string          20010225        (1.0 beta 4)
 >>>>>>(84.b+120)       string          >20010225
 >>>>>>>(84.b+120)      string          <20010615       (beta4-RC1)
->>>>>>(84.b+120)       string          20010615        (RC1)
->>>>>>(84.b+120)       string          20010813        (RC2)
+>>>>>>(84.b+120)       string          20010615        (1.0 RC1)
+>>>>>>(84.b+120)       string          20010813        (1.0 RC2)
 >>>>>>(84.b+120)       string          20010816        (RC2 - Garf tuned v1)
 >>>>>>(84.b+120)       string          20011014        (RC2 - Garf tuned v2)
->>>>>>(84.b+120)       string          20011217        (pre-RC3 CVS)
->>>>>>(84.b+120)       string          20011231        (RC3)
+>>>>>>(84.b+120)       string          20011217        (1.0 RC3)
+>>>>>>(84.b+120)       string          20011231        (1.0 RC3)
 # Some pre-1.0 CVS snapshots still had "Xiphphorus"...
 >>>>>>(84.b+120)       string          >20011231       (pre-1.0 CVS)
 # For the 1.0 release, Xiphophorus is replaced by Xiph.Org
@@ -80,4 +89,5 @@
 >>>>>(84.b+117)                string          >00000000       
 >>>>>>(84.b+117)       string          <20020717       (pre-1.0 CVS)
 >>>>>>(84.b+117)       string          20020717        (1.0)
->>>>>>(84.b+117)       string          >20020717       (post-1.0 CVS)
+>>>>>>(84.b+117)       string          20030909        (1.0.1)
+>>>>>>(84.b+117)       string          20040629        (1.1.0 RC1)
index c24fd7e02a92457cd6a59787ac6115bde78e924d..0c716df5c12e3e03f75c87cc9858e4cec9858641 100644 (file)
@@ -53,6 +53,7 @@ Magdir/cisco \
 Magdir/citrus \
 Magdir/claris \
 Magdir/clipper \
+Magdir/spec \
 Magdir/commands \
 Magdir/communications \
 Magdir/compress \
@@ -111,6 +112,7 @@ Magdir/magic \
 Magdir/mail.news \
 Magdir/maple \
 Magdir/mathematica \
+Magdir/matroska \
 Magdir/mcrypt \
 Magdir/mime \
 Magdir/mips \
index 514089e3abafb557c5637c057e2e33b3a4fe6740..3931a6aeafb85329a8f05d350733c4ad8b11118f 100644 (file)
@@ -160,6 +160,7 @@ Magdir/cisco \
 Magdir/citrus \
 Magdir/claris \
 Magdir/clipper \
+Magdir/spec \
 Magdir/commands \
 Magdir/communications \
 Magdir/compress \
@@ -218,6 +219,7 @@ Magdir/magic \
 Magdir/mail.news \
 Magdir/maple \
 Magdir/mathematica \
+Magdir/matroska \
 Magdir/mcrypt \
 Magdir/mime \
 Magdir/mips \
index 3aa33cf7d5e6ddc8b0b2c70f0a38cd6f4a49eef2..d314c4f4dfc187cd46bd8b8f2250a66914a3d911 100644 (file)
 # Localstuff:  file(1) magic for locally observed files
 # Add any locally observed files here.
 
+# Real Audio (Magic .ra\0375)
+0      belong          0x2e7261fd      audio/x-pn-realaudio
+0      string          .RMF            application/vnd.rn-realmedia
+
+#video/x-pn-realvideo
+#video/vnd.rn-realvideo
+#application/vnd.rn-realmedia
+#      sigh, there are many mimes for that but the above are the most common.
+
+# Taken from magic, converted to magic.mime
+# mime types according to http://www.geocities.com/nevilo/mod.htm:
+#      audio/it        .it
+#      audio/x-zipped-it       .itz
+#      audio/xm        fasttracker modules
+#      audio/x-s3m     screamtracker modules
+#      audio/s3m       screamtracker modules
+#      audio/x-zipped-mod      mdz
+#      audio/mod       mod
+#      audio/x-mod     All modules (mod, s3m, 669, mtm, med, xm, it, mdz, stm, itz, xmz, s3z)
+
+# Taken from loader code from mikmod version 2.14
+# by Steve McIntyre (stevem@chiark.greenend.org.uk)
+# <doj@cubic.org> added title printing on 2003-06-24
+0      string  MAS_UTrack_V00
+>14    string  >/0             audio/x-mod
+#audio/x-tracker-module
+
+#0     string  UN05            MikMod UNI format module sound data
+
+0      string  Extended\ Module: audio/x-mod
+#audio/x-tracker-module
+##>17  string  >\0             Title: "%s"
+
+21     string/c        !SCREAM!        audio/x-mod
+#audio/x-screamtracker-module
+21     string  BMOD2STM        audio/x-mod
+#audio/x-screamtracker-module
+1080   string  M.K.            audio/x-mod
+#audio/x-protracker-module
+#>0    string  >\0             Title: "%s"
+1080   string  M!K!            audio/x-mod
+#audio/x-protracker-module
+#>0    string  >\0             Title: "%s"
+1080   string  FLT4            audio/x-mod
+#audio/x-startracker-module
+#>0    string  >\0             Title: "%s"
+1080   string  FLT8            audio/x-mod
+#audio/x-startracker-module
+#>0    string  >\0             Title: "%s"
+1080   string  4CHN            audio/x-mod
+#audio/x-fasttracker-module
+#>0    string  >\0             Title: "%s"
+1080   string  6CHN            audio/x-mod
+#audio/x-fasttracker-module
+#>0    string  >\0             Title: "%s"
+1080   string  8CHN            audio/x-mod
+#audio/x-fasttracker-module
+#>0    string  >\0             Title: "%s"
+1080   string  CD81            audio/x-mod
+#audio/x-oktalyzer-tracker-module
+#>0    string  >\0             Title: "%s"
+1080   string  OKTA            audio/x-mod
+#audio/x-oktalyzer-tracker-module
+#>0    string  >\0             Title: "%s"
+# Not good enough.
+#1082  string  CH
+#>1080 string  >/0             %.2s-channel Fasttracker "oktalyzer" module sound data
+1080   string  16CN            audio/x-mod
+#audio/x-taketracker-module
+#>0    string  >\0             Title: "%s"
+1080   string  32CN            audio/x-mod
+#audio/x-taketracker-module
+#>0    string  >\0             Title: "%s"
+
+# Impuse tracker module (it)
+0      string          IMPM            audio/x-mod
+#>4    string          >\0             "%s"
+#>40   leshort         !0              compatible w/ITv%x
+#>42   leshort         !0              created w/ITv%x
+
 #------------------------------------------------------------------------------
 # end local stuff
 #------------------------------------------------------------------------------
 
+# xml based formats!
+
+# svg
+
+0      string          \<?xml
+#                      text/xml
+>38    string          \<\!DOCTYPE\040svg      image/svg+xml
+
+
+# xml
+0      string          \<?xml                  text/xml
+
+
 #------------------------------------------------------------------------------
 # Java
 
 #                                      IFF/8SVX audio data
 8      string          8SVX            audio/x-aiff    
 
+
+
 # Creative Labs AUDIO stuff
 #                                      Standard MIDI data
 0      string  MThd                    audio/unknown   
 #MP3 with ID3 tag
 0      string          ID3             audio/mpeg
 # Ogg/Vorbis
-0      string          OggS            audio/ogg
+0      string          OggS            application/ogg
 
 #------------------------------------------------------------------------------
 # c-lang:  file(1) magic for C programs or various scripts
 #0     string          CP              color pointer
 #0     string          BA              bitmap array
 
+# CDROM Filesystems
+32769    string    CD001     application/x-iso9660
+
+# Newer StuffIt archives (grant@netbsd.org)
+0      string          StuffIt                 application/x-stuffit
+#>162  string          >0                      : %s
+
+# BinHex is the Macintosh ASCII-encoded file format (see also "apple")
+# Daniel Quinlan, quinlan@yggdrasil.com
+11     string  must\ be\ converted\ with\ BinHex\ 4    application/mac-binhex40
+##>41  string  x                                       \b, version %.3s
+
 
 #------------------------------------------------------------------------------
 # lisp:  file(1) magic for lisp programs
 # From: stephane.loeuillet@tiscali.f
 # http://www.djvuzone.org/
 0      string          AT&TFORM        image/x.djvu
+
+# Danny Milosavljevic <danny.milo@gmx.net>
+# this are adrift (adventure game standard) game files, extension .taf
+# depending on version magic continues with 0x93453E6139FA (V 4.0)
+# 0x9445376139FA (V 3.90)
+# 0x9445366139FA (V 3.80)
+# this is from source (http://www.adrift.org.uk/) and I have some taf
+# files, and checked them.
+#0       belong          0x3C423FC9
+#>4      belong          0x6A87C2CF application/x-adrift
index 07c6c1026b42c5458d9f26182c3a081ecc8ed7c4..531c7915027d3329ba557456e13617ed810d3577 100644 (file)
@@ -50,7 +50,7 @@
 #endif
 
 #ifndef        lint
-FILE_RCSID("@(#)$Id: apprentice.c,v 1.77 2004/06/04 14:40:19 christos Exp $")
+FILE_RCSID("@(#)$Id: apprentice.c,v 1.78 2004/07/24 20:38:56 christos Exp $")
 #endif /* lint */
 
 #define        EATAB {while (isascii((unsigned char) *l) && \
@@ -213,6 +213,7 @@ file_delmagic(struct magic *p, int type, size_t entries)
                break;
        case 1:
                p--;
+               /*FALLTHROUGH*/
        case 0:
                free(p);
                break;
index fac6f344e6e5f7d42dc598cdde64ea34166a5624..ec63a5ead0bb8de5b4db77d2f7a0472473230362 100644 (file)
@@ -39,7 +39,7 @@
 #include "readelf.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$Id: readelf.c,v 1.40 2004/07/24 19:23:22 christos Exp $")
+FILE_RCSID("@(#)$Id: readelf.c,v 1.41 2004/07/24 20:38:56 christos Exp $")
 #endif
 
 #ifdef ELFCORE
@@ -418,19 +418,36 @@ donote(struct magic_set *ms, unsigned char *nbuf, size_t offset, size_t size,
                 * otherwise 1>xx
                 */
                if (desc / 100000 < 5) {
-                       if (file_printf(ms, " %d.%d", desc / 100000,
-                           desc / 10000 % 10) == -1)
-                               return size;
-                       if (desc / 1000 % 10 > 0)
-                               if (file_printf(ms, ".%d", desc / 1000 % 10)
-                                   == -1)
+                       if (desc / 10000 % 10 == 9) {
+                               if (file_printf(ms, " %d.%d", desc / 100000,
+                                   9 + desc / 1000 % 10) == -1)
+                                       return size;
+                       } else {
+                               if (file_printf(ms, " %d.%d", desc / 100000,
+                                   desc / 10000 % 10) == -1)
                                        return size;
+                               if (desc / 1000 % 10 > 0)
+                                       if (file_printf(ms, ".%d", desc / 1000 % 10)
+                                           == -1)
+                                               return size;
+                       }
+                       if (desc / 10000 % 10 > 5) {
+                               desc %= 1000;
+                               if (desc >= 100) {
+                                       if (file_printf(ms, "-STABLE (rev %d)",
+                                       desc % 100) == -1)
+                                               return size;
+                               } else if (desc != 0) {
+                                       if (file_printf(ms, ".%d", desc) == -1)
+                                               return size;
+                               }
+                       }
                } else {
                        if (file_printf(ms, " %d.%d", desc / 100000,
                            desc / 1000 % 100) == -1)
                                return size;
                        desc %= 1000;
-                       if (desc > 100) {
+                       if (desc >= 100) {
                                if (file_printf(ms, "-CURRENT (rev %d)",
                                    desc % 100) == -1)
                                        return size;
index ef37dfdc625ee9a7e62bbf9d549a358e87553916..4e063b9df2393a7cd84cc54fb05771561108a92b 100644 (file)
@@ -44,7 +44,7 @@
 
 
 #ifndef        lint
-FILE_RCSID("@(#)$Id: softmagic.c,v 1.65 2004/03/09 18:49:58 christos Exp $")
+FILE_RCSID("@(#)$Id: softmagic.c,v 1.66 2004/07/24 20:38:56 christos Exp $")
 #endif /* lint */
 
 private int match(struct magic_set *, struct magic *, uint32_t,
@@ -678,7 +678,7 @@ mget(struct magic_set *ms, union VALUETYPE *p, const unsigned char *s,
        if (m->flag & INDIR) {
                switch (m->in_type) {
                case FILE_BYTE:
-                       if (m->in_offset)
+                       if (m->in_offset) {
                                switch (m->in_op&0x7F) {
                                case FILE_OPAND:
                                        offset = p->b & m->in_offset;
@@ -705,12 +705,14 @@ mget(struct magic_set *ms, union VALUETYPE *p, const unsigned char *s,
                                        offset = p->b % m->in_offset;
                                        break;
                                }
+                       } else
+                               offset = p->b;
                        if (m->in_op & FILE_OPINVERSE)
                                offset = ~offset;
                        break;
                case FILE_BESHORT:
-                       if (m->in_offset)
-                               switch (m->in_op&0x7F) {
+                       if (m->in_offset) {
+                               switch (m->in_op & 0x7F) {
                                case FILE_OPAND:
                                        offset = (short)((p->hs[0]<<8)|
                                                         (p->hs[1])) &
@@ -752,12 +754,15 @@ mget(struct magic_set *ms, union VALUETYPE *p, const unsigned char *s,
                                                 m->in_offset;
                                        break;
                                }
+                       } else
+                               offset = (short)((p->hs[0]<<8)|
+                                                (p->hs[1]));
                        if (m->in_op & FILE_OPINVERSE)
                                offset = ~offset;
                        break;
                case FILE_LESHORT:
-                       if (m->in_offset)
-                               switch (m->in_op&0x7F) {
+                       if (m->in_offset) {
+                               switch (m->in_op & 0x7F) {
                                case FILE_OPAND:
                                        offset = (short)((p->hs[1]<<8)|
                                                         (p->hs[0])) &
@@ -799,12 +804,15 @@ mget(struct magic_set *ms, union VALUETYPE *p, const unsigned char *s,
                                                 m->in_offset;
                                        break;
                                }
+                       } else
+                               offset = (short)((p->hs[1]<<8)|
+                                                (p->hs[0]));
                        if (m->in_op & FILE_OPINVERSE)
                                offset = ~offset;
                        break;
                case FILE_SHORT:
-                       if (m->in_offset)
-                               switch (m->in_op&0x7F) {
+                       if (m->in_offset) {
+                               switch (m->in_op & 0x7F) {
                                case FILE_OPAND:
                                        offset = p->h & m->in_offset;
                                        break;
@@ -830,12 +838,15 @@ mget(struct magic_set *ms, union VALUETYPE *p, const unsigned char *s,
                                        offset = p->h % m->in_offset;
                                        break;
                                }
+                       }
+                       else
+                               offset = p->h;
                        if (m->in_op & FILE_OPINVERSE)
                                offset = ~offset;
                        break;
                case FILE_BELONG:
-                       if (m->in_offset)
-                               switch (m->in_op&0x7F) {
+                       if (m->in_offset) {
+                               switch (m->in_op & 0x7F) {
                                case FILE_OPAND:
                                        offset = (int32_t)((p->hl[0]<<24)|
                                                         (p->hl[1]<<16)|
@@ -893,12 +904,17 @@ mget(struct magic_set *ms, union VALUETYPE *p, const unsigned char *s,
                                                 m->in_offset;
                                        break;
                                }
+                       } else
+                               offset = (int32_t)((p->hl[0]<<24)|
+                                                (p->hl[1]<<16)|
+                                                (p->hl[2]<<8)|
+                                                (p->hl[3]));
                        if (m->in_op & FILE_OPINVERSE)
                                offset = ~offset;
                        break;
                case FILE_LELONG:
-                       if (m->in_offset)
-                               switch (m->in_op&0x7F) {
+                       if (m->in_offset) {
+                               switch (m->in_op & 0x7F) {
                                case FILE_OPAND:
                                        offset = (int32_t)((p->hl[3]<<24)|
                                                         (p->hl[2]<<16)|
@@ -956,12 +972,17 @@ mget(struct magic_set *ms, union VALUETYPE *p, const unsigned char *s,
                                                 m->in_offset;
                                        break;
                                }
+                       } else
+                               offset = (int32_t)((p->hl[3]<<24)|
+                                                (p->hl[2]<<16)|
+                                                (p->hl[1]<<8)|
+                                                (p->hl[0]));
                        if (m->in_op & FILE_OPINVERSE)
                                offset = ~offset;
                        break;
                case FILE_LONG:
-                       if (m->in_offset)
-                               switch (m->in_op&0x7F) {
+                       if (m->in_offset) {
+                               switch (m->in_op & 0x7F) {
                                case FILE_OPAND:
                                        offset = p->l & m->in_offset;
                                        break;
@@ -994,6 +1015,8 @@ mget(struct magic_set *ms, union VALUETYPE *p, const unsigned char *s,
                         *              sleep;
                         */
                                }
+                       } else
+                               offset = p->l;
                        if (m->in_op & FILE_OPINVERSE)
                                offset = ~offset;
                        break;