Reducing external/bsd/file differences

Change-Id: I0d025059ba0b200ac1162ea5a764fd756600ecd0
This commit is contained in:
2013-04-10 11:08:42 +02:00
parent c979136e4e
commit 08ff44c446
67 changed files with 1177 additions and 734 deletions

View File

@@ -1,5 +1,5 @@
#
# $File: Makefile.am,v 1.73 2011/09/08 21:58:42 christos Exp $
# $File: Makefile.am,v 1.78 2012/01/27 01:41:26 christos Exp $
#
MAGIC_FRAGMENT_BASE = magdir
MAGIC_DIR = $(top_srcdir)/magic
@@ -22,6 +22,7 @@ $(MAGIC_FRAGMENT_DIR)/apl \
$(MAGIC_FRAGMENT_DIR)/apple \
$(MAGIC_FRAGMENT_DIR)/applix \
$(MAGIC_FRAGMENT_DIR)/archive \
$(MAGIC_FRAGMENT_DIR)/assembler \
$(MAGIC_FRAGMENT_DIR)/asterix \
$(MAGIC_FRAGMENT_DIR)/att3b \
$(MAGIC_FRAGMENT_DIR)/audio \
@@ -52,6 +53,7 @@ $(MAGIC_FRAGMENT_DIR)/console \
$(MAGIC_FRAGMENT_DIR)/convex \
$(MAGIC_FRAGMENT_DIR)/cracklib \
$(MAGIC_FRAGMENT_DIR)/ctags \
$(MAGIC_FRAGMENT_DIR)/cups \
$(MAGIC_FRAGMENT_DIR)/dact \
$(MAGIC_FRAGMENT_DIR)/database \
$(MAGIC_FRAGMENT_DIR)/diamond \
@@ -88,6 +90,7 @@ $(MAGIC_FRAGMENT_DIR)/gnumeric \
$(MAGIC_FRAGMENT_DIR)/grace \
$(MAGIC_FRAGMENT_DIR)/graphviz \
$(MAGIC_FRAGMENT_DIR)/gringotts \
$(MAGIC_FRAGMENT_DIR)/guile \
$(MAGIC_FRAGMENT_DIR)/hitachi-sh \
$(MAGIC_FRAGMENT_DIR)/hp \
$(MAGIC_FRAGMENT_DIR)/human68k \
@@ -114,10 +117,12 @@ $(MAGIC_FRAGMENT_DIR)/lisp \
$(MAGIC_FRAGMENT_DIR)/llvm \
$(MAGIC_FRAGMENT_DIR)/lua \
$(MAGIC_FRAGMENT_DIR)/luks \
$(MAGIC_FRAGMENT_DIR)/m4 \
$(MAGIC_FRAGMENT_DIR)/mach \
$(MAGIC_FRAGMENT_DIR)/macintosh \
$(MAGIC_FRAGMENT_DIR)/magic \
$(MAGIC_FRAGMENT_DIR)/mail.news \
$(MAGIC_FRAGMENT_DIR)/make \
$(MAGIC_FRAGMENT_DIR)/maple \
$(MAGIC_FRAGMENT_DIR)/marc21 \
$(MAGIC_FRAGMENT_DIR)/mathcad \
@@ -140,6 +145,7 @@ $(MAGIC_FRAGMENT_DIR)/msdos \
$(MAGIC_FRAGMENT_DIR)/msooxml \
$(MAGIC_FRAGMENT_DIR)/msvc \
$(MAGIC_FRAGMENT_DIR)/mup \
$(MAGIC_FRAGMENT_DIR)/music \
$(MAGIC_FRAGMENT_DIR)/natinst \
$(MAGIC_FRAGMENT_DIR)/ncr \
$(MAGIC_FRAGMENT_DIR)/netbsd \
@@ -159,6 +165,7 @@ $(MAGIC_FRAGMENT_DIR)/osf1 \
$(MAGIC_FRAGMENT_DIR)/palm \
$(MAGIC_FRAGMENT_DIR)/parix \
$(MAGIC_FRAGMENT_DIR)/parrot \
$(MAGIC_FRAGMENT_DIR)/pascal \
$(MAGIC_FRAGMENT_DIR)/pbm \
$(MAGIC_FRAGMENT_DIR)/pdf \
$(MAGIC_FRAGMENT_DIR)/pdp \
@@ -238,6 +245,7 @@ $(MAGIC_FRAGMENT_DIR)/xenix \
$(MAGIC_FRAGMENT_DIR)/xilinx \
$(MAGIC_FRAGMENT_DIR)/xo65 \
$(MAGIC_FRAGMENT_DIR)/xwindows \
$(MAGIC_FRAGMENT_DIR)/zfs \
$(MAGIC_FRAGMENT_DIR)/zilog \
$(MAGIC_FRAGMENT_DIR)/zyxel

View File

@@ -197,7 +197,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
#
# $File: Makefile.am,v 1.73 2011/09/08 21:58:42 christos Exp $
# $File: Makefile.am,v 1.78 2012/01/27 01:41:26 christos Exp $
#
MAGIC_FRAGMENT_BASE = magdir
MAGIC_DIR = $(top_srcdir)/magic
@@ -218,6 +218,7 @@ $(MAGIC_FRAGMENT_DIR)/apl \
$(MAGIC_FRAGMENT_DIR)/apple \
$(MAGIC_FRAGMENT_DIR)/applix \
$(MAGIC_FRAGMENT_DIR)/archive \
$(MAGIC_FRAGMENT_DIR)/assembler \
$(MAGIC_FRAGMENT_DIR)/asterix \
$(MAGIC_FRAGMENT_DIR)/att3b \
$(MAGIC_FRAGMENT_DIR)/audio \
@@ -248,6 +249,7 @@ $(MAGIC_FRAGMENT_DIR)/console \
$(MAGIC_FRAGMENT_DIR)/convex \
$(MAGIC_FRAGMENT_DIR)/cracklib \
$(MAGIC_FRAGMENT_DIR)/ctags \
$(MAGIC_FRAGMENT_DIR)/cups \
$(MAGIC_FRAGMENT_DIR)/dact \
$(MAGIC_FRAGMENT_DIR)/database \
$(MAGIC_FRAGMENT_DIR)/diamond \
@@ -284,6 +286,7 @@ $(MAGIC_FRAGMENT_DIR)/gnumeric \
$(MAGIC_FRAGMENT_DIR)/grace \
$(MAGIC_FRAGMENT_DIR)/graphviz \
$(MAGIC_FRAGMENT_DIR)/gringotts \
$(MAGIC_FRAGMENT_DIR)/guile \
$(MAGIC_FRAGMENT_DIR)/hitachi-sh \
$(MAGIC_FRAGMENT_DIR)/hp \
$(MAGIC_FRAGMENT_DIR)/human68k \
@@ -310,10 +313,12 @@ $(MAGIC_FRAGMENT_DIR)/lisp \
$(MAGIC_FRAGMENT_DIR)/llvm \
$(MAGIC_FRAGMENT_DIR)/lua \
$(MAGIC_FRAGMENT_DIR)/luks \
$(MAGIC_FRAGMENT_DIR)/m4 \
$(MAGIC_FRAGMENT_DIR)/mach \
$(MAGIC_FRAGMENT_DIR)/macintosh \
$(MAGIC_FRAGMENT_DIR)/magic \
$(MAGIC_FRAGMENT_DIR)/mail.news \
$(MAGIC_FRAGMENT_DIR)/make \
$(MAGIC_FRAGMENT_DIR)/maple \
$(MAGIC_FRAGMENT_DIR)/marc21 \
$(MAGIC_FRAGMENT_DIR)/mathcad \
@@ -336,6 +341,7 @@ $(MAGIC_FRAGMENT_DIR)/msdos \
$(MAGIC_FRAGMENT_DIR)/msooxml \
$(MAGIC_FRAGMENT_DIR)/msvc \
$(MAGIC_FRAGMENT_DIR)/mup \
$(MAGIC_FRAGMENT_DIR)/music \
$(MAGIC_FRAGMENT_DIR)/natinst \
$(MAGIC_FRAGMENT_DIR)/ncr \
$(MAGIC_FRAGMENT_DIR)/netbsd \
@@ -355,6 +361,7 @@ $(MAGIC_FRAGMENT_DIR)/osf1 \
$(MAGIC_FRAGMENT_DIR)/palm \
$(MAGIC_FRAGMENT_DIR)/parix \
$(MAGIC_FRAGMENT_DIR)/parrot \
$(MAGIC_FRAGMENT_DIR)/pascal \
$(MAGIC_FRAGMENT_DIR)/pbm \
$(MAGIC_FRAGMENT_DIR)/pdf \
$(MAGIC_FRAGMENT_DIR)/pdp \
@@ -434,6 +441,7 @@ $(MAGIC_FRAGMENT_DIR)/xenix \
$(MAGIC_FRAGMENT_DIR)/xilinx \
$(MAGIC_FRAGMENT_DIR)/xo65 \
$(MAGIC_FRAGMENT_DIR)/xwindows \
$(MAGIC_FRAGMENT_DIR)/zfs \
$(MAGIC_FRAGMENT_DIR)/zilog \
$(MAGIC_FRAGMENT_DIR)/zyxel

