MFV r323678: file 5.32

Approved by:	emaste (mentor)
MFC after:	2 weeks
Differential Revision:	https://reviews.freebsd.org/D12400
This commit is contained in:
Gordon Tetlow 2017-09-17 19:14:38 +00:00
commit 40427cca7a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=323683
146 changed files with 3244 additions and 1861 deletions

View file

@ -1,6 +1,60 @@
2017-09-02 11:53 Christos Zoulas <christos@zoulas.com>
* release 5.32
2017-08-28 16:37 Christos Zoulas <christos@zoulas.com>
* Always reset state in {file,buffer}_apprentice (Krzysztof Wilczynski)
2017-08-27 03:55 Christos Zoulas <christos@zoulas.com>
* Fix always true condition (Thomas Jarosch)
2017-05-24 17:30 Christos Zoulas <christos@zoulas.com>
* pickier parsing of numeric values in magic files.
2017-05-23 17:55 Christos Zoulas <christos@zoulas.com>
* PR/615 add magic_getflags()
2017-05-23 13:55 Christos Zoulas <christos@zoulas.com>
* release 5.31
2017-03-17 20:32 Christos Zoulas <christos@zoulas.com>
* remove trailing spaces from magic files
* refactor is_tar
* better bounds checks for cdf
2017-02-10 12:24 Christos Zoulas <christos@zoulas.com>
* release 5.30
2017-02-07 23:27 Christos Zoulas <christos@zoulas.com>
* If we exceeded the offset in a search return no match
(Christoph Biedl)
* Be more lenient on corrupt CDF files (Christoph Biedl)
2017-02-04 16:46 Christos Zoulas <christos@zoulas.com>
* pacify ubsan sign extension (oss-fuzz/524)
2017-02-01 12:42 Christos Zoulas <christos@zoulas.com>
* off by one in cdf parsing (PR/593)
* report debugging sections in elf (PR/591)
2016-11-06 10:52 Christos Zoulas <christos@zoulas.com>
* Allow @@@ in extensions
* Add missing overflow check in der magic (Jonas Wagner)
2016-10-25 10:40 Christos Zoulas <christos@zoulas.com>
* release 5.28
* release 5.29
2016-10-24 11:20 Christos Zoulas <christos@zoulas.com>
@ -387,7 +441,7 @@
`
2013-11-06 14:40 Christos Zoulas <christos@zoulas.com>
* fix erroneous non-zero exit code from non-existant file and message
* fix erroneous non-zero exit code from non-existent file and message
2013-10-29 14:25 Christos Zoulas <christos@zoulas.com>

View file

@ -21,7 +21,7 @@ If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically 'autoreconf'.])])
# visibility.m4 serial 5 (gettext-0.18.2)
dnl Copyright (C) 2005, 2008, 2010-2014 Free Software Foundation, Inc.
dnl Copyright (C) 2005, 2008, 2010-2016 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.

View file

@ -1,8 +1,8 @@
#! /bin/sh
# Attempt to guess a canonical system name.
# Copyright 1992-2015 Free Software Foundation, Inc.
# Copyright 1992-2017 Free Software Foundation, Inc.
timestamp='2015-03-04'
timestamp='2017-01-01'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -27,7 +27,7 @@ timestamp='2015-03-04'
# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
#
# Please send patches to <config-patches@gnu.org>.
@ -50,7 +50,7 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright 1992-2015 Free Software Foundation, Inc.
Copyright 1992-2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -186,9 +186,12 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently, or will in the future.
# to ELF recently (or will in the future) and ABI.
case "${UNAME_MACHINE_ARCH}" in
arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
earm*)
os=netbsdelf
;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
@ -221,7 +224,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
release='-gnu'
;;
*)
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
@ -237,6 +240,10 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
exit ;;
*:LibertyBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-libertybsd${UNAME_RELEASE}
exit ;;
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;;
@ -249,6 +256,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit ;;
*:Sortix:*:*)
echo ${UNAME_MACHINE}-unknown-sortix
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
@ -265,42 +275,42 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
UNAME_MACHINE="alpha" ;;
UNAME_MACHINE=alpha ;;
"EV4.5 (21064)")
UNAME_MACHINE="alpha" ;;
UNAME_MACHINE=alpha ;;
"LCA4 (21066/21068)")
UNAME_MACHINE="alpha" ;;
UNAME_MACHINE=alpha ;;
"EV5 (21164)")
UNAME_MACHINE="alphaev5" ;;
UNAME_MACHINE=alphaev5 ;;
"EV5.6 (21164A)")
UNAME_MACHINE="alphaev56" ;;
UNAME_MACHINE=alphaev56 ;;
"EV5.6 (21164PC)")
UNAME_MACHINE="alphapca56" ;;
UNAME_MACHINE=alphapca56 ;;
"EV5.7 (21164PC)")
UNAME_MACHINE="alphapca57" ;;
UNAME_MACHINE=alphapca57 ;;
"EV6 (21264)")
UNAME_MACHINE="alphaev6" ;;
UNAME_MACHINE=alphaev6 ;;
"EV6.7 (21264A)")
UNAME_MACHINE="alphaev67" ;;
UNAME_MACHINE=alphaev67 ;;
"EV6.8CB (21264C)")
UNAME_MACHINE="alphaev68" ;;
UNAME_MACHINE=alphaev68 ;;
"EV6.8AL (21264B)")
UNAME_MACHINE="alphaev68" ;;
UNAME_MACHINE=alphaev68 ;;
"EV6.8CX (21264D)")
UNAME_MACHINE="alphaev68" ;;
UNAME_MACHINE=alphaev68 ;;
"EV6.9A (21264/EV69A)")
UNAME_MACHINE="alphaev69" ;;
UNAME_MACHINE=alphaev69 ;;
"EV7 (21364)")
UNAME_MACHINE="alphaev7" ;;
UNAME_MACHINE=alphaev7 ;;
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
UNAME_MACHINE=alphaev79 ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
@ -373,16 +383,16 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval $set_cc_for_build
SUN_ARCH="i386"
SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
SUN_ARCH="x86_64"
SUN_ARCH=x86_64
fi
fi
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
@ -407,7 +417,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
test "x${UNAME_RELEASE}" = x && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos${UNAME_RELEASE}
@ -632,13 +642,13 @@ EOF
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
32) HP_ARCH=hppa2.0n ;;
64) HP_ARCH=hppa2.0w ;;
'') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
esac ;;
esac
fi
@ -677,11 +687,11 @@ EOF
exit (0);
}
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
(CCOPTS="" $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
if [ ${HP_ARCH} = "hppa2.0w" ]
if [ ${HP_ARCH} = hppa2.0w ]
then
eval $set_cc_for_build
@ -694,12 +704,12 @@ EOF
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__
then
HP_ARCH="hppa2.0w"
HP_ARCH=hppa2.0w
else
HP_ARCH="hppa64"
HP_ARCH=hppa64
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
@ -804,14 +814,14 @@ EOF
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
@ -893,7 +903,7 @@ EOF
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC}
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
@ -916,7 +926,7 @@ EOF
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC="gnulibc1" ; fi
if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
arc:Linux:*:* | arceb:Linux:*:*)
@ -962,6 +972,9 @@ EOF
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
k1om:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
@ -987,6 +1000,9 @@ EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
mips64el:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
openrisc*:Linux:*:*)
echo or1k-unknown-linux-${LIBC}
exit ;;
@ -1019,6 +1035,9 @@ EOF
ppcle:Linux:*:*)
echo powerpcle-unknown-linux-${LIBC}
exit ;;
riscv32:Linux:*:* | riscv64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
exit ;;
@ -1038,7 +1057,7 @@ EOF
echo ${UNAME_MACHINE}-dec-linux-${LIBC}
exit ;;
x86_64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
echo ${UNAME_MACHINE}-pc-linux-${LIBC}
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
@ -1117,7 +1136,7 @@ EOF
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configury will decide that
# prints for the "djgpp" host, or else GDB configure will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
exit ;;
@ -1266,6 +1285,9 @@ EOF
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
SX-ACE:SUPER-UX:*:*)
echo sxace-nec-superux${UNAME_RELEASE}
exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
@ -1279,9 +1301,9 @@ EOF
UNAME_PROCESSOR=powerpc
fi
if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
(CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
@ -1303,7 +1325,7 @@ EOF
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
if test "$UNAME_PROCESSOR" = x86; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
@ -1334,7 +1356,7 @@ EOF
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
if test "$cputype" = "386"; then
if test "$cputype" = 386; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
@ -1376,7 +1398,7 @@ EOF
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE} | sed -e 's/ .*$//'`
exit ;;
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
@ -1387,23 +1409,25 @@ EOF
x86_64:VMkernel:*:*)
echo ${UNAME_MACHINE}-unknown-esx
exit ;;
amd64:Isilon\ OneFS:*:*)
echo x86_64-unknown-onefs
exit ;;
esac
cat >&2 <<EOF
$0: unable to guess system type
This script, last modified $timestamp, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
This script (version $timestamp), has failed to recognize the
operating system you are using. If your script is old, overwrite
config.guess and config.sub with the latest versions from:
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess
and
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
If the version you run ($0) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
If $0 has already been updated, send the following data and any
information you think might be pertinent to config-patches@gnu.org to
provide the necessary information to handle your system.
config.guess timestamp = $timestamp

View file

@ -1,8 +1,8 @@
#! /bin/sh
# Configuration validation subroutine script.
# Copyright 1992-2015 Free Software Foundation, Inc.
# Copyright 1992-2017 Free Software Foundation, Inc.
timestamp='2015-03-08'
timestamp='2017-01-01'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@ -33,7 +33,7 @@ timestamp='2015-03-08'
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
@ -53,8 +53,7 @@ timestamp='2015-03-08'
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION] CPU-MFR-OPSYS
$0 [OPTION] ALIAS
Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
Canonicalize a configuration name.
@ -68,7 +67,7 @@ Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright 1992-2015 Free Software Foundation, Inc.
Copyright 1992-2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@ -118,7 +117,7 @@ case $maybe_os in
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
kopensolaris*-gnu* | \
kopensolaris*-gnu* | cloudabi*-eabi* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
@ -255,6 +254,7 @@ case $basic_machine in
| arc | arceb \
| arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
| avr | avr32 \
| ba \
| be32 | be64 \
| bfin \
| c4x | c8051 | clipper \
@ -301,11 +301,12 @@ case $basic_machine in
| open8 | or1k | or1knd | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
| pru \
| pyramid \
| riscv32 | riscv64 \
| rl78 | rx \
| score \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
| sh64 | sh64le \
| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
@ -376,6 +377,7 @@ case $basic_machine in
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
| arm-* | armbe-* | armle-* | armeb-* | armv*-* \
| avr-* | avr32-* \
| ba-* \
| be32-* | be64-* \
| bfin-* | bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c4x-* \
@ -427,13 +429,15 @@ case $basic_machine in
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
| pru-* \
| pyramid-* \
| riscv32-* | riscv64-* \
| rl78-* | romp-* | rs6000-* | rx-* \
| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
| sparclite-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
| tahoe-* \
| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
| tile*-* \
@ -641,6 +645,14 @@ case $basic_machine in
basic_machine=m68k-bull
os=-sysv3
;;
e500v[12])
basic_machine=powerpc-unknown
os=$os"spe"
;;
e500v[12]-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
os=$os"spe"
;;
ebmon29k)
basic_machine=a29k-amd
os=-ebmon
@ -1020,7 +1032,7 @@ case $basic_machine in
ppc-* | ppcbe-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppcle | powerpclittle | ppc-le | powerpc-little)
ppcle | powerpclittle)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
@ -1030,7 +1042,7 @@ case $basic_machine in
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
ppc64le | powerpc64little | ppc64-le | powerpc64-little)
ppc64le | powerpc64little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
@ -1376,18 +1388,18 @@ case $os in
| -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
| -sym* | -kopensolaris* | -plan9* \
| -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
| -aos* | -aros* | -cloudabi* \
| -aos* | -aros* | -cloudabi* | -sortix* \
| -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
| -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
| -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
| -bitrig* | -openbsd* | -solidbsd* \
| -bitrig* | -openbsd* | -solidbsd* | -libertybsd* \
| -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -chorusos* | -chorusrdb* | -cegcc* \
| -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
| -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \
| -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
@ -1396,7 +1408,8 @@ case $os in
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
| -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@ -1528,6 +1541,8 @@ case $os in
;;
-nacl*)
;;
-ios)
;;
-none)
;;
*)
@ -1623,6 +1638,9 @@ case $basic_machine in
sparc-* | *-sun)
os=-sunos4.1.1
;;
pru-*)
os=-elf
;;
*-be)
os=-beos
;;

