Skip to content

Commit

Permalink
Apply Debian magic modification patches from Debian package version 5…
Browse files Browse the repository at this point in the history
….04-6.
  • Loading branch information
rrthomas committed Sep 20, 2010
1 parent a1187dc commit e6b4015
Show file tree
Hide file tree
Showing 18 changed files with 241 additions and 112 deletions.
22 changes: 15 additions & 7 deletions magic/Magdir/adventure
@@ -1,6 +1,6 @@

#------------------------------------------------------------------------------
# $File: adventure,v 1.10 2009/09/19 16:28:07 christos Exp $
# $File: adventure,v 1.11 2010/06/29 12:42:32 christos Exp $
# adventure: file(1) magic for Adventure game files
#
# from Allen Garvin <earendil@faeryland.tamu-commerce.edu>
Expand All @@ -17,18 +17,26 @@
# Infocom (see z-machine)
#------------------------------------------------------------------------------
# Z-machine: file(1) magic for Z-machine binaries.
# Updated by Adam Buchbinder <adam.buchbinder@gmail.com>
#
#http://www.gnelson.demon.co.uk/zspec/sect11.html
#http://www.jczorkmid.net/~jpenney/ZSpec11-latest.txt
#http://en.wikipedia.org/wiki/Z-machine
# The first byte is the Z-machine version number which is 0 < v < 9
# The first byte is the Z-machine revision; it is always between 1 and 8. We
# had false matches (for instance, inbig5.ocp from the Omega TeX extension as
# well as an occasional MP3 file), so we sanity-check the version number.
#
# It might be possible to sanity-check the release number as well, as it seems
# (at least in classic Infocom games) to always be a relatively small number,
# always under 150 or so, but as this isn't rigorous, we'll wait on that until
# it becomes clear that it's needed.
#
0 ubyte >0
>0 ubyte <9
16 belong&0xfe00f0f0 0x3030 Infocom game data
>0 ubyte 0 (false match)
>0 ubyte >0 (Z-machine %d,
>>2 ubeshort x Release %d /
>>18 string >\0 Serial %.6s)
>>16 belong&0xfe00f0f0 0x3030 Infocom game data
>>>0 ubyte x (Z-machine %d,
>>>>2 ubeshort x Release %d /
>>>>18 string >\0 Serial %.6s)

#------------------------------------------------------------------------------
# Glulx: file(1) magic for Glulx binaries.
Expand Down
4 changes: 2 additions & 2 deletions magic/Magdir/audio
@@ -1,6 +1,6 @@

#------------------------------------------------------------------------------
# $File: audio,v 1.58 2009/09/19 16:28:08 christos Exp $
# $File: audio,v 1.59 2009/11/04 17:27:37 christos Exp $
# audio: file(1) magic for sound formats (see also "iff")
#
# Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
Expand Down Expand Up @@ -118,7 +118,7 @@
# Real Audio (Magic .ra\0375)
0 belong 0x2e7261fd RealAudio sound file
!:mime audio/x-pn-realaudio
0 string .RMF RealMedia file
0 string .RMF\0\0\0 RealMedia file
!:mime application/vnd.rn-realmedia
#video/x-pn-realvideo
#video/vnd.rn-realvideo
Expand Down
12 changes: 8 additions & 4 deletions magic/Magdir/commands
@@ -1,6 +1,6 @@

