From 4f62edefc03354426e97a08fc31c47d9c6e57ea8 Mon Sep 17 00:00:00 2001 From: pooka Date: Sat, 18 May 2002 06:45:50 +0000 Subject: [PATCH] file 3.38 --- usr.bin/file/magdir/acorn | 32 ++++++++++++++++++ usr.bin/file/magdir/adventure | 32 +++++++++++++++--- usr.bin/file/magdir/cvs | 6 ++++ usr.bin/file/magdir/dolby | 57 ++++++++++++++++++++++++++++++++ usr.bin/file/magdir/editors | 4 +++ usr.bin/file/magdir/gringotts | 25 ++++++++++++++ usr.bin/file/magdir/mcrypt | 61 +++++++++++++++++++---------------- usr.bin/file/magdir/nitpicker | 12 +++++++ usr.bin/file/magdir/perl | 18 +++++++++++ usr.bin/file/magdir/pulsar | 10 ++++++ usr.bin/file/magdir/tgif | 6 ++++ usr.bin/file/magdir/vorbis | 45 ++++++++++++++++---------- usr.bin/file/magdir/vxl | 13 ++++++++ usr.bin/file/magic.mime.in | 11 ++++--- 14 files changed, 278 insertions(+), 54 deletions(-) create mode 100644 usr.bin/file/magdir/acorn create mode 100644 usr.bin/file/magdir/cvs create mode 100644 usr.bin/file/magdir/dolby create mode 100644 usr.bin/file/magdir/gringotts create mode 100644 usr.bin/file/magdir/nitpicker create mode 100644 usr.bin/file/magdir/perl create mode 100644 usr.bin/file/magdir/pulsar create mode 100644 usr.bin/file/magdir/tgif create mode 100644 usr.bin/file/magdir/vxl diff --git a/usr.bin/file/magdir/acorn b/usr.bin/file/magdir/acorn new file mode 100644 index 000000000000..ad89cc66e61e --- /dev/null +++ b/usr.bin/file/magdir/acorn @@ -0,0 +1,32 @@ +#------------------------------------------------------------------------------ +# acorn: file(1) magic for files found on Acorn systems +# + +# RISC OS Chunk File Format +# From RISC OS Programmer's Reference Manual, Appendix D +# We guess the file type from the type of the first chunk. +0 lelong 0xc3cbc6c5 RISC OS Chunk data +>12 string OBJ_ \b, AOF object +>12 string LIB_ \b, ALF library + +# RISC OS AIF, contains "SWI OS_Exit" at offset 16. +16 lelong 0xef000011 RISC OS AIF executable + +# RISC OS Draw files +# From RISC OS Programmer's Reference Manual, Appendix E +0 string Draw RISC OS Draw file data + +# RISC OS new format font files +# From RISC OS Programmer's Reference Manual, Appendix E +0 string FONT\0 RISC OS outline font data, +>5 byte x version %d +0 string FONT\1 RISC OS 1bpp font data, +>5 byte x version %d +0 string FONT\4 RISC OS 4bpp font data +>5 byte x version %d + +# RISC OS Music files +# From RISC OS Programmer's Reference Manual, Appendix E +0 string Maestro\r RISC OS music file +>8 byte x version %d + diff --git a/usr.bin/file/magdir/adventure b/usr.bin/file/magdir/adventure index 38a5e33a3a2a..864712f6da1a 100644 --- a/usr.bin/file/magdir/adventure +++ b/usr.bin/file/magdir/adventure @@ -4,11 +4,12 @@ # # from Allen Garvin # Edited by Dave Chapeskie Jun 28, 1998 +# Edited by Chris Chittleborough , March 2002 # # ALAN # I assume there are other, lower versions, but these are the only ones I # saw in the archive. -0 beshort 0x0206 ALAN text adventure code data +0 beshort 0x0206 ALAN game data >2 byte <10 version 2.6%d # Conflicts with too much other stuff! @@ -34,6 +35,29 @@ #>18 string >\0 Serial %.6s) # TADS (Text Adventure Development System) -0 string TADS TADS game data ->13 string >\0 (ver. %.6s, ->22 string >\0 date %s) +# All files are machine-independent (games compile to byte-code) and are tagged +# with a version string of the form "V2..\0" (but TADS 3 is +# on the way). +# Game files start with "TADS2 bin\n\r\032\0" then the compiler version. +0 string TADS2\ bin TADS +>9 belong !0x0A0D1A00 game data, CORRUPTED +>9 belong 0x0A0D1A00 +>>13 string >\0 %s game data +# Resource files start with "TADS2 rsc\n\r\032\0" then the compiler version. +0 string TADS2\ rsc TADS +>9 belong !0x0A0D1A00 resource data, CORRUPTED +>9 belong 0x0A0D1A00 +>>13 string >\0 %s resource data +# Some saved game files start with "TADS2 save/g\n\r\032\0", a little-endian +# 2-byte length N, the N-char name of the game file *without* a NUL (darn!), +# "TADS2 save\n\r\032\0" and the interpreter version. +0 string TADS2\ save/g TADS +>12 belong !0x0A0D1A00 saved game data, CORRUPTED +>12 belong 0x0A0D1A00 +>>(16.s+32) string >\0 %s saved game data +# Other saved game files start with "TADS2 save\n\r\032\0" and the interpreter +# version. +0 string TADS2\ save TADS +>10 belong !0x0A0D1A00 saved game data, CORRUPTED +>10 belong 0x0A0D1A00 +>>14 string >\0 %s saved game data diff --git a/usr.bin/file/magdir/cvs b/usr.bin/file/magdir/cvs new file mode 100644 index 000000000000..2ce9a1a54a7f --- /dev/null +++ b/usr.bin/file/magdir/cvs @@ -0,0 +1,6 @@ +#------------------------------------------------------------------------------ +# file(1) magic for cvs(1) files +# From Hendrik Scholz + +0 string /1\ :pserver: cvs password text file + diff --git a/usr.bin/file/magdir/dolby b/usr.bin/file/magdir/dolby new file mode 100644 index 000000000000..230f738a209d --- /dev/null +++ b/usr.bin/file/magdir/dolby @@ -0,0 +1,57 @@ +# ATSC A/53 aka AC-3 aka Dolby Digital +# from http://www.atsc.org/standards/a_52a.pdf +# corrections, additions, etc. are always welcome! +# +# syncword +0 beshort 0x0b77 ATSC A/52 aka AC-3 aka Dolby Digital stream, +# fscod +>4 byte&0xc0 0x00 48 kHz, +>4 byte&0xc0 0x40 44.1 kHz, +>4 byte&0xc0 0x80 32 kHz, +# is this one used for 96 kHz? +>4 byte&0xc0 0xc0 reserved frequency, +# +>5 byte&7 = 0 \b, complete main (CM) +>5 byte&7 = 1 \b, music and effects (ME) +>5 byte&7 = 2 \b, visually impaired (VI) +>5 byte&7 = 3 \b, hearing impaired (HI) +>5 byte&7 = 4 \b, dialogue (D) +>5 byte&7 = 5 \b, commentary (C) +>5 byte&7 = 6 \b, emergency (E) +# acmod +>6 byte&0xe0 0x00 1+1 front, +>6 byte&0xe0 0x20 1 front/0 rear, +>6 byte&0xe0 0x40 2 front/0 rear, +>6 byte&0xe0 0x60 3 front/0 rear, +>6 byte&0xe0 0x80 2 front/1 rear, +>6 byte&0xe0 0xa0 3 front/1 rear, +>6 byte&0xe0 0xc0 2 front/2 rear, +>6 byte&0xe0 0xe0 3 front/2 rear, +# lfeon (these may be incorrect) +>7 byte&0x40 0x00 LFE off, +>7 byte&0x40 0x40 LFE on, +# +>4 byte&0x3e = 0x00 \b, 32 kbit/s +>4 byte&0x3e = 0x02 \b, 40 kbit/s +>4 byte&0x3e = 0x04 \b, 48 kbit/s +>4 byte&0x3e = 0x06 \b, 56 kbit/s +>4 byte&0x3e = 0x08 \b, 64 kbit/s +>4 byte&0x3e = 0x0a \b, 80 kbit/s +>4 byte&0x3e = 0x0c \b, 96 kbit/s +>4 byte&0x3e = 0x0e \b, 112 kbit/s +>4 byte&0x3e = 0x10 \b, 128 kbit/s +>4 byte&0x3e = 0x12 \b, 160 kbit/s +>4 byte&0x3e = 0x14 \b, 192 kbit/s +>4 byte&0x3e = 0x16 \b, 224 kbit/s +>4 byte&0x3e = 0x18 \b, 256 kbit/s +>4 byte&0x3e = 0x1a \b, 320 kbit/s +>4 byte&0x3e = 0x1c \b, 384 kbit/s +>4 byte&0x3e = 0x1e \b, 448 kbit/s +>4 byte&0x3e = 0x20 \b, 512 kbit/s +>4 byte&0x3e = 0x22 \b, 576 kbit/s +>4 byte&0x3e = 0x24 \b, 640 kbit/s +# dsurmod (these may be incorrect) +>6 beshort&0x0180 0x0000 Dolby Surround not indicated +>6 beshort&0x0180 0x0080 not Dolby Surround encoded +>6 beshort&0x0180 0x0100 Dolby Surround encoded +>6 beshort&0x0180 0x0180 reserved Dolby Surround mode diff --git a/usr.bin/file/magdir/editors b/usr.bin/file/magdir/editors index c529d0dfab88..7edbe8bc6b64 100644 --- a/usr.bin/file/magdir/editors +++ b/usr.bin/file/magdir/editors @@ -7,3 +7,7 @@ >4 string 1 CP 852 >4 string 2 KOI8-CS >4 string >2 unknown encoding + +# Vi IMproved Encrypted file +# by David Necas +0 string VimCrypt~ Vim encrypted file data diff --git a/usr.bin/file/magdir/gringotts b/usr.bin/file/magdir/gringotts new file mode 100644 index 000000000000..2d135f8fc893 --- /dev/null +++ b/usr.bin/file/magdir/gringotts @@ -0,0 +1,25 @@ + +#------------------------------------------------------------------------------ +# gringotts: file(1) magic for Gringotts +# http://devel.pluto.linux.it/projects/Gringotts/ +# author: Germano Rizzo +#GRG2????Y +0 string GRG Gringotts data file +>3 string 1 v.1, SERPENT crypt, SHA-256 hash, ZLib lvl.9 +>3 string 2 v.2, +>>8 byte&0x70 0x00 RIJNDAEL-128 crypt, +>>8 byte&0x70 0x10 SERPENT crypt, +>>8 byte&0x70 0x20 TWOFISH crypt, +>>8 byte&0x70 0x30 CAST-256 crypt, +>>8 byte&0x70 0x40 SAFER+ crypt, +>>8 byte&0x70 0x50 LOKI97 crypt, +>>8 byte&0x70 0x60 3DES crypt, +>>8 byte&0x70 0x70 RIJNDAEL-256 crypt, +>>8 byte&0x08 0x00 SHA1 hash, +>>8 byte&0x08 0x08 RIPEMD-160 hash, +>>8 byte&0x04 0x00 ZLib +>>8 byte&0x04 0x04 BZip2 +>>8 byte&0x03 0x00 lvl.0 +>>8 byte&0x03 0x01 lvl.3 +>>8 byte&0x03 0x02 lvl.6 +>>8 byte&0x03 0x03 lvl.9 diff --git a/usr.bin/file/magdir/mcrypt b/usr.bin/file/magdir/mcrypt index 6416104da46d..e862f59d7494 100644 --- a/usr.bin/file/magdir/mcrypt +++ b/usr.bin/file/magdir/mcrypt @@ -1,31 +1,36 @@ #------------------------------------------------------------------------------ # Mavroyanopoulos Nikos # mcrypt: file(1) magic for mcrypt 2.2.x; -0 string \0m\2 mcrypt 2.2 encrypted data, ->3 byte 0 algorithm: blowfish-448, ->3 byte 1 algorithm: DES, ->3 byte 2 algorithm: 3DES, ->3 byte 3 algorithm: 3-WAY, ->3 byte 4 algorithm: GOST, ->3 byte 6 algorithm: SAFER-SK64, ->3 byte 7 algorithm: SAFER-SK128, ->3 byte 8 algorithm: CAST-128, ->3 byte 9 algorithm: xTEA, ->3 byte 10 algorithm: TWOFISH-128, ->3 byte 11 algorithm: RC2, ->3 byte 12 algorithm: TWOFISH-192, ->3 byte 13 algorithm: TWOFISH-256, ->3 byte 14 algorithm: blowfish-128, ->3 byte 15 algorithm: blowfish-192, ->3 byte 16 algorithm: blowfish-256, ->3 byte 100 algorithm: RC6, ->3 byte 101 algorithm: IDEA, ->4 byte 0 mode: CBC, ->4 byte 1 mode: ECB, ->4 byte 2 mode: CFB, ->4 byte 3 mode: OFB, ->4 byte 4 mode: nOFB, ->5 byte 0 keymode: 8bit ->5 byte 1 keymode: 4bit ->5 byte 2 keymode: SHA-1 hash ->5 byte 3 keymode: MD5 hash +0 string \0m\3 mcrypt 2.5 encrypted data, +>4 string >\0 algorithm: %s, +>>&1 leshort >0 keysize: %d bytes, +>>>&0 string >\0 mode: %s, + +0 string \0m\2 mcrypt 2.2 encrypted data, +>3 byte 0 algorithm: blowfish-448, +>3 byte 1 algorithm: DES, +>3 byte 2 algorithm: 3DES, +>3 byte 3 algorithm: 3-WAY, +>3 byte 4 algorithm: GOST, +>3 byte 6 algorithm: SAFER-SK64, +>3 byte 7 algorithm: SAFER-SK128, +>3 byte 8 algorithm: CAST-128, +>3 byte 9 algorithm: xTEA, +>3 byte 10 algorithm: TWOFISH-128, +>3 byte 11 algorithm: RC2, +>3 byte 12 algorithm: TWOFISH-192, +>3 byte 13 algorithm: TWOFISH-256, +>3 byte 14 algorithm: blowfish-128, +>3 byte 15 algorithm: blowfish-192, +>3 byte 16 algorithm: blowfish-256, +>3 byte 100 algorithm: RC6, +>3 byte 101 algorithm: IDEA, +>4 byte 0 mode: CBC, +>4 byte 1 mode: ECB, +>4 byte 2 mode: CFB, +>4 byte 3 mode: OFB, +>4 byte 4 mode: nOFB, +>5 byte 0 keymode: 8bit +>5 byte 1 keymode: 4bit +>5 byte 2 keymode: SHA-1 hash +>5 byte 3 keymode: MD5 hash diff --git a/usr.bin/file/magdir/nitpicker b/usr.bin/file/magdir/nitpicker new file mode 100644 index 000000000000..c40daecef3ca --- /dev/null +++ b/usr.bin/file/magdir/nitpicker @@ -0,0 +1,12 @@ +#------------------------------------------------------------------------------ +# nitpicker: file(1) magic for Flowfiles. +# From: Christian Jachmann http://www.nitpicker.de +0 string NPFF NItpicker Flow File +>4 byte x V%d. +>5 byte x %d +>6 bedate x started: %s +>10 bedate x stopped: %s +>14 belong x Bytes: %u +>18 belong x Bytes1: %u +>22 belong x Flows: %u +>26 belong x Pkts: %u diff --git a/usr.bin/file/magdir/perl b/usr.bin/file/magdir/perl new file mode 100644 index 000000000000..28b608667f13 --- /dev/null +++ b/usr.bin/file/magdir/perl @@ -0,0 +1,18 @@ + +#------------------------------------------------------------------------------ +# perl: file(1) magic for Larry Wall's perl language. +# +# The ``eval'' line recognizes an outrageously clever hack for USG systems. +# Keith Waclena +# Send additions to +0 string/b #!\ /bin/perl perl script text executable +0 string eval\ "exec\ /bin/perl perl script text +0 string/b #!\ /usr/bin/perl perl script text executable +0 string eval\ "exec\ /usr/bin/perl perl script text +0 string/b #!\ /usr/local/bin/perl perl script text +0 string eval\ "exec\ /usr/local/bin/perl perl script text executable + +# a couple more, by me +# XXX: christos matches +#0 regex package Perl5 module source text (via regex) +0 string package Perl5 module source text diff --git a/usr.bin/file/magdir/pulsar b/usr.bin/file/magdir/pulsar new file mode 100644 index 000000000000..cb9cac6fb751 --- /dev/null +++ b/usr.bin/file/magdir/pulsar @@ -0,0 +1,10 @@ +#------------------------------------------------------------------------------ +# pulsar: file(1) magic for Pulsar POP3 daemon binary files +# +# http://pulsar.sourceforge.net +# mailto:rok.papez@lugos.si +# + +0 belong 0x1ee7f11e Pulsar POP3 daemon mailbox cache file. +>4 ubelong x Version: %d. +>8 ubelong x \b%d diff --git a/usr.bin/file/magdir/tgif b/usr.bin/file/magdir/tgif new file mode 100644 index 000000000000..a6ffe368161a --- /dev/null +++ b/usr.bin/file/magdir/tgif @@ -0,0 +1,6 @@ +#------------------------------------------------------------------------------ +# file(1) magic for tgif(1) files +# From Hendrik Scholz + +0 string %TGIF\ 4 tgif version 4 object file + diff --git a/usr.bin/file/magdir/vorbis b/usr.bin/file/magdir/vorbis index 6e4efadc21ee..5e4084285325 100644 --- a/usr.bin/file/magdir/vorbis +++ b/usr.bin/file/magdir/vorbis @@ -4,6 +4,7 @@ # # From Felix von Leitner # Extended by Beni Cherniavsky +# Further extended by Greg Wooledge # # Most (everything but the number of channels and bitrate) is commented # out with `##' as it's not interesting to the average user. The most @@ -29,34 +30,44 @@ >>>>48 string <\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff \b, # The above tests if at least one of these is specified: >>>>>44 lelong !-1 ->>>>>>44 lelong x >%lu +# Vorbis RC2 has a bug which puts -1000 in the min/max bitrate fields +# instead of -1. +>>>>>>44 lelong !-1000 +>>>>>>>44 lelong x >%lu >>>>>48 lelong !-1 >>>>>>48 lelong x ~%lu >>>>>52 lelong !-1 ->>>>>>52 lelong x <%lu +>>>>>>52 lelong !-1000 +>>>>>>>52 lelong x <%lu >>>>>48 string <\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff kbps # -- Second vorbis header packet - the comments ->>>102 string \x03vorbis # A kludge to read the vendor string. It's a counted string, not a # zero-terminated one, so file(1) can't read it in a generic way. # libVorbis is the only one existing currently, so I detect specifically # it. The interesting value is the cvs date (8 digits decimal). -##>>>>113 string/c Xiphophorus\ libVorbis\ I \b, created by: Xiphophorus libVorbis I -##>>>>>137 string >00000000 %.8s +# Post-RC1 Ogg files have the second header packet (and thus the version) +# in a different place, so we must use an indirect offset. +>>>(84.b+85) string \x03vorbis +>>>>(84.b+96) string/c Xiphophorus\ libVorbis\ I \b, created by: Xiphophorus libVorbis I +>>>>>(84.b+120) string >00000000 %.8s # Map to beta version numbers: -##>>>>>>137 string <20000508 (>>>>>(84.b+120) string <20000508 (>>>>>(84.b+120) string 20000508 (beta1/2) +>>>>>>(84.b+120) string >20000508 +>>>>>>>(84.b+120) string <20001031 (beta2-3) +>>>>>>(84.b+120) string 20001031 (beta3) +>>>>>>(84.b+120) string >20001031 +>>>>>>>(84.b+120) string <20010225 (beta3-4) +>>>>>>(84.b+120) string 20010225 (beta4) +>>>>>>(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 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) # The string has not changed from beta1 to 2 - they are indistinguishable. -##>>>>>>137 string 20000508 (beta1/2) -##>>>>>>137 string >20000508 -##>>>>>>>137 string <20001031 (beta2-3) -##>>>>>>137 string 20001031 (beta3) -##>>>>>>137 string >20001031 -##>>>>>>>137 string <20010225 (beta3-4) -##>>>>>>137 string 20010225 (beta4) -##>>>>>>137 string >20010225 -##>>>>>>>137 string <20010615 (beta4-RC1) -##>>>>>>137 string 20010615 (RC1) -##>>>>>>137 string >20010615 (>RC1) # Then come the comments, again length-counted (and number-counted). # Some looping constructs and registers would allow reading them but now # it's impossible. However we can print the number of comments present diff --git a/usr.bin/file/magdir/vxl b/usr.bin/file/magdir/vxl new file mode 100644 index 000000000000..d3f55619ebb7 --- /dev/null +++ b/usr.bin/file/magdir/vxl @@ -0,0 +1,13 @@ + +#------------------------------------------------------------------------------ +# VXL: file(1) magic for VXL binary IO data files +# +# from Ian Scott +# +# VXL is a collection of C++ libraries for Computer Vision. +# See the vsl chapter in the VXL Book for more info +# http://www.isbe.man.ac.uk/public_vxl_doc/books/vxl/book.html +# http:/vxl.sf.net + +2 lelong 0x472b2c4e VXL data file, +>0 leshort >0 schema version no %d diff --git a/usr.bin/file/magic.mime.in b/usr.bin/file/magic.mime.in index 5773a552e3a7..a7e7941d3664 100644 --- a/usr.bin/file/magic.mime.in +++ b/usr.bin/file/magic.mime.in @@ -1,5 +1,4 @@ -# $NetBSD: magic.mime.in,v 1.1 2002/03/24 22:13:00 thorpej Exp $ -# +$NetBSD: magic.mime.in,v 1.1.1.1 2002/05/18 06:45:50 pooka Exp $ # Magic data for KMimeMagic (originally for file(1) command) # # The format is 4-5 columns: @@ -96,10 +95,9 @@ 0 belong 0x2e7261fd application/x-realaudio # MPEG Layer 3 sound files -# Modified the 11/20/97 at 15:59:04 by Christophe Prud'homme -0 belong 0xfffb audio/x-mp3 +0 beshort &0xffe0 audio/mpeg #MP3 with ID3 tag -0 string ID3 audio/x-mp3 +0 string ID3 audio/mpeg # Ogg/Vorbis 0 string OggS audio/x-ogg @@ -543,3 +541,6 @@ #PNG Image Format 0 string \x89PNG image/png + +# MNG Video Format, +0 string \x8aMNG video/x-mng