View file

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for file 5.29.
# Generated by GNU Autoconf 2.69 for file 5.32.
#
# Report bugs to <christos@astron.com>.
#
@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='file'
PACKAGE_TARNAME='file'
PACKAGE_VERSION='5.29'
PACKAGE_STRING='file 5.29'
PACKAGE_VERSION='5.32'
PACKAGE_STRING='file 5.32'
PACKAGE_BUGREPORT='christos@astron.com'
PACKAGE_URL=''
@ -1328,7 +1328,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures file 5.29 to adapt to many kinds of systems.
\`configure' configures file 5.32 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1398,7 +1398,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of file 5.29:";;
short | recursive ) echo "Configuration of file 5.32:";;
esac
cat <<\_ACEOF
@ -1509,7 +1509,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
file configure 5.29
file configure 5.32
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -2165,7 +2165,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by file $as_me 5.29, which was
It was created by file $as_me 5.32, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -3031,7 +3031,7 @@ fi
# Define the identity of the package.
PACKAGE='file'
VERSION='5.29'
VERSION='5.32'
cat >>confdefs.h <<_ACEOF
@ -15075,7 +15075,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by file $as_me 5.29, which was
This file was extended by file $as_me 5.32, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -15141,7 +15141,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
file config.status 5.29
file config.status 5.32
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View file

@ -1,5 +1,5 @@
dnl Process this file with autoconf to produce a configure script.
AC_INIT([file],[5.29],[christos@astron.com])
AC_INIT([file],[5.32],[christos@astron.com])
AM_INIT_AUTOMAKE([subdir-objects foreign])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

View file

@ -1,4 +1,4 @@
.\" $File: file.man,v 1.124 2016/10/19 20:52:45 christos Exp $
.\" $File: file.man,v 1.125 2017/01/03 11:24:46 christos Exp $
.Dd October 19, 2016
.Dt FILE __CSECTION__
.Os
@ -411,10 +411,10 @@ and
.Fl h
options.
.Sh SEE ALSO
.Xr magic __FSECTION__ ,
.Xr hexdump 1 ,
.Xr od 1 ,
.Xr strings 1 ,
.Xr magic __FSECTION__ ,
.Xr fstyp 8
.Sh STANDARDS CONFORMANCE
This program is believed to exceed the System V Interface Definition
@ -531,7 +531,7 @@ John Gilmore revised the code extensively, making it better than
the first version.
Geoff Collyer found several inadequacies
and provided some magic file entries.
Contributions by the
Contributions of the
.Sq \*[Am]
operator by Rob McMahon,
.Aq cudcv@warwick.ac.uk ,
@ -540,7 +540,6 @@ operator by Rob McMahon,
Guy Harris,
.Aq guy@netapp.com ,
made many changes from 1993 to the present.
1989.
.Pp
Primary development and maintenance from 1990 to the present by
Christos Zoulas
@ -588,7 +587,6 @@ program, and are not covered by the above license.
.Nm
returns 0 on success, and non-zero on error.
.Sh BUGS
.Pp
Please report bugs and send patches to the bug tracker at
.Pa http://bugs.gw.com/
or the mailing list at
@ -597,7 +595,6 @@ or the mailing list at
.Pa http://mx.gw.com/mailman/listinfo/file
first to subscribe).
.Sh TODO
.Pp
Fix output so that tests for MIME and APPLE flags are not needed all
over the place, and actual output is only done in one place.
This needs a design.

View file

@ -1,4 +1,4 @@
.\" $File: libmagic.man,v 1.40 2016/03/31 17:51:12 christos Exp $
.\" $File: libmagic.man,v 1.41 2017/05/23 21:54:07 christos Exp $
.\"
.\" Copyright (c) Christos Zoulas 2003.
.\" All Rights Reserved.
@ -25,7 +25,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.Dd September 11, 2015
.Dd May 23, 2017
.Dt LIBMAGIC 3
.Os
.Sh NAME
@ -35,6 +35,7 @@
.Nm magic_errno ,
.Nm magic_descriptor ,
.Nm magic_buffer ,
.Nm magic_getflags ,
.Nm magic_setflags ,
.Nm magic_check ,
.Nm magic_compile ,
@ -64,6 +65,8 @@
.Ft const char *
.Fn magic_buffer "magic_t cookie" "const void *buffer" "size_t length"
.Ft int
.Fn magic_getflags "magic_t cookie"
.Ft int
.Fn magic_setflags "magic_t cookie" "int flags"
.Ft int
.Fn magic_check "magic_t cookie" "const char *filename"
@ -206,6 +209,12 @@ argument with
bytes size.
.Pp
The
.Fn magic_getflags
functions returns a value representing current
.Ar flags
set.
.Pp
The
.Fn magic_setflags
function sets the
.Ar flags

View file

@ -1,5 +1,5 @@
.\" $File: magic.man,v 1.88 2016/07/27 09:42:49 rrt Exp $
.Dd July 20, 2016
.\" $File: magic.man,v 1.91 2017/02/12 15:30:08 christos Exp $
.Dd February 12, 2017
.Dt MAGIC __FSECTION__
.Os
.\" install as magic.4 on USG, magic.5 on V7, Berkeley and Linux systems.
@ -7,7 +7,7 @@
.Nm magic
.Nd file command's magic pattern file
.Sh DESCRIPTION
This manual page documents the format of the magic file as
This manual page documents the format of magic files as
used by the
.Xr file __CSECTION__
command, version __VERSION__.
@ -17,13 +17,19 @@ command identifies the type of a file using,
among other tests,
a test for whether the file contains certain
.Dq "magic patterns" .
The file
.Pa __MAGIC__
specifies what patterns are to be tested for, what message or
The database of these
.Dq "magic patterns"
is usually located in a binary file in
.Pa __MAGIC__.mgc
or a directory of source text magic pattern fragment files in
.Pa __MAGIC__ .
The database specifies what patterns are to be tested for, what message or
MIME type to print if a particular pattern is found,
and additional information to extract from the file.
.Pp
Each line of the file specifies a test to be performed.
The format of the source fragment files that are used to build this database
is as follows:
Each line of a fragment file specifies a test to be performed.
A test compares the data starting at a particular offset
in the file with a byte value, a string or a numeric value.
If the test succeeds, a message is printed.
@ -98,13 +104,13 @@ The following modifiers are supported:
.It B
A byte length (default).
.It H
A 2 byte big endian length.
.It h
A 2 byte big little length.
.It L
A 4 byte big endian length.
.It h
A 2 byte big endian length.
.It L
A 4 byte little endian length.
.It l
A 4 byte big little length.
A 2 byte little endian length.
.It J
The length includes itself in its count.
.El
@ -651,7 +657,7 @@ start of the main indirect offset.
\*[Gt]\*[Gt]\*[Gt]\*[Gt](\*[Am]0xe.l+(-4)) string PK\e3\e4 \eb, ZIP self-extracting archive
.Ed
.Pp
If you have a list of known avalues at a particular continuation level,
If you have a list of known values at a particular continuation level,
and you want to provide a switch-like default case:
.Bd -literal -offset indent
# clear that continuation level match

View file

@ -2,6 +2,6 @@
#------------------------------------------------------------------------------
# Localstuff: file(1) magic for locally observed files
#
# $File: Localstuff,v 1.4 2003/03/23 04:17:27 christos Exp $
# $File: Localstuff,v 1.5 2007/01/12 17:38:27 christos Exp $
# Add any locally observed files here. Remember:
# text if readable, executable if runnable binary, data if unreadable.

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: adventure,v 1.15 2015/09/07 10:03:21 christos Exp $
# $File: adventure,v 1.17 2017/07/03 16:03:40 christos Exp $
# adventure: file(1) magic for Adventure game files
#
# from Allen Garvin <earendil@faeryland.tamu-commerce.edu>
@ -36,11 +36,12 @@
>0 ubyte <9
>>16 belong&0xfe00f0f0 0x3030
>>>0 ubyte < 10
>>>>2 ubeshort < 10
>>>>2 ubeshort x
>>>>>18 regex [0-9][0-9][0-9][0-9][0-9][0-9]
>>>>>>0 ubyte < 10 Infocom (Z-machine %d,
>>>>>>>2 ubeshort < 10 Release %d /
>>>>>>>>18 string >\0 Serial %.6s)
>>>>>>0 ubyte < 10 Infocom (Z-machine %d
>>>>>>>2 ubeshort x \b, Release %d
>>>>>>>>18 string >\0 \b, Serial %.6s
>>>>>>>>18 string x \b)
!:strength + 40
!:mime application/x-zmachine

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: amanda,v 1.5 2009/09/19 16:28:07 christos Exp $
# $File: amanda,v 1.6 2017/03/17 21:35:28 christos Exp $
# amanda: file(1) magic for amanda file format
#
0 string AMANDA:\ AMANDA

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: amigaos,v 1.15 2012/06/21 01:13:59 christos Exp $
# $File: amigaos,v 1.16 2017/03/17 21:35:28 christos Exp $
# amigaos: file(1) magic for AmigaOS binary formats:
#

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------
# $File: android,v 1.9 2016/01/11 21:19:18 christos Exp $
# $File: android,v 1.10 2017/03/17 21:35:28 christos Exp $
# Various android related magic entries
#------------------------------------------------------------

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: animation,v 1.58 2016/07/03 14:13:11 christos Exp $
# $File: animation,v 1.63 2017/05/26 14:33:07 christos Exp $
# animation: file(1) magic for animation/movie formats
#
# animation formats
@ -34,14 +34,23 @@
!:mime image/jp2
# http://www.ftyps.com/ with local additions
4 string ftyp ISO Media
# http://aeroquartet.com/wordpress/2016/03/05/3-xavc-s/
>8 string XAVC \b, MPEG v4 system, Sony XAVC Codec
>>96 string x \b, Audio "%.4s"
>>118 beshort x at %dHz
>>140 string x \b, Video "%.4s"
>>168 beshort x %d
>>170 beshort x \bx%d
>8 string 3g2 \b, MPEG v4 system, 3GPP2
!:mime video/3gpp2
>>11 byte 4 \b v4 (H.263/AMR GSM 6.10)
>>11 byte 5 \b v5 (H.263/AMR GSM 6.10)
>>11 byte 6 \b v6 (ITU H.264/AMR GSM 6.10)
>>11 byte a \b C.S0050-0 V1.0
>>11 byte b \b C.S0050-0-A V1.0.0
>>11 byte c \b C.S0050-0-B V1.0
# http://www.3gpp2.org/Public_html/Specs/C.S0050-B_v1.0_070521.pdf
# Section 8.1.1, corresponds to a, b, c
>>11 byte 0x61 \b C.S0050-0 V1.0
>>11 byte 0x62 \b C.S0050-0-A V1.0.0
>>11 byte 0x63 \b C.S0050-0-B V1.0
>8 string 3ge \b, MPEG v4 system, 3GPP
!:mime video/3gpp
>>11 byte 6 \b, Release 6 MBMS Extended Presentations
@ -855,10 +864,12 @@
# X3D (Extensible 3D) [http://www.web3d.org/specifications/x3d-3.0.dtd]
# From Michel Briand <michelbriand@free.fr>
0 string/t \<?xml\ version="
!:strength +1
>20 search/1000/cw \<!DOCTYPE\ X3D X3D (Extensible 3D) model xml text
!:mime model/x3d
# mimetype from https://www.iana.org/assignments/media-types/model/x3d+xml
# Example http://www.web3d.org/x3d/content/examples/Basic/course/CreateX3DFromStringRandomSpheres.x3d
0 string/w \<?xml\ version=
!:strength + 5
>20 search/1000/w \<!DOCTYPE\ X3D X3D (Extensible 3D) model xml text
!:mime model/x3d+xml
#---------------------------------------------------------------------------
# HVQM4: compressed movie format designed by Hudson for Nintendo GameCube

View file

@ -0,0 +1,28 @@
#------------------------------------------------------------------------------
# $File: apache,v 1.1 2017/04/11 14:52:15 christos Exp $
# apache: file(1) magic for Apache Big Data formats
# Avro files
0 string Obj Apache Avro
>3 byte x version %d
# ORC files
# Important information is in file footer, which we can't index to :(
0 string ORC Apache ORC
# Parquet files
0 string PAR1 Apache Parquet
# Hive RC files
0 string RCF Apache Hive RC file
>3 byte x version %d
# Sequence files (and the careless first version of RC file)
0 string SEQ
>3 byte <6 Apache Hadoop Sequence file version %d
>3 byte >6 Apache Hadoop Sequence file version %d
>3 byte =6
>>5 string org.apache.hadoop.hive.ql.io.RCFile$KeyBuffer Apache Hive RC file version 0
>>3 default x Apache Hadoop Sequence file version 6

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: apple,v 1.35 2016/08/17 09:45:13 christos Exp $
# $File: apple,v 1.36 2017/03/17 21:35:28 christos Exp $
# apple: file(1) magic for Apple file formats
#
0 search/1/t FiLeStArTfIlEsTaRt binscii (apple ][) text

View file

@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
# $File: archive,v 1.103 2016/05/05 17:07:40 christos Exp $
# $File: archive,v 1.108 2017/08/30 13:45:10 christos Exp $
# archive: file(1) magic for archive formats (see also "msdos" for self-
# extracting compressed archives)
#
@ -908,7 +908,17 @@
>>>4 byte 0x0a \b, at least v1.0 to extract
>>>4 byte 0x0b \b, at least v1.1 to extract
>>>4 byte 0x14 \b, at least v2.0 to extract
>>>4 byte 0x15 \b, at least v2.1 to extract
>>>4 byte 0x19 \b, at least v2.5 to extract
>>>4 byte 0x1b \b, at least v2.7 to extract
>>>4 byte 0x2d \b, at least v4.5 to extract
>>>4 byte 0x2e \b, at least v4.6 to extract
>>>4 byte 0x32 \b, at least v5.0 to extract
>>>4 byte 0x33 \b, at least v5.1 to extract
>>>4 byte 0x34 \b, at least v5.2 to extract
>>>4 byte 0x3d \b, at least v6.1 to extract
>>>4 byte 0x3e \b, at least v6.2 to extract
>>>4 byte 0x3f \b, at least v6.3 to extract
>>>0x161 string WINZIP \b, WinZIP self-extracting
# StarView Metafile
@ -1169,3 +1179,10 @@
0 string Cr24 Google Chrome extension
!:mime application/x-chrome-extension
>4 ulong x \b, version %u
# SeqBox - Sequenced container
# ext: sbx, seqbox
# Marco Pontello marcopon@gmail.com
# reference: https://github.com/MarcoPon/SeqBox
0 string SBx SeqBox,
>3 byte x version %d

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: att3b,v 1.9 2014/04/30 21:41:02 christos Exp $
# $File: att3b,v 1.10 2017/03/17 21:35:28 christos Exp $
# att3b: file(1) magic for AT&T 3B machines
#
# The `versions' should be un-commented if they work for you.

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: audio,v 1.75 2016/02/08 17:30:11 christos Exp $
# $File: audio,v 1.80 2017/08/13 00:21:47 christos Exp $
# audio: file(1) magic for sound formats (see also "iff")
#
# Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
@ -469,6 +469,8 @@
>>20 byte&0xe 0xc \b, 7 channels
>>20 byte&0xe 0xe \b, 8 channels
# some common sample rates
>>17 belong&0xfffff0 0x2ee000 \b, 192 kHz
>>17 belong&0xfffff0 0x158880 \b, 88.2 kHz
>>17 belong&0xfffff0 0x0ac440 \b, 44.1 kHz
>>17 belong&0xfffff0 0x0bb800 \b, 48 kHz
>>17 belong&0xfffff0 0x07d000 \b, 32 kHz
@ -658,7 +660,7 @@
# From Fabio R. Schmidlin <frs@pop.com.br>
# VGM music file
0 string Vgm\
0 string Vgm\040
>9 ubyte >0 VGM Video Game Music dump v
>>9 ubyte/16 >0 \b%d
>>9 ubyte&0x0F x \b%d
@ -743,7 +745,7 @@
# second of release (0-59)
>>9 ubyte x \b:%.2d
# if you select a language like german on your garmin device
# you can only select voice modules with correponding language byte ID like 1
# you can only select voice modules with corresponding language byte ID like 1
>>18 ubyte x \b, language ID %d
# pointer to 1st audio WAV sample
>>16 uleshort >0
@ -756,3 +758,55 @@
>>>>>>&-4 indirect x \b
# 2 - ~ 131 WAV samples following same way
# From Martin Mueller Skarbiniks Pedersen
0 string GDM
>0x3 byte 0xFE General Digital Music.
>0x4 string >\0 title: "%s"
>0x24 string >\0 musician: "%s"
>>0x44 beshort 0x0D0A
>>>0x46 byte 0x1A
>>>>0x47 string GMFS Version
>>>>0x4B byte x %d.
>>>>0x4C byte x \b%02d
>>>>0x4D beshort 0x000 (2GDM v
>>>>0x4F byte x \b%d.
>>>>>0x50 byte x \b%d)
0 string MTM Multitracker
>0x3 byte/16 x Version %d.
>0x3 byte&0x0F x \b%02d
>>0x4 string >\0 title: "%s"
0 string HVL
>3 byte <2 Hively Tracker Song
>3 byte 0 1 module data
>3 byte 1 2 module data
0 string MO3
>3 ubyte <6 MOdule with MP3
>>3 byte 0 Version 0 (With MP3 and lossless)
>>3 byte 1 Version 1 (With ogg and lossless)
>>3 byte 3 Version 2.2
>>3 byte 4 (With no LAME header)
>>3 byte 5 Version 2.4
0 string ADRVPACK AProSys module
# ftp://ftp.modland.com/pub/documents/format_documentation/\
# Art%20Of%20Noise%20(.aon).txt
0 string AON
>4 string "ArtOfNoise by Bastian Spiegel(twice/lego)"
>0x2e string NAME Art of Noise Tracker Song
>3 string <9
>3 string 4 (4 voices)
>3 string 8 (8 voices)
>>0x36 string >\0 Title: "%s"
0 string FAR
>0x2c byte 0x0d
>0x2d byte 0x0a
>0x2e byte 0x1a
>>0x3 byte 0xFE Farandole Tracker Song
>>>0x31 byte/16 x Version %d.
>>>0x31 byte&0x0F x \b%02d
>>>>0x4 string >\0 \b, title: "%s"

View file

@ -0,0 +1,10 @@
#------------------------------------------------------------------------------
# $File: bhl,v 1.1 2017/06/11 22:20:02 christos Exp $
# BlockHashLoc
# ext: bhl
# Marco Pontello marcopon@gmail.com
# reference: https://github.com/MarcoPon/BlockHashLoc
0 string BlockHashLoc\x1a BlockHashLoc recovery info,
>13 byte x version %d
!:ext bhl

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: blackberry,v 1.1 2014/01/31 01:51:32 christos Exp $
# $File: blackberry,v 1.2 2017/03/17 21:35:28 christos Exp $
# blackberry: file(1) magic for BlackBerry file formats
#
5 belong 0

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: blender,v 1.6 2014/08/30 08:34:17 christos Exp $
# $File: blender,v 1.7 2017/03/17 21:35:28 christos Exp $
# blender: file(1) magic for Blender 3D related files
#
# Native format rule v1.2. For questions use the developers list

View file