View File

@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: apple,v 1.24 2010/11/25 15:00:12 christos Exp $
# $File: apple,v 1.25 2012/04/06 21:18:09 christos Exp $
# apple: file(1) magic for Apple file formats
#
0 search/1/t FiLeStArTfIlEsTaRt binscii (apple ][) text
@@ -249,3 +249,45 @@
# From: "Nelson A. de Oliveira" <naoliv@gmail.com>
# .vdi
4 string innotek\ VirtualBox\ Disk\ Image %s
# Apple disk partition stuff, strengthen the magic using byte 4
0 beshort 0x4552
>4 byte 0 Apple Driver Map
>>2 beshort x \b, blocksize %d
>>4 belong x \b, blockcount %d
>>10 beshort x \b, devtype %d
>>12 beshort x \b, devid %d
>>20 beshort x \b, descriptors %d
# Assume 8 partitions each at a multiple of the sector size.
# We could glean this from the partition descriptors, but they are empty!?!?
# >>(2.S*1) indirect \b, contains[@0x%x]:
# >>(2.S*2) indirect \b, contains[@0x%x]:
# >>(2.S*3) indirect \b, contains[@0x%x]:
# >>(2.S*4) indirect \b, contains[@0x%x]:
# >>(2.S*5) indirect \b, contains[@0x%x]:
# >>(2.S*6) indirect \b, contains[@0x%x]:
# >>(2.S*7) indirect \b, contains[@0x%x]:
# >>(2.S*8) indirect \b, contains[@0x%x]:
# Yes, the 3rd and 4th bytes are reserved, but we use them to make the
# magic stronger.
0 belong 0x504d0000 Apple Partition Map
>4 belong x \b, map block count %d
>8 belong x \b, start block %d
>12 belong x \b, block count %d
>16 string >0 \b, name %s
>48 string >0 \b, type %s
>124 string >0 \b, processor %s
>140 string >0 \b, boot arguments %s
>92 belong & 1 \b, valid
>92 belong & 2 \b, allocated
>92 belong & 4 \b, in use
>92 belong & 8 \b, has boot info
>92 belong & 16 \b, readable
>92 belong & 32 \b, writable
>92 belong & 64 \b, pic boot code
>92 belong & 128 \b, chain compatible driver
>92 belong & 256 \b, real driver
>92 belong & 512 \b, chain driver
>92 belong & 1024 \b, mount at startup
>92 belong & 2048 \b, is the startup partition

View File

@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
# $File: archive,v 1.68 2011/09/07 15:47:51 christos Exp $
# $File: archive,v 1.70 2011/10/26 15:44:47 christos Exp $
# archive: file(1) magic for archive formats (see also "msdos" for self-
# extracting compressed archives)
#
@@ -12,6 +12,11 @@
257 string ustar\040\040\0 GNU tar archive
!:mime application/x-tar # encoding: gnu
# Incremental snapshot gnu-tar format from:
# http://www.gnu.org/software/tar/manual/html_node/Snapshot-Files.html
0 string GNU\ tar- GNU tar incremental snapshot data
>&0 regex [0-9]\.[0-9]+-[0-9]+ version %s
# cpio archives
#
# Yes, the top two "cpio archive" formats *are* supposed to just be "short".

View File

@@ -0,0 +1,14 @@
#------------------------------------------------------------------------------
# $File: assembler,v 1.1 2011/12/08 12:12:46 rrt Exp $
# make: file(1) magic for assembler source
#
0 regex \^\.asciiz\? assembler source text
!:mime text/x-asm
0 regex \^\.byte assembler source text
!:mime text/x-asm
0 regex \^\.even assembler source text
!:mime text/x-asm
0 regex \^\.globl assembler source text
!:mime text/x-asm
0 regex \^\.text assembler source text
!:mime text/x-asm

View File

@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: audio,v 1.63 2011/09/06 11:00:06 christos Exp $
# $File: audio,v 1.64 2012/02/20 16:37:34 christos Exp $
# audio: file(1) magic for sound formats (see also "iff")
#
# Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
@@ -491,6 +491,7 @@
# From danny.milo@gmx.net (Danny Milosavljevic)
# New version from Abel Cheung <abel (@) oaka.org>
0 string MAC\040 Monkey's Audio compressed format
!:mime audio/x-ape
>4 uleshort >0x0F8B version %d
>>(0x08.l) uleshort =1000 with fast compression
>>(0x08.l) uleshort =2000 with normal compression

View File