#------------------------------------------------------------------------------
# $File: commands,v 1.35 2009/09/19 16:28:08 christos Exp $
# $File: commands,v 1.36 2010/01/24 18:41:11 christos Exp $
# commands: file(1) magic for various shells and interpreters
#
#0 string : shell archive or script for antique kernel text
Expand All @@ -13,6 +13,8 @@
!:mime text/x-shellscript
0 string/w #!\ /bin/tcsh Tenex C shell script text executable
!:mime text/x-shellscript
0 string/w #!\ /usr/bin/tcsh Tenex C shell script text executable
!:mime text/x-shellscript
0 string/w #!\ /usr/local/tcsh Tenex C shell script text executable
!:mime text/x-shellscript
0 string/w #!\ /usr/local/bin/tcsh Tenex C shell script text executable
Expand Down Expand Up @@ -47,16 +49,18 @@
!:mime text/x-awk
0 string/w #!\ /usr/bin/awk awk script text executable
!:mime text/x-awk
# update to distinguish from *.vcf files
# this is broken because postscript has /EBEGIN{ for example.
#0 search/Ww BEGIN { awk script text
0 regex =^\\s*BEGIN\\s*[{] awk script text

# AT&T Bell Labs' Plan 9 shell
0 string/w #!\ /bin/rc Plan 9 rc shell script text executable

# bash shell magic, from Peter Tobias (tobias@server.et-inf.fho-emden.de)
0 string/w #!\ /bin/bash Bourne-Again shell script text executable
!:mime text/x-shellscript
0 string/w #!\ /usr/bin/bash Bourne-Again shell script text executable
!:mime text/x-shellscript
0 string/w #!\ /usr/local/bash Bourne-Again shell script text executable
!:mime text/x-shellscript
0 string/w #!\ /usr/local/bin/bash Bourne-Again shell script text executable
!:mime text/x-shellscript

Expand Down
11 changes: 7 additions & 4 deletions magic/Magdir/compress
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
# $File: compress,v 1.43 2010/03/08 20:57:01 rrt Exp $
# $File: compress,v 1.44 2010/09/06 13:38:27 christos Exp $
# compress: file(1) magic for pure-compression formats (no archives)
#
# compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc.
Expand Down Expand Up @@ -187,13 +187,16 @@
0 string 7z\274\257\047\034 7-zip archive data,
>6 byte x version %d
>7 byte x \b.%d
!:mime application/x-7z-compressed

# Type: LZMA
#!:mime application/x-lzma
# LZMA can't reasonably be detected, as it has no fixed magic
0 lelong 0x8000005d LZMA compressed data,
>5 lequad =0xffffffffffffffff streamed
>5 lequad !0xffffffffffffffff non-streamed, size %lld
!:mime application/x-lzma

# http://tukaani.org/xz/xz-file-format.txt
0 ustring \xFD7zXZ\x00 xz compressed data
0 ustring \xFD7zXZ\x00 XZ compressed data
!:mime application/x-xz

# AFX compressed files (Wolfram Kleff)
Expand Down
37 changes: 35 additions & 2 deletions magic/Magdir/dyadic
@@ -1,13 +1,46 @@

#------------------------------------------------------------------------------
# $File$
# $File: dyadic,v 1.4 2009/09/19 16:28:09 christos Exp $
# Dyadic: file(1) magic for Dyalog APL.
#
0 byte 0xaa
0 byte 0xaa
>1 byte <4 Dyalog APL
>>1 byte 0x00 incomplete workspace
>>1 byte 0x01 component file
>>1 byte 0x02 external variable
>>1 byte 0x03 workspace
>>2 byte x version %d
>>3 byte x .%d

0 beshort 0xaa03 Dyalog APL
>2 byte x workspace type %d
>3 byte x subtype %d
>7 byte&0x28 0x00 32-bit
>7 byte&0x28 0x20 64-bit
>7 byte&0x0c 0x00 classic
>7 byte&0x0c 0x04 unicode
>7 byte&0x88 0x00 big-endian
>7 byte&0x88 0x80 little-endian

0 byte 0xaa Dyalog APL
>1 byte 0x00 aplcore
>1 byte 0x01 component file 32-bit non-journaled non-checksummed
>1 byte 0x02 external variable exclusive
>1 byte 0x06 external variable shared
>1 byte 0x07 session
>1 byte 0x08 mapped file 32-bit
>1 byte 0x09 component file 64-bit non-journaled non-checksummed
>1 byte 0x0a mapped file 64-bit
>1 byte 0x0b component file 32-bit level 1 journaled non-checksummed
>1 byte 0x0c component file 64-bit level 1 journaled non-checksummed
>1 byte 0x0d component file 32-bit level 1 journaled checksummed
>1 byte 0x0e component file 64-bit level 1 journaled checksummed
>1 byte 0x0f component file 32-bit level 2 journaled checksummed
>1 byte 0x10 component file 64-bit level 2 journaled checksummed
>1 byte 0x11 component file 32-bit level 3 journaled checksummed
>1 byte 0x12 component file 64-bit level 3 journaled checksummed
>1 byte 0x13 component file 32-bit non-journaled checksummed
>1 byte 0x14 component file 64-bit non-journaled checksummed
>1 byte 0x80 DDB

0 short 0x6060 Dyalog APL transfer
44 changes: 27 additions & 17 deletions magic/Magdir/filesystems
@@ -1,6 +1,6 @@

#------------------------------------------------------------------------------
# $File: filesystems,v 1.56 2010/03/24 14:17:43 christos Exp $
# $File: filesystems,v 1.57 2010/07/07 21:28:43 christos Exp $
# filesystems: file(1) magic for different filesystems
#
0 string \366\366\366\366 PC formatted floppy with no filesystem
Expand Down Expand Up @@ -1109,6 +1109,8 @@

# ext2/ext3 filesystems - Andreas Dilger <adilger@dilger.ca>
# ext4 filesystem - Eric Sandeen <sandeen@sandeen.net>
# volume label and UUID Russell Coker
# http://etbe.coker.com.au/2008/07/08/label-vs-uuid-vs-device/
0x438 leshort 0xEF53 Linux
>0x44c lelong x rev %d
>0x43e leshort x \b.%d
Expand All @@ -1124,25 +1126,32 @@
# else large RO_COMPAT?
>>>0x464 lelong >0x0000007 ext4 filesystem data
# else large INCOMPAT?
>>0x460 lelong >0x000003f ext4 filesystem data
>>0x460 lelong >0x000003f ext4 filesystem data
>0x468 belong x \b, UUID=%08x
>0x46c beshort x \b-%04x
>0x46e beshort x \b-%04x
>0x470 beshort x \b-%04x
>0x472 belong x \b-%08x
>0x476 beshort x \b%04x
>0x478 string >0 \b, volume name "%s"
# General flags for any ext* fs
>0x460 lelong &0x0000004 (needs journal recovery)
>0x43a leshort &0x0000002 (errors)
>0x460 lelong &0x0000004 (needs journal recovery)
>0x43a leshort &0x0000002 (errors)
# INCOMPAT flags
>0x460 lelong &0x0000001 (compressed)
#>0x460 lelong &0x0000002 (filetype)
#>0x460 lelong &0x0000010 (meta bg)
>0x460 lelong &0x0000040 (extents)
>0x460 lelong &0x0000080 (64bit)
#>0x460 lelong &0x0000100 (mmp)
#>0x460 lelong &0x0000200 (flex bg)
>0x460 lelong &0x0000001 (compressed)
#>0x460 lelong &0x0000002 (filetype)
#>0x460 lelong &0x0000010 (meta bg)
>0x460 lelong &0x0000040 (extents)
>0x460 lelong &0x0000080 (64bit)
#>0x460 lelong &0x0000100 (mmp)
#>0x460 lelong &0x0000200 (flex bg)
# RO_INCOMPAT flags
#>0x464 lelong &0x0000001 (sparse super)
>0x464 lelong &0x0000002 (large files)
>0x464 lelong &0x0000008 (huge files)
#>0x464 lelong &0x0000010 (gdt checksum)
#>0x464 lelong &0x0000020 (many subdirs)
#>0x463 lelong &0x0000040 (extra isize)
#>0x464 lelong &0x0000001 (sparse super)
>0x464 lelong &0x0000002 (large files)
>0x464 lelong &0x0000008 (huge files)
#>0x464 lelong &0x0000010 (gdt checksum)
#>0x464 lelong &0x0000020 (many subdirs)
#>0x463 lelong &0x0000040 (extra isize)

# SGI disk labels - Nathan Scott <nathans@debian.org>
0 belong 0x0BE5A941 SGI disk label (volume header)
Expand Down Expand Up @@ -1263,6 +1272,7 @@
# reiserfs - russell@coker.com.au
0x10034 string ReIsErFs ReiserFS V3.5
0x10034 string ReIsEr2Fs ReiserFS V3.6
0x10034 string ReIsEr3Fs ReiserFS V3.6.19
>0x1002c leshort x block size %d
>0x10032 leshort &2 (mounted or unclean)
>0x10000 lelong x num blocks %d
Expand Down
10 changes: 9 additions & 1 deletion magic/Magdir/fonts
@@ -1,6 +1,6 @@

#------------------------------------------------------------------------------
# $File: fonts,v 1.21 2009/12/06 23:17:52 rrt Exp $
# $File: fonts,v 1.22 2010/09/06 13:38:27 christos Exp $
# fonts: file(1) magic for font data
#
0 search/1 FONT ASCII vfont text
Expand Down Expand Up @@ -61,7 +61,15 @@
0 string \007\001\001\000Copyright\ (c)\ 199 Adobe Multiple Master font
0 string \012\001\001\000Copyright\ (c)\ 199 Adobe Multiple Master font

# TrueType/OpenType font collections (.ttc)
# http://www.microsoft.com/typography/otspec/otff.htm
0 string ttcf TrueType font collection data
>4 belong 0x00010000 \b, 1.0
>>8 belong >0 \b, %d fonts
>4 belong 0x00020000 \b, 2.0
>>8 belong >0 \b, %d fonts
# 0x44454947 = 'DSIG'
>>>16 belong 0x44534947 \b, digitally signed

# Opentype font data from Avi Bercovich
0 string OTTO OpenType font data
Expand Down
3 changes: 2 additions & 1 deletion magic/Magdir/gimp
@@ -1,6 +1,6 @@

#------------------------------------------------------------------------------
# $File$
# $File: gimp,v 1.6 2009/09/19 16:28:09 christos Exp $
# GIMP Gradient: file(1) magic for the GIMP's gradient data files
# by Federico Mena <federico@nuclecu.unam.mx>

Expand All @@ -12,6 +12,7 @@
# ('Bucky' LaDieu, nega@vt.edu)

0 string gimp\ xcf GIMP XCF image data,
!:mime image/x-xcf
>9 string file version 0,
>9 string v version
>>10 string >\0 %s,
Expand Down
36 changes: 25 additions & 11 deletions magic/Magdir/images
@@ -1,6 +1,6 @@

#------------------------------------------------------------------------------
# $File: images,v 1.65 2010/02/16 16:49:05 christos Exp $
# $File: images,v 1.66 2010/09/11 00:24:00 christos Exp $
# images: file(1) magic for image formats (see also "iff", and "c-lang" for
# XPM bitmaps)
#
Expand Down Expand Up @@ -310,11 +310,20 @@
# As described in /usr/X11R6/include/X11/XWDFile.h
# used by the xwd program.
# Bradford Castalia, idaeim, 1/01
4 belong 7 XWD X Window Dump image data
>100 string >\0 \b, "%s"
>16 belong x \b, %dx
>20 belong x \b%dx
>12 belong x \b%d
# updated by Adam Buchbinder, 2/09
# The following assumes version 7 of the format; the first long is the length
# of the header, which is at least 25 4-byte longs, and the one at offset 8
# is a constant which is always either 1 or 2. Offset 12 is the pixmap depth,
# which is a maximum of 32.
0 belong >100
>8 belong <3
>>12 belong <33
>>>4 belong 7 XWD X Window Dump image data
!:mime image/x-xwindowdump
>>>>100 string >\0 \b, "%s"
>>>>16 belong x \b, %dx
>>>>20 belong x \b%dx
>>>>12 belong x \b%d

# PDS - Planetary Data System
# These files use Parameter Value Language in the header section.
Expand Down Expand Up @@ -551,11 +560,16 @@
# Bio-Rad .PIC is an image format used by microscope control systems
# and related image processing software used by biologists.
# From: Vebjorn Ljosa <vebjorn@ljosa.com>
54 leshort 12345 Bio-Rad .PIC Image File
>0 leshort >0 %hd x
>2 leshort >0 %hd,
>4 leshort =1 1 image in file
>4 leshort >1 %hd images in file
# BOOL values are two-byte integers; use them to rule out false positives.
# http://web.archive.org/web/20050317223257/www.cs.ubc.ca/spider/ladic/text/biorad.txt
# Samples: http://www.loci.wisc.edu/software/sample-data
14 leshort <2
>62 leshort <2
>>54 leshort 12345 Bio-Rad .PIC Image File
>>>0 leshort >0 %hd x
>>>2 leshort >0 %hd,
>>>4 leshort =1 1 image in file
>>>4 leshort >1 %hd images in file

# From Jan "Yenya" Kasprzak <kas@fi.muni.cz>
# The description of *.mrw format can be found at
Expand Down

0 comments on commit e6b4015

Please sign in to comment.