@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
# $File: c-lang,v 1.24 2016/07/01 23:31:13 christos Exp $
# $File: c-lang,v 1.26 2017/08/14 07:40:38 christos Exp $
# c-lang: file(1) magic for C and related languages programs
#
# The strength is to beat standard HTML
@ -11,40 +11,63 @@
!:mime text/x-bcpl
# C
0 regex \^#include C source text
!:strength +25
# Check for class if include is found, otherwise class is beaten by include becouse of lowered strength
0 regex \^#include C
>0 regex \^class[[:space:]]+
>>&0 regex \\{[\.\*]\\}(;)?$ \b++
>&0 clear x source text
!:strength + 13
!:mime text/x-c
0 regex \^char[\ \t\n]+ C source text
0 regex \^#[[:space:]]*pragma C source text
!:mime text/x-c
0 regex \^double[\ \t\n]+ C source text
0 regex \^#[[:space:]]*(if\|ifn)def
>&0 regex \^#[[:space:]]*endif$ C source text
!:mime text/x-c
0 regex \^extern[\ \t\n]+ C source text
0 regex \^#[[:space:]]*(if\|ifn)def
>&0 regex \^#[[:space:]]*define C source text
!:mime text/x-c
0 regex \^float[\ \t\n]+ C source text
0 regex \^[[:space:]]*char(\ \\*|\\*)(.+)(=.*)?;[[:space:]]*$ C source text
!:mime text/x-c
0 regex \^struct[\ \t\n]+ C source text
0 regex \^[[:space:]]*double(\ \\*|\\*)(.+)(=.*)?;[[:space:]]*$ C source text
!:mime text/x-c
0 regex \^union[\ \t\n]+ C source text
0 regex \^[[:space:]]*extern[[:space:]]+ C source text
!:mime text/x-c
0 search/8192 main( C source text
0 regex \^[[:space:]]*float(\ \\*|\\*)(.+)(=.*)?;[[:space:]]*$ C source text
!:mime text/x-c
0 regex \^struct[[:space:]]+ C source text
!:mime text/x-c
0 regex \^union[[:space:]]+ C source text
!:mime text/x-c
0 search/8192 main(
>&0 regex \\)[[:space:]]*\\{ C source text
!:mime text/x-c
# C++
# The strength of these rules is increased so they beat the C rules above
0 regex \^template[\ \t]+<.*>[\ \t\n]+ C++ source text
0 regex \^namespace[[:space:]]+[_[:alpha:]]{1,30}[[:space:]]*\\{ C++ source text
!:strength + 30
!:mime text/x-c++
0 regex \^virtual[\ \t\n]+ C++ source text
# using namespace [namespace] or using std::[lib]
0 regex \^using[[:space:]]+(namespace\ )?std(::)?[[:alpha:]]*[[:space:]]*; C++ source text
!:strength + 30
!:mime text/x-c++
0 regex \^class[\ \t\n]+ C++ source text
# But class is reduced to avoid beating php (Jens Schleusener)
0 regex \^[[:space:]]*template[[:space:]]*<.*>[[:space:]]*$ C++ source text
!:strength + 30
!:mime text/x-c++
0 regex \^[[:space:]]*virtual[[:space:]]+.*[};][[:space:]]*$ C++ source text
!:strength + 30
!:mime text/x-c++
# But class alone is reduced to avoid beating php (Jens Schleusener)
0 regex \^[[:space:]]*class[[:space:]]+[[:digit:][:alpha:]:_]+[[:space:]]*\\{(.*[\n]*)*\\}(;)?$ C++ source text
!:strength + 13
!:mime text/x-c++
0 regex \^public: C++ source text
0 regex \^[[:space:]]*public: C++ source text
!:strength + 30
!:mime text/x-c++
0 regex \^private: C++ source text
0 regex \^[[:space:]]*private: C++ source text
!:strength + 30
!:mime text/x-c++
0 regex \^[[:space:]]*protected: C++ source text
!:strength + 30
!:mime text/x-c++

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: cad,v 1.13 2014/03/23 18:05:38 christos Exp $
# $File: cad,v 1.15 2017/06/24 15:24:56 christos Exp $
# autocad: file(1) magic for cad files
#
@ -147,8 +147,13 @@
>0x02 byte 0xfe
>>0x04 beshort 0x1800 CIT raster CAD
# 3DS (3d Studio files) Conflicts with diff output 0x3d '='
#16 beshort 0x3d3d image/x-3ds
# 3DS (3d Studio files)
0 leshort 0x4d4d
>6 leshort 0x2
>>8 lelong 0xa
>>>16 leshort 0x3d3d 3D Studio model
!:mime image/x-3ds
!:extension 3ds
# MegaCAD 2D/3D drawing (.prt)
# http://megacad.de/

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: cafebabe,v 1.21 2015/10/15 20:56:51 christos Exp $
# $File: cafebabe,v 1.23 2017/05/25 20:07:23 christos Exp $
# Cafe Babes unite!
#
# Since Java bytecode and Mach-O universal binaries have the same magic number,
@ -47,7 +47,7 @@
0 name mach-o \b [
>0 use mach-o-cpu \b
>(8.L) indirect \b:
>(8.L) indirect x \b:
>0 belong x \b]
0 belong 0xcafebabe

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: clipper,v 1.7 2014/04/30 21:41:02 christos Exp $
# $File: clipper,v 1.8 2017/03/17 21:35:28 christos Exp $
# clipper: file(1) magic for Intergraph (formerly Fairchild) Clipper.
#
# XXX - what byte order does the Clipper use?

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: coff,v 1.1 2015/09/30 20:32:35 christos Exp $
# $File: coff,v 1.2 2017/03/17 21:35:28 christos Exp $
# coff: file(1) magic for Common Object Files not specific to known cpu types or manufactures
#
# COFF

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: commands,v 1.56 2016/07/14 19:01:12 christos Exp $
# $File: commands,v 1.59 2017/08/14 07:40:38 christos Exp $
# commands: file(1) magic for various shells and interpreters
#
#0 string/w : shell archive or script for antique kernel text
@ -56,7 +56,7 @@
!:mime text/x-awk
0 string/wt #!\ /usr/bin/awk awk script text executable
!:mime text/x-awk
0 regex/4096 =^\\s{0,100}BEGIN\\s{0,100}[{] awk or perl script text
0 regex/4096 =^[\040\t\f\r\n]{0,100}BEGIN[\040\t\f\r\n]{0,100}[{] awk or perl script text
# AT&T Bell Labs' Plan 9 shell
0 string/wt #!\ /bin/rc Plan 9 rc shell script text executable
@ -84,7 +84,7 @@
# PHP scripts
# Ulf Harnhammar <ulfh@update.uu.se>
0 search/1/c =<?php PHP script text
!:strength + 10
!:strength + 30
!:mime text/x-php
0 search/1 =<?\n PHP script text
!:mime text/x-php

View file

@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
# $File: compress,v 1.66 2016/09/16 12:12:05 christos Exp $
# $File: compress,v 1.68 2017/05/25 20:07:23 christos Exp $
# compress: file(1) magic for pure-compression formats (no archives)
#
# compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc.
@ -223,7 +223,7 @@
# Zstandard/LZ4 skippable frames
# https://github.com/facebook/zstd/blob/dev/zstd_compression_format.md
0 lelong&0xFFFFFFF0 0x184D2A50
>(4.l+8) indirect
>(4.l+8) indirect x
# Zstandard Dictionary ID subroutine
0 name zstd-dictionary-id

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: console,v 1.26 2016/06/12 15:20:37 christos Exp $
# $File: console,v 1.32 2017/08/13 00:21:47 christos Exp $
# Console game magic
# Toby Deshane <hac@shoelace.digivill.net>
@ -9,17 +9,19 @@
# References:
# - http://wiki.nesdev.com/w/index.php/INES
# - http://wiki.nesdev.com/w/index.php/NES_2.0
0 string NES\x1A iNES ROM image
# Common header for iNES, NES 2.0, and Wii U iNES.
0 name nes-rom-image-ines
>7 byte&0x0C =0x8 (NES 2.0)
>4 byte x \b: %ux16k PRG
>5 byte x \b, %ux16k CHR
>5 byte x \b, %ux8k CHR
>6 byte&0x08 =0x8 [4-Scr]
>6 byte&0x09 =0x0 [H-mirror]
>6 byte&0x09 =0x1 [V-mirror]
>6 byte&0x02 =0x2 [SRAM]
>6 byte&0x04 =0x4 [Trainer]
>7 byte&0x03 =0x2 [PC10]
>7 byte&0x03 =0x1 [VS
>7 byte&0x03 =0x1 [VS]
>>7 byte&0x0C =0x8
# NES 2.0: VS PPU
>>>13 byte&0x0F =0x0 \b, RP2C03B
@ -43,17 +45,24 @@
>>12 byte&0x03 =0x1 [PAL]
>>12 byte&0x02 =0x2 [NTSC+PAL]
# Standard iNES ROM header.
0 string NES\x1A NES ROM image (iNES)
>0 use nes-rom-image-ines
# Wii U Virtual Console iNES ROM header.
0 belong 0x4E455300 NES ROM image (Wii U Virtual Console)
>0 use nes-rom-image-ines
#------------------------------------------------------------------------------
# unif: file(1) magic for UNIF-format Nintendo Entertainment System ROM images
# Reference: http://wiki.nesdev.com/w/index.php/UNIF
# From: David Korth <gerbilsoft@gerbilsoft.com>
# TODO commit on 2016/03/21
#
# NOTE: The UNIF format uses chunks instead of a fixed header,
# so most of the data isn't easily parseable.
#
0 string UNIF
>4 lelong <16 UNIF v%d format NES ROM image
>4 lelong <16 NES ROM image (UNIF v%d format)
#------------------------------------------------------------------------------
# fds: file(1) magic for Famciom Disk System disk images
@ -63,24 +72,39 @@
# Disk info block. (block 1)
0 name nintendo-fds-disk-info-block
>1 string *NINTENDO-HVC* Famicom Disk System disk image:
>23 byte !1 FMC-
>23 byte 1 FSC-
>16 string x \b%.3s
>15 byte x \b, mfr 0x%02X
>15 byte x \b, mfr %02X
>20 byte x (Rev.%02u)
# Headered version.
0 string FDS\x1A
>0x11 string *NINTENDO-HVC*
>0x11 string *NINTENDO-HVC* Famicom Disk System disk image:
>>0x10 use nintendo-fds-disk-info-block
>4 byte 1 (%u side)
>4 byte !1 (%u sides)
# Unheadered version.
1 string *NINTENDO-HVC*
1 string *NINTENDO-HVC* Famicom Disk System disk image:
>0 use nintendo-fds-disk-info-block
#------------------------------------------------------------------------------
# tnes: file(1) magic for TNES-format Nintendo Entertainment System ROM images
# Used by Nintendo 3DS NES Virtual Console games.
# From: David Korth <gerbilsoft@gerbilsoft.com>
#
0 string TNES NES ROM image (Nintendo 3DS Virtual Console)
>4 byte 100 \b: FDS,
>>0x2010 use nintendo-fds-disk-info-block
>4 byte !100 \b: TNES mapper %u
>>5 byte x \b, %ux8k PRG
>>6 byte x \b, %ux8k CHR
>>7 byte&0x08 =1 [WRAM]
>>8 byte&0x09 =1 [H-mirror]
>>8 byte&0x09 =2 [V-mirror]
>>8 byte&0x02 =3 [VRAM]
#------------------------------------------------------------------------------
# gameboy: file(1) magic for the Nintendo (Color) Gameboy raw ROM format
# Reference: http://gbdev.gg8.se/wiki/articles/The_Cartridge_Header
@ -389,6 +413,15 @@
>0x1E byte x \b, Rev.%02u)
>0x12 byte 2 (DSi enhanced)
>0x12 byte 3 (DSi only)
# Secure Area check.
>0x20 lelong <0x4000 (homebrew)
>0x20 lelong >0x3FFF
>>0x4000 lequad 0x0000000000000000 (multiboot)
>>0x4000 lequad !0x0000000000000000
>>>0x4000 lequad 0xE7FFDEFFE7FFDEFF (decrypted)
>>>0x4000 lequad !0xE7FFDEFFE7FFDEFF
>>>>0x1000 lequad 0x0000000000000000 (encrypted)
>>>>0x1000 lequad !0x0000000000000000 (mask ROM)
#------------------------------------------------------------------------------
# nds_passme: file(1) magic for Nintendo DS ROM images for GBA cartridge boot.
@ -491,6 +524,10 @@
>3 byte x version %d,
>4 byte x %d tracks
# IPS Patch Files from: From: Thomas Klausner <tk@giga.or.at>
# see http://zerosoft.zophar.net/ips.php
0 string PATCH IPS patch file
# Playstations Patch Files from: From: Thomas Klausner <tk@giga.or.at>
0 string PPF30 Playstation Patch File version 3.0
>5 byte 0 \b, PPF 1.0 patch
@ -617,6 +654,52 @@
>0x218 belong 0x5D1C9EA3 Nintendo Wii disc image (WBFS format):
>>0x200 use nintendo-gcn-disc-common
# Type: Nintendo GameCube/Wii disc image (CISO format)
# NOTE: This is NOT the same as Compact ISO or PSP CISO,
# though it has the same magic number.
0 string CISO
# Other fields are used to determine what type of CISO this is:
# - 0x04 == 0x00200000: GameCube/Wii CISO (block_size)
# - 0x10 == 0x00000800: PSP CISO (ISO-9660 sector size)
# - None of the above: Compact ISO.
>4 lelong 0x200000
>>8 byte 1
>>>0x801C belong 0xC2339F3D Nintendo GameCube disc image (CISO format):
>>>>0x8000 use nintendo-gcn-disc-common
>>>0x8018 belong 0x5D1C9EA3 Nintendo Wii disc image (CISO format):
>>>>0x8000 use nintendo-gcn-disc-common
# Type: Nintendo GameCube/Wii disc image (GCZ format)
# Due to zlib compression, we can't get the actual disc information.
0 lelong 0xB10BC001
>4 lelong 0 Nintendo GameCube disc image (GCZ format)
>4 lelong 1 Nintendo Wii disc image (GCZ format)
>4 lelong >1 Nintendo GameCube/Wii disc image (GCZ format)
# Type: Nintendo GameCube/Wii disc image (WDF format)
0 string WII\001DISC
>8 belong 1
# WDFv1
>>0x54 belong 0xC2339F3D Nintendo GameCube disc image (WDFv1 format):
>>>0x38 use nintendo-gcn-disc-common
>>0x58 belong 0x5D1C9EA3 Nintendo Wii disc image (WDFv1 format):
>>>0x38 use nintendo-gcn-disc-common
>8 belong 2
# WDFv2
>>(12.L+0x1C) belong 0xC2339F3D Nintendo GameCube disc image (WDFv2 format):
>>>(12.L) use nintendo-gcn-disc-common
>>(12.L+0x18) belong 0x5D1C9EA3 Nintendo Wii disc image (WDFv2 format):
>>>(12.L) use nintendo-gcn-disc-common
# Type: Nintendo GameCube/Wii disc image (WIA format)
0 string WIA\001 Nintendo
>0x48 belong 0 GameCube/Wii
>0x48 belong 1 GameCube
>0x48 belong 2 Wii
>0x48 belong >2 GameCube/Wii
>0x48 belong x disc image (WIA format):
>>0x58 use nintendo-gcn-disc-common
#------------------------------------------------------------------------------
# Nintendo 3DS file formats.
#
@ -722,7 +805,7 @@
# Type: Nintendo 3DS Homebrew Application.
# From: David Korth <gerbilsoft@gerbilsoft.com>
# Refernece: https://3dbrew.org/wiki/3DSX_Format
# Reference: https://3dbrew.org/wiki/3DSX_Format
0 string 3DSX Nintendo 3DS Homebrew Application (3DSX)
#------------------------------------------------------------------------------
@ -750,3 +833,17 @@
#
0 string g\ GCE Vectrex ROM image
>0x11 string >\0 \b: "%.16s"
#------------------------------------------------------------------------------
# amiibo: file(1) magic for Nintendo amiibo NFC dumps.
# From: David Korth <gerbilsoft@gerbilsoft.com>
# Reference: https://www.3dbrew.org/wiki/Amiibo
0x00 byte 0x04
>0x0A beshort 0x0FE0
>>0x0C belong 0xF110FFEE
>>>0x208 beshort 0x0100
>>>>0x020A byte 0x0F
>>>>>0x020C bequad 0x000000045F000000
>>>>>>0x5B byte 0x02
>>>>>>>0x54 belong x Nintendo amiibo NFC dump - amiibo ID: %08X-
>>>>>>>0x58 belong x \b%08X

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: cups,v 1.4 2016/10/17 18:51:02 christos Exp $
# $File: cups,v 1.5 2017/03/17 21:35:28 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

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: database,v 1.49 2016/06/11 17:01:51 christos Exp $
# $File: database,v 1.52 2017/08/13 00:21:47 christos Exp $
# database: file(1) magic for various databases
#
# extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
@ -207,7 +207,7 @@
>>>>>>>>>>>>>8 uleshort >0 \b, at offset %d
>>>>>>>>>>>>>(8.s+1) ubyte >0
>>>>>>>>>>>>>>&-1 string >\0 1st record "%s"
# for multiple index files (*.MDX) Production flag,tag numbers(<=0x30),tag length(<=0x20), reserverd (NULL)
# for multiple index files (*.MDX) Production flag,tag numbers(<=0x30),tag length(<=0x20), reserved (NULL)
>>>>>>>24 ubelong&0x0133f7ff >0
# test for reserved NULL byte
>>>>>>>>47 ubyte 0
@ -622,3 +622,13 @@
# MUIbase Database Tool by Stefan A. Haubenthal <polluks@web.de>
0 string MBSTV\040 MUIbase DB
>6 string x version %s
#
# CDB database
0 string NBCDB\012 NetBSD Constant Database
>7 byte x \b, version %d
>8 string x \b, for '%s'
>24 lelong x \b, datasize %d
>28 lelong x \b, entries %d
>32 lelong x \b, index %d
>36 lelong x \b, seed %#x

View file

@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
# $File: der,v 1.1 2016/01/19 15:07:45 christos Exp $
# $File: der,v 1.2 2017/03/17 21:35:28 christos Exp $
# der: file(1) magic for DER encoded files
#

View file

@ -1,15 +1,15 @@
#------------------------------------------------------------------------------
# $File: diff,v 1.14 2012/09/16 23:08:54 christos Exp $
# $File: diff,v 1.16 2017/03/17 22:20:22 christos Exp $
# diff: file(1) magic for diff(1) output
#
0 search/1 diff\ diff output text
0 search/1 diff\040 diff output text
!:mime text/x-diff
0 search/1 ***\ diff output text
0 search/1 ***\040 diff output text
!:mime text/x-diff
0 search/1 Only\ in\ diff output text
0 search/1 Only\040in\040 diff output text
!:mime text/x-diff
0 search/1 Common\ subdirectories:\ diff output text
0 search/1 Common\040subdirectories:\040 diff output text
!:mime text/x-diff
0 search/1 Index: RCS/CVS diff output text
@ -20,9 +20,9 @@
# unified diff
0 search/4096 ---\
0 search/4096 ---\040
>&0 search/1024 \n
>>&0 search/1 +++\
>>&0 search/1 +++\040
>>>&0 search/1024 \n
>>>>&0 search/1 @@ unified diff output text
!:mime text/x-diff

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: dolby,v 1.7 2014/01/08 22:37:23 christos Exp $
# $File: dolby,v 1.8 2017/03/17 21:35:28 christos Exp $
# ATSC A/53 aka AC-3 aka Dolby Digital <ashitaka@gmx.at>
# from http://www.atsc.org/standards/a_52a.pdf
# corrections, additions, etc. are always welcome!

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: dump,v 1.13 2014/04/30 21:41:02 christos Exp $
# $File: dump,v 1.16 2017/07/22 19:21:02 christos Exp $
# dump: file(1) magic for dump file format--for new and old dump filesystems
#
# We specify both byte orders in order to recognize byte-swapped dumps.
@ -69,6 +69,8 @@
>0 use old-dump-be
24 lelong 60012 new-fs dump file (little endian),
# to correctly recognize '*.mo' GNU message catalog (little endian)
!:strength - 15
>0 use \^new-dump-be
24 lelong 60011 old-fs dump file (little endian),

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: dyadic,v 1.7 2015/05/27 18:02:48 christos Exp $
# $File: dyadic,v 1.8 2017/03/17 21:35:28 christos Exp $
# Dyadic: file(1) magic for Dyalog APL.
#
# updated by Joerg Jenderek at Oct 2013

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: editors,v 1.10 2016/07/18 17:44:49 christos Exp $
# $File: editors,v 1.11 2017/03/17 21:35:28 christos Exp $
# T602 editor documents
# by David Necas <yeti@physics.muni.cz>
0 string @CT\ T602 document data,

View file

@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
# $File: filesystems,v 1.114 2016/09/05 08:34:25 christos Exp $
# $File: filesystems,v 1.122 2017/07/21 10:34:41 christos Exp $
# filesystems: file(1) magic for different filesystems
#
0 name partid
@ -449,7 +449,7 @@
# Ranish Partition Manager http://www.ranish.com/part/
>387 search/4 \0\ Error!\r
>>378 search/7 Virus!
>>>397 search/4 Booting\
>>>397 search/4 Booting\040
>>>>408 search/4 HD1/\0 \b, Ranish MBR (
>>>>>416 string Writing\ changes... \b2.37
>>>>>>438 ubyte x \b,0x%x dots
@ -467,7 +467,7 @@
# SYSLINUX MBR moved
# http://www.acronis.de/
>362 string MBR\ Error\ \0\r
>>376 string ress\ any\ key\ to\
>>376 string ress\ any\ key\ to\040
>>>392 string boot\ from\ floppy...\0 \b, Acronis MBR
# added by Joerg Jenderek
# http://www.visopsys.org/
@ -565,7 +565,7 @@
# http://www.acronis.de/
#FAT label=ACRONIS\ SZ
#OEM-ID=BOOTWIZ0
>442 string Non-system\ disk,\
>442 string Non-system\ disk,\040
>>459 string press\ any\ key...\x7\0 \b, Acronis Startup Recovery Loader
# updated by Joerg Jenderek at Nov 2012, Sep 2013
# DOS names like F11.SYS or BOOTWIZ.SYS are 8 right space padded bytes+3 bytes
@ -573,11 +573,11 @@
>>>447 ubyte x \b
>>>477 use DOS-filename
#
>185 string FDBOOT\ Version\
>>204 string \rNo\ Systemdisk.\
>185 string FDBOOT\ Version\040
>>204 string \rNo\ Systemdisk.\040
>>>220 string Booting\ from\ harddisk.\n\r
>>>245 string Cannot\ load\ from\ harddisk.\n\r
>>>>273 string Insert\ Systemdisk\
>>>>273 string Insert\ Systemdisk\040
>>>>>291 string and\ press\ any\ key.\n\r \b, FDBOOT harddisk Bootloader
>>>>>>200 string >\0 \b, version %-3s
>242 string Bootsector\ from\ C.H.\ Hochst\204
@ -616,11 +616,11 @@
>>>>>>>>>>>>>>0x77 string >\0 "%-s"
>214 string Please\ try\ to\ install\ FreeDOS\ \b, DOS Emulator boot message display
#>>244 string from\ dosemu-freedos-*-bin.tgz\r
#>>>170 string Sorry,\ could\ not\ load\ an\
#>>>170 string Sorry,\ could\ not\ load\ an\040
#>>>>195 string operating\ system.\r\n
#
>103 string This\ is\ not\ a\ bootable\ disk.\
>>132 string Please\ insert\ a\ bootable\
>103 string This\ is\ not\ a\ bootable\ disk.\040
>>132 string Please\ insert\ a\ bootable\040
>>>157 string floppy\ and\r\n
>>>>169 string press\ any\ key\ to\ try\ again...\r \b, FREE-DOS message display
#
@ -640,11 +640,11 @@
>>>470 string OS2BOOT\ \ \ \ \b, IBM OS/2 Warp Bootloader
>112 string This\ disk\ is\ not\ bootable\r
>>142 string If\ you\ wish\ to\ make\ it\ bootable
>>>176 string run\ the\ DOS\ program\ SYS\
>>>176 string run\ the\ DOS\ program\ SYS\040
>>>200 string after\ the\r
>>>>216 string system\ has\ been\ loaded\r\n
>>>>>242 string Please\ insert\ a\ DOS\ diskette\
>>>>>271 string into\r\n\ the\ drive\ and\
>>>>>242 string Please\ insert\ a\ DOS\ diskette\040
>>>>>271 string into\r\n\ the\ drive\ and\040
>>>>>>292 string strike\ any\ key...\0 \b, IBM OS/2 Warp message display
# XP
>430 string NTLDR\ is\ missing\xFF\r\n
@ -737,24 +737,24 @@
>>>>>>425 string >\ \b.%-.3s
#
#>3 string NTFS\ \ \ \
>389 string Fehler\ beim\ Lesen\
#>3 string NTFS\ \ \ \040
>389 string Fehler\ beim\ Lesen\040
>>407 string des\ Datentr\204gers
>>>426 string NTLDR\ fehlt
>>>>440 string NTLDR\ ist\ komprimiert
>>>>>464 string Neustart\ mit\ Strg+Alt+Entf\r \b, Microsoft Windows XP Bootloader NTFS (german)
#>3 string NTFS\ \ \ \
#>3 string NTFS\ \ \ \040
>313 string A\ disk\ read\ error\ occurred.\r
>>345 string A\ kernel\ file\ is\ missing\
>>345 string A\ kernel\ file\ is\ missing\040
>>>370 string from\ the\ disk.\r
>>>>484 string NTLDR\ is\ compressed
>>>>>429 string Insert\ a\ system\ diskette\
>>>>>429 string Insert\ a\ system\ diskette\040
>>>>>>454 string and\ restart\r\nthe\ system.\r \b, Microsoft Windows XP Bootloader NTFS
# DOS loader variants different languages,offsets
>472 ubyte&0xDF >0
>>389 string Invalid\ system\ disk\xFF\r\n
>>>411 string Disk\ I/O\ error
>>>>428 string Replace\ the\ disk,\ and\
>>>>428 string Replace\ the\ disk,\ and\040
>>>>>455 string press\ any\ key \b, Microsoft Windows 98 Bootloader
#IO.SYS
>>>>>>472 ubyte&0xDF >0
@ -775,11 +775,11 @@
#
>>390 string Invalid\ system\ disk\xFF\r\n
>>>412 string Disk\ I/O\ error\xFF\r\n
>>>>429 string Replace\ the\ disk,\ and\
>>>>429 string Replace\ the\ disk,\ and\040
>>>>>451 string then\ press\ any\ key\r \b, Microsoft Windows 98 Bootloader
>>388 string Ungueltiges\ System\ \xFF\r\n
>>>410 string E/A-Fehler\ \ \ \ \xFF\r\n
>>>>427 string Datentraeger\ wechseln\ und\
>>>>427 string Datentraeger\ wechseln\ und\040
>>>>>453 string Taste\ druecken\r \b, Microsoft Windows 95/98/ME Bootloader (german)
#WINBOOT.SYS only not spaces (0xDF)
>>>>>>497 ubyte&0xDF >0
@ -811,7 +811,7 @@
#
>>390 string Ungueltiges\ System\ \xFF\r\n
>>>412 string E/A-Fehler\ \ \ \ \xFF\r\n
>>>>429 string Datentraeger\ wechseln\ und\
>>>>429 string Datentraeger\ wechseln\ und\040
>>>>>455 string Taste\ druecken\r \b, Microsoft Windows 95/98/ME Bootloader (German)
#WINBOOT.SYS only not spaces (0xDF)
>>>>>>497 ubyte&0xDF >0
@ -837,7 +837,7 @@
#
>>389 string Ungueltiges\ System\ \xFF\r\n
>>>411 string E/A-Fehler\ \ \ \ \xFF\r\n
>>>>428 string Datentraeger\ wechseln\ und\
>>>>428 string Datentraeger\ wechseln\ und\040
>>>>>454 string Taste\ druecken\r \b, Microsoft Windows 95/98/ME Bootloader (GERMAN)
# DOS names like IO.SYS,WINBOOT.SYS,MSDOS.SYS,WINBOOT.INI are 8 right space padded bytes+3 bytes
>>>>>>472 string x %-.2s
@ -856,7 +856,7 @@
>>>>>>>491 ubyte&0xDF >0
>>>>>>>>491 string x \b.%-.3s
>479 ubyte&0xDF >0
>>416 string Kein\ System\ oder\
>>416 string Kein\ System\ oder\040
>>>433 string Laufwerksfehler
>>>>450 string Wechseln\ und\ Taste\ dr\201cken \b, Microsoft DOS Bootloader (german)
#IO.SYS
@ -873,9 +873,9 @@
>>>>>>>498 ubyte&0xDF >0
>>>>>>>>498 string x \b.%-.3s
#
>376 search/41 Non-System\ disk\ or\
>376 search/41 Non-System\ disk\ or\040
>>395 search/41 disk\ error\r
>>>407 search/41 Replace\ and\
>>>407 search/41 Replace\ and\040
>>>>419 search/41 press\ \b,
>>>>419 search/41 strike\ \b, old
>>>>426 search/41 any\ key\ when\ ready\r MS or PC-DOS bootloader
@ -900,7 +900,7 @@
>>>>>>>&7 ubyte&0xDF >0 \b.
>>>>>>>>&-1 string x \b%-.3s
>441 string Cannot\ load\ from\ harddisk.\n\r
>>469 string Insert\ Systemdisk\
>>469 string Insert\ Systemdisk\040
>>>487 string and\ press\ any\ key.\n\r \b, MS (2.11) DOS bootloader
#>43 string \224R-LOADER\ \ SYS =label
>54 string SYS
@ -920,9 +920,9 @@
>>>>>>>52 string x \b.%-.3s
#
>70 string IBMBIO\ \ COM
>>472 string Cannot\ load\ DOS!\
>>472 string Cannot\ load\ DOS!\040
>>>489 string Any\ key\ to\ retry \b, DR-DOS Bootloader
>>471 string Cannot\ load\ DOS\
>>471 string Cannot\ load\ DOS\040
>>487 string press\ key\ to\ retry \b, Open-DOS Bootloader
#??
>444 string KERNEL\ \ SYS
@ -984,7 +984,7 @@
>>>>>>>>504 string x \b%-.1s
>>>>505 ubyte&0xDF >0
>>>>>505 string x \b.%-.3s
>336 string Error!\
>336 string Error!\040
>>343 string Hit\ a\ key\ to\ reboot. \b, FREE-DOS Beta 0.9sr1 Bootloader
>>>497 ubyte&0xDF >0
>>>>497 string x \b %-.6s
@ -999,7 +999,7 @@
# http://partitionlogic.org.uk/
# OEM-ID=Visopsys
>478 ulelong 0
>>(1.b+326) string I/O\ Error\ reading\
>>(1.b+326) string I/O\ Error\ reading\040
>>>(1.b+344) string Visopsys\ loader\r
>>>>(1.b+361) string Press\ any\ key\ to\ continue.\r \b, Visopsys loader
# http://alexfru.chat.ru/epm.html#bootprog
@ -1553,6 +1553,16 @@
>>>0x0c lestring16 x \b%-2.2s
### DOS,NTFS boot sectors end
# ntfsclone-image is a special save format for NTFS volumes,
# created and restored by the ntfsclone program
0 string \0ntfsclone-image ntfsclone image,
>0x10 byte x version %d.
>0x11 byte x \b%d,
>0x12 lelong x cluster size %d,
>0x16 lequad x device size %lld,
>0x1e lequad x %lld total clusters,
>0x26 lequad x %lld clusters in use
9564 lelong 0x00011954 Unix Fast File system [v1] (little-endian),
>8404 string x last mounted on %s,
#>9504 ledate x last checked at %s,
@ -1669,6 +1679,13 @@
>&-1248 belong 0 TIME optimization
>&-1248 belong 1 SPACE optimization
0 ulequad 0xc8414d4dc5523031 HAMMER filesystem (little-endian),
>0x90 lelong+1 x volume %d
>0x94 lelong x (of %d),
>0x50 string x name %s,
>0x98 ulelong x version %u,
>0xa0 ulelong x flags 0x%x
# ext2/ext3 filesystems - Andreas Dilger <adilger@dilger.ca>
# ext4 filesystem - Eric Sandeen <sandeen@sandeen.net>
# volume label and UUID Russell Coker
@ -1942,14 +1959,25 @@
32769 string CD001
# mime line at that position does not work
# to display CD-ROM (70=81-11) after MBR (113=40+72+1), partition-table (71=50+21) and before Apple Driver Map (51)
!:strength -11
#!:strength -11
# to display CD-ROM (114=81+33) before MBR (113=40+72+1), partition-table (71=50+21) and Apple Driver Map (51)
# does not work
#!:strength +33
!:strength +34
>0 use cdrom
# .cso files
0 string CISO Compressed ISO CD image
# Reference: http://pismotec.com/ciso/ciso.h
# NOTE: There are two other formats with the same magic but
# completely incompatible specifications:
# - GameCube/Wii CISO: https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/DiscIO/CISOBlob.h
# - PSP CISO: https://github.com/jamie/ciso/blob/master/ciso.h
0 string CISO
# Other fields are used to determine what type of CISO this is:
# - 0x04 == 0x00200000: GameCube/Wii CISO (block_size)
# - 0x10 == 0x00000800: PSP CISO (ISO-9660 sector size)
# - None of the above: Compact ISO.
>4 lelong !0
>>4 lelong !0x200000
>>>0x10 lelong !0x800 Compressed ISO CD image
# cramfs filesystem - russell@coker.com.au
0 lelong 0x28cd3d45 Linux Compressed ROM File System data, little endian
@ -2041,6 +2069,13 @@
>29 byte 16 \bBlackfin,
>29 byte 17 \bAVR32,
>29 byte 18 \bSTMicroelectronics ST200,
>29 byte 19 \bSandbox architecture,
>29 byte 20 \bANDES Technology NDS32,
>29 byte 21 \bOpenRISC 1000,
>29 byte 22 \bARM 64-bit,
>29 byte 23 \bDesignWare ARC,
>29 byte 24 \bx86_64,
>29 byte 25 \bXtensa,
>30 byte 0 Invalid Image
>30 byte 1 Standalone Program
>30 byte 2 OS Kernel Image
@ -2352,3 +2387,13 @@
>>>>>>>>0x1B ubyte 0x30 \b, media=1D
>>>>>>>>0x1B ubyte 0x40 \b, media=1DD
>>>>>>>>0x1A ubyte 0x10 \b, write-protected
# HDD Raw Copy Tool disk image, file extension: .imgc
# From Benjamin Vanheuverzwijn <bvanheu@gmail.com>
0 pstring HDD\ Raw\ Copy\ Tool %s
>0x100 pstring x %s
>0x200 pstring x - HD model: %s
#>0x300 pstring x unknown %s
>0x400 pstring x serial: %s
#>0x500 pstring x unknown: %s
!:ext imgc

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: flash,v 1.11 2014/05/02 00:26:49 christos Exp $
# $File: flash,v 1.14 2017/05/25 20:09:55 christos Exp $
# flash: file(1) magic for Macromedia Flash file format
#
# See
@ -11,23 +11,45 @@
#
0 name swf-details
>0 string F Macromedia Flash data
>0 string F
>>8 byte&0xfd 0x08 Macromedia Flash data
!:mime application/x-shockwave-flash
>0 string C Macromedia Flash data (compressed)
>>>3 byte x \b, version %d
>>8 byte&0xfe 0x10 Macromedia Flash data
!:mime application/x-shockwave-flash
>0 string Z Macromedia Flash data (lzma compressed)
>>>3 byte x \b, version %d
>>8 byte 0x18 Macromedia Flash data
!:mime application/x-shockwave-flash
>3 byte x \b, version %d
>>>3 byte x \b, version %d
>>8 beshort&0xff87 0x2000 Macromedia Flash data
!:mime application/x-shockwave-flash
>>>3 byte x \b, version %d
>>8 beshort&0xffe0 0x3000 Macromedia Flash data
!:mime application/x-shockwave-flash
>>>3 byte x \b, version %d
>>8 byte&0x7 0
>>>8 ubyte >0x2f
>>>>9 ubyte <0x20 Macromedia Flash data
!:mime application/x-shockwave-flash
>>>>>3 byte x \b, version %d
>0 string C
>>8 byte 0x78 Macromedia Flash data (compressed)
!:mime application/x-shockwave-flash
>>>3 byte x \b, version %d
>0 string Z
>>8 byte 0x5d Macromedia Flash data (lzma compressed)
!:mime application/x-shockwave-flash
>>>3 byte x \b, version %d
1 string WS
>4 lelong !0
>>3 byte 255 Suspicious
>4 ulelong >14
>>3 ubyte !0
>>>0 use swf-details
>>3 ubyte <32
>>>3 ubyte !0
>>>>0 use swf-details
# From: Cal Peake <cp@absolutedigital.net>
0 string FLV\x01 Macromedia Flash Video
!:mime video/x-flv

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: fonts,v 1.33 2016/09/14 01:26:26 christos Exp $
# $File: fonts,v 1.37 2017/06/24 00:39:00 christos Exp $
# fonts: file(1) magic for font data
#
0 search/1 FONT ASCII vfont text
@ -100,9 +100,11 @@
# X11 fonts, from Daniel Quinlan (quinlan@yggdrasil.com)
# PCF must come before SGI additions ("MIPSEL MIPS-II COFF" collides)
0 string \001fcp X11 Portable Compiled Font data
>12 byte 0x02 \b, LSB first
>12 byte 0x0a \b, MSB first
0 string \001fcp X11 Portable Compiled Font data,
>12 lelong ^0x08 bit: LSB,
>12 lelong &0x08 bit: MSB,
>12 lelong ^0x04 byte: LSB first
>12 lelong &0x04 byte: MSB first
0 string D1.0\015 X11 Speedo font data
#------------------------------------------------------------------------------
@ -134,21 +136,159 @@
>4 beshort >0 version %d
# True Type fonts
0 string \000\001\000\000\000 TrueType font data
!:mime application/x-font-ttf
# Modified by: Joerg Jenderek
# URL: https://en.wikipedia.org/wiki/TrueType
# Reference: https://developer.apple.com/fonts/TrueType-Reference-Manual/
#
# sfnt version "typ1" used by some Apple, but no example found
0 string typ1
>0 use sfnt-font
>0 use sfnt-names
# sfnt version "true" used by some Apple
0 string true
>0 use sfnt-font
>0 use sfnt-names
# GRR: below test is too general
# sfnt version often 0x00010000
0 string \000\001\000\000
>0 use sfnt-font
>0 use sfnt-names
# validate and display sfnt font data like number of tables
0 name sfnt-font
# file 5.30 version assumes 00FFh as maximal number of tables
#>4 ubeshort <0x0100
# maximal 27 tables found like in Skia.ttf
# 46 different table names mentioned on Apple specification
# skip 1st sequence of DOS 2 backup with path separator (\~92 or /~47) misinterpreted as table number
>4 ubeshort <47
# skip bad examples with garbage table names like in a5.show HYPERC MAC
# tag names consist of up to four characters padded with spaces at end like
# BASE DSIG OS/2 Zapf acnt glyf cvt vmtx xref ...
>>12 regex/4l \^[A-Za-z][A-Za-z][A-Za-z/][A-Za-z2\ ]
#>>>0 ubelong x \b, sfnt version 0x%x
>>>0 ubelong !0x4f54544f TrueType
!:mime application/font-sfnt
#!:mime font/ttf
!:apple ????tfil
# .ttf for TrueType font
# EUDC.tte created by privat character editor %WINDIR%\system32\eudcedit.exe
!:ext ttf/tte
# sfnt version 4F54544Fh~OTTO
>>>0 ubelong =0x4f54544f OpenType
!:mime application/font-sfnt
#!:mime font/otf
!:apple ????OTTO
!:ext otf
>>>0 ubelong x Font data
# DSIG=44454947h table name implies a digitally signed font
# search range = number of tables * 16 =< maximal number of tables * 16 = 27 * 16 = 432
>>>12 search/432 DSIG \b, digitally signed
>>>4 ubeshort x \b, %d tables
# minimal 9 tables found like in NISC18030.ttf
#>>>4 ubeshort <10 TMIN
#>>>4 ubeshort >24 TBIG
# table directory entries
>>>12 string x \b, 1st "%4.4s"
# search and display 1st name in sfnt font which is often copyright text
# does not work inside font collections
0 name sfnt-names
# search for naming table
>12 search/432/s name
# biggest offset 0x0100bd28 like Windows10 Fonts\simsunb.ttf
#>>>>&8 ubelong >0x0100bd27 BIGGEST OFFSET
>>&8 ubelong >0x00100000
# offset of name table
>>>&-4 ubelong x \b, name offset 0x%x
# GRR: pointer to name table only works if offset ~< FILE_BYTES_MAX = 100000h defined in src\file.h
>>&8 ubelong <0x00100000
>>>&-16 ubelong x
# name table
>>>>(&8.L) ubequad x
# invalid format selector
#>>>>>&-8 ubeshort !0 \b, invalid selector %x
# minimal 3 name records found like in c:\Program Files (x86)\Tesseract-OCR\tessdata\pdf.ttf
# maximal 1227 name records found like in Apple Chancery.ttf
#>>>>>&-6 ubeshort <0x4 mincount
#>>>>>&-6 ubeshort >130 maxcount
>>>>>&-6 ubeshort x \b, %d names
# offset to start of string storage from start of table
#>>>>>&-4 ubeshort x \b, record offset %d
# 1st name record
# string offset from start of storage area
#>>>>>&8 ubeshort x \b, string offset %d
# string length
#>>>>>&6 ubeshort x \b, string length %d
# minimal name string 7 like in c:\Program Files (x86)\Kodi\addons\webinterface.default\lib\video-js\font\VideoJS.ttf
# also found 0 like in SWZCONLN.TTF
#>>>>>&6 ubeshort <8 MIN STRING
# maximal name string 806 like in c:\Windows\Fonts\palabi.ttf
#>>>>>&6 ubeshort >805 MAX STRING
# platform identifier: 0~Apple Unicode, 1~Macintosh, 3~Microsoft
#>>>>>&-2 ubeshort >3 BAD PLATFORM
>>>>>&-2 ubeshort 0 \b, Unicode
>>>>>&-2 ubeshort 1 \b, Macintosh
>>>>>&-2 ubeshort 3 \b, Microsoft
# languageID (0~english Macintosh, 0409h~english Microsoft, ...)
>>>>>&2 ubeshort >0 \b, language 0x%x
# name identifiers
# often 0~copyright, 1~font, 2~font subfamily, 5~version, 13~license, 19~sample, ...
>>>>>&4 ubeshort >0 \b, type %d string
# platform specific encoding:
# 0~undefined character set, 1~UGL set with Unicode, 3~Unicode 2.0 BMP only, 4~Unicode 2.0
#>>>>>&0 ubeshort x \b, %d encoding
>>>>>&0 ubeshort 0
# handle only name string offset 0 because do not know how to add 2 relative offsets
>>>>>>&6 ubeshort 0
>>>>>>>&(&-14.S-18) ubyte !0
# GRR: instead 806 only first MAXstring = 96 characters are displayed as defined in src\file.h
# often copyright string that starts like \251 2006 The Monotype Corporation
>>>>>>>>&-1 string x \b, %-11.96s
# test for unicode string
>>>>>>>&(&-14.S-18) ubyte 0
>>>>>>>>&0 lestring16 x \b, %-11.96s
# unicode encoding
>>>>>&0 ubeshort >0
>>>>>>&6 ubeshort 0
>>>>>>>&(&-14.S-17) lestring16 x \b, %-11.96s
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)
# URL: https://en.wikipedia.org/wiki/OpenType
# 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
# Modified by: Joerg Jenderek
# Note: container for TrueType, OpenType font
0 string ttcf
# skip ASCII text
>4 ubyte 0
# sfnt version often 0x00010000 of 1st table is TrueType
>>(12.L) ubelong !0x4f54544f TrueType
#!:mime font/ttf
!:apple ????tfil
!:ext ttc
# sfnt version 4F54544Fh~OTTO of 1st table is OpenType font
>>(12.L) ubelong =0x4f54544f OpenType
#!:mime font/otf
!:apple ????OTTO
# no example found for otc
!:ext ttc/otc
>>4 ubyte x font collection data
!:mime application/font-sfnt
#!:mime font/collection
# TCC version
>>4 belong 0x00010000 \b, 1.0
>>4 belong 0x00020000 \b, 2.0
>>8 ubelong >0 \b, %d fonts
# array offset size = fonts * offsetsize = fonts * 4
>>(8.L*4) ubequad x
# 0x44454947 = 'DSIG'
>>>16 belong 0x44534947 \b, digitally signed
>>>&4 belong 0x44534947 \b, digitally signed
# offset to 1st font
>>12 ubelong x \b, at 0x%x
# point to 1st font that starts with sfnt version
>>(12.L) use sfnt-font
# Opentype font data from Avi Bercovich
0 string OTTO OpenType font data

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: fsav,v 1.13 2013/03/25 17:18:47 christos Exp $
# $File: fsav,v 1.14 2017/03/17 21:35:28 christos Exp $
# fsav: file(1) magic for datafellows fsav virus definition files
# Anthon van der Neut (anthon@mnt.org)

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: games,v 1.14 2014/04/30 21:41:02 christos Exp $
# $File: games,v 1.15 2017/03/17 21:35:28 christos Exp $
# games: file(1) for games
# Fabio Bonelli <fabiobonelli@libero.it>

View file

@ -0,0 +1,10 @@
#------------------------------------------------------------------------------
# $File: gconv
# gconv: file(1) magic for iconv/gconv module configuration cache
#
# Magic number defined in glibc/iconv/iconvconfig.h as GCONVCACHE_MAGIC
#
# From: Marek Cermak <macermak@redhat.com>
#
0 lelong 0x20010324 gconv module configuration cache data

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: geo,v 1.3 2013/01/04 00:47:02 christos Exp $
# $File: geo,v 1.4 2017/03/17 21:35:28 christos Exp $
# Geo- files from Kurt Schwehr <schwehr@ccom.unh.edu>
######################################################################

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: gnu,v 1.17 2016/07/16 22:17:04 christos Exp $
# $File: gnu,v 1.18 2017/03/17 21:35:28 christos Exp $
# gnu: file(1) magic for various GNU tools
#
# GNU nlsutils message catalog file format

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: gpt,v 1.3 2014/04/30 21:41:02 christos Exp $
# $File: gpt,v 1.4 2017/03/17 21:35:28 christos Exp $
#
# GPT Partition table patterns.
# Author: Rogier Goossens (goossens.rogier@gmail.com)

View file

@ -0,0 +1,28 @@
#------------------------------------------------------------------------------
# $File: gpu,v 1.2 2017/03/23 22:11:53 christos Exp $
# gpu: file(1) magic for GPU input files
# Standard Portable Intermediate Representation (SPIR)
# Documentation: https://www.khronos.org/spir
# Typical file extension: .spv
0 belong 0x07230203 Khronos SPIR-V binary, big-endian
>4 belong x \b, version 0x%08x
>8 belong x \b, generator 0x%08x
0 lelong 0x07230203 Khronos SPIR-V binary, little-endian
>4 lelong x \b, version 0x%08x
>8 lelong x \b, generator 0x%08x
# Vulkan Trace file
# Documentation:
# https://github.com/LunarG/VulkanTools/blob/master/vktrace/vktrace_common/\
# vktrace_trace_packet_identifiers.h
# Typical file extension: .vktrace
8 lequad 0xABADD068ADEAFD0C Vulkan trace file, little-endian
>0 leshort x \b, version %d
8 bequad 0xABADD068ADEAFD0C Vulkan trace file, big-endian
>0 beshort x \b, version %d

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: gringotts,v 1.5 2009/09/19 16:28:09 christos Exp $
# $File: gringotts,v 1.6 2017/03/17 21:35:28 christos Exp $
# gringotts: file(1) magic for Gringotts
# http://devel.pluto.linux.it/projects/Gringotts/
# author: Germano Rizzo <mano@pluto.linux.it>

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: hitachi-sh,v 1.7 2015/09/30 20:32:35 christos Exp $
# $File: hitachi-sh,v 1.8 2017/03/17 21:35:28 christos Exp $
# hitach-sh: file(1) magic for Hitachi Super-H
#
# Super-H COFF

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: ibm370,v 1.9 2014/04/30 21:41:02 christos Exp $
# $File: ibm370,v 1.10 2017/03/17 21:35:28 christos Exp $
# ibm370: file(1) magic for IBM 370 and compatibles.
#
# "ibm370" said that 0x15d == 0535 was "ibm 370 pure executable".

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: ibm6000,v 1.12 2013/09/16 15:12:42 christos Exp $
# $File: ibm6000,v 1.13 2017/03/17 21:35:28 christos Exp $
# ibm6000: file(1) magic for RS/6000 and the RT PC.
#
0 beshort 0x01df executable (RISC System/6000 V3.1) or obj module

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: icc,v 1.1 2013/01/08 01:43:18 christos Exp $
# $File: icc,v 1.5 2017/08/13 00:21:47 christos Exp $
# icc: file(1) magic for International Color Consortium file formats
#
@ -11,41 +11,204 @@
# http://www.color.org/specification/ICC1v43_2010-12.pdf
#
# for Specification ICC.1:2010 (Profile version 4.3.0.0).
# URL: http://fileformats.archiveteam.org/wiki/ICC_profile
# Reference: http://www.color.org/iccmax/ICC.2-2016-7.pdf
# Update: Joerg Jenderek
#
# Bytes 36 to 39 contain a generic profile file signature of "acsp";
# bytes 40 to 43 "may be used to identify the primary platform/operating
# system framework for which the profile was created".
#
# There are other fields that might be worth dumping as well.
#
# check and display ICC/ICM color profile
0 name color-profile
>36 string acsp
# skip ASCII like Cognacspirit.txt by month <= 12
>>26 ubeshort <13
# platform/operating system. Only 5 mentioned
#
# This appears to be what's used for Apple ColorSync profiles.
# Instead of adding that, Apple just changed the generic "acsp" entry
# to be for "ColorSync ICC Color Profile" rather than "Kodak Color
# Management System, ICC Profile".
# Yes, it's "APPL", not "AAPL"; see the spec.
36 string acspAPPL ColorSync ICC Profile
!:mime application/vnd.iccprofile
>>>40 string APPL ColorSync
# Microsoft ICM color profile
36 string acspMSFT Microsoft ICM Color Profile
!:mime application/vnd.iccprofile
>>>40 string MSFT Microsoft
# Yes, that's a blank after "SGI".
36 string acspSGI\ SGI ICC Profile
!:mime application/vnd.iccprofile
>>>40 string SGI\ SGI
# XXX - is this what's used for the Sun KCMS or not? The standard file
# uses just "acsp" for that, but Apple's file uses it for "ColorSync",
# and there *is* an identified "primary platform" value of SUNW.
36 string acspSUNW Sun KCMS ICC Profile
>>>40 string SUNW Sun KCMS
# 5th platform
>>>40 string TGNT Taligent
# remaining "l" "e" of "color profile" printed later to avoid error
>>>40 string x color profi
#>>>40 string x (%.4s)
!:mime application/vnd.iccprofile
# for "ICM" extension only versions 2.x and for Kodak "CC" 2.0 is found
>>>8 ubyte =2
# do not use empty message text to a avoid error like
# icc, 82: Warning: Current entry does not yet have a description for adding a EXTENSION type
# file.exe: could not find any valid magic files!
>>>>9 ubyte !0 \ble
!:ext icc/icm
# minor version
>>>>9 ubyte =0 \bl
# Kodak colour management system
>>>>>4 string =KCMS \be
!:ext icc/icm/cc
>>>>>4 string !KCMS \be
!:ext icc/icm
>>>8 ubyte !2 \ble
!:ext icc
# Profile version major.4bit-minor.sub1.sub2 like 4.3.0.0 (04300000h)
>>>8 ubyte x %u
>>>9 ubyte/16 x \b.%u
# reserved and shall be null but 205.205 in umx1220u.icm
>>>10 ubyte >0 \b.%u
>>>>11 ubyte >0 \b.%u
# preferred colour management module like appl CCMS KCMS Lino UCCM "Win " "FF "
# skip space like in brmsl08f.icm and null like in brmsl09f.icm, brmsl07f.icm
>>>4 string >\ \b, type %.2s
>>>>6 string >\ \b%.1s
>>>>>7 string >\ \b%.1s
# colour space "XYZ " "Lab " "RGB " CMYK GRAY ...
>>>16 string x \b, %.3s
>>>19 string >\ \b%.1s
# Profile Connection Space (PCS) field usually "XYZ " or "Lab " but sometimes
# null or CMYK like in ISOcoated_v2_to_PSOcoated_v3_DeviceLink.icc
>>>20 string >\0 \b/%.3s
>>>>23 string >\ \b%.1s
# eleven device classes
>>>12 string x \b-%.4s device
# skip 00001964h in hpf69000.icc or 0h in XRDC50Q.ICM or " ROT" in brmsl05f.icm
>>>52 string >\040
# skip "none" model like in "Trinitron Compatible 9300K G2.2.icm"
>>>>52 ubelong !0x6e6f6e65
# device manufacturer field like "HP " "IBM " EPSO
>>>>>48 string x \b, %.2s
>>>>>50 string >\ \b%.1s
>>>>>51 string >\ \b%.1s
# model like "ADI " "A265" and skip 20000404h in IS330.icm for RICOH RUSSIAN-SC
>>>>>52 string >\ \ \b/%.3s
>>>>>>55 string >\ \b%.1s
>>>>>52 string x model
# creator (often same as manufacture) like HP SONY XROX or null like in A925A.icm
>>>80 string >\0 by %.2s
>>>>82 string >\ \b%.1s
>>>>>83 string >\ \b%.1s
# profile size
>>>0 ubelong x \b, %u bytes
# skip invalid date 0 like in linearSRGB.icc
>>>24 ubequad !0
# datetime dd-mm-yyyy hh:mm:ss
>>>>28 ubeshort x \b, %u
# month <= 12
>>>>26 ubeshort x \b-%u
# year
>>>>24 ubeshort x \b-%u
# do not display midnight time like in CNHP8308.ICC
>>>>30 ubequad&0xFFffFFffFFff0000 !0
# hour <= 24
>>>>>30 ubeshort x %u
# minutes <= 59
>>>>>32 ubeshort x \b:%.2u
# seconds <= 59
>>>>>34 ubeshort x \b:%.2u
# vendor specific flags like 2 in HPCLJ5.ICM
>>>44 ubeshort >0 \b, 0x%x vendor flags
# profile flags bits 0-2 of least 16 used by ICC
#>>>44 ubelong >0 \b, 0x%x flags
# icEmbeddedProfileTrue
>>>44 ubelong &1 \b, embedded
# icEmbeddedProfileFalse
#>>>44 ubelong ^1 \b, not embedded
# icUseWithEmbeddedDataOnly
>>>44 ubelong &2 \b, dependently
# icUseAnywhere
#>>>44 ubelong ^2 \b, independently
>>>44 ubelong &4 \b, MCS
#>>>44 ubelong ^4 \b, no MCS
# vendor specific device attributes 1~srgb.icc
# E000D00h~CNB7QEDA.ICM C000A00h~CNB5FCAA.ICM 01040401h~CNB25PE3.ICM
>>>56 ubelong >0 \b, 0x%x vendor attribute
# ICC device attributes bits 0-7 used
#>>>60 ubelong x \b, 0x%x attribute
# http://www.color.org/icc34.h
>>>60 ubelong &0x01 \b, transparent
#>>>60 ubelong ^0x01 \b, reflective
>>>60 ubelong &0x02 \b, matte
#>>>60 ubelong ^0x02 \b, glossy
>>>60 ubelong &0x04 \b, negative
#>>>60 ubelong ^0x04 \b, positive
>>>60 ubelong &0x08 \b, black&white
#>>>60 ubelong ^0x08 \b, colour
>>>60 ubelong &0x10 \b, non-paper
#>>>60 ubelong ^0x10 \b, paper
>>>60 ubelong &0x20 \b, non-textured
#>>>60 ubelong ^0x20 \b, textured
>>>60 ubelong &0x40 \b, non-isotropic
#>>>60 ubelong ^0x40 \b, isotropic
>>>60 ubelong &0x80 \b, self-luminous
#>>>60 ubelong ^0x80 \b, non-self-luminous
# rendering intent 0-3 but 7AEA5027h in EE051__1.ICM 6CB1BCh in EE061__1.ICM
>>>64 ubelong >3 \b, 0x%x rendering intent
#>>>64 ubelong =0 \b, perceptual
>>>64 ubelong =1 \b, relative colorimetric
>>>64 ubelong =2 \b, saturation
>>>64 ubelong =3 \b, absolute colorimetric
# PCS illuminant (3*s15Fixed16Numbers) often 0000f6d6 00010000 0000d32d
>>>71 ubequad !0xd6000100000000d3 \b, PCS
# usually X~0.9642*65536=63189.8112~63190=F6D5h ; but also found
# often F6D6 in gt5000r.icm, F6B8 in kodakce.icm, F6CA in RSWOP.icm
>>>>68 ubelong !0x0000f6d5 X=0x%x
# usually Y=1.0~00010000h but Y=0 in brmsl07f.icm
>>>>72 ubelong !0x00010000 Y=0x%x
# usually Z~0.8249*65536=54060.6464~54061=D32Dh ; but also found
# D2F7 in hp1200c.icm, often D32C in A925A.icm, D309 in RSWOP.icm , D2F8 in kodak_dc.icm
>>>>76 ubelong !0x0000d32d Z=0x%x
# Profile ID. MD5 fingerprinting method as defined in Internet RFC 1321.
>>>84 ubequad >0 \b, 0x%llx MD5
# reserved in older versions should be zero but also found CDCDCDCDCDCDCDCD
#>>100 ubequad x \b 0x%llx reserved
# tag table
# 6 <= tags count <= 43
#>>>128 ubelong >43 \b, %u tags
>>>128 ubelong x
# shall contain the profileDescriptionTag "desc" , copyrightTag "cprt"
# search range = tags count * 12 -8=< maximal tag count * 12 -8= 43 * 12 -8= 508
>>>>132 search/508 cprt
# but no copyright tag in linearSRGB.icc
# beneath /System/Library/Frameworks/WebKit.framework/
# Versions/A/Frameworks/WebCore.framework/Versions/A/Resources
>>>>132 default x \b, no copyright tag
# 1st tag
#>>>132 string x \b, 1st tag %.4s
#>>>136 ubelong x 0x%x offset
#>>>140 ubelong x 0x%x len
# 2nd tag,...
# look also for profileDescriptionTag "desc"
>>>132 search/508 desc
# look further for TextDescriptionType "desc" signature
>>>>(&0.L) string =desc
>>>>>&4 pstring/l x "%s"
# look alternative for multiLocalizedUnicodeType "mluc" signature like in VideoPAL.icc
>>>>(&0.L) string =mluc
>>>>>&(&8.L) ubequad x
>>>>>>&4 bestring16 x '%s'
# Any other profile.
# XXX - should we use "acsp\0\0\0\0" for "no primary platform" profiles,
# and use "acsp" for everything else and dump the "primary platform"
# string in those cases?
36 string acsp ICC Profile
!:mime application/vnd.iccprofile
36 string acsp
>0 use color-profile

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: images,v 1.117 2016/07/05 19:12:21 christos Exp $
# $File: images,v 1.126 2017/06/11 22:25:44 christos Exp $
# images: file(1) magic for image formats (see also "iff", and "c-lang" for
# XPM bitmaps)
#
@ -35,14 +35,19 @@
>>>16 ubyte <33
# skip more by looking for pixel size 0Fh 10h 18h 20h
>>>>16 ubyte&0xC0 0x00
# skip 260-16.ico by looking for no color map
>>>>>1 ubyte 0
# implies no first map entry
>>>>>>3 uleshort 0
>>>>>>>0 use tga-image
# Color Map
>>>>>1 ubyte >0
>>>>>1 belong&0xfff7ffff 0x01010000
>>>>>>0 use tga-image
>>>>>1 belong&0xfff7ffff 0x00020000
>>>>>>0 use tga-image
>>>>>1 belong&0xfff7ffff 0x00030000
>>>>>>0 use tga-image
>>>>>1 default x
# skip 260-16.ico by looking for no color map
>>>>>>1 ubyte 0
# implies no first map entry
>>>>>>>3 uleshort 0
>>>>>>>>0 use tga-image
# display tga bitmap image information
0 name tga-image
>2 ubyte <34 Targa image data
@ -171,42 +176,42 @@
>>>&0 regex =[0-9]{1,50} \b %s
0 search/1 P1
>0 regex/4 P1\\s
>0 regex/4 P1[\040\t\f\r\n]
>>0 use netpbm
>>>0 string x \b, bitmap
!:strength + 45
!:mime image/x-portable-bitmap
0 search/1 P2
>0 regex/4 P2\\s
>0 regex/4 P2[\040\t\f\r\n]
>>0 use netpbm
>>>0 string x \b, greymap
!:strength + 45
!:mime image/x-portable-greymap
0 search/1 P3
>0 regex/4 P3\\s
>0 regex/4 P3[\040\t\f\r\n]
>>0 use netpbm
>>>0 string x \b, pixmap
!:strength + 45
!:mime image/x-portable-pixmap
0 string P4
>0 regex/4 P4\\s
>0 regex/4 P4[\040\t\f\r\n]
>>0 use netpbm
>>>0 string x \b, rawbits, bitmap
!:strength + 45
!:mime image/x-portable-bitmap
0 string P5
>0 regex/4 P5\\s
>0 regex/4 P5[\040\t\f\r\n]
>>0 use netpbm
>>>0 string x \b, rawbits, greymap
!:strength + 45
!:mime image/x-portable-greymap
0 string P6
>0 regex/4 P6\\s
>0 regex/4 P6[\040\t\f\r\n]
>>0 use netpbm
>>>0 string x \b, rawbits, pixmap
!:strength + 45
@ -414,21 +419,35 @@
# (Greg Roelofs, newt@uchicago.edu)
# (Albert Cahalan, acahalan@cs.uml.edu)
#
# 137 P N G \r \n ^Z \n [4-byte length] H E A D [HEAD data] [HEAD crc] ...
# 137 P N G \r \n ^Z \n [4-byte length] I H D R [HEAD data] [HEAD crc] ...
#
0 string \x89PNG\x0d\x0a\x1a\x0a PNG image data
# IHDR parser
0 name png-ihdr
>0 belong x \b, %d x
>4 belong x %d,
>8 byte x %d-bit
>9 byte 0 grayscale,
>9 byte 2 \b/color RGB,
>9 byte 3 colormap,
>9 byte 4 gray+alpha,
>9 byte 6 \b/color RGBA,
#>10 byte 0 deflate/32K,
>12 byte 0 non-interlaced
>12 byte 1 interlaced
# Standard PNG image.
0 string \x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0DIHDR PNG image data
!:mime image/png
>16 belong x \b, %d x
>20 belong x %d,
>24 byte x %d-bit
>25 byte 0 grayscale,
>25 byte 2 \b/color RGB,
>25 byte 3 colormap,
>25 byte 4 gray+alpha,
>25 byte 6 \b/color RGBA,
#>26 byte 0 deflate/32K,
>28 byte 0 non-interlaced
>28 byte 1 interlaced
!:strength +10
>16 use png-ihdr
# Apple CgBI PNG image.
0 string \x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x04CgBI
>24 string \x00\x00\x00\x0DIHDR PNG image data (CgBI)
!:mime image/png
!:strength +10
>>32 use png-ihdr
# possible GIF replacements; none yet released!
# (Greg Roelofs, newt@uchicago.edu)
@ -1451,3 +1470,12 @@
>0x10 string GVRT Sega GVR image:
>>0x10 use sega-gvr-image-header
>>0x08 belong x \b, global index = %u
# Light Field Picture
# Documentation: http://optics.miloush.net/lytro/TheFileFormat.aspx
# Typical file extensions: .lfp .lfr .lfx
0 belong 0x894C4650
>4 belong 0x0D0A1A0A
>12 belong 0x00000000 Lytro Light Field Picture
>8 belong x \b, version %d

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: intel,v 1.14 2015/11/10 00:13:27 christos Exp $
# $File: intel,v 1.15 2017/03/17 21:35:28 christos Exp $
# intel: file(1) magic for x86 Unix
#
# Various flavors of x86 UNIX executable/object (other than Xenix, which

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: isz,v 1.3 2014/04/30 21:41:02 christos Exp $
# $File: isz,v 1.4 2017/03/17 21:35:28 christos Exp $
# ISO Zipped file format
# http://www.ezbsystems.com/isz/iszspec.txt
0 string IsZ! ISO Zipped file

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: jpeg,v 1.30 2016/07/04 15:18:23 christos Exp $
# $File: jpeg,v 1.31 2017/03/17 21:35:28 christos Exp $
# JPEG images
# SunOS 5.5.1 had
#

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: kerberos,v 1.1 2014/12/10 18:45:43 christos Exp $
# $File: kerberos,v 1.2 2017/03/17 21:35:28 christos Exp $
# kerberos: MIT kerberos file binary formats
#

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: kml,v 1.3 2010/11/25 15:00:12 christos Exp $
# $File: kml,v 1.4 2017/03/17 21:35:28 christos Exp $
# Type: Google KML, formerly Keyhole Markup Language
# Future development of this format has been handed
# over to the Open Geospatial Consortium.

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: linux,v 1.63 2015/08/24 05:16:11 christos Exp $
# $File: linux,v 1.64 2017/03/17 21:35:28 christos Exp $
# linux: file(1) magic for Linux files
#
# Values for Linux/i386 binaries, from Daniel Quinlan <quinlan@yggdrasil.com>

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: lisp,v 1.24 2015/11/30 20:54:26 christos Exp $
# $File: lisp,v 1.25 2017/03/17 21:35:28 christos Exp $
# lisp: file(1) magic for lisp programs
#
# various lisp types, from Daniel Quinlan (quinlan@yggdrasil.com)

View file

@ -1,6 +1,9 @@
#------------------------------------------------------------------------------
# $File: m4,v 1.1 2011/12/08 12:12:46 rrt Exp $
# $File: m4,v 1.2 2017/08/14 07:40:38 christos Exp $
# make: file(1) magic for M4 scripts
#
0 regex \^dnl\ M4 macro processor script text
!:mime text/x-m4
0 regex \^AC_DEFUN\\(\\[ M4 macro processor script text
!:strength + 15
!:mime text/x-m4

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: macintosh,v 1.26 2015/11/25 00:36:02 christos Exp $
# $File: macintosh,v 1.27 2017/03/17 21:35:28 christos Exp $
# macintosh description
#
# BinHex is the Macintosh ASCII-encoded file format (see also "apple")

View file

@ -1,7 +1,8 @@
#------------------------------------------------------------------------------
# $File: make,v 1.2 2015/08/25 07:34:06 christos Exp $
# $File: make,v 1.3 2016/12/10 14:21:29 christos Exp $
# make: file(1) magic for makefiles
#
# URL: https://en.wikipedia.org/wiki/Make_(software)
0 regex/100l \^CFLAGS makefile script text
!:mime text/x-makefile
0 regex/100l \^VPATH makefile script text
@ -10,12 +11,19 @@
!:mime text/x-makefile
0 regex/100l \^all: makefile script text
!:mime text/x-makefile
0 regex/100l \^\.PRECIOUS makefile script text
0 regex/100l \^\\.PRECIOUS makefile script text
!:mime text/x-makefile
0 regex/100l \^\.BEGIN BSD makefile script text
# Update: Joerg Jenderek
# Reference: https://www.freebsd.org/cgi/man.cgi?make(1)
# exclude grub-core\lib\libgcrypt\mpi\Makefile.am with "#BEGIN_ASM_LIST"
# by additional escaping point character
0 regex/100l \^\\.BEGIN BSD makefile script text with "%s"
!:mime text/x-makefile
0 regex/100l \^\.include BSD makefile script text
!:ext /mk
# exclude MS Windows help file CoNtenT with ":include FOOBAR.CNT"
# and NSIS script with "!include" by additional escaping point character
0 regex/100l \^\\.include BSD makefile script text with "%s"
!:mime text/x-makefile
!:ext /mk
0 regex/100l \^SUBDIRS automake makefile script text
!:mime text/x-makefile

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: maple,v 1.7 2013/01/11 16:45:23 christos Exp $
# $File: maple,v 1.8 2017/03/17 21:35:28 christos Exp $
# maple: file(1) magic for maple files
# "H. Nanosecond" <aldomel@ix.netcom.com>
# Maple V release 4, a multi-purpose math program

View file

@ -9,20 +9,22 @@
# leader position 20-21 must be 45
# and 22-23 also 00 so far, but we check that later.
20 string 45
>0 search/2048 \x1e
# leader starts with 5 digits, followed by codes specific to MARC format
>0 regex/1l (^[0-9]{5})[acdnp][^bhlnqsu-z] MARC21 Bibliographic
>>0 regex/1l (^[0-9]{5})[acdnp][^bhlnqsu-z] MARC21 Bibliographic
!:mime application/marc
>0 regex/1l (^[0-9]{5})[acdnosx][z] MARC21 Authority
>>0 regex/1l (^[0-9]{5})[acdnosx][z] MARC21 Authority
!:mime application/marc
>0 regex/1l (^[0-9]{5})[cdn][uvxy] MARC21 Holdings
>>0 regex/1l (^[0-9]{5})[cdn][uvxy] MARC21 Holdings
!:mime application/marc
0 regex/1l (^[0-9]{5})[acdn][w] MARC21 Classification
>>0 regex/1l (^[0-9]{5})[acdn][w] MARC21 Classification
!:mime application/marc
>0 regex/1l (^[0-9]{5})[cdn][q] MARC21 Community
>>0 regex/1l (^[0-9]{5})[cdn][q] MARC21 Community
!:mime application/marc
# leader position 22-23, should be "00" but is it?
>0 regex/1l (^.{21})([^0]{2}) (non-conforming)
>>0 regex/1l (^.{21})([^0]{2}) (non-conforming)
!:mime application/marc

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: mathematica,v 1.8 2015/04/09 20:01:40 christos Exp $
# $File: mathematica,v 1.9 2017/03/17 21:35:28 christos Exp $
# mathematica: file(1) magic for mathematica files
# "H. Nanosecond" <aldomel@ix.netcom.com>
# Mathematica a multi-purpose math program

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: metastore,v 1.1 2011/04/06 12:37:44 christos Exp $
# $File: metastore,v 1.2 2017/03/17 21:35:28 christos Exp $
# metastore: file(1) magic for metastore files
# From: Thomas Wissen
# see http://david.hardeman.nu/software.php#metastore

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: meteorological,v 1.1 2014/08/04 06:26:16 christos Exp $
# $File: meteorological,v 1.2 2017/03/17 21:35:28 christos Exp $
# rinex: file(1) magic for RINEX files
# http://igscb.jpl.nasa.gov/igscb/data/format/rinex210.txt
# ftp://cddis.gsfc.nasa.gov/pub/reports/formats/rinex300.pdf

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: microfocus,v 1.1 2016/02/09 01:22:49 christos Exp $
# $File: microfocus,v 1.2 2017/03/17 21:35:28 christos Exp $
# Micro Focus COBOL data files.
# http://documentation.microfocus.com/help/index.jsp?topic=\

View file

@ -1,9 +1,9 @@
#------------------------------------------------------------------------------
# $File: mime,v 1.6 2010/11/25 15:00:12 christos Exp $
# $File: mime,v 1.8 2017/03/17 22:20:22 christos Exp $
# mime: file(1) magic for MIME encoded files
#
0 string/t Content-Type:\
0 string/t Content-Type:\040
>14 string >\0 %s
0 string/t Content-Type:
>13 string >\0 %s

View file

@ -1,6 +1,6 @@
#-----------------------------------------------------------------------------
# $File: misctools,v 1.16 2016/02/14 15:46:52 christos Exp $
# $File: misctools,v 1.17 2017/03/17 21:35:28 christos Exp $
# misctools: file(1) magic for miscellaneous UNIX tools.
#
0 search/1 %%!! X-Post-It-Note text

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: modem,v 1.7 2016/01/08 00:56:42 christos Exp $
# $File: modem,v 1.8 2017/03/17 21:35:28 christos Exp $
# modem: file(1) magic for modem programs
#
# From: Florian La Roche <florian@knorke.saar.de>

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: mozilla,v 1.6 2015/01/25 16:20:46 christos Exp $
# $File: mozilla,v 1.7 2017/03/17 21:35:28 christos Exp $
# mozilla: file(1) magic for Mozilla XUL fastload files
# (XUL.mfasl and XPC.mfasl)
# URL: http://www.mozilla.org/

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: msdos,v 1.111 2016/09/14 01:26:26 christos Exp $
# $File: msdos,v 1.120 2017/08/13 00:21:47 christos Exp $
# msdos: file(1) magic for MS-DOS files
#
@ -328,9 +328,15 @@
0 string \xffKEYB\ \ \ \0\0\0\0
>12 string \0\0\0\0`\004\360 MS-DOS KEYBoard Layout file
# DOS device driver updated by Joerg Jenderek at May 2011
# http://maben.homeip.net/static/S100/IBM/software/DOS/DOS%20techref/CHAPTER.009
0 ulequad&0x07a0ffffffff 0xffffffff DOS executable (
# DOS device driver updated by Joerg Jenderek at May 2011,Mar 2017
# https://amaus.net/static/S100/IBM/software/DOS/DOS%20techref/CHAPTER.009
0 ulequad&0x07a0ffffffff 0xffffffff
>0 use msdos-driver
0 name msdos-driver DOS executable (
#!:mime application/octet-stream
!:mime application/x-dosdriver
# also found FreeDOS print driver SPOOL.DEV and disc compression driver STACLOAD.BIN
!:ext sys/dev/bin
>40 search/7 UPX! \bUPX compressed
# DOS device driver attributes
>4 uleshort&0x8000 0x0000 \bblock device driver
@ -350,7 +356,7 @@
>>40 search/7 UPX!
>>40 default x
# leading/trailing nulls, zeros or non ASCII characters in 8-byte name field at offset 10 are skipped
>>>12 ubyte >0x27 \b
>>>12 ubyte >0x2E \b
>>>>10 ubyte >0x20
>>>>>10 ubyte !0x2E
>>>>>>10 ubyte !0x2A \b%c
@ -372,10 +378,10 @@
>>>>>17 ubyte !0x2E
>>>>>>17 ubyte <0x90 \b%c
# some character device drivers like ASPICD.SYS, btcdrom.sys and Cr_atapi.sys contain only spaces or points in name field
>>>4 uleshort&0x8000 0x8000
>>>>12 ubyte <0x2F
>>>12 ubyte <0x2F
# they have their real name at offset 22
>>>>>22 string >\0 \b%-.5s
# also block device drivers like DUMBDRV.SYS
>>>>22 string >\056 %-.6s
>4 uleshort&0x8000 0x0000
# 32 bit sector addressing ( > 32 MB) for block devices
>>4 uleshort&0x0002 0x0002 \b,32-bit sector-
@ -394,11 +400,20 @@
>>4 uleshort&0x4842 >0 \bsupport
>0 ubyte x \b)
# DOS driver cmd640x.sys has 0x12 instead of 0xffffffff for pointer field to next device header
# Too weak, matches files that only contain 0's
#0 ulequad&0x000007a0ffffffed 0x0000000000000000 DOS-executable (
#>4 uleshort&0x8000 0x8000 \bcharacter device driver
#>>10 string x %-.8s
#>4 uleshort&0x4000 0x4000 \b,control strings-support)
0 ulequad 0x0513c00000000012
>0 use msdos-driver
# DOS drivers DC2975.SYS, DUMBDRV.SYS, ECHO.SYS has also none 0xffffffff for pointer field
0 ulequad 0x32f28000ffff0016
>0 use msdos-driver
0 ulequad 0x007f00000000ffff
>0 use msdos-driver
0 ulequad 0x001600000000ffff
>0 use msdos-driver
# DOS drivers LS120.SYS, MKELS120.SYS use reserved bits of attribute field
0 ulequad 0x0bf708c2ffffffff
>0 use msdos-driver
0 ulequad 0x07bd08c2ffffffff
>0 use msdos-driver
# updated by Joerg Jenderek
# GRR: line below too general as it catches also
@ -565,10 +580,23 @@
0 string/b PO^Q` Microsoft Word 6.0 Document
!:mime application/msword
#
0 string/b \376\067\0\043 Microsoft Office Document
4 long 0
>0 belong 0xfe320000 Microsoft Word for Macintosh 1.0
!:mime application/msword
0 string/b \333\245-\0\0\0 Microsoft Office Document
!:ext mcw
>0 belong 0xfe340000 Microsoft Word for Macintosh 3.0
!:mime application/msword
!:ext mcw
>0 belong 0xfe37001c Microsoft Word for Macintosh 4.0
!:mime application/msword
!:ext mcw
>0 belong 0xfe370023 Microsoft Word for Macintosh 5.0
!:mime application/msword
!:ext mcw
0 string/b \333\245-\0\0\0 Microsoft Word 2.0 Document
!:mime application/msword
!:ext doc
512 string/b \354\245\301 Microsoft Word Document
!:mime application/msword
@ -792,7 +820,7 @@
# Windows icons
# Update: Joerg Jenderek
# URL: https://en.wikipedia.org/wiki/CUR_(file_format)
# Note: similiar to Windows CURsor. container for BMP (only DIB part) or PNG
# Note: similar to Windows CURsor. container for BMP (only DIB part) or PNG
0 belong 0x00000100
>9 byte 0
>>0 byte x
@ -863,7 +891,7 @@
# Windows non-animated cursors
# Update: Joerg Jenderek
# URL: https://en.wikipedia.org/wiki/CUR_(file_format)
# Note: similiar to Windows ICOn. container for BMP ( only DIB part)
# Note: similar to Windows ICOn. container for BMP ( only DIB part)
# GRR: line below is too general as it catches also Lotus 1-2-3 files
0 belong 0x00000200
>9 byte 0
@ -960,6 +988,7 @@
# DOS EPS Binary File Header
# From: Ed Sznyter <ews@Black.Market.NET>
0 belong 0xC5D0D3C6 DOS EPS Binary File
!:mime image/x-eps
>4 long >0 Postscript starts at byte %d
>>8 long >0 length %d
>>>12 long >0 Metafile starts at byte %d
@ -969,7 +998,7 @@
# TNEF magic From "Joomy" <joomy@se-ed.net>
# Microsoft Outlook's Transport Neutral Encapsulation Format (TNEF)
0 leshort 0x223e9f78 TNEF
0 lelong 0x223e9f78 TNEF
!:mime application/vnd.ms-tnef
# Norton Guide (.NG , .HLP) files added by Joerg Jenderek from source NG2HTML.C
@ -1106,3 +1135,66 @@
0 string MIOPEN Mallard BASIC Jetsam data
0 string Jetsam0 Mallard BASIC Jetsam index data
# DOS backup 2.0 to 3.2
# backupid.@@@
# plausibility check for date
0x3 ushort >1979
>0x5 ubyte-1 <31
>>0x6 ubyte-1 <12
# actually 121 nul bytes
>>>0x7 string \0\0\0\0\0\0\0\0
>>>>0x1 ubyte x DOS 2.0 backup id file, sequence %d
!:ext @@@
>>>>0x0 ubyte 0xff \b, last disk
# backed up file
# skip some AppleWorks word like Tomahawk.Awp, WIN98SE-DE.vhd
# by looking for trailing nul of maximal file name string
0x52 ubyte 0
# test for flag byte: FFh~complete file, 00h~split file
# FFh -127 = -1 -127 = -128
# 00h -127 = 0 -127 = -127
>0 byte-127 <-126
# plausibility check for file name length
>>0x53 ubyte-1 <78
# looking for terminating nul of file name string
>>>(0x53.b+4) ubyte 0
# looking if last char of string is valid DOS file name
>>>>(0x53.b+3) ubyte >0x1F
# actually 44 nul bytes
# but sometimes garbage according to Ralf Quint. So can not be used as test
#>0x54 string \0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0
# first char of full file name is DOS (5Ch) or UNIX (2Fh) path separator
# only DOS variant found. UNIX variant according to V32SLASH.TXT in archive PD0315.EXE
>>>>>5 ubyte&0x8C 0x0C
# ./msdos (version 5.30) labeled the entry as
# "DOS 2.0 backed up file %s, split file, sequence %d" or
# "DOS 2.0 backed up file %s, complete file"
>>>>>>0 ubyte x DOS 2.0-3.2 backed up
#>>>>>>0 ubyte 0xff complete
>>>>>>0 ubyte 0
>>>>>>>1 uleshort x sequence %d of
# full file name with path but without drive letter and colon stored from 0x05 til 0x52
>>>>>>0x5 string x file %s
# backup name is original filename
#!:ext *
# magic/Magdir/msdos, 1169: Warning: EXTENSION type ` *' has bad char '*'
# file: line 1169: Bad magic entry ' *'
# after header original file content
>>>>>>128 indirect x \b;
# DOS backup 3.3 to 5.x
# CONTROL.nnn files
0 string \x8bBACKUP\x20
# actually 128 nul bytes
>0xa string \0\0\0\0\0\0\0\0
>>0x9 ubyte x DOS 3.3 backup control file, sequence %d
>>0x8a ubyte 0xff \b, last disk
# NB: The BACKUP.nnn files consist of the files backed up,
# concatenated.

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: msvc,v 1.6 2016/01/26 00:03:19 christos Exp $
# $File: msvc,v 1.9 2017/08/02 08:15:20 christos Exp $
# msvc: file(1) magic for msvc
# "H. Nanosecond" <aldomel@ix.netcom.com>
# Microsoft visual C
@ -33,7 +33,7 @@
# Update: Joerg Jenderek
# Note: test only for Windows XP+SP3 x86 , 8.1 x64 arm and 10.1 x86
# info does only applies partly for older files like msvbvm50.pdb about year 2001
0 string Microsoft\ C/C++\
0 string Microsoft\ C/C++\040
# "Microsoft Program DataBase" by TrID
>24 search/14 \r\n\x1A MSVC program database
!:mime application/x-ms-pdb
@ -54,6 +54,9 @@
# Page Count for msoo-dll.pdb 4379h
>>>0x32 leshort x \b*%d bytes
# Reference: https://github.com/Microsoft/vstest/pull/856/commits/fdc7a9f074ca5a8dfeec83b1be9162bf0cf4000d
0 string/c bsjb\001\000\001\000\000\000\000\000\f\000\000\000pdb\ v1.0 Microsoft Rosyln C# debugging symbols version 1.0
#.sbr
0 string \000\002\000\007\000 MSVC .sbr
>5 string >\0 %s

View file

@ -245,18 +245,18 @@
0x4000 string/b AB
>0x4002 uleshort >0x400F
>>0x400A string \0\0\0\0\0\0 MSX ROM with nonstandard page order
>>0x4002 uleshort x \b, init=0x%04x
>>0x4004 uleshort >0 \b, stahdl=0x%04x
>>0x4006 uleshort >0 \b, devhdl=0x%04x
>>0x4008 uleshort >0 \b, bas=0x%04x
>>>0x4002 uleshort x \b, init=0x%04x
>>>0x4004 uleshort >0 \b, stahdl=0x%04x
>>>0x4006 uleshort >0 \b, devhdl=0x%04x
>>>0x4008 uleshort >0 \b, bas=0x%04x
0x8000 string/b AB
>0x8002 uleshort >0x400F
>>0x800A string \0\0\0\0\0\0 MSX ROM with nonstandard page order
>>0x8002 uleshort x \b, init=0x%04x
>>0x8004 uleshort >0 \b, stahdl=0x%04x
>>0x8006 uleshort >0 \b, devhdl=0x%04x
>>0x8008 uleshort >0 \b, bas=0x%04x
>>>0x8002 uleshort x \b, init=0x%04x
>>>0x8004 uleshort >0 \b, stahdl=0x%04x
>>>0x8006 uleshort >0 \b, devhdl=0x%04x
>>>0x8008 uleshort >0 \b, bas=0x%04x
0x3C000 string/b AB
@ -296,7 +296,7 @@
4 uleshort 0x0900
>0xF byte 1
>>0x14 byte 0
>>>0x1E string \ \ \
>>>0x1E string \040\040\040
>>>>0x23 byte 1
>>>>>0x25 byte 0
>>>>>>0x15 string >\x30

View file

@ -1,6 +1,6 @@
# ------------------------------------------------------------------------
# $File: mup,v 1.4 2009/09/19 16:28:11 christos Exp $
# $File: mup,v 1.5 2017/03/17 21:35:28 christos Exp $
# mup: file(1) magic for Mup (Music Publisher) input file.
#
# From: Abel Cheung <abel (@) oaka.org>

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: netbsd,v 1.23 2015/11/29 01:55:14 christos Exp $
# $File: netbsd,v 1.24 2017/03/17 21:35:28 christos Exp $
# netbsd: file(1) magic for NetBSD objects
#
# All new-style magic numbers are in network byte order.

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: netscape,v 1.7 2015/08/24 05:20:52 christos Exp $
# $File: netscape,v 1.8 2017/03/17 21:35:28 christos Exp $
# netscape: file(1) magic for Netscape files
# "H. Nanosecond" <aldomel@ix.netcom.com>
# version 3 and 4 I think

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: nitpicker,v 1.6 2014/04/30 21:41:02 christos Exp $
# $File: nitpicker,v 1.7 2017/03/17 21:35:28 christos Exp $
# nitpicker: file(1) magic for Flowfiles.
# From: Christian Jachmann <C.Jachmann@gmx.net> http://www.nitpicker.de
0 string NPFF NItpicker Flow File

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: os2,v 1.9 2016/05/11 15:51:57 christos Exp $
# $File: os2,v 1.10 2017/03/17 21:35:28 christos Exp $
# os2: file(1) magic for OS/2 files
#

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: os9,v 1.7 2011/05/13 22:15:54 christos Exp $
# $File: os9,v 1.8 2017/03/17 21:35:28 christos Exp $
#
# Copyright (c) 1996 Ignatios Souvatzis. All rights reserved.
#

View file

@ -1,11 +1,11 @@
#------------------------------------------------------------------------------
# $File: pbf,v 1.1 2013/12/21 14:27:24 christos Exp $
# $File: pbf,v 1.2 2017/01/18 16:16:21 christos Exp $
# file(1) magic(5) data for OpenStreetMap
# OpenStreetMap Protocolbuffer Binary Format (.osm.pbf)
# http://wiki.openstreetmap.org/wiki/PBF_Format
# From: Markus Heidelberg <markus.heidelberg@web.de>
0 belong 0x0000000D
0 belong&0xfffffff0 0
>4 beshort 0x0A09
>>6 string OSMHeader OpenStreetMap Protocolbuffer Binary Format

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: pdf,v 1.8 2015/01/11 18:19:18 christos Exp $
# $File: pdf,v 1.9 2017/05/24 17:35:20 christos Exp $
# pdf: file(1) magic for Portable Document Format
#
@ -20,3 +20,8 @@
!:mime application/vnd.fdf
>5 byte x \b, version %c
>7 byte x \b.%c
0 search/256 %PDF- PDF document
!:mime application/pdf
>&0 byte x \b, version %c
>&2 byte x \b.%c

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: pdp,v 1.10 2014/04/30 21:41:02 christos Exp $
# $File: pdp,v 1.11 2017/03/17 21:35:28 christos Exp $
# pdp: file(1) magic for PDP-11 executable/object and APL workspace
#
0 lelong 0101555 PDP-11 single precision APL workspace

View file

@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
# $File: perl,v 1.25 2016/06/07 23:28:37 rrt Exp $
# $File: perl,v 1.26 2017/02/21 18:34:55 christos Exp $
# perl: file(1) magic for Larry Wall's perl language.
#
# The `eval' lines recognizes an outrageously clever hack.
@ -33,14 +33,14 @@
# by Dmitry V. Levin and Alexey Tourbin
# check the first line
0 search/1024 package
0 search/8192 package
>0 regex \^package[\ \t]+[0-9A-Za-z_:]+\ *; Perl5 module source text
!:strength + 10
!:strength + 40
# not 'p', check other lines
0 search/1024 !p
0 search/8192 !p
>0 regex \^package[\ \t]+[0-9A-Za-z_:]+\ *;
>>0 regex \^1\ *;|\^(use|sub|my)\ .*[(;{=] Perl5 module source text
!:strength + 10
!:strength + 75
# Perl POD documents
# From: Tom Hukins <tom@eborcom.com>

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: pgf,v 1.1 2013/04/22 15:19:49 christos Exp $
# $File: pgf,v 1.2 2017/03/17 21:35:28 christos Exp $
# pgf: file(1) magic for Progressive Graphics File (PGF)
#
# <http://www.libpgf.org/uploads/media/PGF_Details_01.pdf>

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: pgp,v 1.12 2016/10/07 20:22:12 christos Exp $
# $File: pgp,v 1.14 2017/03/17 21:35:28 christos Exp $
# pgp: file(1) magic for Pretty Good Privacy
# see http://lists.gnupg.org/pipermail/gnupg-devel/1999-September/016052.html
#
@ -19,15 +19,15 @@
#>15 string SIGNED\040MESSAGE- signed message
#>15 string PGP\040SIGNATURE- signature
2 string ---BEGIN\ PGP\ PUBLIC\ KEY\ BLOCK- PGP public key block
2 string ---BEGIN\040PGP\040PUBLIC\040KEY\040BLOCK- PGP public key block
!:mime application/pgp-keys
>10 search/100 \n\n
>>&0 use pgp
0 string -----BEGIN\040PGP\40MESSAGE- PGP message
0 string -----BEGIN\040PGP\040MESSAGE- PGP message
!:mime application/pgp
>10 search/100 \n\n
>>&0 use pgp
0 string -----BEGIN\040PGP\40SIGNATURE- PGP signature
0 string -----BEGIN\040PGP\040SIGNATURE- PGP signature
!:mime application/pgp-signature
>10 search/100 \n\n
>>&0 use pgp

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: printer,v 1.26 2014/04/12 14:51:52 christos Exp $
# $File: printer,v 1.28 2017/03/17 22:20:22 christos Exp $
# printer: file(1) magic for printer-formatted files
#
@ -13,7 +13,7 @@
>>>15 string EPS \b, type %s
>>>15 string Query \b, type %s
>>>15 string ExitServer \b, type %s
>>>15 search/1000 %%LanguageLevel:\
>>>15 search/1000 %%LanguageLevel:\040
>>>>&0 string >\0 \b, Level %s
# Some PCs have the annoying habit of adding a ^D as a document separator
0 string \004%! PostScript document text
@ -24,7 +24,7 @@
>>>16 string EPS \b, type %s
>>>16 string Query \b, type %s
>>>16 string ExitServer \b, type %s
>>>16 search/1000 %%LanguageLevel:\
>>>16 search/1000 %%LanguageLevel:\040
>>>>&0 string >\0 \b, Level %s
0 string \033%-12345X%!PS PostScript document

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: project,v 1.4 2009/09/19 16:28:11 christos Exp $
# $File: project,v 1.5 2017/03/17 21:35:28 christos Exp $
# project: file(1) magic for Project management
#
# Magic strings for ftnchek project files. Alexander Mai

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: psdbms,v 1.7 2016/01/08 00:41:02 christos Exp $
# $File: psdbms,v 1.8 2017/03/17 21:35:28 christos Exp $
# psdbms: file(1) magic for psdatabase
#
# Update: Joerg Jenderek

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: python,v 1.29 2016/07/27 09:42:16 rrt Exp $
# $File: python,v 1.34 2017/08/14 07:40:38 christos Exp $
# python: file(1) magic for python
#
# Outlook puts """ too for urgent messages
@ -24,7 +24,11 @@
0 belong 0x6c0c0d0a python 3.2 byte-compiled
0 belong 0x9e0c0d0a python 3.3 byte-compiled
0 belong 0xee0c0d0a python 3.4 byte-compiled
0 belong 0x160d0d0a python 3.5 byte-compiled
0 belong 0x160d0d0a python 3.5.1- byte-compiled
0 belong 0x170d0d0a python 3.5.2+ byte-compiled
0 belong 0x330d0d0a python 3.6 byte-compiled
0 belong 0x3e0d0d0a python 3.7 byte-compiled
0 search/1/w #!\ /usr/bin/python Python script text executable
!:strength + 15
@ -41,12 +45,25 @@
# from module.submodule import func1, func2
0 regex \^from\\s+(\\w|\\.)+\\s+import.*$ Python script text executable
0 regex \^from[\040\t\f\r\n]+([A-Za-z0-9_]|\\.)+[\040\t\f\r\n]+import.*$ Python script text executable
!:strength + 15
!:mime text/x-python
# def __init__ (self, ...):
0 search/4096 def\ __init__
>&0 search/64 self Python script text executable
!:strength + 15
!:mime text/x-python
# if __name__ == "__main__":
0 search/4096 if\ __name__
>&0 search/64 '__main__' Python script text executable
>&0 search/64 "__main__" Python script text executable
!:strength + 15
!:mime text/x-python
# import module [as abrev]
0 regex \^import\ [_[:alpha:]]+\ as\ [[:alpha:]][[:space:]]*$ Python script text executable
!:mime text/x-python
# comments
@ -62,12 +79,19 @@
# except: or finally:
# block
0 search/4096 try:
>&0 regex \^\\s*except.*: Python script text executable
>&0 regex \^[[:space:]]*except.*:$ Python script text executable
!:strength + 15
!:mime text/x-python
>&0 search/4096 finally: Python script text executable
!:mime text/x-python
# def name(args, args):
0 regex \^(\ |\\t){0,50}def\ {1,50}[a-zA-Z]{1,100}
>&0 regex \ {0,50}\\(([a-zA-Z]|,|\ ){1,255}\\):$ Python script text executable
# class name[(base classes,)]: [pass]
0 regex \^class\ [_[:alpha:]]+(\\(.*\\))?(\ )*:([\ \t]+pass)?$ Python script text executable
!:strength + 15
!:mime text/x-python
# def name(*args, **kwargs):
0 regex \^[[:space:]]{0,50}def\ {1,50}[_a-zA-Z]{1,100}
>&0 regex \\(([[:alpha:]*_,\ ]){0,255}\\):$ Python script text executable
!:strength + 15
!:mime text/x-python

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: riff,v 1.31 2015/02/14 17:30:03 christos Exp $
# $File: riff,v 1.32 2017/03/17 21:35:28 christos Exp $
# riff: file(1) magic for RIFF format
# See
#

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: ruby,v 1.6 2016/07/27 09:46:29 rrt Exp $
# $File: ruby,v 1.7 2017/08/14 13:39:18 christos Exp $
# ruby: file(1) magic for Ruby scripting language
# URL: http://www.ruby-lang.org/
# From: Reuben Thomas <rrt@sc3d.org>
@ -22,11 +22,30 @@
# What looks like ruby, but does not have a shebang
# (modules and such)
# From: Lubomir Rintel <lkundrak@v3.sk>
0 regex \^[\ \t]*require[\ \t]'[A-Za-z_/]+'
>0 regex include\ [A-Z]|def\ [a-z]|\ do$
>>0 regex \^[\ \t]*end([\ \t]*[;#].*)?$ Ruby script text
0 regex \^[[:space:]]*require[[:space:]]'[A-Za-z_/]+'
>0 regex def\ [a-z]|\ do$
>>&0 regex \^[[:space:]]*end([[:space:]]+[;#].*)?$ Ruby script text
!:strength + 30
!:mime text/x-ruby
0 regex \^[\ \t]*(class|module)[\ \t][A-Z]
0 regex \^[[:space:]]*(class|module)[[:space:]][A-Z]
>0 regex (modul|includ)e\ [A-Z]|def\ [a-z]
>>0 regex \^[\ \t]*end([\ \t]*[;#].*)?$ Ruby module source text
>>&0 regex \^[[:space:]]*end([[:space:]]+[;#].*)?$ Ruby script text
!:strength + 30
!:mime text/x-ruby
# Classes with no modules or defs, beats simple ASCII
0 regex \^[[:space:]]*(class|module)[[:space:]][A-Z]
>&0 regex \^[[:space:]]*end([[:space:]]+[;#if].*)?$ Ruby script text
!:strength + 10
!:mime text/x-ruby
# Looks for function definition to balance python magic
# def name (args)
# end
0 regex \^[[:space:]]*def\ [a-z]|def\ [[:alpha:]]+::[a-z]
>&0 regex \^[[:space:]]*end([[:space:]]+[;#].*)?$ Ruby script text
!:strength + 10
!:mime text/x-ruby
0 regex \^[[:space:]]*require[[:space:]]'[A-Za-z_/]+' Ruby script text
!:mime text/x-ruby
0 regex \^[[:space:]]*include\ ([A-Z]+[a-z]*(::))+ Ruby script text
!:mime text/x-ruby

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: sccs,v 1.6 2009/09/19 16:28:12 christos Exp $
# $File: sccs,v 1.7 2017/03/17 21:35:28 christos Exp $
# sccs: file(1) magic for SCCS archives
#
# SCCS archive structure:

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: scientific,v 1.10 2015/08/24 05:18:55 christos Exp $
# $File: scientific,v 1.12 2017/03/17 22:20:22 christos Exp $
# scientific: file(1) magic for scientific formats
#
# From: Joe Krahn <krahn@niehs.nih.gov>
@ -90,7 +90,7 @@
# format DD-MMM-YY, e.g., 01-JAN-70, and the IDcode consists of numbers and
# uppercase letters. However, examples have been seen without the date string,
# e.g., the example on the chemime site.
0 string HEADER\ \ \ \
0 string HEADER\ \ \ \040
>&0 regex/1l \^.{40}
>>&0 regex/1l [0-9]{2}-[A-Z]{3}-[0-9]{2}\ {3}
>>>&0 regex/1ls [A-Z0-9]{4}.{14}$

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: sendmail,v 1.8 2015/11/11 15:27:03 christos Exp $
# $File: sendmail,v 1.10 2017/08/13 00:21:47 christos Exp $
# sendmail: file(1) magic for sendmail config files
#
# XXX - byte order?
@ -15,7 +15,7 @@
# http://www.sendmail.com/sm/open_source/docs/older_release_notes/
# freezed configuration file (dbm format?) created from sendmal.cf with -bz
# by older sendmail. til version 8.6 support for frozen configuration files is removed
# valid version numbers look like "7.14.4" and should be simliar to output of commands
# valid version numbers look like "7.14.4" and should be similar to output of commands
# "sendmail -d0 -bt < /dev/null |grep -i Version" or "egrep '^DZ' /etc/sendmail.cf"
>16 regex/s =^[0-78][0-9.]{4} Sendmail frozen configuration
# normally only /etc/sendmail.fc or /var/adm/sendmail/sendmail.fc

View file

@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
# $File: sequent,v 1.12 2014/08/16 16:07:12 christos Exp $
# $File: sequent,v 1.13 2017/03/17 21:35:28 christos Exp $
# sequent: file(1) magic for Sequent machines
#
# Sequent information updated by Don Dwiggins <atsun!dwiggins>.

Some files were not shown because too many files have changed in this diff Show more