@@ -1,21 +1,49 @@
#------------------------------------------------------------------------------
# $File: c-lang,v 1.14 2009/09/19 16:28:08 christos Exp $
# c-lang: file(1) magic for C programs (or REXX)
# $File: c-lang,v 1.16 2011/12/09 08:02:16 rrt Exp $
# c-lang: file(1) magic for C and related languages programs
#
# XPM icons (Greg Roelofs, newt@uchicago.edu)
# if you uncomment "/*" for C/REXX below, also uncomment this entry
#0 string /*\ XPM\ */ X pixmap image data
#!:mime image/x-xpmi
# BCPL
0 search/8192 "libhdr" BCPL source text
!:mime text/x-bcpl
0 search/8192 "LIBHDR" BCPL source text
!:mime text/x-bcpl
# 3DS (3d Studio files) Conflicts with diff output 0x3d '='
#16 beshort 0x3d3d image/x-3ds
# C
0 regex \^#include C source text
!:mime text/x-c
0 regex \^char C source text
!:mime text/x-c
0 regex \^double C source text
!:mime text/x-c
0 regex \^extern C source text
!:mime text/x-c
0 regex \^float C source text
!:mime text/x-c
0 regex \^struct C source text
!:mime text/x-c
0 regex \^union C source text
!:mime text/x-c
0 search/8192 main( C source text
!:mime text/x-c
# this first will upset you if you're a PL/1 shop...
# in which case rm it; ascmagic will catch real C programs
#0 search/1 /* C or REXX program text
#0 search/1 // C++ program text
# C++
# The strength of these rules is increased so they beat the C rules above
0 regex \^template C++ source text
!:strength + 10
!:mime text/x-c++
0 regex \^virtual C++ source text
!:strength + 10
!:mime text/x-c++
0 regex \^class C++ source text
!:strength + 10
!:mime text/x-c++
0 regex \^public: C++ source text
!:strength + 10
!:mime text/x-c++
0 regex \^private: C++ source text
!:strength + 10
!:mime text/x-c++
# From: Mikhail Teterin <mi@aldan.algebra.com>
0 string cscope cscope reference data

View File

@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: cad,v 1.10 2010/12/25 14:33:43 christos Exp $
# $File: cad,v 1.11 2011/12/08 12:12:46 rrt Exp $
# autocad: file(1) magic for cad files
#
@@ -113,3 +113,6 @@
0 string AC1012 AutoDesk AutoCAD R13
0 string AC1014 AutoDesk AutoCAD R14
0 string AC1015 AutoDesk AutoCAD R2000
# 3DS (3d Studio files) Conflicts with diff output 0x3d '='
#16 beshort 0x3d3d image/x-3ds

View File

@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: commands,v 1.41 2011/05/02 12:36:41 christos Exp $
# $File: commands,v 1.42 2011/12/05 23:14:02 rrt Exp $
# commands: file(1) magic for various shells and interpreters
#
#0 string/w : shell archive or script for antique kernel text
@@ -64,12 +64,6 @@
0 string/wt #!\ /usr/local/bin/bash Bourne-Again shell script text executable
!:mime text/x-shellscript
# using env
0 string/t #!/usr/bin/env a
>15 string/t >\0 %s script text executable
0 string/t #!\ /usr/bin/env a
>16 string/t >\0 %s script text executable
# PHP scripts
# Ulf Harnhammar <ulfh@update.uu.se>
0 search/1/c =<?php PHP script text

View File

@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
# $File: compress,v 1.47 2011/03/08 00:39:46 christos Exp $
# $File: compress,v 1.49 2011/12/07 22:04:27 christos Exp $
# compress: file(1) magic for pure-compression formats (no archives)
#
# compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc.
@@ -190,9 +190,10 @@
!:mime application/x-7z-compressed
# Type: LZMA
0 lelong 0x8000005d LZMA compressed data,
>5 lequad =0xffffffffffffffff streamed
>5 lequad !0xffffffffffffffff non-streamed, size %lld
0 lelong&0xffffff =0x5d
>12 leshort =0xff 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

View File

@@ -0,0 +1,82 @@
#------------------------------------------------------------------------------
# $File: cups,v 1.1 2011/11/10 18:59:54 christos Exp $
# Cups: file(1) magic for the cups raster file format
# From: Laurent Martelli <martellilaurent@gmail.com>
# http://www.cups.org/documentation.php/spec-raster.html
#
# Cups Raster image format, Big Endian
0 string RaS
!:mime application/vnd.cups-raster
>3 string t Cups Raster version 1, Big Endian
>3 string 2 Cups Raster version 2, Big Endian
>3 string 3 Cups Raster version 3, Big Endian
>280 belong x \b, %d
>284 belong x \bx%d dpi
>376 belong x \b, %dx
>380 belong x \b%d pixels
>388 belong x %d bits/color
>392 belong x %d bits/pixel
>400 belong 0 ColorOrder=Chunky
>400 belong 1 ColorOrder=Banded
>400 belong 2 ColorOrder=Planar
>404 belong 0 ColorSpace=gray
>404 belong 1 ColorSpace=RGB
>404 belong 2 ColorSpace=RGBA
>404 belong 3 ColorSpace=black
>404 belong 4 ColorSpace=CMY
>404 belong 5 ColorSpace=YMC
>404 belong 6 ColorSpace=CMYK
>404 belong 7 ColorSpace=YMCK
>404 belong 8 ColorSpace=KCMY
>404 belong 9 ColorSpace=KCMYcm
>404 belong 10 ColorSpace=GMCK
>404 belong 11 ColorSpace=GMCS
>404 belong 12 ColorSpace=WHITE
>404 belong 13 ColorSpace=GOLD
>404 belong 14 ColorSpace=SILVER
>404 belong 15 ColorSpace=CIE XYZ
>404 belong 16 ColorSpace=CIE Lab
>404 belong 17 ColorSpace=RGBW
>404 belong 18 ColorSpace=sGray
>404 belong 19 ColorSpace=sRGB
>404 belong 20 ColorSpace=AdobeRGB
# Cups Raster image format, Little Endian
1 string SaR
>0 string t Cups Raster version 1, Little Endian
>0 string 2 Cups Raster version 2, Little Endian
>0 string 3 Cups Raster version 3, Little Endian
!:mime application/vnd.cups-raster
>280 lelong x \b, %d
>284 lelong x \bx%d dpi
>376 lelong x \b, %dx
>380 lelong x \b%d pixels
>388 lelong x %d bits/color
>392 lelong x %d bits/pixel
>400 lelong 0 ColorOrder=Chunky
>400 lelong 1 ColorOrder=Banded
>400 lelong 2 ColorOrder=Planar
>404 lelong 0 ColorSpace=gray
>404 lelong 1 ColorSpace=RGB
>404 lelong 2 ColorSpace=RGBA
>404 lelong 3 ColorSpace=black
>404 lelong 4 ColorSpace=CMY
>404 lelong 5 ColorSpace=YMC
>404 lelong 6 ColorSpace=CMYK
>404 lelong 7 ColorSpace=YMCK
>404 lelong 8 ColorSpace=KCMY
>404 lelong 9 ColorSpace=KCMYcm
>404 lelong 10 ColorSpace=GMCK
>404 lelong 11 ColorSpace=GMCS
>404 lelong 12 ColorSpace=WHITE
>404 lelong 13 ColorSpace=GOLD
>404 lelong 14 ColorSpace=SILVER
>404 lelong 15 ColorSpace=CIE XYZ
>404 lelong 16 ColorSpace=CIE Lab
>404 lelong 17 ColorSpace=RGBW
>404 lelong 18 ColorSpace=sGray
>404 lelong 19 ColorSpace=sRGB
>404 lelong 20 ColorSpace=AdobeRGB

View File

@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: elf,v 1.53 2009/09/19 16:28:09 christos Exp $
# $File: elf,v 1.54 2011/12/17 17:16:29 christos Exp $
# elf: file(1) magic for ELF executables
#
# We have to check the byte order flag to see what byte order all the
@@ -40,9 +40,10 @@
>>18 leshort 2 SPARC - invalid byte order,
>>18 leshort 3 Intel 80386,
>>18 leshort 4 Motorola
>>>36 lelong &0x01000000 68000 - invalid byte order,
>>>36 lelong &0x00810000 CPU32 - invalid byte order,
>>>36 lelong 0 68020 - invalid byte order,
>>>4 byte 1
>>>>36 lelong &0x01000000 68000 - invalid byte order,
>>>>36 lelong &0x00810000 CPU32 - invalid byte order,
>>>>36 lelong 0 68020 - invalid byte order,
>>18 leshort 5 Motorola 88000 - invalid byte order,
>>18 leshort 6 Intel 80486,
>>18 leshort 7 Intel 80860,
@@ -50,9 +51,11 @@
# The second number (#10) will be deprecated later. For now, we still
# say something if #10 is encountered, but only gory details for #8.
>>18 leshort 8 MIPS,
>>>36 lelong &0x20 N32
>>>4 byte 1
>>>>36 lelong &0x20 N32
>>18 leshort 10 MIPS,
>>>36 lelong &0x20 N32
>>>4 byte 1
>>>>36 lelong &0x20 N32
>>18 leshort 8
# only for 32-bit
>>>4 byte 1
@@ -80,8 +83,14 @@
>>18 leshort 10 MIPS (deprecated),
>>18 leshort 11 RS6000 - invalid byte order,
>>18 leshort 15 PA-RISC - invalid byte order,
>>>50 leshort 0x0214 2.0
>>>48 leshort &0x0008 (LP64),
# only for 32-bit
>>>4 byte 1
>>>>38 leshort 0x0214 2.0
>>>>36 leshort &0x0008 (LP64)
# only for 64-bit
>>>4 byte 2
>>>>50 leshort 0x0214 2.0
>>>>48 leshort &0x0008 (LP64)
>>18 leshort 16 nCUBE,
>>18 leshort 17 Fujitsu VPP500,
>>18 leshort 18 SPARC32PLUS - invalid byte order,
@@ -92,6 +101,9 @@
>>18 leshort 38 TRW RH-32,
>>18 leshort 39 Motorola RCE,
>>18 leshort 40 ARM,
>>>4 byte 1
>>>>36 lelong&0xff000000 0x04000000 EABI4
>>>>36 lelong&0xff000000 0x05000000 EABI5
>>18 leshort 41 Alpha,
>>18 leshort 0xa390 IBM S/390 (obsolete),
>>18 leshort 42 Renesas SH,
@@ -149,12 +161,14 @@
>>18 leshort 106 Analog Devices Blackfin,
>>18 leshort 113 Altera Nios II,
>>18 leshort 0xae META,
>>18 leshort 187 Tilera TILE64,
>>18 leshort 188 Tilera TILEPro,
>>18 leshort 191 Tilera TILE-Gx,
>>18 leshort 0x3426 OpenRISC (obsolete),
>>18 leshort 0x8472 OpenRISC (obsolete),
>>18 leshort 0x9026 Alpha (unofficial),
>>20 lelong 0 invalid version
>>20 lelong 1 version 1
>>36 lelong 1 MathCoPro/FPU/MAU Required
>5 byte 2 MSB
>>16 beshort 0 no file type,
!:mime application/octet-stream
@@ -174,17 +188,20 @@
>>18 beshort 2 SPARC,
>>18 beshort 3 Intel 80386 - invalid byte order,
>>18 beshort 4 Motorola
>>>36 belong &0x01000000 68000,
>>>36 belong &0x00810000 CPU32,
>>>36 belong 0 68020,
>>>4 byte 1
>>>>36 belong &0x01000000 68000,
>>>>36 belong &0x00810000 CPU32,
>>>>36 belong 0 68020,
>>18 beshort 5 Motorola 88000,
>>18 beshort 6 Intel 80486 - invalid byte order,
>>18 beshort 7 Intel 80860,
# only for MIPS - see comment in little-endian section above.
>>18 beshort 8 MIPS,
>>>36 belong &0x20 N32
>>>4 byte 1
>>>>36 belong &0x20 N32
>>18 beshort 10 MIPS,
>>>36 belong &0x20 N32
>>>4 byte 1
>>>>36 belong &0x20 N32
>>18 beshort 8
# only for 32-bit
>>>4 byte 1
@@ -212,15 +229,23 @@
>>18 beshort 10 MIPS (deprecated),
>>18 beshort 11 RS6000,
>>18 beshort 15 PA-RISC
>>>50 beshort 0x0214 2.0
>>>48 beshort &0x0008 (LP64)
# only for 32-bit
>>>4 byte 1
>>>>38 beshort 0x0214 2.0
>>>>36 beshort &0x0008 (LP64)
# only for 64-bit
>>>4 byte 2
>>>>50 beshort 0x0214 2.0
>>>>48 beshort &0x0008 (LP64)
>>18 beshort 16 nCUBE,
>>18 beshort 17 Fujitsu VPP500,
>>18 beshort 18 SPARC32PLUS,
>>>36 belong&0xffff00 0x000100 V8+ Required,
>>>36 belong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required,
>>>36 belong&0xffff00 0x000400 HaL R1 Extensions Required,
>>>36 belong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required,
# only for 32-bit
>>>4 byte 1
>>>>36 belong&0xffff00 0x000100 V8+ Required,
>>>>36 belong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required,
>>>>36 belong&0xffff00 0x000400 HaL R1 Extensions Required,
>>>>36 belong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required,
>>18 beshort 20 PowerPC or cisco 4500,
>>18 beshort 21 64-bit PowerPC or cisco 7500,
>>18 beshort 22 IBM S/390,
@@ -232,15 +257,19 @@
>>18 beshort 38 TRW RH-32,
>>18 beshort 39 Motorola RCE,
>>18 beshort 40 ARM,
>>>4 byte 2
>>>>36 belong&0xff000000 0x04000000 EABI4
>>>>36 belong&0xff000000 0x05000000 EABI5
>>18 beshort 41 Alpha,
>>18 beshort 42 Renesas SH,
>>18 beshort 43 SPARC V9,
>>>48 belong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required,
>>>48 belong&0xffff00 0x000400 HaL R1 Extensions Required,
>>>48 belong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required,
>>>48 belong&0x3 0 total store ordering,
>>>48 belong&0x3 1 partial store ordering,
>>>48 belong&0x3 2 relaxed memory ordering,
>>>4 byte 2
>>>>48 belong&0xffff00 0x000200 Sun UltraSPARC1 Extensions Required,
>>>>48 belong&0xffff00 0x000400 HaL R1 Extensions Required,
>>>>48 belong&0xffff00 0x000800 Sun UltraSPARC3 Extensions Required,
>>>>48 belong&0x3 0 total store ordering,
>>>>48 belong&0x3 1 partial store ordering,
>>>>48 belong&0x3 2 relaxed memory ordering,
>>18 beshort 44 Siemens Tricore Embedded Processor,
>>18 beshort 45 Argonaut RISC Core, Argonaut Technologies Inc.,
>>18 beshort 46 Renesas H8/300,
@@ -259,12 +288,16 @@
>>18 leshort 0x8472 OpenRISC (obsolete),
>>18 beshort 94 Tensilica Xtensa,
>>18 beshort 97 NatSemi 32k,
>>18 beshort 187 Tilera TILE64,
>>18 beshort 188 Tilera TILEPro,
>>18 beshort 191 Tilera TILE-Gx,
>>18 beshort 0x18ad AVR32 (unofficial),
>>18 beshort 0x9026 Alpha (unofficial),
>>18 beshort 0xa390 IBM S/390 (obsolete),
>>20 belong 0 invalid version
>>20 belong 1 version 1
>>36 belong 1 MathCoPro/FPU/MAU Required
>>>20 belong 0 invalid version
>>>20 belong 1 version 1
>>>4 byte 1
>>>>36 belong 1 MathCoPro/FPU/MAU Required
# Up to now only 0, 1 and 2 are defined; I've seen a file with 0x83, it seemed
# like proper ELF, but extracting the string had bad results.
>4 byte <0x80

View File

@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: games,v 1.12 2010/11/25 15:00:12 christos Exp $
# $File: games,v 1.13 2012/02/13 22:50:50 christos Exp $
# games: file(1) for games
# Fabio Bonelli <fabiobonelli@libero.it>
@@ -255,3 +255,11 @@
>2 regex/c GM\\[19\\] - Octi Game
>2 regex/c GM\\[20\\] - Gess Game
>2 regex/c GM\\[21\\] - twix Game
# Epic Games/Unreal Engine Package
#
0 lelong 0x9E2A83C1 Unreal Engine Package,
>4 leshort x version: %i
>12 lelong !0 \b, names: %i
>28 lelong !0 \b, imports: %i
>20 lelong !0 \b, exports: %i

View File

@@ -1,19 +1,28 @@
#------------------------------------------------------------------------------
# $File: gnu,v 1.11 2009/09/19 16:28:09 christos Exp $
# $File: gnu,v 1.13 2012/01/03 17:16:54 christos Exp $
# gnu: file(1) magic for various GNU tools
#
# GNU nlsutils message catalog file format
#
# GNU message catalog (.mo and .gmo files)
0 string \336\22\4\225 GNU message catalog (little endian),
>4 lelong x revision %d,
>8 lelong x %d messages
>6 leshort x revision %d.
>4 leshort >0 \b%d,
>>8 lelong x %d messages,
>>36 lelong x %d sysdep messages
>4 leshort =0 \b%d,
>>8 lelong x %d messages
0 string \225\4\22\336 GNU message catalog (big endian),
>4 belong x revision %d,
>8 belong x %d messages
# message catalogs, from Mitchum DSouza <m.dsouza@mrc-apu.cam.ac.uk>
0 string *nazgul* Nazgul style compiled message catalog
>8 lelong >0 \b, version %ld
>4 beshort x revision %d.
>6 beshort >0 \b%d,
>>8 belong x %d messages,
>>36 belong x %d sysdep messages
>6 beshort =0 \b%d,
>>8 belong x %d messages
# GnuPG
# The format is very similar to pgp
@@ -42,3 +51,7 @@
# Files produced by GNU gettext
0 long 0xDE120495 GNU-format message catalog data
0 long 0x950412DE GNU-format message catalog data
# gettext message catalogue
0 regex \^msgid\ GNU gettext message catalogue text
!:mime text/x-po

View File

@@ -0,0 +1,13 @@
#------------------------------------------------------------------------------
# $File: guile,v 1.1 2011/12/16 17:44:33 christos Exp $
# Guile file magic from <dalepsmith@gmail.com>
# http://www.gnu.org/s/guile/
# http://git.savannah.gnu.org/gitweb/?p=guile.git;f=libguile/_scm.h;hb=HEAD#l250
0 string GOOF---- Guile Object
>8 string LE \b, little endian
>8 string BE \b, big endian
>11 string 4 \b, 32bit
>11 string 8 \b, 64bit
>13 regex .\.. \b, bytecode v%s

View File

@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: images,v 1.70 2010/11/25 15:00:12 christos Exp $
# $File: images,v 1.72 2011/12/08 12:12:46 rrt Exp $
# images: file(1) magic for image formats (see also "iff", and "c-lang" for
# XPM bitmaps)
#
@@ -90,6 +90,11 @@
0 string II\x2a\x00 TIFF image data, little-endian
!:mime image/tiff
0 string MM\x00\x2b Big TIFF image data, big-endian
!:mime image/tiff
0 string II\x2b\x00 Big TIFF image data, little-endian
!:mime image/tiff
# PNG [Portable Network Graphics, or "PNG's Not GIF"] images
# (Greg Roelofs, newt@uchicago.edu)
# (Albert Cahalan, acahalan@cs.uml.edu)
@@ -228,8 +233,8 @@
#0 string BA PC bitmap array data
# XPM icons (Greg Roelofs, newt@uchicago.edu)
# note possible collision with C/REXX entry in c-lang; currently commented out
0 search/1 /*\ XPM\ */ X pixmap image text
!:mime image/x-xpmi
# Utah Raster Toolkit RLE images (janl@ifi.uio.no)
0 leshort 0xcc52 RLE image data,

View File

@@ -1,6 +1,6 @@
#------------------------------------------------------------
# $File: java,v 1.12 2009/09/19 16:28:10 christos Exp $
# $File: java,v 1.13 2011/12/08 12:12:46 rrt Exp $
# Java ByteCode and Mach-O binaries (e.g., Mac OS X) use the
# same magic number, 0xcafebabe, so they are both handled
# in the entry called "cafebabe".
@@ -24,3 +24,6 @@
>0 regex dey\n[0-9][0-9][0-9]\0 Dalvik dex file (optimized for host)
>4 string >000 version %s
# Java source
0 regex ^import.*;$ Java source
!:mime text/x-java

View File

@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: linux,v 1.41 2011/04/20 18:57:10 christos Exp $
# $File: linux,v 1.42 2012/02/07 21:35:03 christos Exp $
# linux: file(1) magic for Linux files
#
# Values for Linux/i386 binaries, from Daniel Quinlan <quinlan@yggdrasil.com>
@@ -182,6 +182,11 @@
>>&0 string \x80\x00\x20\x00\x00\x00\x00\x00 Z990 32bit kernel
>>&0 string \x80\x00\x00\x00\x00\x00\x00\x00 Z900 32bit kernel
# Linux ARM compressed kernel image
# From: Kevin Cernekee <cernekee@gmail.com>
36 lelong 0x016f2818 Linux kernel ARM boot executable zImage (little-endian)
36 belong 0x016f2818 Linux kernel ARM boot executable zImage (big-endian)
############################################################################
# Linux 8086 executable
0 lelong&0xFF0000FF 0xC30000E9 Linux-Dev86 executable, headerless

View File

@@ -0,0 +1,6 @@
#------------------------------------------------------------------------------
# $File: m4,v 1.1 2011/12/08 12:12:46 rrt Exp $
# make: file(1) magic for M4 scripts
#
0 regex \^dnl\ M4 macro processor script text
!:mime text/x-m4

View File

@@ -1,11 +1,9 @@
#------------------------------------------------------------------------------
# $File: mail.news,v 1.19 2011/01/25 13:55:57 christos Exp $
# $File: mail.news,v 1.20 2011/12/08 12:12:46 rrt Exp $
# mail.news: file(1) magic for mail and news
#
# Unfortunately, saved netnews also has From line added in some news software.
#0 string From mail text
# There are tests to ascmagic.c to cope with mail and news.
0 string/t Relay-Version: old news text
!:mime message/rfc822
0 string/t #!\ rnews batched news text
@@ -16,7 +14,9 @@
!:mime message/rfc822
0 string/t Pipe\ to mail piping text
!:mime message/rfc822
0 string/t Return-Path: smtp mail text
0 string/t Delivered-To: SMTP mail text
!:mime message/rfc822
0 string/t Return-Path: SMTP mail text
!:mime message/rfc822
0 string/t Path: news text
!:mime message/news

View File

@@ -0,0 +1,15 @@
#------------------------------------------------------------------------------
# $File: make,v 1.1 2011/12/08 12:12:46 rrt Exp $
# make: file(1) magic for makefiles
#
0 regex \^CFLAGS makefile script text
!:mime text/x-makefile
0 regex \^LDFLAGS makefile script text
!:mime text/x-makefile
0 regex \^all: makefile script text
!:mime text/x-makefile
0 regex \^.PRECIOUS makefile script text
!:mime text/x-makefile
0 regex \^SUBDIRS automake makefile script text
!:mime text/x-makefile

View File

@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: msdos,v 1.75 2011/08/08 08:56:17 christos Exp $
# $File: msdos,v 1.77 2011/12/07 22:05:05 christos Exp $
# msdos: file(1) magic for MS-DOS files
#
@@ -41,7 +41,7 @@
#
# Many of the compressed formats were extraced from IDARC 1.23 source code.
#
0 string MZ
0 string/b MZ
!:mime application/x-dosexec
# All non-DOS EXE extensions have the relocation table more than 0x40 bytes into the file.
>0x18 leshort <0x40 MS-DOS executable
@@ -294,7 +294,7 @@
# added by Joerg Jenderek of http://www.freedos.org/software/?prog=kc
# and http://www.freedos.org/software/?prog=kpdos
# for FreeDOS files like KEYBOARD.SYS, KEYBRD2.SYS, KEYBRD3.SYS, *.KBD
0 string KCF FreeDOS KEYBoard Layout collection
0 string/b KCF FreeDOS KEYBoard Layout collection
# only version=0x100 found
>3 uleshort x \b, version 0x%x
# length of string containing author,info and special characters
@@ -305,7 +305,7 @@
#>>>&0 string x \b%-s
>>>&0 string x \b%-.15s
# for FreeDOS *.KL files
0 string KLF FreeDOS KEYBoard Layout file
0 string/b KLF FreeDOS KEYBoard Layout file
# only version=0x100 or 0x101 found
>3 uleshort x \b, version 0x%x
# stringlength
@@ -402,12 +402,12 @@
# byte 0xeb conflicts with "sequent" magic leshort 0xn2eb
0 ubeshort&0xeb8d >0xeb00
# DR-DOS STACKER.COM SCREATE.SYS missed
>0 byte 0xeb DOS executable (COM)
>>0x1FE leshort 0xAA55 \b, boot code
>>85 string UPX \b, UPX compressed
>>4 string \ $ARX \b, ARX self-extracting archive
>>4 string \ $LHarc \b, LHarc self-extracting archive
>>0x20e string SFX\ by\ LARC \b, LARC self-extracting archive
>0 byte 0xeb
>>0x1FE leshort 0xAA55 DOS executable (COM), boot code
>>85 string UPX DOS executable (COM), UPX compressed
>>4 string \ $ARX DOS executable (COM), ARX self-extracting archive
>>4 string \ $LHarc DOS executable (COM), LHarc self-extracting archive
>>0x20e string SFX\ by\ LARC DOS executable (COM), LARC self-extracting archive
# updated by Joerg Jenderek at Oct 2008
#0 byte 0xb8 COM executable
0 uleshort&0x80ff 0x00b8
@@ -421,11 +421,11 @@
# syslinux:doc/comboot.txt
# A COM32R program must start with the byte sequence B8 FE 4C CD 21 (mov
# eax,21cd4cfeh) as a magic number.
0 string \xb8\xfe\x4c\xcd\x21 COM executable (COM32R)
0 string/b \xb8\xfe\x4c\xcd\x21 COM executable (COM32R)
# start with assembler instructions mov eax,21cd4cfeh
0 uleshort&0xc0ff 0xc0b8
>1 lelong 0x21cd4cfe COM executable (32-bit COMBOOT, relocatable)
0 string \x81\xfc
0 string/b \x81\xfc
>4 string \x77\x02\xcd\x20\xb9
>>36 string UPX! FREE-DOS executable (COM), UPX compressed
252 string Must\ have\ DOS\ version DR-DOS executable (COM)
@@ -466,16 +466,16 @@
# FIXME: missing diet .com compression
# miscellaneous formats
0 string LZ MS-DOS executable (built-in)
0 string/b LZ MS-DOS executable (built-in)
#0 byte 0xf0 MS-DOS program library data
#
# AAF files:
# <stuartc@rd.bbc.co.uk> Stuart Cunningham
0 string \320\317\021\340\241\261\032\341AAFB\015\000OM\006\016\053\064\001\001\001\377 AAF legacy file using MS Structured Storage
0 string/b \320\317\021\340\241\261\032\341AAFB\015\000OM\006\016\053\064\001\001\001\377 AAF legacy file using MS Structured Storage
>30 byte 9 (512B sectors)
>30 byte 12 (4kB sectors)
0 string \320\317\021\340\241\261\032\341\001\002\001\015\000\002\000\000\006\016\053\064\003\002\001\001 AAF file using MS Structured Storage
0 string/b \320\317\021\340\241\261\032\341\001\002\001\015\000\002\000\000\006\016\053\064\003\002\001\001 AAF file using MS Structured Storage
>30 byte 9 (512B sectors)
>30 byte 12 (4kB sectors)
@@ -491,14 +491,14 @@
0 belong 0x31be0000 Microsoft Word Document
!:mime application/msword
#
0 string PO^Q` Microsoft Word 6.0 Document
0 string/b PO^Q` Microsoft Word 6.0 Document
!:mime application/msword
#
0 string \376\067\0\043 Microsoft Office Document
0 string/b \376\067\0\043 Microsoft Office Document
!:mime application/msword
0 string \333\245-\0\0\0 Microsoft Office Document
0 string/b \333\245-\0\0\0 Microsoft Office Document
!:mime application/msword
512 string \354\245\301 Microsoft Word Document
512 string/b \354\245\301 Microsoft Word Document
!:mime application/msword
#
2080 string Microsoft\ Excel\ 5.0\ Worksheet %s
@@ -513,7 +513,7 @@
# Italian MS-Excel
2121 string Biff5 Microsoft Excel 5.0 Worksheet
!:mime application/vnd.ms-excel
0 string \x09\x04\x06\x00\x00\x00\x10\x00 Microsoft Excel Worksheet
0 string/b \x09\x04\x06\x00\x00\x00\x10\x00 Microsoft Excel Worksheet
!:mime application/vnd.ms-excel
#
0 belong 0x00001a00 Lotus 1-2-3
@@ -527,9 +527,9 @@
!:mime application/x-123
>4 belong 0x06040600 wk1 document data
>4 belong 0x06800200 fmt document data
0 string WordPro\0 Lotus WordPro
0 string/b WordPro\0 Lotus WordPro
!:mime application/vnd.lotus-wordpro
0 string WordPro\r\373 Lotus WordPro
0 string/b WordPro\r\373 Lotus WordPro
!:mime application/vnd.lotus-wordpro
@@ -542,17 +542,17 @@
# Winamp .avs
#0 string Nullsoft\ AVS\ Preset\ \060\056\061\032 A plug in for Winamp ms-windows Freeware media player
0 string Nullsoft\ AVS\ Preset\ Winamp plug in
0 string/b Nullsoft\ AVS\ Preset\ Winamp plug in
# Windows Metafont .WMF
0 string \327\315\306\232 ms-windows metafont .wmf
0 string \002\000\011\000 ms-windows metafont .wmf
0 string \001\000\011\000 ms-windows metafont .wmf
0 string/b \327\315\306\232 ms-windows metafont .wmf
0 string/b \002\000\011\000 ms-windows metafont .wmf
0 string/b \001\000\011\000 ms-windows metafont .wmf
#tz3 files whatever that is (MS Works files)
0 string \003\001\001\004\070\001\000\000 tz3 ms-works file
0 string \003\002\001\004\070\001\000\000 tz3 ms-works file
0 string \003\003\001\004\070\001\000\000 tz3 ms-works file
0 string/b \003\001\001\004\070\001\000\000 tz3 ms-works file
0 string/b \003\002\001\004\070\001\000\000 tz3 ms-works file
0 string/b \003\003\001\004\070\001\000\000 tz3 ms-works file
# PGP sig files .sig
#0 string \211\000\077\003\005\000\063\237\127 065 to \027\266\151\064\005\045\101\233\021\002 PGP sig
@@ -564,14 +564,14 @@
0 string \211\000\225\003\005\000\062\122\207\304\100\345\042 PGP sig
# windows zips files .dmf
0 string MDIF\032\000\010\000\000\000\372\046\100\175\001\000\001\036\001\000 MS Windows special zipped file
0 string/b MDIF\032\000\010\000\000\000\372\046\100\175\001\000\001\036\001\000 MS Windows special zipped file
#ico files
0 string \102\101\050\000\000\000\056\000\000\000\000\000\000\000 Icon for MS Windows
0 string/b \102\101\050\000\000\000\056\000\000\000\000\000\000\000 Icon for MS Windows
# Windows icons (Ian Springer <ips@fpk.hp.com>)
0 string \000\000\001\000 MS Windows icon resource
0 string/b \000\000\001\000 MS Windows icon resource
!:mime image/x-icon
>4 byte 1 - 1 icon
>4 byte >1 - %d icons
@@ -582,13 +582,13 @@
# .chr files
0 string PK\010\010BGI Borland font
0 string/b PK\010\010BGI Borland font
>4 string >\0 %s
# then there is a copyright notice
# .bgi files
0 string pk\010\010BGI Borland device
0 string/b pk\010\010BGI Borland device
>4 string >\0 %s
# then there is a copyright notice
@@ -703,28 +703,28 @@
!:mime application/vnd.ms-tnef
# HtmlHelp files (.chm)
0 string ITSF\003\000\000\000\x60\000\000\000\001\000\000\000 MS Windows HtmlHelp Data
0 string/b ITSF\003\000\000\000\x60\000\000\000\001\000\000\000 MS Windows HtmlHelp Data
# GFA-BASIC (Wolfram Kleff)
2 string GFA-BASIC3 GFA-BASIC 3 data
2 string/b GFA-BASIC3 GFA-BASIC 3 data
#------------------------------------------------------------------------------
# From Stuart Caie <kyzer@4u.net> (developer of cabextract)
# Microsoft Cabinet files
0 string MSCF\0\0\0\0 Microsoft Cabinet archive data
0 string/b MSCF\0\0\0\0 Microsoft Cabinet archive data
!:mime application/vnd.ms-cab-compressed
>8 lelong x \b, %u bytes
>28 leshort 1 \b, 1 file
>28 leshort >1 \b, %u files
# InstallShield Cabinet files
0 string ISc( InstallShield Cabinet archive data
0 string/b ISc( InstallShield Cabinet archive data
>5 byte&0xf0 =0x60 version 6,
>5 byte&0xf0 !0x60 version 4/5,
>(12.l+40) lelong x %u files
# Windows CE package files
0 string MSCE\0\0\0\0 Microsoft WinCE install header
0 string/b MSCE\0\0\0\0 Microsoft WinCE install header
>20 lelong 0 \b, architecture-independent
>20 lelong 103 \b, Hitachi SH3
>20 lelong 104 \b, Hitachi SH4
@@ -748,7 +748,7 @@
>>44 ulelong x version 0x%x
# From: Alex Beregszaszi <alex@fsn.hu>
0 string COWD VMWare3
0 string/b COWD VMWare3
>4 byte 3 disk image
>>32 lelong x (%d/
>>36 lelong x \b%d/
@@ -756,8 +756,8 @@
>4 byte 2 undoable disk image
>>32 string >\0 (%s)
0 string VMDK VMware4 disk image
0 string KDMV VMware4 disk image
0 string/b VMDK VMware4 disk image
0 string/b KDMV VMware4 disk image
#--------------------------------------------------------------------
# Qemu Emulator Images
@@ -765,11 +765,11 @@
# Updated by Adam Buchbinder (adam.buchbinder@gmail.com)
# Made by reading sources, reading documentation, and doing trial and error
# on existing QCOW files
0 string QFI\xFB QEMU QCOW Image
0 string/b QFI\xFB QEMU QCOW Image
# Uncomment the following line to display Magic (only used for debugging
# this magic number)
#>0 string x , Magic: %s
#>0 string/b x , Magic: %s
# There are currently 2 Versions: "1" and "2".
# http://www.gnome.org/~markmc/qcow-image-format-version-1.html
@@ -813,9 +813,9 @@
>4 default x (unknown version)
0 string QEVM QEMU suspend to disk image
0 string/b QEVM QEMU suspend to disk image
0 string Bochs\ Virtual\ HD\ Image Bochs disk image,
0 string/b Bochs\ Virtual\ HD\ Image Bochs disk image,
>32 string x type %s,
>48 string x subtype %s
@@ -823,8 +823,8 @@
# from http://filext.com by Derek M Jones <derek@knosof.co.uk>
# False positive with PPT (also currently this string is too long)
#0 string \xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3E\x00\x03\x00\xFE\xFF\x09\x00\x06 Microsoft Installer
0 string \320\317\021\340\241\261\032\341 Microsoft Office Document
#0 string/b \xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3E\x00\x03\x00\xFE\xFF\x09\x00\x06 Microsoft Installer
0 string/b \320\317\021\340\241\261\032\341 Microsoft Office Document
#>48 byte 0x1B Excel Document
#!:mime application/vnd.ms-excel
>546 string bjbj Microsoft Word Document
@@ -832,7 +832,7 @@
>546 string jbjb Microsoft Word Document
!:mime application/msword
0 string \224\246\056 Microsoft Word Document
0 string/b \224\246\056 Microsoft Word Document
!:mime application/msword
512 string R\0o\0o\0t\0\ \0E\0n\0t\0r\0y Microsoft Word Document
@@ -841,7 +841,7 @@
# From: "Nelson A. de Oliveira" <naoliv@gmail.com>
# Magic type for Dell's BIOS .hdr files
# Dell's .hdr
0 string $RBU
0 string/b $RBU
>23 string Dell %s system BIOS
>5 byte 2
>>48 byte x version %d.
@@ -853,7 +853,7 @@
# Type: Microsoft DirectDraw Surface
# URL: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp
# From: Morten Hustveit <morten@debian.org>
0 string DDS\040\174\000\000\000 Microsoft DirectDraw Surface (DDS),
0 string/b DDS\040\174\000\000\000 Microsoft DirectDraw Surface (DDS),
>16 lelong >0 %hd x
>12 lelong >0 %hd,
>84 string x %.4s
@@ -864,13 +864,13 @@
0 short 0x5045 Microsoft Document Imaging Format
# MS eBook format (.lit)
0 string ITOLITLS Microsoft Reader eBook Data
0 string/b ITOLITLS Microsoft Reader eBook Data
>8 lelong x \b, version %u
!:mime application/x-ms-reader
# Windows CE Binary Image Data Format
# From: Dr. Jesus <j@hug.gs>
0 string B000FF\n Windows Embedded CE binary image
0 string/b B000FF\n Windows Embedded CE binary image
# Windows Imaging (WIM) Image
0 string MSWIM\000\000\000 Windows imaging (WIM) image
0 string/b MSWIM\000\000\000 Windows imaging (WIM) image

View File

@@ -0,0 +1,17 @@
#------------------------------------------------------------------------------
# $File: music,v 1.1 2011/11/25 03:28:17 christos Exp $
# music: file (1) magic for music formats
# BWW format used by Bagpipe Music Writer Gold by Robert MacNeil Musicworks
# and Bagpipe Writer by Doug Wickstrom
#
0 string Bagpipe Bagpipe
>8 string Reader Reader
>>15 string >\0 (version %.3s)
>8 string Music\ Writer Music Writer
>>20 string :
>>>21 string >\0 (version %.3s)
>>21 string Gold Gold
>>>25 string :
>>>>26 string >\0 (version %.3s)

View File

@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: netbsd,v 1.18 2009/09/19 16:28:11 christos Exp $
# $File: netbsd,v 1.19 2011/10/31 17:23:34 christos Exp $
# netbsd: file(1) magic for NetBSD objects
#
# All new-style magic numbers are in network byte order.
@@ -245,3 +245,42 @@
0 belong&0377777777 043600507 a.out NetBSD/arm core
>12 string >\0 from '%s'
>32 lelong !0 (signal %d)
# Kernel core dump format
0 belong&0x0000ffff 0x00008fca NetBSD kernel core file
>0 belong&0x03ff0000 0x00000000 \b, Unknown
>0 belong&0x03ff0000 0x00001000 \b, sun 68010/68020
>0 belong&0x03ff0000 0x00020000 \b, sun 68020
>0 belong&0x03ff0000 0x00640000 \b, 386 PC
>0 belong&0x03ff0000 0x00860000 \b, i386 BSD
>0 belong&0x03ff0000 0x00870000 \b, m68k BSD (8K pages)
>0 belong&0x03ff0000 0x00880000 \b, m68k BSD (4K pages)
>0 belong&0x03ff0000 0x00890000 \b, ns32532 BSD
>0 belong&0x03ff0000 0x008a0000 \b, sparc/32 BSD
>0 belong&0x03ff0000 0x008b0000 \b, pmax BSD
>0 belong&0x03ff0000 0x008c0000 \b, vax BSD (1K pages)
>0 belong&0x03ff0000 0x008d0000 \b, alpha BSD
>0 belong&0x03ff0000 0x008e0000 \b, mips BSD (Big Endian)
>0 belong&0x03ff0000 0x008f0000 \b, arm6 BSD
>0 belong&0x03ff0000 0x00900000 \b, m68k BSD (2K pages)
>0 belong&0x03ff0000 0x00910000 \b, sh3 BSD
>0 belong&0x03ff0000 0x00920000 \b, ppc BSD (Big Endian)
>0 belong&0x03ff0000 0x00930000 \b, vax BSD (4K pages)
>0 belong&0x03ff0000 0x00940000 \b, mips1 BSD
>0 belong&0x03ff0000 0x00950000 \b, mips2 BSD
>0 belong&0x03ff0000 0x00960000 \b, parisc BSD
>0 belong&0x03ff0000 0x00970000 \b, sh5/64 BSD
>0 belong&0x03ff0000 0x00980000 \b, sparc/64 BSD
>0 belong&0x03ff0000 0x00990000 \b, amd64 BSD
>0 belong&0x03ff0000 0x009a0000 \b, hp200 (68010) BSD
>0 belong&0x03ff0000 0x009b0000 \b, hp300 (68020+68881) BSD
>0 belong&0x03ff0000 0x009b0000 \b, hp300 (68020+68881) BSD
>0 belong&0x03ff0000 0x00c80000 \b, hp200
>0 belong&0x03ff0000 0x020b0000 \b, hp300 (68020+68881) HP-UX
>0 belong&0x03ff0000 0x020c0000 \b, hp300 (68020+68881) HP-UX
>0 belong&0xfc000000 0x04000000 \b, CPU
>0 belong&0xfc000000 0x08000000 \b, DATA
>0 belong&0xfc000000 0x10000000 \b, STACK
>4 leshort x \b, (headersize = %d
>6 leshort x \b, segmentsize = %d
>6 lelong x \b, segments = %d)

View File

@@ -1,65 +1,72 @@
#------------------------------------------------------------------------------
# $File: palm,v 1.7 2009/09/19 16:28:11 christos Exp $
# palm: file(1) magic for PalmOS {.prc,.pdb}: applications, docfiles, and hacks
# $File: palm,v 1.9 2012/01/16 15:16:43 christos Exp $
# palm: file(1) magic for PalmOS {.prc,.pdb}: applications, docfiles, and hacks
#
# Brian Lalor <blalor@hcirisc.cs.binghamton.edu>
# These are weak, byte 59 is not guaranteed to be 0 and there are
# 8 character identifiers at byte 60, one I found for appl is BIGb.
# What are the possibilities and where is this documented?
# appl
60 belong 0x6170706c PalmOS application
>0 string >\0 "%s"
#59 byte \0
#>60 string appl PalmOS application
#>0 string >\0 "%s"
# TEXt
60 belong 0x54455874 AportisDoc file
>0 string >\0 "%s"
#59 byte \0
#>60 belong TEXt AportisDoc file
#>0 string >\0 "%s"
# HACK
60 belong 0x4841434b HackMaster hack
>0 string >\0 "%s"
#59 byte \0
#>60 string HACK HackMaster hack
#>0 string >\0 "%s"
# Variety of PalmOS document types
# Michael-John Turner <mj@debian.org>
# Thanks to Hasan Umit Ezerce <humit@tr-net.net.tr> for his DocType
60 string BVokBDIC BDicty PalmOS document
>0 string >\0 "%s"
60 string DB99DBOS DB PalmOS document
>0 string >\0 "%s"
60 string vIMGView FireViewer/ImageViewer PalmOS document
>0 string >\0 "%s"
60 string PmDBPmDB HanDBase PalmOS document
>0 string >\0 "%s"
60 string InfoINDB InfoView PalmOS document
>0 string >\0 "%s"
60 string ToGoToGo iSilo PalmOS document
>0 string >\0 "%s"
60 string JfDbJBas JFile PalmOS document
>0 string >\0 "%s"
60 string JfDbJFil JFile Pro PalmOS document
>0 string >\0 "%s"
60 string DATALSdb List PalmOS document
>0 string >\0 "%s"
60 string Mdb1Mdb1 MobileDB PalmOS document
>0 string >\0 "%s"
60 string PNRdPPrs PeanutPress PalmOS document
>0 string >\0 "%s"
60 string DataPlkr Plucker PalmOS document
>0 string >\0 "%s"
60 string DataSprd QuickSheet PalmOS document
>0 string >\0 "%s"
60 string SM01SMem SuperMemo PalmOS document
>0 string >\0 "%s"
60 string TEXtTlDc TealDoc PalmOS document
>0 string >\0 "%s"
60 string InfoTlIf TealInfo PalmOS document
>0 string >\0 "%s"
60 string DataTlMl TealMeal PalmOS document
>0 string >\0 "%s"
60 string DataTlPt TealPaint PalmOS document
>0 string >\0 "%s"
60 string dataTDBP ThinkDB PalmOS document
>0 string >\0 "%s"
60 string TdatTide Tides PalmOS document
>0 string >\0 "%s"
60 string ToRaTRPW TomeRaider PalmOS document
>0 string >\0 "%s"
60 string BVokBDIC BDicty PalmOS document
>0 string >\0 "%s"
60 string DB99DBOS DB PalmOS document
>0 string >\0 "%s"
60 string vIMGView FireViewer/ImageViewer PalmOS document
>0 string >\0 "%s"
60 string PmDBPmDB HanDBase PalmOS document
>0 string >\0 "%s"
60 string InfoINDB InfoView PalmOS document
>0 string >\0 "%s"
60 string ToGoToGo iSilo PalmOS document
>0 string >\0 "%s"
60 string JfDbJBas JFile PalmOS document
>0 string >\0 "%s"
60 string JfDbJFil JFile Pro PalmOS document
>0 string >\0 "%s"
60 string DATALSdb List PalmOS document
>0 string >\0 "%s"
60 string Mdb1Mdb1 MobileDB PalmOS document
>0 string >\0 "%s"
60 string PNRdPPrs PeanutPress PalmOS document
>0 string >\0 "%s"
60 string DataPlkr Plucker PalmOS document
>0 string >\0 "%s"
60 string DataSprd QuickSheet PalmOS document
>0 string >\0 "%s"
60 string SM01SMem SuperMemo PalmOS document
>0 string >\0 "%s"
60 string TEXtTlDc TealDoc PalmOS document
>0 string >\0 "%s"
60 string InfoTlIf TealInfo PalmOS document
>0 string >\0 "%s"
60 string DataTlMl TealMeal PalmOS document
>0 string >\0 "%s"
60 string DataTlPt TealPaint PalmOS document
>0 string >\0 "%s"
60 string dataTDBP ThinkDB PalmOS document
>0 string >\0 "%s"
60 string TdatTide Tides PalmOS document
>0 string >\0 "%s"
60 string ToRaTRPW TomeRaider PalmOS document
>0 string >\0 "%s"
# A GutenPalm zTXT etext for use on Palm Pilots (http://gutenpalm.sf.net)
# For version 1.xx zTXTs, outputs version and numbers of bookmarks and
@@ -88,5 +95,5 @@
>0 string >\0 "%s"
# Mobipocket (www.mobipocket.com), donated by Carl Witty
60 string BOOKMOBI Mobipocket E-book
>0 string >\0 "%s"
60 string BOOKMOBI Mobipocket E-book
>0 string >\0 "%s"

View File

@@ -0,0 +1,10 @@
#------------------------------------------------------------------------------
# $File: pascal,v 1.1 2011/12/08 12:12:46 rrt Exp $
# pascal: file(1) magic for Pascal source
#
0 search/8192 (input, Pascal source text
!:mime text/x-pascal
0 regex \^program Pascal source text
!:mime text/x-pascal
0 regex \^record Pascal source text
!:mime text/x-pascal

View File

@@ -1,6 +1,5 @@
#------------------------------------------------------------------------------
# $File: perl,v 1.16 2009/09/19 16:28:11 christos Exp $
# $File: perl,v 1.17 2011/12/16 16:24:40 rrt Exp $
# perl: file(1) magic for Larry Wall's perl language.
#
# The `eval' lines recognizes an outrageously clever hack.
@@ -20,7 +19,10 @@
!:mime text/x-perl
0 search/1 eval\ '(exit\ $?0)'\ &&\ eval\ 'exec Perl script text
!:mime text/x-perl
0 search/1 #!/usr/bin/env\ perl Perl script text executable
!:mime text/x-perl
0 search/1 #!\ /usr/bin/env\ perl Perl script text executable
!:mime text/x-perl
# by Dmitry V. Levin and Alexey Tourbin
# check the first line

View File

@@ -1,11 +1,12 @@
#------------------------------------------------------------------------------
# $File: python,v 1.18 2011/02/26 02:33:38 christos Exp $
# $File: python,v 1.20 2011/12/13 13:53:14 christos Exp $
# python: file(1) magic for python
#
# Outlook puts """ too for urgent messages
# From: David Necas <yeti@physics.muni.cz>
# often the module starts with a multiline string
0 string/t """ a python script text executable
0 string/t """ Python script text executable
# MAGIC as specified in Python/import.c (1.5 to 2.7a0 and 3.1a0, assuming
# that Py_UnicodeFlag is off for Python 2)
# 20121 ( YEAR - 1995 ) + MONTH + DAY (little endian followed by "\r\n"

View File

@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
# $File: sgml,v 1.26 2011/04/16 15:20:04 christos Exp $
# $File: sgml,v 1.27 2011/12/07 12:01:24 rrt Exp $
# Type: SVG Vectorial Graphics
# From: Noel Torres <tecnico@ejerciciosresueltos.com>
0 string \<?xml\ version="
@@ -18,15 +18,15 @@
# xhtml
0 string/t \<?xml\ version="
>15 string >\0
>>19 search/4096/cWbt \<!doctype\ html xHTML document text
>>19 search/4096/cWbt \<!doctype\ html XHTML document text
!:mime text/html
0 string/t \<?xml\ version='
>15 string >\0
>>19 search/4096/cWbt \<!doctype\ html xHTML document text
>>19 search/4096/cWbt \<!doctype\ html XHTML document text
!:mime text/html
0 string/t \<?xml\ version="
>15 string >\0
>>19 search/4096/cWbt \<html broken xHTML document text
>>19 search/4096/cWbt \<html broken XHTML document text
!:mime text/html
#------------------------------------------------------------------------------

View File

@@ -1,16 +1,27 @@
#------------------------------------------------------------------------------
# $File: varied.script,v 1.7 2010/11/25 15:00:12 christos Exp $
# $File: varied.script,v 1.9 2011/12/16 16:32:48 rrt Exp $
# varied.script: file(1) magic for various interpreter scripts
0 string/t #!\ / a
>3 string >\0 %s script text executable
!:strength / 2
0 string/t #!\t/ a
>3 string >\0 %s script text executable
!:strength / 2
0 string/t #!/ a
>2 string >\0 %s script text executable
!:strength / 2
0 string/t #!\ script text executable
>3 string >\0 for %s
!:strength / 3
# using env
0 string/t #!/usr/bin/env a
>15 string/t >\0 %s script text executable
!:strength / 10
0 string/t #!\ /usr/bin/env a
>16 string/t >\0 %s script text executable
!:strength / 10
# From: arno <arenevier@fdn.fr>
# mozilla xpconnect typelib

View File

@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: virtual,v 1.1 2009/12/25 16:04:30 christos Exp $
# $File: virtual,v 1.2 2011/11/22 13:30:05 christos Exp $
# From: James Nobis <quel@quelrod.net>
# Microsoft hard disk images for:
# Virtual Server
@@ -10,8 +10,8 @@
0 string conectix Microsoft Disk Image, Virtual Server or Virtual PC
# Sun xVM VirtualBox Disk Image
# string <<< Sun xVM VirtualBox Disk Image >>>
# .vdi
0 string \<\<\<\ Sun\ xVM\ VirtualBox\ Disk Sun xVM VirtualBox Disk Image
# From: Richard W.M. Jones <rich@annexia.org>
# VirtualBox Disk Image
0x40 ulelong 0xbeda107f VirtualBox Disk Image
>0x44 uleshort >0 \b, major %u
>0x46 uleshort >0 \b, minor %u

96
external/bsd/file/dist/magic/magdir/zfs vendored Normal file
View File

@@ -0,0 +1,96 @@
#------------------------------------------------------------------------------
# zfs: file(1) magic for ZFS dumps
#
# From <rea-fbsd@codelabs.ru>
# ZFS dump header has the following structure (as per zfs_ioctl.h
# in FreeBSD with drr_type is set to DRR_BEGIN)
#
# enum {
# DRR_BEGIN, DRR_OBJECT, DRR_FREEOBJECTS,
# DRR_WRITE, DRR_FREE, DRR_END,
# } drr_type;
# uint32_t drr_pad;
# uint64_t drr_magic;
# uint64_t drr_version;
# uint64_t drr_creation_time;
# dmu_objset_type_t drr_type;
# uint32_t drr_pad;
# uint64_t drr_toguid;
# uint64_t drr_fromguid;
# char drr_toname[MAXNAMELEN];
#
# Backup magic is 0x00000002f5bacbac (quad word)
# The drr_type is defined as
# typedef enum dmu_objset_type {
# DMU_OST_NONE,
# DMU_OST_META,
# DMU_OST_ZFS,
# DMU_OST_ZVOL,
# DMU_OST_OTHER, /* For testing only! */
# DMU_OST_ANY, /* Be careful! */
# DMU_OST_NUMTYPES
# } dmu_objset_type_t;
#
# Almost all uint64_t fields are printed as the 32-bit ones (with high
# 32 bits zeroed), because there is no simple way to print them as the
# full 64-bit values.
# Big-endian values
8 string \000\000\000\002\365\272\313\254 ZFS shapshot (big-endian machine),
>20 belong x version %lu,
>32 belong 0 type: NONE,
>32 belong 1 type: META,
>32 belong 2 type: ZFS,
>32 belong 3 type: ZVOL,
>32 belong 4 type: OTHER,
>32 belong 5 type: ANY,
>32 belong >5 type: UNKNOWN (%lu),
>40 byte x destination GUID: %02X
>41 byte x %02X
>42 byte x %02X
>43 byte x %02X
>44 byte x %02X
>45 byte x %02X
>46 byte x %02X
>47 byte x %02X,
>48 ulong >0
>>52 ulong >0
>>>48 byte x source GUID: %02X
>>>49 byte x %02X
>>>50 byte x %02X
>>>51 byte x %02X
>>>52 byte x %02X
>>>53 byte x %02X
>>>54 byte x %02X
>>>55 byte x %02X,
>56 string >\0 name: '%s'
# Little-endian values
8 string \254\313\272\365\002\000\000\000 ZFS shapshot (little-endian machine),
>16 lelong x version %lu,
>32 lelong 0 type: NONE,
>32 lelong 1 type: META,
>32 lelong 2 type: ZFS,
>32 lelong 3 type: ZVOL,
>32 lelong 4 type: OTHER,
>32 lelong 5 type: ANY,
>32 lelong >5 type: UNKNOWN (%lu),
>47 byte x destination GUID: %02X
>46 byte x %02X
>45 byte x %02X
>44 byte x %02X
>43 byte x %02X
>42 byte x %02X
>41 byte x %02X
>40 byte x %02X,
>48 ulong >0
>>52 ulong >0
>>>55 byte x source GUID: %02X
>>>54 byte x %02X
>>>53 byte x %02X
>>>52 byte x %02X
>>>51 byte x %02X
>>>50 byte x %02X
>>>49 byte x %02X
>>>48 byte x %02X,
>56 string >\0 name: '%s'