Imported Upstream version 5.37 upstream/5.37
authorDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 19 Sep 2019 06:02:37 +0000 (15:02 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Thu, 19 Sep 2019 06:02:37 +0000 (15:02 +0900)
127 files changed:
ChangeLog
configure.ac
doc/file.man
magic/Magdir/acorn
magic/Magdir/adventure
magic/Magdir/android
magic/Magdir/animation
magic/Magdir/apple
magic/Magdir/archive
magic/Magdir/audio
magic/Magdir/basis
magic/Magdir/ber
magic/Magdir/bioinformatics
magic/Magdir/biosig
magic/Magdir/blcr
magic/Magdir/blender
magic/Magdir/c-lang
magic/Magdir/cad
magic/Magdir/commands
magic/Magdir/compress
magic/Magdir/console
magic/Magdir/coverage
magic/Magdir/ctf
magic/Magdir/cups
magic/Magdir/database
magic/Magdir/dataone
magic/Magdir/dbpf
magic/Magdir/dolby
magic/Magdir/dyadic
magic/Magdir/ebml
magic/Magdir/edid [new file with mode: 0644]
magic/Magdir/erlang
magic/Magdir/esri
magic/Magdir/filesystems
magic/Magdir/finger
magic/Magdir/flash
magic/Magdir/fonts
magic/Magdir/fsav
magic/Magdir/games
magic/Magdir/geo
magic/Magdir/gnome
magic/Magdir/gnu
magic/Magdir/graphviz
magic/Magdir/guile
magic/Magdir/ibm6000
magic/Magdir/images
magic/Magdir/isz
magic/Magdir/keepass
magic/Magdir/kerberos
magic/Magdir/kml
magic/Magdir/linux
magic/Magdir/lisp
magic/Magdir/llvm
magic/Magdir/lua
magic/Magdir/m4
magic/Magdir/macintosh
magic/Magdir/mail.news
magic/Magdir/map
magic/Magdir/marc21
magic/Magdir/matroska
magic/Magdir/mercurial
magic/Magdir/metastore
magic/Magdir/microfocus
magic/Magdir/misctools
magic/Magdir/modem
magic/Magdir/mozilla
magic/Magdir/msdos
magic/Magdir/msooxml
magic/Magdir/neko
magic/Magdir/nitpicker
magic/Magdir/numpy [new file with mode: 0644]
magic/Magdir/ole2compounddocs
magic/Magdir/palm
magic/Magdir/parrot
magic/Magdir/pbf
magic/Magdir/pc98
magic/Magdir/pgp
magic/Magdir/polyml
magic/Magdir/printer
magic/Magdir/psl
magic/Magdir/pwsafe
magic/Magdir/python
magic/Magdir/qt
magic/Magdir/revision
magic/Magdir/riff
magic/Magdir/rpmsg [new file with mode: 0644]
magic/Magdir/ruby
magic/Magdir/scientific
magic/Magdir/selinux
magic/Magdir/sendmail
magic/Magdir/sequent
magic/Magdir/sgml
magic/Magdir/sniffer
magic/Magdir/sql
magic/Magdir/sun
magic/Magdir/sysex
magic/Magdir/tcl
magic/Magdir/terminfo
magic/Magdir/tex
magic/Magdir/tplink
magic/Magdir/varied.script
magic/Magdir/virtual
magic/Magdir/warc
magic/Magdir/webassembly
magic/Magdir/windows
magic/Magdir/wordprocessors
magic/Magdir/wsdl
magic/Magdir/xwindows
magic/Magdir/yara
magic/Magdir/zip
magic/Makefile.am
src/ascmagic.c
src/buffer.c
src/cdf_time.c
src/compress.c
src/encoding.c
src/file.c
src/file.h
src/fsmagic.c
src/funcs.c
src/is_json.c
src/magic.c
src/print.c
src/readcdf.c
src/readelf.c
src/seccomp.c
src/softmagic.c

index 3b7feb2..482a5f7 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,39 @@
+2019-05-14  22:26  Christos Zoulas <christos@zoulas.com>
+
+       * release 5.37
+
+2019-05-09  22:27  Christos Zoulas <christos@zoulas.com>
+       
+       * Make sure that continuation separators are printed
+         with -k within softmagic
+
+2019-05-06  22:27  Christos Zoulas <christos@zoulas.com>
+
+       * Change SIGPIPE saving and restoring during compression to use
+         sigaction(2) instead of signal(3) and cache it. (Denys Vlasenko)
+       * Cache stat(2) calls more to reduce number of calls (Denys Vlasenko)
+
+2019-05-06  17:25  Christos Zoulas <christos@zoulas.com>
+
+       * PR/77: Handle --mime-type and -k correctly.
+
+2019-05-03  15:26  Christos Zoulas <christos@zoulas.com>
+
+       * Switch decompression code to use vfork() because
+         tools like rpmdiff and rpmbuild call libmagic
+         with large process footprints (Denys Vlasenko)
+
+2019-04-07  14:05  Christos Zoulas <christos@zoulas.com>
+
+       * PR/75: --enable-zlib, did not work.
+
+2019-02-27  11:54  Christos Zoulas <christos@zoulas.com>
+
+       * Improve regex efficiency (Michael Schroeder) by:
+               1. Prefixing regex searches with regular search
+                  for keywords where possible
+               2. Using memmem(3) where available
+
 2019-02-20  10:16  Christos Zoulas <christos@zoulas.com>
 
        * release 5.36
index ec296aa..7da62aa 100644 (file)
@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT([file],[5.36],[christos@astron.com])
+AC_INIT([file],[5.37],[christos@astron.com])
 AM_INIT_AUTOMAKE([subdir-objects foreign])
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
@@ -35,12 +35,12 @@ fi], [
 ])
 
 AC_MSG_CHECKING(for zlib support)
-AC_ARG_ENABLE(zlib,
+AC_ARG_ENABLE([zlib],
 [AS_HELP_STRING([--disable-zlib], [disable zlib compression support @<:@default=auto@:>@])])
 AC_MSG_RESULT($enable_zlib)
 
 AC_MSG_CHECKING(for libseccomp support)
-AC_ARG_ENABLE(libseccomp,
+AC_ARG_ENABLE([libseccomp],
 [AS_HELP_STRING([--disable-libseccomp], [disable libseccomp sandboxing @<:@default=auto@:>@])])
 AC_MSG_RESULT($enable_libseccomp)
 
@@ -90,10 +90,10 @@ dnl Checks for headers
 AC_HEADER_STDC
 AC_HEADER_MAJOR
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(stdint.h fcntl.h stdint.h inttypes.h unistd.h)
-AC_CHECK_HEADERS(stddef.h utime.h wchar.h wctype.h limits.h)
+AC_CHECK_HEADERS(stdint.h fcntl.h inttypes.h unistd.h)
+AC_CHECK_HEADERS(utime.h wchar.h wctype.h)
 AC_CHECK_HEADERS(getopt.h err.h xlocale.h)
-AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h)
+AC_CHECK_HEADERS(sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h sys/sysmacros.h)
 if test "$enable_zlib" != "no"; then
   AC_CHECK_HEADERS(zlib.h)
 fi
@@ -105,7 +105,7 @@ AC_TYPE_OFF_T
 AC_TYPE_SIZE_T
 AC_CHECK_MEMBERS([struct stat.st_rdev])
 
-AC_CHECK_MEMBERS([struct tm.tm_gmtoff])
+AC_CHECK_MEMBERS([struct tm.tm_gmtoff],,,[#include <time.h>])
 AC_STRUCT_TIMEZONE
 AC_STRUCT_TIMEZONE_DAYLIGHT
 AC_SYS_LARGEFILE
@@ -151,7 +151,7 @@ else
 fi])
 
 dnl Checks for functions
-AC_CHECK_FUNCS(strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale setlocale)
+AC_CHECK_FUNCS(strndup mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale memmem)
 
 dnl Provide implementation of some required functions if necessary
 AC_REPLACE_FUNCS(getopt_long asprintf vasprintf strlcpy strlcat getline ctime_r asctime_r localtime_r gmtime_r pread strcasestr fmtcheck dprintf)
@@ -175,7 +175,8 @@ if test "$enable_zlib" = "yes"; then
   if test "$ac_cv_header_zlib_h$ac_cv_lib_z_gzopen" != "yesyes"; then
     AC_MSG_ERROR([zlib support requested but not found])
   fi
-elif  test "$ac_cv_header_zlib_h$ac_cv_lib_z_gzopen" = "yesyes"; then
+fi
+if  test "$ac_cv_header_zlib_h$ac_cv_lib_z_gzopen" = "yesyes"; then
   AC_DEFINE([ZLIBSUPPORT], 1, [Enable zlib compression support])
 fi
 
index 070a2e4..63e95f1 100644 (file)
@@ -1,4 +1,4 @@
-.\" $File: file.man,v 1.134 2019/02/18 18:59:25 christos Exp $
+.\" $File: file.man,v 1.135 2019/03/03 02:32:40 christos Exp $
 .Dd February 18, 2019
 .Dt FILE __CSECTION__
 .Os
@@ -171,7 +171,6 @@ Causes the file command to output the file type and creator code as
 used by older MacOS versions.
 The code consists of eight letters,
 the first describing the file type, the latter the creator.
-the first describing the file type, the latter the creator.
 This option works properly only for file formats that have the
 apple-style output defined.
 .It Fl b , Fl Fl brief
index c4debd0..4aa3455 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: acorn,v 1.6 2017/10/19 16:40:37 christos Exp $
+# $File: acorn,v 1.7 2019/04/19 00:42:27 christos Exp $
 # acorn:  file(1) magic for files found on Acorn systems
 #
 
@@ -83,7 +83,7 @@
 # compression mode y (0 - 4) for GIF LZW with a maximum n bits
 # (y~n,0~12,1~13,2~14,3~15,4~16)
 >>>5   ulelong+12 x    \b, LZW %u-bits compression
-# http://www.filebase.org.uk/filetypes
+# https://www.filebase.org.uk/filetypes
 # !Packdir compressed archive has three hexadecimal digits code 68E
 !:mime application/x-acorn-68E
 !:ext  pkd/bin
index 6fae85a..bd7f863 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: adventure,v 1.17 2017/07/03 16:03:40 christos Exp $
+# $File: adventure,v 1.18 2019/04/19 00:42:27 christos Exp $
 # adventure: file(1) magic for Adventure game files
 #
 # from Allen Garvin <earendil@faeryland.tamu-commerce.edu>
@@ -21,8 +21,8 @@
 # Updated by Adam Buchbinder <adam.buchbinder@gmail.com>
 #
 #http://www.gnelson.demon.co.uk/zspec/sect11.html
-#http://www.jczorkmid.net/~jpenney/ZSpec11-latest.txt
-#http://en.wikipedia.org/wiki/Z-machine
+#https://www.jczorkmid.net/~jpenney/ZSpec11-latest.txt
+#https://en.wikipedia.org/wiki/Z-machine
 # The first byte is the Z-machine revision; it is always between 1 and 8. We
 # had false matches (for instance, inbig5.ocp from the Omega TeX extension as
 # well as an occasional MP3 file), so we sanity-check the version number.
 # Danny Milosavljevic <danny.milo@gmx.net>
 # These are ADRIFT (adventure game standard) game files, extension .taf
 # Checked from source at (http://www.adrift.co/) and various taf files
-# found at the Interactive Fiction Archive (http://ifarchive.org/)
+# found at the Interactive Fiction Archive (https://ifarchive.org/)
 0      belong  0x3C423FC9
 >4     belong  0x6A87C2CF      Adrift game file version
 >>8    belong  0x94453661      3.80
index 3ec41c5..a9cfb35 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------
-# $File: android,v 1.11 2018/12/04 14:24:01 christos Exp $
+# $File: android,v 1.12 2019/04/19 00:42:27 christos Exp $
 # Various android related magic entries
 #------------------------------------------------------------
 
@@ -36,7 +36,7 @@
 # URL: https://github.com/android/platform_frameworks_base/blob/\
 # 0bacfd2ba68d21a68a3df345b830bc2a1e515b5a/services/java/com/\
 # android/server/BackupManagerService.java#L2367
-# Reference: http://sourceforge.net/projects/adbextractor/
+# Reference: https://sourceforge.net/projects/adbextractor/
 #            android-backup-extractor/perl/backupencrypt.pl 
 # Note:        only unix line feeds "\n" found
 # After the header comes a tar file
@@ -92,8 +92,8 @@
 #>>>>&1                ubequad x       \b, Content magic %16.16llx
 
 # *.pit files by Joerg Jenderek
-# http://forum.xda-developers.com/showthread.php?p=9122369
-# http://forum.xda-developers.com/showthread.php?t=816449
+# https://forum.xda-developers.com/showthread.php?p=9122369
+# https://forum.xda-developers.com/showthread.php?t=816449
 # Partition Information Table for Samsung's smartphone with Android
 # used by flash software Odin
 0              ulelong                 0x12349876
index 01fd3c3..aaf32dd 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: animation,v 1.69 2018/08/21 12:48:06 christos Exp $
+# $File: animation,v 1.71 2019/04/19 00:42:27 christos Exp $
 # animation:  file(1) magic for animation/movie formats
 #
 # animation formats
@@ -32,9 +32,9 @@
 !:mime application/x-quicktime-player
 4      string/W        jP              JPEG 2000 image
 !:mime image/jp2
-# http://www.ftyps.com/ with local additions
+# https://www.ftyps.com/ with local additions
 4      string          ftyp            ISO Media
-# http://aeroquartet.com/wordpress/2016/03/05/3-xavc-s/
+# https://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
@@ -46,7 +46,7 @@
 >>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)
-# http://www.3gpp2.org/Public_html/Specs/C.S0050-B_v1.0_070521.pdf
+# https://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
 0      string/w        #VRML\ V2.0\ utf8       ISO/IEC 14772 VRML 97 file
 !:mime model/vrml
 
-# X3D (Extensible 3D) [http://www.web3d.org/specifications/x3d-3.0.dtd]
+# X3D (Extensible 3D) [https://www.web3d.org/specifications/x3d-3.0.dtd]
 # From Michel Briand <michelbriand@free.fr>
 # mimetype from https://www.iana.org/assignments/media-types/model/x3d+xml
-# Example http://www.web3d.org/x3d/content/examples/Basic/course/CreateX3DFromStringRandomSpheres.x3d
+# Example https://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
 
 # Type: Bink Video
 # Extension: .bik
-# URL:  http://wiki.multimedia.cx/index.php?title=Bink_Container
+# URL:  https://wiki.multimedia.cx/index.php?title=Bink_Container
 # From: <hoehle@users.sourceforge.net>  2008-07-18
 0      string          BIK     Bink Video
 >3     regex           =[a-z]  rev.%s
 #>>51  byte&0x10       !0      DCT
 
 # Type:        NUT Container
-# URL: http://wiki.multimedia.cx/index.php?title=NUT
+# URL: https://wiki.multimedia.cx/index.php?title=NUT
 # From:        Adam Buchbinder <adam.buchbinder@gmail.com>
 0      string  nut/multimedia\ container\0     NUT multimedia container
 
 # Type: Nullsoft Video (NSV)
-# URL:  http://wiki.multimedia.cx/index.php?title=Nullsoft_Video
+# URL:  https://wiki.multimedia.cx/index.php?title=Nullsoft_Video
 # From: Mike Melanson <mike@multimedia.cx>
 0      string  NSVf    Nullsoft Video
 
 # Type: REDCode Video
-# URL:  http://www.red.com/ ; http://wiki.multimedia.cx/index.php?title=REDCode
+# URL:  https://www.red.com/ ; https://wiki.multimedia.cx/index.php?title=REDCode
 # From: Mike Melanson <mike@multimedia.cx>
 4      string  RED1    REDCode Video
 
 # Type: MTV Multimedia File
-# URL:  http://wiki.multimedia.cx/index.php?title=MTV
+# URL:  https://wiki.multimedia.cx/index.php?title=MTV
 # From: Mike Melanson <mike@multimedia.cx>
 0      string  AMVS    MTV Multimedia File
 
 # Type: ARMovie
-# URL:  http://wiki.multimedia.cx/index.php?title=ARMovie
+# URL:  https://wiki.multimedia.cx/index.php?title=ARMovie
 # From: Mike Melanson <mike@multimedia.cx>
 0      string  ARMovie\012     ARMovie
 
 # Type: Interplay MVE Movie
-# URL:  http://wiki.multimedia.cx/index.php?title=Interplay_MVE
+# URL:  https://wiki.multimedia.cx/index.php?title=Interplay_MVE
 # From: Mike Melanson <mike@multimedia.cx>
 0      string  Interplay\040MVE\040File\032    Interplay MVE Movie
 
 # Type: Windows Television DVR File
-# URL:  http://wiki.multimedia.cx/index.php?title=WTV
+# URL:  https://wiki.multimedia.cx/index.php?title=WTV
 # From: Mike Melanson <mike@mutlimedia.cx>
 # This takes the form of a Windows-style GUID
 0      bequad  0xB7D800203749DA11
 >8     bequad  0xA64E0007E95EAD8D      Windows Television DVR Media
 
 # Type: Sega FILM/CPK Multimedia
-# URL:  http://wiki.multimedia.cx/index.php?title=Sega_FILM
+# URL:  https://wiki.multimedia.cx/index.php?title=Sega_FILM
 # From: Mike Melanson <mike@multimedia.cx>
 0      string  FILM    Sega FILM/CPK Multimedia,
 >32    belong  x       %d x
 >28    belong  x       %d
 
 # Type: Nintendo THP Multimedia
-# URL:  http://wiki.multimedia.cx/index.php?title=THP
+# URL:  https://wiki.multimedia.cx/index.php?title=THP
 # From: Mike Melanson <mike@multimedia.cx>
 0      string  THP\0   Nintendo THP Multimedia
 
 # Type: BBC Dirac Video
-# URL:  http://wiki.multimedia.cx/index.php?title=Dirac
+# URL:  https://wiki.multimedia.cx/index.php?title=Dirac
 # From: Mike Melanson <mike@multimedia.cx>
 0      string  BBCD    BBC Dirac Video
 
 # Type: RAD Game Tools Smacker Multimedia
-# URL:  http://wiki.multimedia.cx/index.php?title=Smacker
+# URL:  https://wiki.multimedia.cx/index.php?title=Smacker
 # From: Mike Melanson <mike@multimedia.cx>
 0      string  SMK     RAD Game Tools Smacker Multimedia
 >3     byte    x       version %c,
 >8     string  AHDR    LucasArts Smush Animation Format (SAN) video
 0      string  SANM
 >8     string  SHDR    LucasArts Smush v2 (SANM) video
+
+# Type: Scaleform video
+# Extension: .usm
+# URL:  https://wiki.multimedia.cx/index.php/USM
+# From: David Korth <gerbilsoft@gerbilsoft.com>
+0      string  CRID
+>32    string  @UTF    Scaleform video
index 39e838b..4ac10fc 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: apple,v 1.39 2018/03/02 15:26:39 christos Exp $
+# $File: apple,v 1.43 2019/04/19 00:42:27 christos Exp $
 # apple:  file(1) magic for Apple file formats
 #
 0      search/1/t      FiLeStArTfIlEsTaRt      binscii (apple ][) text
 0      belong          0x00051600              AppleSingle encoded Macintosh file
 0      belong          0x00051607              AppleDouble encoded Macintosh file
 
+# Type: Apple Emulator WOZ format
+# From: Greg Wildman <greg@apple2.org.za>
+# Ref: https://applesaucefdc.com/woz/reference/
+# Ref: https://applesaucefdc.com/woz/reference2/
+#
+# Note: The following test are mostly identical. I would rather not
+# use a regex to identify the WOZ format number.
+0      string          WOZ1
+>4     string          \xFF\x0A\x0D\x0A        Apple ][ WOZ 1.0 Disk Image
+>12    string          INFO
+>>21   byte            01                      \b, 5.25 inch
+>>21   byte            02                      \b, 3.5 inch
+>>22   byte            01                      \b, write protected
+>>23   byte            01                      \b, cross track synchronized
+>>25   string/T        x                       \b, %.32s
+0      string          WOZ2
+>4     string          \xFF\x0A\x0D\x0A        Apple ][ WOZ 2.0 Disk Image
+>12    string          INFO
+>>21   byte            01                      \b, 5.25 inch
+>>21   byte            02                      \b, 3.5 inch
+>>22   byte            01                      \b, write protected
+>>23   byte            01                      \b, cross track synchronized
+>>25   string/T        x                       \b, %.32s
+
+# Type: Apple Emulator disk images
+# From: Greg Wildman <greg@apple2.org.za>
+# ProDOS boot loader?
+0              string  \x01\x38\xB0\x03\x4C    Apple ProDOS Image
+# Detect Volume Directory block ($02)
+>0x400         string  \x00\x00\x03\x00
+>>0x404                byte    &0xF0
+>>>0x405       string  x                       \b, Volume /%s
+>>>0x429       leshort x                       \b, %u Blocks
+# ProDOS ordered ?
+>0xb00         string  \x00\x00\x03\x00
+>>0xb04                byte    &0xF0
+>>>0xb05       string  x                       \b, Volume /%s
+>>>0xb29       leshort x                       \b, %u Blocks
+#
+# DOS3.3 boot loader?
+0              string  \x01\xA5\x27\xC9\x09\xD0\x18\xA5\x2B
+>0x11001       string  \x11\x0F\x03    Apple DOS 3.3 Image
+>>0x11006      byte    x               \b, Volume %u
+>>0x11034      byte    x               \b, %u Tracks
+>>0x11035      byte    x               \b, %u Sectors
+>>0x11036      leshort x               \b, %u bytes per sector
+# DOS3.2 ?
+>0x11001       string  \x11\x0C\x02    Apple DOS 3.2 Image
+>>0x11006      byte    x               \b, Volume %u
+>>0x11034      byte    x               \b, %u Tracks
+>>0x11035      byte    x               \b, %u Sectors
+>>0x11036      leshort x               \b, %u bytes per sector
+# DOS3.1 ?
+>0x11001       string  \x11\x0C\x01
+>>0x11c00      string  \x00\x11\x0B    Apple DOS 3.1 Image
+#
+# Pascal boot loader?
+0              string  \x01\xE0\x60\xF0\x03\x4C\xE3\x08\xAD
+>0xd6          pstring SYSTEM.APPLE
+>>0xb00                leshort 0x0000
+>>>0xb04       leshort 0x0000          Apple Pascal Image
+>>>>0xb06      pstring x               \b, Volume %s:
+>>>>0xb0e      leshort x               \b, %u Blocks
+>>>>0xb10      leshort x               \b, %u Files
+
 # Type: Apple Emulator 2IMG format
 # From: Radek Vokal <rvokal@redhat.com>
-0      string          2IMG    Apple ][ 2IMG Disk Image
->4     string          XGS!    \b, XGS
->4     string          CTKG    \b, Catakig
->4     string          ShIm    \b, Sheppy's ImageMaker
->4     string          WOOF    \b, Sweet 16
->4     string          B2TR    \b, Bernie ][ the Rescue
->4     string          !nfc    \b, ASIMOV2
->4     string          x       \b, Unknown Format
->0xc   byte            00      \b, DOS 3.3 sector order
->>0x10 byte            00      \b, Volume 254
->>0x10 byte&0x7f       x       \b, Volume %u
->0xc   byte            01      \b, ProDOS sector order
->>0x14 short           x       \b, %u Blocks
->0xc   byte            02      \b, NIB data
+# Update: Greg Wildman <greg@apple2.org.za>
+0      string          2IMG            Apple ][ 2IMG Disk Image
+>4     clear           x
+>4     string          XGS!            \b, XGS
+>4     string          CTKG            \b, Catakig
+>4     string          ShIm            \b, Sheppy's ImageMaker
+>4     string          SHEP            \b, Sheppy's ImageMaker
+>4     string          WOOF            \b, Sweet 16
+>4     string          B2TR            \b, Bernie ][ the Rescue
+>4     string          \!nfc           \b, ASIMOV2
+>4     string          \>BD\<          \b, Brutal Deluxe's Cadius
+>4     string          CdrP            \b, CiderPress
+>4     string          Vi][            \b, Virtual ][
+>4     string          PRFS            \b, ProFUSE
+>4     string          FISH            \b, FishWings
+>4     string          RVLW            \b, Revival for Windows
+>4     default         x
+>>4    string          x               \b, Creator tag "%-4.4s"
+>0xc   byte            00              \b, DOS 3.3 sector order
+>>0x10 byte            00              \b, Volume 254
+>>0x10 byte&0x7f       x               \b, Volume %u
+>0xc   byte            01              \b, ProDOS sector order
+>>0x14 short           x               \b, %u Blocks
+>0xc   byte            02              \b, NIB data
 
 # magic for Newton PDA package formats
 # from Ruda Moura <ruda@helllabs.org>
 # http://home.earthlink.net/~hughhood/appleiiworksenvoy/
 # ('p' + 1-byte ProDOS File Type + 2-byte ProDOS Aux Type')
 # $70 $1A $F8 $FF is this the apple type ?
-#:apple pdosp\1aøÿ
+#:apple pdosp^Z\xf8\xff
 !:ext awp
 # minimum version needed to read this files. SFMinVers (0 , 30~3.0 )
 >>>183 ubyte           30      3.0
 >>6    ubeshort        x               \b, type 0x%x
 
 # URL: https://en.wikipedia.org/wiki/Apple_Partition_Map
-# Reference: http://opensource.apple.com/source/IOStorageFamily/IOStorageFamily-116/IOApplePartitionScheme.h
+# Reference: https://opensource.apple.com/source/IOStorageFamily/IOStorageFamily-116/IOApplePartitionScheme.h
 # Update: Joerg Jenderek
 # Yes, the 3rd and 4th bytes pmSigPad are reserved, but we use them to make the
 # magic stronger.
 # is the startup partition APPLE_PS_STARTUP
 >>88   ubelong &0x80000000             \b, is the startup partition
 
-#http://wiki.mozilla.org/DS_Store_File_Format
-#http://en.wikipedia.org/wiki/.DS_Store
+#https://wiki.mozilla.org/DS_Store_File_Format
+#https://en.wikipedia.org/wiki/.DS_Store
 0      string  \0\0\0\1Bud1\0          Apple Desktop Services Store
 
 # HFS/HFS+ Resource fork files (andrew.roazen@nau.edu Apr 13 2015)
index edbab37..cd0213f 100644 (file)
@@ -1,5 +1,5 @@
 #------------------------------------------------------------------------------
-# $File: archive,v 1.124 2019/02/20 15:07:44 christos Exp $
+# $File: archive,v 1.129 2019/05/09 18:58:02 christos Exp $
 # archive:  file(1) magic for archive formats (see also "msdos" for self-
 #           extracting compressed archives)
 #
 >>>257 string          >\0             \b, comment: %-.40s
 
 # Incremental snapshot gnu-tar format from:
-# http://www.gnu.org/software/tar/manual/html_node/Snapshot-Files.html
+# https://www.gnu.org/software/tar/manual/html_node/Snapshot-Files.html
 0      string          GNU\ tar-       GNU tar incremental snapshot data
 >&0    regex           [0-9]\.[0-9]+-[0-9]+    version %s
 
 # a portable archive whose first member has a name beginning with
 # "debian".
 #
+# Update: Joerg Jenderek
+# URL: https://en.wikipedia.org/wiki/Deb_(file_format)
 0      string          =!<arch>\ndebian
->8     string          debian-split    part of multipart Debian package
+# https://manpages.debian.org/testing/dpkg/dpkg-split.1.en.html
+>14    string          -split  part of multipart Debian package
 !:mime application/vnd.debian.binary-package
->8     string          debian-binary   Debian binary package
+# udeb is used for stripped down deb file
+!:ext  deb/udeb
+>14    string          -binary Debian binary package
 !:mime application/vnd.debian.binary-package
->8     string          !debian
+!:ext  deb/udeb
+# This should not happen
+>14    default         x       Unknown Debian package
+# NL terminated version; for most Debian cases this is 2.0 or 2.1 for splitted
 >68    string          >\0             (format %s)
-# These next two lines do not work, because a bzip2 Debian archive
-# still uses gzip for the control.tar (first in the archive).  Only
-# data.tar varies, and the location of its filename varies too.
-# file/libmagic does not current have support for ascii-string based
-# (offsets) as of 2005-09-15.
-#>81   string          bz2             \b, uses bzip2 compression
-#>84   string          gz              \b, uses gzip compression
-#>136  ledate          x               created: %s
+#>68   string          !2.0\n
+#>>68  string          x               (format %.3s)
+>68    string          =2.0\n
+# 2nd archive name=control archive name like control.tar.gz or control.tar.xz
+>>72   string          >\0             \b, with %.14s
+# look for 3rd archive name=data archive name like data.tar.{gz,xz,bz2,lzma}
+>>0    search/0x93e4f  data.tar.       \b, data compression
+# the above line only works if FILE_BYTES_MAX in ../../src/file.h is raised
+# for example like libreoffice-dev-doc_1%3a5.2.7-1+rpi1+deb9u3_all.deb
+>>>&0  string          x               %.4s
+# splitted debian package case
+>68    string          =2.1\n
+# dpkg-1.18.25/dpkg-split/info.c
+# NL terminated ASCII package name like ckermit
+>>&0   string          x               \b, %s
+# NL terminated package version like 302-5.3
+>>>&1  string          x               %s
+# NL terminated MD5 checksum
+>>>>&1 string          x               \b, MD5 %s
+# NL terminated original package length
+>>>>>&1        string          x               \b, unsplitted size %s
+# NL terminated part length
+>>>>>>&1       string  x               \b, part lenght %s
+# NL terminated package part like n/m
+>>>>>>>&1      string  x               \b, part %s
+# NL terminated package architecture like armhf since dpkg 1.16.1 or later
+>>>>>>>>&1     string  x               \b, %s
 
 #
 # MIPS archive; they're in the portable archive format, and need to go
 # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
 # Update: Joerg Jenderek
 # URL: https://en.wikipedia.org/wiki/LHA_(file_format)
-# Reference: http://web.archive.org/web/20021005080911/http://www.osirusoft.com/joejared/lzhformat.html
+# Reference: https://web.archive.org/web/20021005080911/http://www.osirusoft.com/joejared/lzhformat.html
 #
 #      check and display information of lharc (LHa,PMarc) file
 0      name                            lharc-file
 !:ext  rar
 
 # Very old RAR archive
-# http://jasonblanks.com/wp-includes/images/papers/KnowyourarchiveRAR.pdf
+# https://jasonblanks.com/wp-includes/images/papers/KnowyourarchiveRAR.pdf
 0      string          RE\x7e\x5e  RAR archive data (<v1.5)
 !:mime application/x-rar
 !:ext  rar/cbr
 !:ext zip/cbz
 !:strength +1
 0      string          PK\003\004
+!:strength +1
 
 # Specialised zip formats which start with a member named 'mimetype'
 # (stored uncompressed, with no 'extra field') containing the file's MIME type.
 >>>62  string  base                    Database file
 
 #   OpenDocument formats (for OpenOffice 2.x / StarOffice >= 8)
-#    http://lists.oasis-open.org/archives/office/200505/msg00006.html
+#    https://lists.oasis-open.org/archives/office/200505/msg00006.html
 #    (mimetype contains "application/vnd.oasis.opendocument.<SUBTYPE>")
 >>50   string  vnd.oasis.opendocument. OpenDocument
 >>>73  string  text
 !:mime application/vnd.oasis.opendocument.image-template
 
 #  EPUB (OEBPS) books using OCF (OEBPS Container Format)
-#    http://www.idpf.org/ocf/ocf1.0/download/ocf10.htm, section 4.
+#    https://www.idpf.org/ocf/ocf1.0/download/ocf10.htm, section 4.
 #    From: Ralf Brown <ralf.brown@gmail.com>
 >>50   string  epub+zip        EPUB document
 !:mime application/epub+zip
 >14    beshort 0x4e53          multi-part, with -S
 
 # Symbian installation files
-#  http://www.thouky.co.uk/software/psifs/sis.html
+#  https://www.thouky.co.uk/software/psifs/sis.html
 #  http://developer.symbian.com/main/downloads/papers/SymbianOSv91/softwareinstallsis.pdf
 8      lelong  0x10000419      Symbian installation file
 !:mime application/vnd.symbian.install
 >10    string x                with compression level %.1s
 
 # xar (eXtensible ARchiver) archive
-# xar archive format: http://code.google.com/p/xar/
+# URL: https://en.wikipedia.org/wiki/Xar_(archiver)
+# xar archive format: https://code.google.com/p/xar/
 # From: "David Remahl" <dremahl@apple.com>
+# Update: Joerg Jenderek
+# TODO: lzma compression; X509Data for pkg and xip
+# Note: verified by `xar --dump-header -f FullBundleUpdate.xar` or
+# 7z t -txar Xcode_10.2_beta_4.xip`
 0      string  xar!            xar archive
 !:mime application/x-xar
-#>4    beshort x               header size %d
->6     beshort x               version %d,
-#>8    quad    x               compressed TOC: %d,
-#>16   quad    x               uncompressed TOC: %d,
+# pkg for Mac OSX installer package like FullBundleUpdate.pkg
+# xip for signed Apple software like Xcode_10.2_beta_4.xip
+!:ext  xar/pkg/xip
+# always 28 in older archives
+>4     ubeshort >28            \b, header size %u
+# currently there exit only version 1 since about 2014
+>6     ubeshort >1             version %u,
+>8     ubequad x               compressed TOC: %llu,
+#>16   ubequad x               uncompressed TOC: %llu,
+# cksum_alg 0-2 in older and also 3-4 in newer
 >24    belong  0               no checksum
 >24    belong  1               SHA-1 checksum
 >24    belong  2               MD5 checksum
+>24    belong  3               SHA-256 checksum
+>24    belong  4               SHA-512 checksum
+>24    belong  >4              unknown 0x%x checksum
+#>24   belong  >4              checksum
+#                      For no compression jump 0 bytes
+>24    belong  0
+>>0            ubyte   x
+# jump more bytes forward by header size
+>>>&(4.S)      ubyte   x
+# jump more bytes forward by compressed table of contents size
+#>>>>&(8.Q)    ubequad x       \b, heap data 0x%llx
+>>>>&(8.Q)     ubyte   x
+# look for data by ./compress after message with 1 space at end
+>>>>>&-3       indirect x      \b, contains 
+#                      For SHA-1 jump 20 minus 2 bytes
+>24    belong  1
+>>18           ubyte   x
+# jump more bytes forward by header size
+>>>&(4.S)      ubyte   x
+# jump more bytes forward by compressed table of contents size
+>>>>&(8.Q)     ubyte   x
+# data compressed by gzip, bzip, lzma or none
+>>>>>&-1       indirect x      \b, contains 
+#                      For SHA-256 jump 32 minus 2 bytes
+>24    belong  3
+>>30           ubyte   x
+# jump more bytes forward by header size
+>>>&(4.S)      ubyte   x
+# jump more bytes forward by compressed table of contents size
+>>>>&(8.Q)     ubyte   x
+>>>>>&-1       indirect x      \b, contains 
+#                      For SHA-512 jump 64 minus 2 bytes
+>24    belong  4
+>>62           ubyte   x
+# jump more bytes forward by header size
+>>>&(4.S)      ubyte   x
+# jump more bytes forward by compressed table of contents size
+>>>>&(8.Q)     ubyte   x
+>>>>>&-1       indirect x      \b, contains 
 
 # Type: Parity Archive
 # From: Daniel van Eeden <daniel_e@dds.nl>
 0      string  PAR2            Parity Archive Volume Set
 
 # Bacula volume format. (Volumes always start with a block header.)
-# URL: http://bacula.org/3.0.x-manuals/en/developers/developers/Block_Header.html
+# URL: https://bacula.org/3.0.x-manuals/en/developers/developers/Block_Header.html
 # From: Adam Buchbinder <adam.buchbinder@gmail.com>
 12     string  BB02            Bacula volume
 >20    bedate  x               \b, started %s
 0      string  zPQ     ZPAQ stream
 >3     byte    x       \b, level %d
 # From: Barry Carter <carter.barry@gmail.com>
-# http://encode.ru/threads/456-zpaq-updates/page32
+# https://encode.ru/threads/456-zpaq-updates/page32
 0      string  7kSt    ZPAQ file
 
 # BBeB ebook, unencrypted (LRF format)
-# URL: http://www.sven.de/librie/Librie/LrfFormat
+# URL: https://www.sven.de/librie/Librie/LrfFormat
 # From: Adam Buchbinder <adam.buchbinder@gmail.com>
 0      string  L\0R\0F\0\0\0   BBeB ebook data, unencrypted
 >8     beshort x               \b, version %d
 >44    beshort x               %d)
 
 # Symantec GHOST image by Joerg Jenderek at May 2014
-# http://us.norton.com/ghost/
-# http://www.garykessler.net/library/file_sigs.html
+# https://us.norton.com/ghost/
+# https://www.garykessler.net/library/file_sigs.html
 0              ubelong&0xFFFFf7f0      0xFEEF0100      Norton GHost image
 # *.GHO
 >2             ubyte&0x08              0x00            \b, first file
 56     string  USE\040LYNX\040TO\040DISSOLVE\040THIS\040FILE    LyNX archive
 
 # From: Joerg Jenderek
-# URL: http://www.acronis.com/
-# Reference: http://en.wikipedia.org/wiki/TIB_(file_format)
+# URL: https://www.acronis.com/
+# Reference: https://en.wikipedia.org/wiki/TIB_(file_format)
 # Note: only tested with True Image 2013 Build 5962 and 2019 Build 14110
 0      ubequad         0xce24b9a220000000      Acronis True Image backup
 !:mime application/x-acronis-tib
 # https://gitweb.gentoo.org/proj/portage.git/tree/man/xpak.5
 -4     string  STOP
 >-16   string  XPAKSTOP        Gentoo binary package (XPAK)
+
+# From:                Joerg Jenderek
+# URL:         https://kodi.wiki/view/TexturePacker
+# Reference:   https://mirrors.kodi.tv/releases/source/17.3-Krypton.tar.gz
+# /xbmc-Krypton/xbmc/guilib/XBTF.h
+# /xbmc-Krypton/xbmc/guilib/XBTF.cpp 
+0      string  XBTF
+# skip ASCII text by looking for terminating \0 of path
+>264   ubyte   0               XBMC texture package
+!:mime application/x-xbmc-xbt
+!:ext  xbt
+# XBTF_VERSION 2
+>>4    string  !2              \b, version %-.1s
+# nofFiles /xbmc-Krypton/xbmc/guilib/XBTFReader.cpp
+>>5    ulelong x               \b, %u file
+# plural s
+>>5    ulelong >1              \bs
+# path[CXBTFFile[MaximumPathLength=256]
+>>9    string  x               \b, 1st %s
+
index e5aea03..5492635 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: audio,v 1.96 2019/01/16 19:35:21 christos Exp $
+# $File: audio,v 1.111 2019/05/08 18:02:45 christos Exp $
 # audio:  file(1) magic for sound formats (see also "iff")
 #
 # Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
 # From: Alex Myczko <alex@aiei.ch>
 
 # https://github.com/rerrahkr/BambooTracker
-0      string          BambooTrackerMod        BambooTracker
+0      string          BambooTrackerMod        BambooTracker module
+>22    byte    x       \b, version %u
+>21    byte    x       \b.%u
+>20    byte    x       \b.%u
+
+0      string          BambooTrackerIst        BambooTracker instrument
+>22    byte    x       \b, version %u
+>21    byte    x       \b.%u
+>20    byte    x       \b.%u
 
 0      string          RAWADATA        RdosPlay RAW
 
 
 # IMY
 # from http://filext.com/detaillist.php?extdetail=IMY
-# http://cellphones.about.com/od/cellularfaqs/f/rf_imelody.htm
+# https://cellphones.about.com/od/cellularfaqs/f/rf_imelody.htm
 # http://download.ncl.ie/doc/api/ie/ncl/media/music/IMelody.html
 # http://www.wx800.com/msg/download/irda/iMelody.pdf
 0      string  BEGIN:IMELODY   iMelody Ringtone Format
 >4     belong  x       version %d
 
 # Type: True Audio Lossless Audio
-# URL:  http://wiki.multimedia.cx/index.php?title=True_Audio
+# URL:  https://wiki.multimedia.cx/index.php?title=True_Audio
 # From: Mike Melanson <mike@multimedia.cx>
 0      string  TTA1    True Audio Lossless Audio
 
 # Type: WavPack Lossless Audio
-# URL:  http://wiki.multimedia.cx/index.php?title=WavPack
+# URL:  https://wiki.multimedia.cx/index.php?title=WavPack
 # From: Mike Melanson <mike@multimedia.cx>
 0      string  wvpk    WavPack Lossless Audio
 
 # VGM music file
 0      string          Vgm\040
 >9     ubyte           >0      VGM Video Game Music dump v
+!:mime audio/x-vgm
+!:ext  vgm
 >>9    ubyte/16        >0      \b%d
 >>9    ubyte&0x0F      x       \b%d
 >>8    ubyte/16        x       \b.%d
 >>>>0x78 ubyte         0x03    AY-3-8930,
 >>>>0x78 ubyte         0x10    YM2149,
 >>>>0x78 ubyte         0x11    YM3439,
+# VGM 1.61
+>>0x34 ulelong         >0x4C
+>>>0x80        ulelong         >0      DMG,
+>>0x34 ulelong         >0x50
+>>>0x84        lelong          >0      NES APU,
+>>>0x84        lelong          <0      NES APU with FDS,
+>>0x34 ulelong         >0x54
+>>>0x88        ulelong         >0      MultiPCM,
+>>0x34 ulelong         >0x58
+>>>0x8C        ulelong         >0      uPD7759,
+>>0x34 ulelong         >0x5C
+>>>0x90        ulelong         >0      OKIM6258,
+>>0x34 ulelong         >0x64
+>>>0x98        ulelong         >0      OKIM6295,
+>>0x34 ulelong         >0x68
+>>>0x9C        ulelong         >0      K051649,
+>>0x34 ulelong         >0x6C
+>>>0xA0        ulelong         >0      K054539,
+>>0x34 ulelong         >0x70
+>>>0xA4        ulelong         >0      HuC6280,
+>>0x34 ulelong         >0x74
+>>>0xA8        ulelong         >0      C140,
+>>0x34 ulelong         >0x78
+>>>0xAC        ulelong         >0      K053260,
+>>0x34 ulelong         >0x7C
+>>>0xB0        ulelong         >0      Pokey,
+>>0x34 ulelong         >0x80
+>>>0xB4        ulelong         >0      QSound,
+# VGM 1.71
+>>0x34 ulelong         >0x84
+>>>0xB8        ulelong         >0      SCSP,
+>>0x34 ulelong         >0x8C
+>>>0xC0        ulelong         >0      WonderSwan,
+>>0x34 ulelong         >0x90
+>>>0xC4        ulelong         >0      VSU,
+>>0x34 ulelong         >0x94
+>>>0xC8        ulelong         >0      SAA1099,
+>>0x34 ulelong         >0x98
+>>>0xCC        ulelong         >0      ES5503,
+>>0x34 ulelong         >0x9C
+>>>0xD0        lelong          >0      ES5505,
+>>>0xD0        lelong          <0      ES5506,
+>>0x34 ulelong         >0xA4
+>>>0xD8        ulelong         >0      X1-010,
+>>0x34 ulelong         >0xA8
+>>>0xDC        ulelong         >0      C352,
+>>0x34 ulelong         >0xAC
+>>>0xE0        ulelong         >0      GA20,
 
 # GVOX Encore file format
 # Since this is a proprietary file format and there is no publicly available
 
 # Summary:     Garmin Voice Processing Module (WAVE audios)
 # From:                Joerg Jenderek
-# URL:         http://www.garmin.com/
+# URL:         https://www.garmin.com/
 # Reference:   http://www.poi-factory.com/node/19580
 # NOTE:                there exist 2 other Garmin VPM formats
 0              string  AUDIMG
 >>>0x31                byte&0x0F       x       \b%02d
 >>>>0x4                string          >\0     \b, title: "%s"
 
-# magic for Klystrack, http://kometbomb.github.io/klystrack/
+# magic for Klystrack, https://kometbomb.github.io/klystrack/
 # from Alex Myczko <alex@aiei.ch>
 0      string  cyd!song        Klystrack song
 >8     byte    >0              \b, version %u
 # Added by David Korth <gerbilsoft@gerbilsoft.com>
 0x00           beshort         0x8000
 >(2.S-2)       string          (c)CRI          CRI ADX ADPCM audio
+!:ext adx
+!:mime audio/x-adx
+!:strength +50
 >>0x12         byte            x               v%u
 >>0x04         byte            0x02            \b, pre-set prediction coefficients
 >>0x04         byte            0x03            \b, standard ADX
 >>0x04         byte            0x04            \b, exponential scale
->>0x04         byte            0x05            \b, AHX
+>>0x04         byte            0x10            \b, AHX (Dreamcast)
+>>0x04         byte            0x11            \b, AHX
 >>0x08         belong          x               \b, %u Hz
 >>0x12         byte            0x03
 >>>0x02                beshort         >0x2B
 # Sony PlayStation Audio (.xa)
 0      leshort 0x4158  Sony PlayStation Audio
 
+# Portable Sound Format
+# Used for audio rips for various consoles.
+# http://fileformats.archiveteam.org/wiki/Portable_Sound_Format
+# Added by David Korth <gerbilsoft@gerbilsoft.com>
+0      string  PSF     Portable Sound Format
+!:mime audio/x-psf
+>3     byte    0x01    (Sony PlayStation)
+>3     byte    0x02    (Sony PlayStation 2)
+>3     byte    0x11    (Sega Saturn)
+>3     byte    0x12    (Sega Dreamcast)
+>3     byte    0x13    (Sega Mega Drive)
+>3     byte    0x21    (Nintendo 64)
+>3     byte    0x22    (Game Boy Advance)
+>3     byte    0x23    (Super NES)
+>3     byte    0x41    (Capcom QSound)
+
+# Atari 8-bit SAP audio format
+# http://asap.sourceforge.net/sap-format.html
+# Added by David Korth <gerbilsoft@gerbilsoft.com>
+0      string          SAP\r\n Atari 8-bit SAP audio file
+!:mime audio/x-sap
+!:ext  sap
+>5     search/1024     NAME
+>>&1   string          x       \b: %s
+>>5    search/1024     AUTHOR
+>>>&1  string          x       by %s
+
+# Nintendo Wii BRSTM audio format (fields)
+# NOTE: Assuming HEAD starts at 0x40.
+# FIXME: Replace 0x48 with HEAD offset plus 8.
+0      name    nintendo-wii-brstm-fields
+>(0x10.L)      string  HEAD    \b:
+>>(0x10.L+0x0C)        belong  x
+>>>(&-4.L+0x48)        belong  x
+>>>>&-4                byte    0       PCM, signed 8-bit,
+>>>>&-4                byte    1       PCM, signed 16-bit,
+>>>>&-4                byte    2       THP ADPCM,
+>>>>&-3                byte    !0      looping,
+>>>>&-2                byte    1       mono
+>>>>&-2                byte    2       stereo
+>>>>&-2                byte    3       3 channels
+>>>>&-2                byte    4       quad
+>>>>&-2                byte    >4      %u channels
+>>>>&0         beshort !0      %u Hz
+
+# Nintendo Wii BRSTM audio format
+# https://wiibrew.org/wiki/BRSTM_file
+# Added by David Korth <gerbilsoft@gerbilsoft.com>
+0      string          RSTM    Nintendo Wii BRSTM audio file
+!:mime audio/x-brstm
+!:ext  brstm
+# Wii is big-endian, so default to BE.
+>4     beshort         0xFEFF
+>>0    use             nintendo-wii-brstm-fields
+>4     leshort         0xFEFF
+>>0    use             \^nintendo-wii-brstm-fields
+
+# Nintendo 3DS BCSTM audio format (fields)
+0      name    nintendo-3ds-bcstm-fields
+>(0x18.l)      string  INFO    \b:
+# INFO block: Stream information starts at 0x20 (minus 4 for the 'INFO' magic)
+>>&0x1C                byte    0       PCM, signed 8-bit,
+>>&0x1C                byte    1       PCM, signed 16-bit,
+>>&0x1C                byte    2       DSP ADPCM,
+>>&0x1C                byte    3       IMA ADPCM,
+>>&0x1D                byte    !0      looping,
+>>&0x1E                byte    1       mono
+>>&0x1E                byte    2       stereo
+>>&0x1E                byte    3       3 channels
+>>&0x1E                byte    4       quad
+>>&0x1E                byte    >4      %u channels
+>>&0x20                lelong  !0      %u Hz
+
+# Nintendo 3DS BCSTM audio format
+# https://www.3dbrew.org/wiki/BCSTM
+# Added by David Korth <gerbilsoft@gerbilsoft.com>
+0      string          CSTM    Nintendo 3DS BCSTM audio file
+!:mime audio/x-bcstm
+!:ext  bcstm
+# 3DS is little-endian, so default to LE.
+>4     leshort         0xFEFF
+>>0    use             nintendo-3ds-bcstm-fields
+>4     beshort         0xFEFF
+>>0    use             \^nintendo-3ds-bcstm-fields
+
+# Nintendo Wii U BFSTM audio format
+# http://mk8.tockdom.com/wiki/BFSTM_(File_Format)
+# NOTE: This format is very similar to BCSTM.
+# Added by David Korth <gerbilsoft@gerbilsoft.com>
+0      string          FSTM    Nintendo Wii U BFSTM audio file
+!:mime audio/x-bfstm
+!:ext  bfstm
+# BFSTM is used on both Wii U (BE) and Switch (LE),
+# so default to LE.
+>4     leshort         0xFEFF
+>>0    use             nintendo-3ds-bcstm-fields
+>4     beshort         0xFEFF
+>>0    use             \^nintendo-3ds-bcstm-fields
+
+# Nintendo 3DS BCSTM audio format (fields)
+0      name    nintendo-3ds-bcwav-fields
+>(0x18.l)      string  INFO    \b:
+# INFO block (minus 4 for INFO magic)
+>>&0x4         byte    0       PCM, signed 8-bit,
+>>&0x4         byte    1       PCM, signed 16-bit,
+>>&0x4         byte    2       DSP ADPCM,
+>>&0x4         byte    3       IMA ADPCM,
+>>&0x5         byte    !0      looping,
+>>&0x8         lelong  x       stereo
+>>&0x8         lelong  !0      %u Hz
+
+# Nintendo 3DS BCWAV audio format
+# https://www.3dbrew.org/wiki/BCWAV
+# Added by David Korth <gerbilsoft@gerbilsoft.com>
+0      string          CWAV    Nintendo 3DS BCWAV audio file
+!:mime audio/x-bcwav
+!:ext  bcwav
+# 3DS is little-endian, so default to LE.
+>4     leshort         0xFEFF
+>>0    use             nintendo-3ds-bcwav-fields
+>4     beshort         0xFEFF
+>>0    use             \^nintendo-3ds-bcwav-fields
index 7026443..19dd463 100644 (file)
@@ -1,9 +1,9 @@
 
 #----------------------------------------------------------------
-# $File$
+# $File: basis,v 1.5 2019/04/19 00:42:27 christos Exp $
 # basis: file(1) magic for BBx/Pro5-files
 #      Oliver Dammer <dammer@olida.de>  2005/11/07
-# http://www.basis.com business-basic-files.
+# https://www.basis.com business-basic-files.
 #
 0      string          \074\074bbx\076\076     BBx
 >7     string          \000                    indexed file
index e080496..15288c6 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: animation,v 1.57 2015/11/29 22:11:07 christos Exp $
+# $File: ber,v 1.2 2019/04/19 00:42:27 christos Exp $
 # ber:  file(1) magic for several BER formats used in the mobile
 # telecommunications industry (Georg Sauthoff)
 
@@ -19,7 +19,7 @@
 #
 # TAP 3 Files
 # TAP -> Transferred Account Procedure
-# cf. http://www.gsma.com/newsroom/wp-content/uploads/TD.57-v32.31.pdf
+# cf. https://www.gsma.com/newsroom/wp-content/uploads/TD.57-v32.31.pdf
 # TransferBatch short tag
 0      byte    0x61
 # BatchControlInfo short tag
@@ -47,7 +47,7 @@
 >>&0   byte    x       NRT 2.%d (TD.35, Near Real Time Roaming Data Exchange)
 
 # RAP Files
-# cf. http://www.gsma.com/newsroom/wp-content/uploads/TD.32-v6.11.pdf
+# cf. https://www.gsma.com/newsroom/wp-content/uploads/TD.32-v6.11.pdf
 # Long ReturnBatch tag
 0      string  \x7f\x84\x16
 # Long RapBatchControlInfo tag
index 8478863..2966fa6 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: bioinformatics,v 1.3 2016/06/20 16:13:14 christos Exp $
+# $File: bioinformatics,v 1.5 2019/04/19 00:42:27 christos Exp $
 # bioinfomatics:  file(1) magic for Bioinfomatics file formats
 
 ###############################################################################
@@ -83,7 +83,7 @@
 
 ###############################################################################
 # BCF (Binary Call Format), version 2.1
-# used by SAMtools (http://samtools.github.io/hts-specs/BCFv2_qref.pdf)
+# used by SAMtools (https://samtools.github.io/hts-specs/BCFv2_qref.pdf)
 # data is normally present only within compressed BGZF blocks (CDATA), so use file -z to examine it
 ###############################################################################
 0              string     BCF\2\1    Binary Call Format (BCF) version 2.1
@@ -96,7 +96,7 @@
 
 ###############################################################################
 # BCF (Binary Call Format), version 2.2
-# used by SAMtools (http://samtools.github.io/hts-specs/BCFv2_qref.pdf)
+# used by SAMtools (https://samtools.github.io/hts-specs/BCFv2_qref.pdf)
 # data is normally present only within compressed BGZF blocks (CDATA), so use file -z to examine it
 ###############################################################################
 0              string     BCF\2\2    Binary Call Format (BCF) version 2.2
 
 ###############################################################################
 # FASTA
-# used by FASTA (http://fasta.bioch.virginia.edu/fasta_www2/fasta_guide.pdf)
+# used by FASTA (https://fasta.bioch.virginia.edu/fasta_www2/fasta_guide.pdf)
 ###############################################################################
 #0     byte    0x3e
 # q>0  regex   =^[>][!-~\t\ ]+$
index fe72956..e490f6c 100644 (file)
@@ -7,7 +7,7 @@
 #    The list has been derived from biosig projects
 #      http://biosig.sourceforge.net
 #      https://pub.ist.ac.at/~schloegl/matlab/eeg/
-#      http://pub.ist.ac.at/~schloegl/biosig/TESTED
+#      https://pub.ist.ac.at/~schloegl/biosig/TESTED
 #
 ##############################################################################
 #
index 70ea563..d2f901a 100644 (file)
@@ -1,5 +1,5 @@
 # Berkeley Lab Checkpoint Restart (BLCR) checkpoint context files
-# http://ftg.lbl.gov/checkpoint
+# https://ftg.lbl.gov/checkpoint
 0      string  C\0\0\0R\0\0\0  BLCR
 >16    lelong  1       x86
 >16    lelong  3       alpha
index 0948570..276242e 100644 (file)
@@ -1,10 +1,10 @@
 
 #------------------------------------------------------------------------------
-# $File: blender,v 1.7 2017/03/17 21:35:28 christos Exp $
+# $File: blender,v 1.8 2019/04/19 00:42:27 christos Exp $
 # blender: file(1) magic for Blender 3D related files
 #
 # Native format rule v1.2. For questions use the developers list
-# http://lists.blender.org/mailman/listinfo/bf-committers
+# https://lists.blender.org/mailman/listinfo/bf-committers
 # GLOB chunk was moved near start and provides subversion info since 2.42
 
 0              string  =BLENDER        Blender3D,
index 7b3f703..becf6b0 100644 (file)
@@ -1,5 +1,5 @@
 #------------------------------------------------------------------------------
-# $File: c-lang,v 1.26 2017/08/14 07:40:38 christos Exp $
+# $File: c-lang,v 1.27 2019/02/27 16:46:23 christos Exp $
 # c-lang:  file(1) magic for C and related languages programs
 #
 # The strength is to beat standard HTML
 
 # C
 # 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
+0      search/8192     #include
+>0     regex   \^#include                      C
+>>0    regex   \^class[[:space:]]+
+>>>&0  regex   \\{[\.\*]\\}(;)?$                       \b++
+>>&0   clear   x                               source text
 !:strength + 13
 !:mime text/x-c
-0      regex   \^#[[:space:]]*pragma   C source text
+0      search/8192     pragma
+>0     regex   \^#[[:space:]]*pragma   C source text
 !:mime text/x-c
-0      regex   \^#[[:space:]]*(if\|ifn)def
->&0    regex   \^#[[:space:]]*endif$   C source text
+0      search/8192     endif
+>0     regex   \^#[[:space:]]*(if\|ifn)def
+>>&0   regex   \^#[[:space:]]*endif$   C source text
 !:mime text/x-c
-0      regex   \^#[[:space:]]*(if\|ifn)def
->&0    regex   \^#[[:space:]]*define   C source text
+0      search/8192     define
+>0     regex   \^#[[:space:]]*(if\|ifn)def
+>>&0   regex   \^#[[:space:]]*define   C source text
 !:mime text/x-c
-0      regex   \^[[:space:]]*char(\ \\*|\\*)(.+)(=.*)?;[[:space:]]*$                   C source text
+0      search/8192     char
+>0     regex   \^[[:space:]]*char(\ \\*|\\*)(.+)(=.*)?;[[:space:]]*$                   C source text
 !:mime text/x-c
-0      regex   \^[[:space:]]*double(\ \\*|\\*)(.+)(=.*)?;[[:space:]]*$                 C source text
+0      search/8192     double
+>0     regex   \^[[:space:]]*double(\ \\*|\\*)(.+)(=.*)?;[[:space:]]*$                 C source text
 !:mime text/x-c
-0      regex   \^[[:space:]]*extern[[:space:]]+                C source text
+0      search/8192     extern
+>0     regex   \^[[:space:]]*extern[[:space:]]+                C source text
 !:mime text/x-c
-0      regex   \^[[:space:]]*float(\ \\*|\\*)(.+)(=.*)?;[[:space:]]*$                  C source text
+0      search/8192     float
+>0     regex   \^[[:space:]]*float(\ \\*|\\*)(.+)(=.*)?;[[:space:]]*$                  C source text
 !:mime text/x-c
-0      regex   \^struct[[:space:]]+            C source text
+0      search/8192     struct
+>0     regex   \^struct[[:space:]]+            C source text
 !:mime text/x-c
-0      regex   \^union[[:space:]]+             C source text
+0      search/8192     union
+>0     regex   \^union[[:space:]]+             C source text
 !:mime text/x-c
 0      search/8192     main(
 >&0 regex      \\)[[:space:]]*\\{              C source text
 
 # C++
 # The strength of these rules is increased so they beat the C rules above
-0      regex   \^namespace[[:space:]]+[_[:alpha:]]{1,30}[[:space:]]*\\{        C++ source text
+0      search/8192     namespace
+>0     regex   \^namespace[[:space:]]+[_[:alpha:]]{1,30}[[:space:]]*\\{        C++ source text
 !:strength + 30
 !:mime text/x-c++
 # using namespace [namespace] or using std::[lib]
-0      regex   \^using[[:space:]]+(namespace\ )?std(::)?[[:alpha:]]*[[:space:]]*;              C++ source text
+0      search/8192     using
+>0     regex   \^using[[:space:]]+(namespace\ )?std(::)?[[:alpha:]]*[[:space:]]*;              C++ source text
 !:strength + 30
 !:mime text/x-c++
-0      regex   \^[[:space:]]*template[[:space:]]*<.*>[[:space:]]*$     C++ source text
+0      search/8192     template
+>0     regex   \^[[:space:]]*template[[:space:]]*<.*>[[:space:]]*$     C++ source text
 !:strength + 30
 !:mime text/x-c++
-0      regex   \^[[:space:]]*virtual[[:space:]]+.*[};][[:space:]]*$            C++ source text
+0      search/8192     virtual
+>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
+0      search/8192     class
+>0     regex   \^[[:space:]]*class[[:space:]]+[[:digit:][:alpha:]:_]+[[:space:]]*\\{(.*[\n]*)*\\}(;)?$         C++ source text
 !:strength + 13
 !:mime text/x-c++
-0      regex   \^[[:space:]]*public:           C++ source text
+0      search/8192     public
+>0     regex   \^[[:space:]]*public:           C++ source text
 !:strength + 30
 !:mime text/x-c++
-0      regex   \^[[:space:]]*private:          C++ source text
+0      search/8192     private
+>0     regex   \^[[:space:]]*private:          C++ source text
 !:strength + 30
 !:mime text/x-c++
-0      regex   \^[[:space:]]*protected:                C++ source text
+0      search/8192     protected
+>0     regex   \^[[:space:]]*protected:                C++ source text
 !:strength + 30
 !:mime text/x-c++
 
 # Objective-C
-0      regex   \^#import                       Objective-C source text
+0      search/8192     #import
+>0     regex   \^#import                       Objective-C source text
 !:strength + 25
 !:mime text/x-objective-c
 
index 26eae69..48a76d1 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: cad,v 1.18 2018/08/02 06:23:27 christos Exp $
+# $File: cad,v 1.19 2019/04/19 00:42:27 christos Exp $
 # autocad:  file(1) magic for cad files
 #
 
 # raster underlays to Microstation DGN (vector) drawings.
 #
 # http://www.wotsit.org/search.asp
-# http://filext.com/detaillist.php?extdetail=DGN
-# http://filext.com/detaillist.php?extdetail=CIT
+# https://filext.com/detaillist.php?extdetail=DGN
+# https://filext.com/detaillist.php?extdetail=CIT
 #
-# http://www.bentley.com/products/default.cfm?objectid=97F351F5-9C35-4E5E-89C2
+# https://www.bentley.com/products/default.cfm?objectid=97F351F5-9C35-4E5E-89C2
 # 3F86C928&method=display&p_objectid=97F351F5-9C35-4E5E-89C280A93F86C928
-# http://www.bentley.com/products/default.cfm?objectid=A5C2FD43-3AC9-4C71-B682
+# https://www.bentley.com/products/default.cfm?objectid=A5C2FD43-3AC9-4C71-B682
 # 721C479F&method=display&p_objectid=A5C2FD43-3AC9-4C71-B682C7BE721C479F
 0      string  \010\011\376                    Microstation
 >3     string  \002
@@ -43,8 +43,8 @@
 >4     string  \030\000\003                    CITFile
 
 # AutoCAD
-# Merge of the different contributions and updates from http://en.wikipedia.org/wiki/Dwg
-# and http://www.iana.org/assignments/media-types/image/vnd.dwg
+# Merge of the different contributions and updates from https://en.wikipedia.org/wiki/Dwg
+# and https://www.iana.org/assignments/media-types/image/vnd.dwg
 0      string  MC0.0   DWG AutoDesk AutoCAD Release 1.0
 !:mime image/vnd.dwg
 0      string  AC1.2   DWG AutoDesk AutoCAD Release 1.2
@@ -89,7 +89,7 @@
 # Sergey Zaykov (mail_of_sergey@mail.ru, sergey_zaikov@rambler.ru,
 # ICQ 358572321)
 # From various sources like:
-# http://autodesk.blogs.com/between_the_lines/autocad-release-history.html
+# https://autodesk.blogs.com/between_the_lines/autocad-release-history.html
 0      string  AC1018  DWG AutoDesk AutoCAD 2004/2005/2006
 !:mime image/vnd.dwg
 0      string  AC1021  DWG AutoDesk AutoCAD 2007/2008/2009
 # KOMPAS 2D drawing from ASCON
 # This is KOMPAS 2D drawing or fragment of drawing but is not detailed nor
 # gathered nor specification
-# ASCON http://ascon.net/main/ in English,
-#      http://ascon.ru/ main site in Russian
+# ASCON https://ascon.net/main/ in English,
+#      https://ascon.ru/ main site in Russian
 # Extension is CDW for drawing and FRW for fragment of drawing
 # Sergey Zaykov (mail_of_sergey@mail.ru, sergey_zaikov@rambler.ru,
-# ICQ 358572321, http://vkontakte.ru/id16076543)
+# ICQ 358572321, https://vkontakte.ru/id16076543)
 # From:
-# http://sd.ascon.ru/otrs/customer.pl?Action=CustomerFAQ&CategoryID=4&ItemID=292
+# https://sd.ascon.ru/otrs/customer.pl?Action=CustomerFAQ&CategoryID=4&ItemID=292
 # (in russian) and my experiments
 0      string  KF
 >2     belong  0x4E00000C      Kompas drawing 12.0 SP1
 !:ext 3ds
 
 # MegaCAD 2D/3D drawing (.prt)
-# http://megacad.de/
+# https://megacad.de/
 # From: Markus Heidelberg <markus.heidelberg@web.de>
 0      string  MegaCad23\0     MegaCAD 2D/3D drawing
 
index f6ad1c8..1120c7d 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: commands,v 1.59 2017/08/14 07:40:38 christos Exp $
+# $File: commands,v 1.60 2019/04/19 00:42:27 christos Exp $
 # commands:  file(1) magic for various shells and interpreters
 #
 #0     string/w        :                       shell archive or script for antique kernel text
@@ -96,7 +96,7 @@
 0      search/1/w      #!\ /usr/bin/php        PHP script text executable
 !:strength + 10
 !:mime text/x-php
-# Smarty compiled template, http://www.smarty.net/
+# Smarty compiled template, https://www.smarty.net/
 # Elan Ruusamae <glen@delfi.ee>
 0      string  =<?php
 >5     regex   [\ \n]
 0      string/t        $!                      DCL command file
 
 # Type: Pdmenu
-# URL:  http://packages.debian.org/pdmenu
+# URL:  https://packages.debian.org/pdmenu
 # From: Edward Betts <edward@debian.org>
 0      string          #!/usr/bin/pdmenu       Pdmenu configuration file text
 
index 4c74337..7520eb4 100644 (file)
@@ -1,5 +1,5 @@
 #------------------------------------------------------------------------------
-# $File: compress,v 1.73 2018/09/01 13:52:39 christos Exp $
+# $File: compress,v 1.75 2019/04/19 00:42:27 christos Exp $
 # compress:  file(1) magic for pure-compression formats (no archives)
 #
 # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc.
 >2     byte&0x1f       x               %d bits
 
 # gzip (GNU zip, not to be confused with Info-ZIP or PKWARE zip archiver)
+# URL: https://en.wikipedia.org/wiki/Gzip
+# Reference: https://tools.ietf.org/html/rfc1952
+# Update: Joerg Jenderek, Apr 2019
 #   Edited by Chris Chittleborough <cchittleborough@yahoo.com.au>, March 2002
 #      * Original filename is only at offset 10 if "extra field" absent
 #      * Produce shorter output - notably, only report compression methods
 #         other than 8 ("deflate", the only method defined in RFC 1952).
-0       string          \037\213        gzip compressed data
-!:mime application/x-gzip
-!:strength * 2
+# Note: find defs -iname '*.trid.xml' -exec grep -q '<Bytes>1F8B08' {} \; -ls
+# TODO:
+# FBR  Blueberry FlashBack screen Record       https://www.flashbackrecorder.com/
+# KPR  KOffice/Calligra KPresenter             application/x-kpresenter
+# KPT  KOffice/Calligra KPresenter template?   application/x-kpresenter
+# SAV  Diggles Saved Game File                 http://www.innonics.com
+# SAV  FarCry (demo) saved game                http://www.farcry-thegame.com
+# DAT  ZOAGZIP game data format                http://en.wikipedia.org/wiki/SD_Gundam_Capsule_Fighter
+0       string          \037\213
+# to display gzip compressed (strength=100=2*50) before other (strength=50)?
+#!:strength * 2
+# no FNAME and FCOMMENT bit implies no file name/comment. That means only binary
+>3     byte&0x18       =0
+# For binary gzipped no ASCII text should occur
+#      mcd-monu-cad.trid.xml
+>>10   string          MCD                     Monu-Cad Drawing, Component or Font
+#>>36  string          Created\ with\ MONU-CAD 
+#!:mime        application/octet-stream
+# http://fileformats.archiveteam.org/wiki/Monu-CAD
+#      http://www.monucad.com/downloads/FullDemo-2005.EXE
+#      /HANDS96.MCC    Component
+#      /DEMO_DD01.MCD  Drawing
+#      /MCALF020.FNT   Font
+!:ext  mcc/mcd/fnt
+# http://www.generalcadd.com
+>>10   string          GXD                     General CADD, Drawing or Component
+#!:mime        application/octet-stream
+#      /gxc/BUILDINGEDGE.gxc                   Component
+#      /gxd/HOCKETT-STPAUL-WRHSE.gxd           Drawing
+#      /gxd/POWERLAND-MILL-ADD-11.gxd          Drawing         v9.1.06
+!:ext  gxc/gxd
+#>>>13 ubyte           0                       \b, version 0
+>>>13  string          09                      \b, version 9
+# other gzipped binary like gzipped tar, VirtualBox extension package,...
+>>10   default         x               gzip compressed data
+>>>0   use     gzip-info
+# size of the original (uncompressed) input data modulo 2^32
+>>>-4  ulelong         x               \b, original size modulo 2^32 %u
+# gzipped TAR or VirtualBox extension package
+!:mime application/gzip
+#!:mime        application/x-compressed-tar
+#!:mime        application/x-virtualbox-vbox-extpack
+# https://www.w3.org/TR/SVG/mimereg.html
+#!:mime        image/image/svg+xml-compressed
+#      zlib.3.gz
+#      microcode-20180312.tgz
+#      tpz same as tgz
+#      lua-md5_1.2-1_i386_i486.ipk     https://en.wikipedia.org/wiki/Opkg
+#      Oracle_VM_VirtualBox_Extension_Pack-5.0.12-104815.vbox-extpack
+!:ext  gz/tgz/tpz/ipk/vbox-extpack/svgz
+# FNAME/FCOMMENT bit implies file name/comment as iso-8859-1 text
+>3     byte&0x18       >0              gzip compressed data
+!:mime application/gzip
+# gzipped tar, gzipped Abiword document
+#!:mime        application/x-compressed-tar
+#!:mime        application/x-abiword-compressed
+#!:mime        image/image/svg+xml-compressed
+#      kleopatra_splashscreen.svgz     gzipped .svg
+!:ext  gz/tgz/tpz/zabw/svgz
+>>0    use     gzip-info
+# size of the original (uncompressed) input data modulo 2^32
+>>-4   ulelong         x               \b, original size modulo 2^32 %u
+#      display information of gzip compressed files
+0      name                            gzip-info
+#>2    byte            x               THIS iS GZIP
 >2     byte            <8              \b, reserved method
 >2     byte            >8              \b, unknown method
 >3     byte            &0x01           \b, ASCII
 >9     byte            =0x0B           \b, from NTFS filesystem (NT)
 >9     byte            =0x0C           \b, from QDOS
 >9     byte            =0x0D           \b, from Acorn RISCOS
->-4    lelong          x               \b, original size %u
+# size of the original (uncompressed) input data modulo 2^32
+#>-4   ulelong         x               \b, original size modulo 2^32 %u
+#ERROR: line 114: non zero offset 1048572 at level 1
 
 # packed data, Huffman (minimum redundancy) codes on a byte-by-byte basis
 0      string          \037\036        packed data
 >>17   byte            =0x0E           os: Win32
 
 # 4.3BSD-Quasijarus Strong Compression
-# http://minnie.tuhs.org/Quasijarus/compress.html
+# https://minnie.tuhs.org/Quasijarus/compress.html
 0      string          \037\241        Quasijarus strong compressed data
 
 # From: Cory Dikkers <cdikkers@swbell.net>
 >4     belong          0x090A0C0D      best compression
 
 # 7-zip archiver, from Thomas Klausner (wiz@danbala.tuwien.ac.at)
-# http://www.7-zip.org or DOC/7zFormat.txt
+# https://www.7-zip.org or DOC/7zFormat.txt
 #
 0      string          7z\274\257\047\034      7-zip archive data,
 >6     byte            x                       version %d
 >5     byte            x                       \b.%d
 !:mime application/x-lrzip
 
-# http://fastcompression.blogspot.fi/2013/04/lz4-streaming-format-final.html
+# https://fastcompression.blogspot.fi/2013/04/lz4-streaming-format-final.html
 0      lelong          0x184d2204      LZ4 compressed data (v1.4+)
 !:mime application/x-lz4
 # Added by osm0sis@xda-developers.com
 >0x8   lelong  x               \b, %u entries
 
 # Snappy framing format
-# http://code.google.com/p/snappy/source/browse/trunk/framing_format.txt
+# https://code.google.com/p/snappy/source/browse/trunk/framing_format.txt
 0      string  \377\006\0\0sNaPpY      snappy framed data
 !:mime application/x-snappy-framed
 
-# qpress, http://www.quicklz.com/
+# qpress, https://www.quicklz.com/
 0      string  qpress10        qpress compressed data
 !:mime application/x-qpress
 
index ab2954f..5e5e581 100644 (file)
@@ -1,14 +1,14 @@
 
 #------------------------------------------------------------------------------
-# $File: console,v 1.40 2018/06/23 16:40:40 christos Exp $
+# $File: console,v 1.45 2019/04/19 00:42:27 christos Exp $
 # Console game magic
 # Toby Deshane <hac@shoelace.digivill.net>
 
 # ines: file(1) magic for Marat's iNES Nintendo Entertainment System ROM dump format
 # Updated by David Korth <gerbilsoft@gerbilsoft.com>
 # References:
-# - http://wiki.nesdev.com/w/index.php/INES
-# - http://wiki.nesdev.com/w/index.php/NES_2.0
+# - https://wiki.nesdev.com/w/index.php/INES
+# - https://wiki.nesdev.com/w/index.php/NES_2.0
 
 # Common header for iNES, NES 2.0, and Wii U iNES.
 0      name            nes-rom-image-ines
@@ -57,7 +57,7 @@
 
 #------------------------------------------------------------------------------
 # unif: file(1) magic for UNIF-format Nintendo Entertainment System ROM images
-# Reference: http://wiki.nesdev.com/w/index.php/UNIF
+# Reference: https://wiki.nesdev.com/w/index.php/UNIF
 # From: David Korth <gerbilsoft@gerbilsoft.com>
 #
 # NOTE: The UNIF format uses chunks instead of a fixed header,
@@ -69,7 +69,7 @@
 
 #------------------------------------------------------------------------------
 # fds: file(1) magic for Famciom Disk System disk images
-# Reference: http://wiki.nesdev.com/w/index.php/Family_Computer_Disk_System#.FDS_format
+# Reference: https://wiki.nesdev.com/w/index.php/Family_Computer_Disk_System#.FDS_format
 # From: David Korth <gerbilsoft@gerbilsoft.com>
 # TODO: Check "Disk info block" and get info from that in addition to the optional header.
 
 # genesis: file(1) magic for various Sega Mega Drive / Genesis ROM image and disc formats
 # Updated by David Korth <gerbilsoft@gerbilsoft.com>
 # References:
-# - http://www.retrodev.com/segacd.html
+# - https://www.retrodev.com/segacd.html
 # - http://devster.monkeeh.com/sega/32xguide1.txt
 #
 
 # Detects all Game Gear and export Sega Master System ROM images,
 # and some Japanese Sega Master System ROM images.
 # From: David Korth <gerbilsoft@gerbilsoft.com>
-# Reference: http://www.smspower.org/Development/ROMHeader
+# Reference: https://www.smspower.org/Development/ROMHeader
 #
 
 # General SMS header rule.
 #------------------------------------------------------------------------------
 # dreamcast: file(1) magic for the Sega Dreamcast disc image format.
 # From: David Korth <gerbilsoft@gerbilsoft.com>
-# Reference: http://mc.pp.se/dc/ip0000.bin.html
+# Reference: https://mc.pp.se/dc/ip0000.bin.html
 #
 
 # Common Sega Dreamcast disc header format.
 
 #------------------------------------------------------------------------------
 # gba: file(1) magic for the Nintendo Game Boy Advance raw ROM format
-# Reference: http://problemkaputt.de/gbatek.htm#gbacartridgeheader
+# Reference: https://problemkaputt.de/gbatek.htm#gbacartridgeheader
 #
 # Original version from: "Nelson A. de Oliveira" <naoliv@gmail.com>
 # Updated version from: David Korth <gerbilsoft@gerbilsoft.com>
 
 #------------------------------------------------------------------------------
 # nds: file(1) magic for the Nintendo DS(i) raw ROM format
-# Reference: http://problemkaputt.de/gbatek.htm#dscartridgeheader
+# Reference: https://problemkaputt.de/gbatek.htm#dscartridgeheader
 #
 # Original version from: "Nelson A. de Oliveira" <naoliv@gmail.com>
 # Updated version from: David Korth <gerbilsoft@gerbilsoft.com>
 # From: David Korth <gerbilsoft@gerbilsoft.com>
 # References:
 # - https://neogpc.googlecode.com/svn-history/r10/trunk/src/core/neogpc.cpp
-# - http://www.devrs.com/ngp/files/ngpctech.txt
+# - https://www.devrs.com/ngp/files/ngpctech.txt
 #
 0x0A   string  BY\ SNK\ CORPORATION    Neo Geo Pocket
 !:mime application/x-neo-geo-pocket-rom
 
 #------------------------------------------------------------------------------
 # Microsoft Xbox executables .xbe (Esa Hyytia <ehyytia@cc.hut.fi>)
-0       string          XBEH            XBE, Microsoft Xbox executable
+0      string  XBEH    Microsoft Xbox executable
+# expect base address of 0x10000
+>0x0104                 ulelong =0x10000
+>>(0x0118.l-0x0FFF4)    lestring16 x       \b: "%.40s"
+>>(0x0118.l-0x0FFF5)    byte     x         (%c
+>>(0x0118.l-0x0FFF6)    byte     x         \b%c-
+>>(0x0118.l-0x0FFF8)    uleshort x         \b%03u)
+>>(0x0118.l-0x0FF60)    ulelong&0x80000007  0x80000007 \b, all regions
+>>(0x0118.l-0x0FF60)    ulelong&0x80000007  !0x80000007
+>>>(0x0118.l-0x0FF60)   ulelong >0           (regions:
+>>>>(0x0118.l-0x0FF60)  ulelong &0x00000001  NA
+>>>>(0x0118.l-0x0FF60)  ulelong &0x00000002  Japan
+>>>>(0x0118.l-0x0FF60)  ulelong &0x00000004  Rest_of_World
+>>>>(0x0118.l-0x0FF60)  ulelong &0x80000000  Manufacturer
+>>>(0x0118.l-0x0FF60)   ulelong >0           \b)
 # probabilistic checks whether signed or not
 >0x0004 ulelong =0x0
 >>&2    ulelong =0x0
 >0x0004 ulelong >0
 >>&2    ulelong >0
 >>>&2   ulelong >0    \b, signed
-# expect base address of 0x10000
->0x0104               ulelong =0x10000
->>(0x0118-0x0FF60)    ulelong&0x80000007  0x80000007 \b, all regions
->>(0x0118-0x0FF60)    ulelong&0x80000007  !0x80000007
->>>(0x0118-0x0FF60)   ulelong >0           (regions:
->>>>(0x0118-0x0FF60)  ulelong &0x00000001  NA
->>>>(0x0118-0x0FF60)  ulelong &0x00000002  Japan
->>>>(0x0118-0x0FF60)  ulelong &0x00000004  Rest_of_World
->>>>(0x0118-0x0FF60)  ulelong &0x80000000  Manufacturer
->>>(0x0118-0x0FF60)   ulelong >0           \b)
 
 # --------------------------------
 # Microsoft Xbox data file formats
 0       string          XIP0            XIP, Microsoft Xbox data
 0       string          XTF0            XTF, Microsoft Xbox data
 
+#------------------------------------------------------------------------------
+# Microsoft Xbox 360 executables (.xex)
+# From: David Korth <gerbilsoft@gerbilsoft.com>
+# References:
+# - https://free60project.github.io/wiki/XEX.html
+# - https://github.com/xenia-project/xenia/blob/HEAD/src/xenia/kernel/util/xex2_info.h
+
+# Title ID (part of Execution ID section)
+0              name    xbox-360-xex-execution-id
+>(0.L+0xC)     byte    x       (%c
+>(0.L+0xD)     byte    x       \b%c
+>(0.L+0xE)     beshort x       \b-%04u)
+
+0      string  XEX2    Microsoft Xbox 360 executable
+>0x18  search/0x100    \x00\x04\x00\x06
+>>&0   use     xbox-360-xex-execution-id
+>(0x010.L+0x178)       ubelong 0xFFFFFFFF      \b, all regions
+>(0x010.L+0x178)       ubelong !0xFFFFFFFF
+>>(0x010.L+0x178)      ubelong >0              (regions:
+>>(0x010.L+0x178)      ubelong&0x000000FF      0x000000FF      USA
+>>(0x010.L+0x178)      ubelong&0x00000100      0x00000100      Japan
+>>(0x010.L+0x178)      ubelong&0x00000200      0x00000200      China
+>>(0x010.L+0x178)      ubelong&0x0000FC00      0x0000FC00      Asia
+>>(0x010.L+0x178)      ubelong&0x00FF0000      0x00FF0000      PAL
+>>(0x010.L+0x178)      ubelong&0x00FF0000      0x00FE0000      PAL [except AU/NZ]
+>>(0x010.L+0x178)      ubelong&0x00FF0000      0x00010000      AU/NZ
+>>(0x010.L+0x178)      ubelong&0xFF000000      0xFF000000      Other
+>>(0x010.L+0x178)      ubelong >0              \b)
+
+
+
 # Atari Lynx cartridge dump (EXE/BLL header)
 # From: "Stefan A. Haubenthal" <polluks@web.de>
 
 >4     byte            x       %u tracks
 
 # IPS Patch Files from: From: Thomas Klausner <tk@giga.or.at>
-# see http://zerosoft.zophar.net/ips.php
+# see https://zerosoft.zophar.net/ips.php
 0      string  PATCH                   IPS patch file
 
 # Playstations Patch Files from: From: Thomas Klausner <tk@giga.or.at>
 
 # Type: Nintendo GameCube/Wii common disc header data.
 # From: David Korth <gerbilsoft@gerbilsoft.com>
-# Reference: http://wiibrew.org/wiki/Wii_Disc
+# Reference: https://wiibrew.org/wiki/Wii_Disc
 0      name    nintendo-gcn-disc-common
 >0x20  string  x       "%.64s"
 >0x00  string  x       (%.6s
 
 # Type: Nintendo GameCube disc image
 # From: David Korth <gerbilsoft@gerbilsoft.com>
-# Reference: http://wiibrew.org/wiki/Wii_Disc
+# Reference: https://wiibrew.org/wiki/Wii_Disc
 0x1C   belong  0xC2339F3D      Nintendo GameCube disc image:
 !:mime application/x-gamecube-rom
 >0     use     nintendo-gcn-disc-common
 
 # Type: Nintendo Wii disc image
 # From: David Korth <gerbilsoft@gerbilsoft.com>
-# Reference: http://wiibrew.org/wiki/Wii_Disc
+# Reference: https://wiibrew.org/wiki/Wii_Disc
 0x18   belong  0x5D1C9EA3      Nintendo Wii disc image:
 >0     use     nintendo-gcn-disc-common
 
 # Type: Nintendo Wii disc image (WBFS format)
 # From: David Korth <gerbilsoft@gerbilsoft.com>
-# Reference: http://wiibrew.org/wiki/Wii_Disc
+# Reference: https://wiibrew.org/wiki/Wii_Disc
 0      string  WBFS
 >0x218 belong  0x5D1C9EA3      Nintendo Wii disc image (WBFS format):
 !:mime application/x-wii-rom
 
 # Type: Nintendo GameCube/Wii disc image (with SDK header)
 # From: David Korth <gerbilsoft@gerbilsoft.com>
-# Reference: http://wiibrew.org/wiki/Wii_Disc
+# Reference: https://wiibrew.org/wiki/Wii_Disc
 0              belong  0xFFFF0000
 >0x18          belong  0x00000000
 >>0x1C         belong  0x00000000
 >>>0x8018      belong  0x5D1C9EA3      Nintendo Wii SDK disc image:
+!:mime application/x-wii-rom
 >>>>0x8000     use     nintendo-gcn-disc-common
 >>>0x801C      belong  0xC2339F3D      Nintendo GameCube SDK disc image:
+!:mime application/x-gamecube-rom
 >>>>0x8000     use     nintendo-gcn-disc-common
 
 #------------------------------------------------------------------------------
index 8dfc9fe..69eab70 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: animation,v 1.57 2015/11/29 22:11:07 christos Exp $
+# $File: coverage,v 1.2 2019/04/19 00:42:27 christos Exp $
 # xoverage:  file(1) magic for test coverage data
 
 # File formats used to store test coverage data
@@ -67,7 +67,7 @@
 # `clang -fprofile-instr-generate -fcoverage-mapping ...`
 # default name: default.profraw
 # magic is: \xFF lprofr \x81
-# cf. http://llvm.org/docs/doxygen/html/InstrProfData_8inc_source.html
+# cf. https://llvm.org/docs/doxygen/html/InstrProfData_8inc_source.html
 0      lequad  0xff6c70726f667281      LLVM raw profile data,
 >&0    byte    x       version %d
 
 
 # LLVM indexed instruction profile (as generated by llvm-profdata)
 # magic is: reverse(\xFF lprofi \x81)
-# cf. http://llvm.org/docs/CoverageMappingFormat.html
-# http://llvm.org/docs/doxygen/html/namespacellvm_1_1IndexedInstrProf.html
-# http://llvm.org/docs/CommandGuide/llvm-cov.html
-# http://llvm.org/docs/CommandGuide/llvm-profdata.html
+# cf. https://llvm.org/docs/CoverageMappingFormat.html
+# https://llvm.org/docs/doxygen/html/namespacellvm_1_1IndexedInstrProf.html
+# https://llvm.org/docs/CommandGuide/llvm-cov.html
+# https://llvm.org/docs/CommandGuide/llvm-profdata.html
 0      lequad  0x8169666f72706cff      LLVM indexed profile data,
 >&0    byte    x       version %d
 
index 37fdd1b..ebea8f3 100644 (file)
@@ -2,7 +2,7 @@
 #--------------------------------------------------------------
 # ctf:  file(1) magic for CTF (Common Trace Format) trace files
 #
-# Specs. available here: <http://www.efficios.com/ctf>
+# Specs. available here: <https://www.efficios.com/ctf>
 #--------------------------------------------------------------
 
 # CTF trace data
index a065de3..6dd14ac 100644 (file)
@@ -1,9 +1,9 @@
 
 #------------------------------------------------------------------------------
-# $File: cups,v 1.5 2017/03/17 21:35:28 christos Exp $
+# $File: cups,v 1.6 2019/04/19 00:42:27 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
+# https://www.cups.org/documentation.php/spec-raster.html
 #
 
 0      name            cups-le
index dd88f25..071a115 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: database,v 1.54 2018/06/23 16:37:21 christos Exp $
+# $File: database,v 1.55 2019/04/19 00:42:27 christos Exp $
 # database:  file(1) magic for various databases
 #
 # extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
 
 ## XBase database files
 # updated by Joerg Jenderek at Feb 2013
-# http://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm
-# http://www.clicketyclick.dk/databases/xbase/format/dbf.html
+# https://www.dbase.com/Knowledgebase/INT/db7_file_fmt.htm
+# https://www.clicketyclick.dk/databases/xbase/format/dbf.html
 # http://home.f1.htw-berlin.de/scheibl/db/intern/dBase.htm
 # inspect VVYYMMDD , where 1<= MM <= 12 and 1<= DD <= 31
 0      ubelong&0x0000FFFF              <0x00000C20
 >>>>>>>>>>>>4  lelong                  >0              \b, %d record
 # plural s appended
 >>>>>>>>>>>>>4 lelong                  >1              \bs
-# http://www.clicketyclick.dk/databases/xbase/format/dbf_check.html#CHECK_DBF
+# https://www.clicketyclick.dk/databases/xbase/format/dbf_check.html#CHECK_DBF
 # 1 <= record size <= 4000 (dBase 3,4) or 32 * KB (=0x8000)
 >>>>>>>>>>>>10 uleshort                x               * %d
 # file size = records * record size + header size
 >>>>>>>>>>>>1  ubyte                   x               \b, update-date
 >>>>>>>>>>>>1  use                     xbase-date
-# http://msdn.microsoft.com/de-de/library/cc483186(v=vs.71).aspx
+# https://msdn.microsoft.com/de-de/library/cc483186(v=vs.71).aspx
 #>>>>>>>>>>>>29        ubyte                   =0              \b, codepage ID=0x%x
 # 2~cp850 , 3~cp1252 , 0x1b~?? ; what code page is 0x1b ?
 >>>>>>>>>>>>29 ubyte                   >0              \b, codepage ID=0x%x
 # dBASE IV SQL, no memo;dbv memo var size (Flagship)
 >>0    ubyte           0x43            dBase IV, with SQL table
 !:mime application/x-dbf
-# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx
+# https://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx
 #>>0   ubyte           0x62            dBase IV, with SQL table
 #!:mime        application/x-dbf
 # dBASE IV, with memo!!
 >>0    ubyte           0x7b            dBase IV, with memo
 !:mime application/x-dbf
-# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx
+# https://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx
 #>>0   ubyte           0x82            dBase IV, with SQL system
 #!:mime        application/x-dbf
 # FoxBase+/dBaseIII+ with memo .DBT!
 # VISUAL OBJECTS (first 1.0 versions) for the Dbase III files (NTX clipper driver); memo file
 >>0    ubyte           0x87            VISUAL OBJECTS, with memo file
 !:mime application/x-dbf
-# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx
+# https://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx
 #>>0   ubyte           0x8A            FoxBase+/dBase III, with memo .DBT
 #!:mime        application/x-dbf
 # dBASE IV with memo!
 !:mime application/x-dbf
 # .dbv and .dbt memo (Flagship)?
 >>0    ubyte           0xB3            Flagship
-# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx
+# https://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx
 #>>0   ubyte           0xCA            dBase IV with memo .DBT
 #!:mime        application/x-dbf
 # dBASE IV with SQL table, with memo .DBT
 # HiPer-Six format;Clipper SIX, with SMT memo file
 >>0    ubyte           0xE5            Clipper SIX with memo
 !:mime application/x-dbf
-# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx
+# https://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx
 #>>0   ubyte           0xF4            dBase IV, with SQL table, with memo
 #!:mime        application/x-dbf
 >>0    ubyte           0xF5            FoxPro with memo
 !:mime application/x-dbf
-# http://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx
+# https://msdn.microsoft.com/en-US/library/st4a0s68(v=vs.80).aspx
 #>>0   ubyte           0xFA            FoxPro 2.x, with memo
 #!:mime        application/x-dbf
 # unknown version (should not happen)
 >>>>>2 ubyte           x               \b-%d
 
 #      dBase memo files .DBT or .FPT
-# http://msdn.microsoft.com/en-us/library/8599s21w(v=vs.80).aspx
+# https://msdn.microsoft.com/en-us/library/8599s21w(v=vs.80).aspx
 16             ubyte           <4
 >16            ubyte           !2
 >>16           ubyte           !1
 >>220  ulelong         x               \b.%d
 
 # From: Joerg Jenderek
-# URL: http://forensicswiki.org/wiki/Windows_Application_Compatibility
+# URL: https://forensicswiki.org/wiki/Windows_Application_Compatibility
 # Note: files contain application compatibility fixes, application compatibility modes and application help messages.
 8      string          sdbf
 >7     ubyte           0
 >>7    byte            x               \b-%d
 
 # Type: Advanced Data Format (ADF) database
-# URL:  http://www.grc.nasa.gov/WWW/cgns/adf/
+# URL:  https://www.grc.nasa.gov/WWW/cgns/adf/
 # From: Nicolas Chauvat <nicolas.chauvat@logilab.fr>
 0      string  @(#)ADF\ Database       CGNS Advanced Data Format
 
 0      string          ToKyO\ CaBiNeT\n        TokyoCabinet database
 >14    string          x                       (version %s)
 
-# From:  Stephane Blondon http://www.yaal.fr
+# From:  Stephane Blondon https://www.yaal.fr
 # Database file for Zope (done by FileStorage)
 0      string  FS21    Zope Object Database File Storage v3 (data)
 0      string  FS30    Zope Object Database File Storage v4 (data)
 # IDA (Interactive Disassembler) database
 0      string          IDA1    IDA (Interactive Disassembler) database
 
-# Hopper (reverse engineering tool) http://www.hopperapp.com/
+# Hopper (reverse engineering tool) https://www.hopperapp.com/
 0      string          hopperdb        Hopper database
 
 # URL: https://en.wikipedia.org/wiki/Panorama_(database_engine)
index 8bbe87a..8ef3f79 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: dataone,v 1.1 2018/06/06 01:16:40 christos Exp $
+# $File: dataone,v 1.2 2019/04/19 00:42:27 christos Exp $
 #
 # DataONE- files from Dave Vieglais <dave.vieglais@gmail.com> &
 #                     Pratik Shrivastava <pratikshrivastava23@gmail.com>
 >&0    regex   (eml)-[0-9].[0-9].[0-9]+        eml://ecoinformatics.org/%s
 
 # onedcx (DataONE Dublin Core Extended v1.0)
->&0    regex   (onedcx/v)[0-9].[0-9]+          http://ns.dataone.org/metadata/schema/onedcx/v1.0
+>&0    regex   (onedcx/v)[0-9].[0-9]+          https://ns.dataone.org/metadata/schema/onedcx/v1.0
 
 # FGDC-STD-001-1998 (Content Standard for Digital Geospatial Metadata,
 # version 001-1998)
 >&0    regex   fgdc                            FGDC-STD-001-1998
 
 # Mercury (Oak Ridge National Lab Mercury Metadata version 1.0)
->&0    regex   (mercury/terms/v)[0-9].[0-9]    http://purl.org/ornl/schema/mercury/terms/v1.0
+>&0    regex   (mercury/terms/v)[0-9].[0-9]    https://purl.org/ornl/schema/mercury/terms/v1.0
 
 # ISOTC211 (Geographic MetaData (GMD) Extensible Markup Language)
 >&0    regex   isotc211
->>&0   regex   eng;USA                         http://www.isotc211.org/2005/gmd
+>>&0   regex   eng;USA                         https://www.isotc211.org/2005/gmd
 
 # ISOTC211 (NOAA Variant Geographic MetaData (GMD) Extensible Markup Language)
->>&0   regex   gov.noaa.nodc:[0-9]+            http://www.isotc211.org/2005/gmd-noaa
+>>&0   regex   gov.noaa.nodc:[0-9]+            https://www.isotc211.org/2005/gmd-noaa
 
 # ISOTC211 PANGAEA Variant Geographic MetaData (GMD) Extensible Markup Language
->>&0   regex   pangaea.dataset[0-9][0-9][0-9][0-9][0-9][0-9]+  http://www.isotc211.org/2005/gmd-pangaea
+>>&0   regex   pangaea.dataset[0-9][0-9][0-9][0-9][0-9][0-9]+  https://www.isotc211.org/2005/gmd-pangaea
 !:mime text/xml
 
 
 # Object Reuse and Exchange Vocabulary
 0      string  <?xml
 >&0    regex   rdf
->>&0   regex   openarchives    http://www.openarchives.org/ore/terms
+>>&0   regex   openarchives    https://www.openarchives.org/ore/terms
 !:mime application/rdf+xml
 
 
 # Dryad Metadata Application Profile Version 3.1
 0      string  <DryadData
->&0    regex   (dryad-bibo/v)[0-9].[0-9]       http://datadryad.org/profile/v3.1
+>&0    regex   (dryad-bibo/v)[0-9].[0-9]       https://datadryad.org/profile/v3.1
 !:mime text/xml
index 8545720..df07ff8 100644 (file)
@@ -1,9 +1,9 @@
 
 #------------------------------------------------------------------------------
-# $File: dbpf,v 1.2 2018/05/24 18:54:40 christos Exp $
+# $File: dbpf,v 1.3 2019/04/19 00:42:27 christos Exp $
 # dppf:        Maxis Database Packed Files, the stored data file format used by all
 #      Maxis games after the Sims: http://wiki.niotso.org/DBPF
-#      http://www.wiki.sc4devotion.com/index.php?title=DBPF
+#      https://www.wiki.sc4devotion.com/index.php?title=DBPF
 #      13 Oct 2017, Kip Warner <kip at thevertigo dot com>
 0      string  DBPF    Maxis Database Packed File
 >4     ulelong x       \b, version: %u.
index 8034edd..d73e7d3 100644 (file)
@@ -1,8 +1,8 @@
 
 #------------------------------------------------------------------------------
-# $File: dolby,v 1.8 2017/03/17 21:35:28 christos Exp $
+# $File: dolby,v 1.9 2019/04/19 00:42:27 christos Exp $
 # ATSC A/53 aka AC-3 aka Dolby Digital <ashitaka@gmx.at>
-# from http://www.atsc.org/standards/a_52a.pdf
+# from https://www.atsc.org/standards/a_52a.pdf
 # corrections, additions, etc. are always welcome!
 #
 # syncword
index 185970e..c57f81b 100644 (file)
@@ -1,11 +1,11 @@
 
 #------------------------------------------------------------------------------
-# $File: dyadic,v 1.8 2017/03/17 21:35:28 christos Exp $
+# $File: dyadic,v 1.9 2019/04/19 00:42:27 christos Exp $
 # Dyadic: file(1) magic for Dyalog APL.
 #
 # updated by Joerg Jenderek at Oct 2013
-# http://en.wikipedia.org/wiki/Dyalog_APL
-# http://www.dyalog.com/
+# https://en.wikipedia.org/wiki/Dyalog_APL
+# https://www.dyalog.com/
 # .DXV Dyalog APL External Variable
 # .DIN Dyalog APL Input Table
 # .DOT Dyalog APL Output Table
index 725f03b..d37b5c0 100644 (file)
@@ -1,8 +1,8 @@
 
 #------------------------------------------------------------------------------
-# $File$
+# $File: ebml,v 1.2 2019/04/19 00:42:27 christos Exp $
 # ebml:  file(1) magic for various Extensible Binary Meta Language
-# http://www.matroska.org/technical/specs/index.html#track
+# https://www.matroska.org/technical/specs/index.html#track
 0      belong  0x1a45dfa3      EBML file
 >4     search/b/100    \102\202
 >>&1   string  x               \b, creator %.8s
diff --git a/magic/Magdir/edid b/magic/Magdir/edid
new file mode 100644 (file)
index 0000000..a17b6c4
--- /dev/null
@@ -0,0 +1,11 @@
+
+#------------------------------------------------------------------------------
+# $File: edid,v 1.1 2019/03/28 12:36:01 christos Exp $
+# edid:  file(1) magic for EDID dump files
+
+0      quad    0x00ffffffffffff00      Extended display identification data dump
+!:mime application/x-edid-dump
+>18    byte    0x01                    Version 1
+>>19   byte    <0x04                   \b.%d
+>18    byte    0x02                    Version 2
+>>19   byte    0x00                    \b.0
index a77c81c..df7aa2a 100644 (file)
@@ -1,8 +1,8 @@
 
 #------------------------------------------------------------------------------
-# $File: erlang,v 1.5 2009/09/19 16:28:09 christos Exp $
+# $File: erlang,v 1.7 2019/04/19 00:42:27 christos Exp $
 # erlang:  file(1) magic for Erlang JAM and BEAM files
-# URL:  http://www.erlang.org/faq/x779.html#AEN812
+# URL:  https://www.erlang.org/faq/x779.html#AEN812
 
 # OTP R3-R4
 0      string  \0177BEAM!      Old Erlang BEAM file
index 6d67535..e49a7ce 100644 (file)
@@ -1,9 +1,9 @@
 
 #------------------------------------------------------------------------------
-# $File$
+# $File: esri,v 1.5 2019/04/19 00:42:27 christos Exp $
 # ESRI Shapefile format (.shp .shx .dbf=DBaseIII)
 # Based on info from
-# <URL:http://www.esri.com/library/whitepapers/pdfs/shapefile.pdf>
+# <URL:https://www.esri.com/library/whitepapers/pdfs/shapefile.pdf>
 0      belong  9994    ESRI Shapefile
 >4     belong  =0
 >8     belong  =0
index bf1775c..1920e56 100644 (file)
@@ -1,5 +1,5 @@
 #------------------------------------------------------------------------------
-# $File: filesystems,v 1.125 2018/12/10 21:06:53 christos Exp $
+# $File: filesystems,v 1.128 2019/04/23 15:43:27 christos Exp $
 # filesystems:  file(1) magic for different filesystems
 #
 0      name    partid
 # to display information (50) before DOS BPB (strength=70) and after DOS floppy (120) like in old file version
 !:strength +65
 >2             string          OSBS            OS/BS MBR
-# added by Joerg Jenderek at Feb 2013 according to http://thestarman.pcministry.com/asm/mbr/
-# and http://en.wikipedia.org/wiki/Master_Boot_Record
+# added by Joerg Jenderek at Feb 2013 according to https://thestarman.pcministry.com/asm/mbr/
+# and https://en.wikipedia.org/wiki/Master_Boot_Record
 # test for nearly all MS-DOS Master Boot Record initial program loader (IPL) is now done by
 # characteristic assembler instructions: xor ax,ax;mov ss,ax;mov sp,7c00
 >0     search/2        \x33\xc0\x8e\xd0\xbc\x00\x7c    MS-MBR
-# Microsoft Windows 95A and early ( http://thestarman.pcministry.com/asm/mbr/STDMBR.htm )
+# Microsoft Windows 95A and early ( https://thestarman.pcministry.com/asm/mbr/STDMBR.htm )
 # assembler instructions: mov si,sp;push ax;pop es;push ax;pop ds;sti;cld
 >>8    ubequad         0x8bf45007501ffbfc
-# http://thestarman.pcministry.com/asm/mbr/200MBR.htm
+# https://thestarman.pcministry.com/asm/mbr/200MBR.htm
 >>>0x16        ubyte           0xF3                            \b,DOS 2
 >>>>219        regex           Author\ -\                      Author:
 # found "David Litton" , "A Pehrsson  "
 >>>>>&0        string          x                               "%s"
 >>>0x16        ubyte           0xF2
-# NEC MS-DOS 3.30 Rev. 3 . See http://thestarman.pcministry.com/asm/mbr/DOS33MBR.htm
+# NEC MS-DOS 3.30 Rev. 3 . See https://thestarman.pcministry.com/asm/mbr/DOS33MBR.htm
 # assembler instructions: mov di,077c;cmp word ptrl[di],a55a;jnz
 >>>>0x22       ubequad 0xbf7c07813d5aa575              \b,NEC 3.3
 # version MS-DOS 3.30 til MS-Windows 95A (WinVer=4.00.1111)
 # "Sistema operativo mancante"                         nn=0xe2 for italian version
 >>>>>0x79      ubyte           >0                      at offset 0x%x
 >>>>>>(0x79.b) string          >\0                     "%s"
-# Microsoft Windows 95B to XP (http://thestarman.pcministry.com/asm/mbr/95BMEMBR.htm)
+# Microsoft Windows 95B to XP (https://thestarman.pcministry.com/asm/mbr/95BMEMBR.htm)
 # assembler instructions: push ax;pop es;push  ax;pop ds;cld;mov si,7c1b
 >>8    ubequad         0x5007501ffcbe1b7c
 # assembler instructions: rep;movsb;retf;mov si,07be;mov cl,04
 # "\216\257\245\340\240\346\250\256\255\255\240\357 \341\250\341\342\245\254\240 \255\245 \255\240\251\244\245\255\240"        nn=0x156 for russian version
 >>>>0xA9               ubyte   x                       at offset 0x1%x
 >>>>(0xA9.b+0x100)     string  >\0                     "%s"
-# http://thestarman.pcministry.com/asm/mbr/Win2kmbr.htm
+# https://thestarman.pcministry.com/asm/mbr/Win2kmbr.htm
 # assembler instructions: rep;movsb;retf;mov BP,07be;mov cl,04
 >>>24          ubequad 0xf3a4cbbdbe07b104              XP
 # where xxyyzz are lower bits from offsets of error messages varying for different languages
 # Microsoft Windows Vista or 7
 # assembler instructions: ..;mov ds,ax;mov si,7c00;mov di,..00
 >>8    ubequad         0xc08ed8be007cbf00
-# Microsoft Windows Vista (http://thestarman.pcministry.com/asm/mbr/VistaMBR.htm)
+# Microsoft Windows Vista (https://thestarman.pcministry.com/asm/mbr/VistaMBR.htm)
 # assembler instructions: jnz 0729;cmp ebx,"TCPA"
 >>>0xEC                ubequad 0x753b6681fb544350              Vista
 # where xxyyzz are lower bits from offsets of error messages varying for different languages
 # "Betriebssystem nicht vorhanden"                     zz=0x1?? for german version
 >>>>0x1b7      ubyte           >0                      at offset 0x1%x
 >>>>(0x1b7.b+0x100)    string  >\0                     "%s"
-# Microsoft Windows 7 (http://thestarman.pcministry.com/asm/mbr/W7MBR.htm)
+# Microsoft Windows 7 (https://thestarman.pcministry.com/asm/mbr/W7MBR.htm)
 # assembler instructions: cmp ebx,"TCPA";cmp
 >>>0xEC                ubequad 0x6681fb5443504175              Windows 7
 # where xxyyzz are lower bits from offsets of error messages varying for different languages
 # "Betriebssystem nicht vorhanden"                     zz=0x1?? for german version
 >>>>0x1b7      ubyte           >0                      at offset 0x1%x
 >>>>(0x1b7.b+0x100)    string  >\0                     "%s"
-# http://thestarman.pcministry.com/asm/mbr/Win2kmbr.htm#DiskSigs
-# http://en.wikipedia.org/wiki/MBR_disk_signature#ID
+# https://thestarman.pcministry.com/asm/mbr/Win2kmbr.htm#DiskSigs
+# https://en.wikipedia.org/wiki/MBR_disk_signature#ID
 >>0x1b8        ulelong         >0                              \b, disk signature 0x%-.4x
-# driveID/timestamp for Win 95B,98,98SE and ME. See http://thestarman.pcministry.com/asm/mbr/mystery.htm
+# driveID/timestamp for Win 95B,98,98SE and ME. See https://thestarman.pcministry.com/asm/mbr/mystery.htm
 >>0xDA uleshort                0
 >>>0xDC        ulelong         >0                      \b, created
 # physical drive number (0x80-0xFF) when the Windows wrote that byte to the drive
 >>>>>420       ubyte           x                       \b)
 #
 # SYSLINUX MBR moved
-# http://www.acronis.de/
+# https://www.acronis.de/
 >362   string  MBR\ Error\ \0\r
 >>376  string  ress\ any\ key\ to\040
 >>>392 string  boot\ from\ floppy...\0                 \b, Acronis MBR
 # added by Joerg Jenderek
-# http://www.visopsys.org/
-# http://partitionlogic.org.uk/
+# https://www.visopsys.org/
+# https://partitionlogic.org.uk/
 >309   string  No\ bootable\ partition\ found\r
 >>339  string  I/O\ Error\ reading\ boot\ sector\r     \b, Visopsys MBR
 >349   string  No\ bootable\ partition\ found\r
 >>172  string  LILO                            \b, version 22.5.8 Debian
 # updated by Joerg Jenderek at Oct 2008
 # variables according to grub-0.97/stage1/stage1.S or
-# http://www.gnu.org/software/grub/manual/grub.html#Embedded-data
+# https://www.gnu.org/software/grub/manual/grub.html#Embedded-data
 # usual values are marked with comments to get only informations of strange GRUB loaders
 >342           search/60       \0Geom\0
 #>0            ulelong         x               %x=0x009048EB , 0x2a9048EB  0
 # skip FSInfosector
 >>>>>>0                string          !RRaA
 # skip 3rd sector of MS x86 bootloader with assember instructions cli;MOVZX EAX,BYTE PTR [BP+10];MOV ECX,
-# http://thestarman.pcministry.com/asm/mbr/MSWIN41.htm
+# https://thestarman.pcministry.com/asm/mbr/MSWIN41.htm
 >>>>>>>0       ubequad         !0xfa660fb64610668b
 # skip 13rd sector of MS x86 bootloader
 >>>>>>>>0      ubequad         !0x660fb64610668b4e
 >>>>>>>>>>>446 use             partition-table
 # TODO: test for extended bootrecord (ebr) moved and merged with mbr partition table entries
 # mbr partition table entries end
-# http://www.acronis.de/
+# https://www.acronis.de/
 #FAT label=ACRONIS\ SZ
 #OEM-ID=BOOTWIZ0
 >442   string  Non-system\ disk,\040
 >>>>505                ubyte&0xDF      >0
 >>>>>505       string          x                       \b.%-.3s
 # added by Joerg Jenderek
-# http://www.visopsys.org/
-# http://partitionlogic.org.uk/
+# https://www.visopsys.org/
+# https://partitionlogic.org.uk/
 # OEM-ID=Visopsys
 >478           ulelong 0
 >>(1.b+326)    string  I/O\ Error\ reading\040
 #it prints a very short message ("RE") to the screen and hangs the computer.
 # x86 bootloader end
 
-# added by Joerg Jenderek at Feb 2013 according to http://thestarman.pcministry.com/asm/mbr/MSWIN41.htm#FSINFO
-# and http://en.wikipedia.org/wiki/File_Allocation_Table#FS_Information_Sector
+# added by Joerg Jenderek at Feb 2013 according to https://thestarman.pcministry.com/asm/mbr/MSWIN41.htm#FSINFO
+# and https://en.wikipedia.org/wiki/File_Allocation_Table#FS_Information_Sector
 >0             string          RRaA
 >>0x1E4                string          rrAa            \b, FSInfosector
 #>>0x1FC       uleshort        =0              SHOULD BE ZERO
 >11                    ubyte           x               \b+
 >11                    use             DOS-filename
 
-# http://en.wikipedia.org/wiki/Master_boot_record#PTE
+# https://en.wikipedia.org/wiki/Master_boot_record#PTE
 # display standard partition table
 0      name                            partition-table
 #>0            ubyte           x       PARTITION-TABLE
 0x18b  string  OS/2    OS/2 Boot Manager
 
 # updated by Joerg Jenderek at Oct 2008 and Sep 2012
-# http://syslinux.zytor.com/iso.php
+# https://syslinux.zytor.com/iso.php
 # tested with versions 1.47,1.48,1.49,1.50,1.62,1.76,2.00,2.10;3.00,3.11,3.31,;3.70,3.71,3.73,3.75,3.80,3.82,3.84,3.86,4.01,4.03 and 4.05
 # assembler instructions: cli;jmp 0:7Cyy (yy=0x40,0x5e,0x6c,0x6e,0x77);nop;nop
 0      ulequad&0x909000007cc0eafa      0x909000007c40eafa
 >631   search/689      ISOLINUX\       isolinux Loader
 >>&0   string          x               (version %-4.4s)
-# http://syslinux.zytor.com/pxe.php
+# https://syslinux.zytor.com/pxe.php
 # assembler instructions: jmp 7C05
 0      ulelong 0x007c05ea              pxelinux loader (version 2.13 or older)
 # assembler instructions: pushfd;pushad
 0      ulelong 0x60669c66              pxelinux loader
 # assembler instructions: jmp 05
 0      ulelong 0xc00005ea              pxelinux loader (version 3.70 or newer)
-# http://syslinux.zytor.com/wiki/index.php/SYSLINUX
+# https://syslinux.zytor.com/wiki/index.php/SYSLINUX
 0      string  LDLINUX\ SYS\           SYSLINUX loader
 >12    string  x                       (older version %-4.4s)
 0      string  \r\nSYSLINUX\           SYSLINUX loader
 >0004  uleshort        x
 # ERRorTeXT
 >>181  search/166              Error\ \0\r\n                           NetBSD mbr
-# NT Drive Serial Number http://thestarman.pcministry.com/asm/mbr/Win2kmbr.htm#DS
+# NT Drive Serial Number https://thestarman.pcministry.com/asm/mbr/Win2kmbr.htm#DS
 >>>0x1B8       ubelong         >0                                      \b,Serial 0x%-.8x
 # BOOTSEL definitions contains assembler instructions: int 0x13;pop dx;push dx;push dx
 >>>0xbb                search/71       \xcd\x13\x5a\x52\x52                    \b,bootselector
 >>>398         string  Disk\ error\r\n\0FDD\0HDD\0
 >>>>419                string  \ EBIOS\r\n\0                           AdvanceMAME mbr
 
-# Neil Turton mbr loader variant of http://www.chiark.greenend.org.uk/~neilt/mbr/
+# Neil Turton mbr loader variant of https://www.chiark.greenend.org.uk/~neilt/mbr/
 # added by Joerg Jenderek at Mar 2011 for versions 1.0.0 - 1.1.11
 # for 1st version assembler instructions:      cld;xor ax,ax;mov DS,ax;MOV ES,AX;mov SI,
 # or                                           cld;xor ax,ax;mov SS,ax;XOR SP,SP;mov DS,
 >>>(0x1BC.s+9)         ubyte           x                       \bVersion<=%u
 #>>>(0x1BC.s+8)                ubyte           x                       asm_flag_%x
 >>>(0x1BC.s+8)         ubyte&1         1                       \b,Y2K-Fix
-# variant used by testdisk of http://www.cgsecurity.org/wiki/Menu_MBRCode
+# variant used by testdisk of https://www.cgsecurity.org/wiki/Menu_MBRCode
 >>>(0x1BC.s+8)         ubyte&2         2                       \b,TestDisk
 #0x1~1,..,0x8~4,0x10~F,0x80~A enabled
 #>>>(0x1BC.s+10)               ubyte           x                       \b,flags 0x%x
 # added by Joerg Jenderek
 # In the second sector (+0x200) are variables according to grub-0.97/stage2/asm.S or
 # grub-1.94/kern/i386/pc/startup.S
-# http://www.gnu.org/software/grub/manual/grub.html#Embedded-data
+# https://www.gnu.org/software/grub/manual/grub.html#Embedded-data
 # usual values are marked with comments to get only informations of strange GRUB loaders
 0x200  uleshort                0x70EA
 # found only version 3.{1,2}
 # DOS x86 sector updated and separated from "DOS/MBR boot sector" by Joerg Jenderek at May 2011
 # JuMP short     bootcodeoffset NOP assembler instructions will usually be EB xx 90
 # over BIOS parameter block (BPB)
-# http://thestarman.pcministry.com/asm/2bytejumps.htm#FWD
+# https://thestarman.pcministry.com/asm/2bytejumps.htm#FWD
 # older drives may use Near JuMP instruction E9 xx xx
 # minimal short forward jump found 0x29 for bootloaders or 0x0
 # maximal short forward jump is 0x7f
 >>>>>26                ubyte           =1              \b, heads %u
 # valid only for sector sizes with more then 32 Bytes
 >>>>>11                uleshort        >32
-# http://en.wikipedia.org/wiki/Design_of_the_FAT_file_system#Extended_BIOS_Parameter_Block
+# https://en.wikipedia.org/wiki/Design_of_the_FAT_file_system#Extended_BIOS_Parameter_Block
 # skip for values 2,2Ah,70h,73h,DFh
 # and continue for extended boot signature values 0,28h,29h,80h
 >>>>>>38       ubyte&0x56      =0
 # FAT32 bit specific
 >>>>>82                string/c        fat32           \b, FAT (32 bit)
 >>>>>>36       ulelong         x               \b, sectors/FAT %u
-# http://technet.microsoft.com/en-us/library/cc977221.aspx
+# https://technet.microsoft.com/en-us/library/cc977221.aspx
 >>>>>>40       uleshort        >0              \b, extension flags 0x%x
 #>>>>>>40      uleshort        =0              \b, extension flags %hu
 >>>>>>42       uleshort        >0              \b, fsVersion %u
 #>>>>>>50      uleshort        =6              \b, Backup boot sector %u (usual)
 >>>>>>50       default         x
 >>>>>>>50      uleshort        x               \b, Backup boot sector %u
-# corrected by Joerg Jenderek at Feb 2011 according to http://thestarman.pcministry.com/asm/mbr/MSWIN41.htm#FSINFO
+# corrected by Joerg Jenderek at Feb 2011 according to https://thestarman.pcministry.com/asm/mbr/MSWIN41.htm#FSINFO
 >>>>>>52       ulelong         >0              \b, reserved1 0x%x
 >>>>>>56       ulelong         >0              \b, reserved2 0x%x
 >>>>>>60       ulelong         >0              \b, reserved3 0x%x
 >>>>>>>(11.s)  ulelong&0x00ffffF0      0x00ffffF0      \b, followed by FAT
 # floppy image
 !:mime application/x-ima
-# NTFS specific added by Joerg Jenderek at Mar 2011 according to http://thestarman.pcministry.com/asm/mbr/NTFSBR.htm
+# NTFS specific added by Joerg Jenderek at Mar 2011 according to https://thestarman.pcministry.com/asm/mbr/NTFSBR.htm
 # and http://homepage.ntlworld.com/jonathan.deboynepollard/FGA/bios-parameter-block.html
 # 0 FATs
 >>>>>16        ubyte           =0
 >>>>>>>>>72    ulequad         x               \b, serial number 0%llx
 >>>>>>>>>80    ulelong         >0              \b, checksum 0x%x
 #>>>>>>>>>80   ulelong         =0              \b, checksum 0x%x=0 (usual)
->>>>>>>>>0x258 ulelong&0x00009090      =0x00009090
->>>>>>>>>>&-92         indirect        x       \b; contains
-# For 2nd NTFS sector added by Joerg Jenderek at Jan 2013
-# http://thestarman.pcministry.com/asm/mbr/NTFSbrHexEd.htm
-# unused assembler instructions JMP y2;NOP;NOP
-0x056          ulelong&0xFFFF0FFF      0x909002EB
-# unicode loadername terminated by CTRL-D
->(0.s*2)       ulelong&0xFFFFFF00      0x00040000
+# unicode loadername size jump
+>>>>>>>>>(0x200.s*2)   ubyte                           x
+# in next sector loadername terminated by unicode CTRL-D and $
+>>>>>>>>>>&0x1FF       ulequad&0x0000FFffFFffFF00      0x0000002400040000 \b; contains
+# if 2nd NTFS sectors is found then assume whole filesystem
+#!:mime                application/x-raw-disk-image
+!:ext          img/bin/ntfs
+>>>>>>>>>>>0x200       use                             ntfs-sector2
+
+# For 2nd NTFS sector added by Joerg Jenderek at Jan 2013, Mar 2019
+# https://thestarman.pcministry.com/asm/mbr/NTFSbrHexEd.htm
+# unused assembler instructions short JMP y2;NOP;NOP
+0x056          ulelong&0xFFFF0FFF      0x909002EB      NTFS
+#!:mime                application/octet-stream
+!:ext          bin
+>0             use             ntfs-sector2
+# https://memory.dataram.com/products-and-services/software/ramdisk
+# assembler instructions JMP C000;NOP
+0x056          ulelong                 0x9000c0e9      NTFS
+#!:mime                application/octet-stream
+!:ext          bin
+>0             use             ntfs-sector2
+# check for characteristics of second NTFS sector and then display loader name
+0              name            ntfs-sector2
+# number of utf16 characters of loadername
+>0             uleshort        <8
+# unused assembler instructions JMP y2;NOP;NOP or JMP C000;NOP
+>>0x056                ulelong&0xFF0000FD      0x900000E9
 # loadernames are NTLDR,CMLDR,PELDR,$LDR$ or BOOTMGR
->>0x002                lestring16      x       Microsoft Windows XP/VISTA bootloader %-5.5s
->>0x12         string          $
->>>0x0c                lestring16      x       \b%-2.2s
+>>>0x002               lestring16      x       bootstrap %-5.5s
+# check for 7 character length of loader name like BOOTMGR
+>>>0           uleshort        7
+>>>>0x0c       lestring16      x       \b%-2.2s
 ### DOS,NTFS boot sectors end
 
 # ntfsclone-image is a special save format for NTFS volumes,
 # ext2/ext3 filesystems - Andreas Dilger <adilger@dilger.ca>
 # ext4 filesystem - Eric Sandeen <sandeen@sandeen.net>
 # volume label and UUID Russell Coker
-# http://etbe.coker.com.au/2008/07/08/label-vs-uuid-vs-device/
+# https://etbe.coker.com.au/2008/07/08/label-vs-uuid-vs-device/
 0x438   leshort         0xEF53          Linux
 >0x44c  lelong          x               rev %d
 >0x43e  leshort         x               \b.%d
 ############################################################################
 # Minix-ST kernel floppy
 0x800  belong          0x46fc2700      Atari-ST Minix kernel image
-# http://en.wikipedia.org/wiki/BIOS_parameter_block
+# https://en.wikipedia.org/wiki/BIOS_parameter_block
 # floppies with valid BPB and any instruction at beginning
 >19    string          \240\005\371\005\0\011\0\2\0    \b, 720k floppy
 >19    string          \320\002\370\005\0\011\0\1\0    \b, 360k floppy
 #
 
 # all FAT12 (strength=70) floppies with sectorsize 512 added by Joerg Jenderek at Jun 2013
-# http://en.wikipedia.org/wiki/File_Allocation_Table#Exceptions
+# https://en.wikipedia.org/wiki/File_Allocation_Table#Exceptions
 # Too Weak.
 #512           ubelong&0xE0ffff00      0xE0ffff00
 # without valid Media descriptor in place of BPB, cases with are done at other places
 #>>512         ubyte                   =0xfa                   320k
 #>>512         ubyte                   =0xfb                   640k
 #>>512         ubyte                   =0xfc                   180k
-# look like an an old DOS directory entry
+# look like an old DOS directory entry
 #>>>0xA0E      ubequad                 0
 #>>>>0xA00     ubequad                 !0
 #!:mime application/x-ima
 # only x86 short jump instruction found
 #>>>0          ubyte                   =0xEB
 #>>>>1         ubyte                   x                       \b, code offset 0x%x+2
-# http://thestarman.pcministry.com/DOS/ibm100/Boot.htm
+# https://thestarman.pcministry.com/DOS/ibm100/Boot.htm
 # assembler instructions: CLI;MOV AX,CS;MOV DS,AX;MOV DX,0
 #>>>>(1.b+2)   ubequad                 0xfa8cc88ed8ba0000      \b, PC-DOS 1.0 bootloader
 # ibmbio.com+ibmdos.com
 #>>>>>0x176    use                     DOS-filename
 #>>>>>0x181    ubyte                   x                       \b+
 #>>>>>0x182    use                     DOS-filename
-# http://thestarman.pcministry.com/DOS/ibm110/Boot.htm
+# https://thestarman.pcministry.com/DOS/ibm110/Boot.htm
 # assembler instructions: CLI;MOV AX,CS;MOV DS,AX;XOR DX,DX;MOV
 #>>>>(1.b+2)   ubequad                 0xfa8cc88ed833d28e      \b, PC-DOS 1.1 bootloader
 # ibmbio.com+ibmdos.com
 #>>>>>0x18b    use                     DOS-filename
 #>>>>>0x196    ubyte                   x                       \b+
 #>>>>>0x197    use                     DOS-filename
-# http://en.wikipedia.org/wiki/Zenith_Data_Systems
+# https://en.wikipedia.org/wiki/Zenith_Data_Systems
 # assembler instructions: MOV BX,07c0;MOV SS,BX;MOV SP,01c6
 #>>>>(1.b+2)   ubequad                 0xbbc0078ed3bcc601      \b, Zenith Data Systems MS-DOS 1.25 bootloader
 # IO.SYS+MSDOS.SYS
 #>>>>>0x20     use                     2xDOS-filename
-# http://en.wikipedia.org/wiki/Corona_Data_Systems
+# https://en.wikipedia.org/wiki/Corona_Data_Systems
 # assembler instructions: MOV AX,CS;MOV DS,AX;CLI;MOV SS,AX;
 #>>>>(1.b+2)   ubequad                 0x8cc88ed8fa8ed0bc      \b, MS-DOS 1.25 bootloader
 # IO.SYS+MSDOS.SYS
 >307200        use cdrom
 
 # .cso files
-# Reference: http://pismotec.com/ciso/ciso.h
+# Reference: https://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
 >984    string          x               volume label is '%-12.12s'
 
 # From: Thomas Klausner <wiz@NetBSD.org>
-# http://filext.com/file-extension/DAA
+# https://filext.com/file-extension/DAA
 # describes the daa file format. The magic would be:
 0      string          DAA\x0\x0\x0\x0\x0      PowerISO Direct-Access-Archive
 
index a736f02..ab43ac6 100644 (file)
@@ -1,11 +1,11 @@
 
 #------------------------------------------------------------------------------
-# $File: finger,v 1.1 2015/10/02 18:36:54 christos Exp $
+# $File: finger,v 1.3 2019/04/19 00:42:27 christos Exp $
 # fingerprint:  file(1) magic for fingerprint data
 # XPM bitmaps)
 #
 
-# http://cgit.freedesktop.org/libfprint/libfprint/tree/libfprint/data.c
+# https://cgit.freedesktop.org/libfprint/libfprint/tree/libfprint/data.c
 
 0      string  FP1             libfprint fingerprint data V1
 >3     beshort x               \b, driver_id %x
index b48abe9..33b7344 100644 (file)
@@ -1,12 +1,12 @@
 
 #------------------------------------------------------------------------------
-# $File: flash,v 1.14 2017/05/25 20:09:55 christos Exp $
+# $File: flash,v 1.15 2019/04/19 00:42:27 christos Exp $
 # flash:       file(1) magic for Macromedia Flash file format
 #
 # See
 #
-#      http://www.macromedia.com/software/flash/open/
-#      http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/\
+#      https://www.macromedia.com/software/flash/open/
+#      https://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/\
 #      en/devnet/swf/pdf/swf-file-format-spec.pdf page 27
 #
 
index 9ca50cb..f47736f 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: fonts,v 1.39 2018/12/10 20:58:34 christos Exp $
+# $File: fonts,v 1.41 2019/05/05 16:44:04 christos Exp $
 # fonts:  file(1) magic for font data
 #
 0      search/1        FONT            ASCII vfont text
@@ -17,7 +17,7 @@
 
 # Summary:     PostScript Type 1 Printer Font Metrics
 # URL:         https://en.wikipedia.org/wiki/PostScript_fonts
-# Reference:   http://partners.adobe.com/public/developer/en/font/5178.PFM.pdf
+# Reference:   https://partners.adobe.com/public/developer/en/font/5178.PFM.pdf
 # Modified by: Joerg Jenderek
 # Note:                moved from ./msdos magic
 # dfVersion 256=0100h
@@ -80,7 +80,7 @@
 0      search/1        STARTFONT\              X11 BDF font text
 
 # From: Joerg Jenderek
-# URL: http://grub.gibibit.com/New_font_format
+# URL: https://grub.gibibit.com/New_font_format
 # Reference: util/grub-mkfont.c
 #              include/grub/fontformat.h
 # FONT_FORMAT_SECTION_NAMES_FILE
 7      belong          0x00564944      DOS code page font data (from Linux?)
 4098   string          DOSFONT         DOSFONT2 encrypted font data
 
+# From: Joerg Jenderek
+# URL: http://fileformats.archiveteam.org/wiki/GEM_bitmap_font
+# Reference: http://cd.textfiles.com/ataricompendium/BOOK/HTML/APPENDC.HTM#cnt
+#
+# usual case with lightening mask and skewing mask 5555h~UU
+62     ulelong         0x55555555
+>0     use             gdos-font
+# BOX18.GFT COWBOY30.GFT ROYALK30.GFT
+62     ulelong         0
+# skip ISO 9660 CD-ROM ./filesystem by looking for low positive face size
+>2     uleshort        >2
+# skip DOS 2.0 backup id file ./msdos by looking for face size lower/equal 48
+>>2    uleshort        <49
+# skip MS Windows ICO ./msdos by looking for valid face name
+>>>4   ubeshort        >0x1F00
+# skip DOS executable BACKM212.COM by looking for horizontal offset table after header
+#>>>>68        ulelong         >87             OFFSET_OK
+>>>>0  use             gdos-font
+0      name            gdos-font
+>0     uleshort        x               GEM GDOS font
+!:mime application/x-font-gdos
+# also .eps found like AA070GEP.EPS AI360GEP.EPS
+!:ext  fnt/gtf
+# font name like University Bold
+>4     string          x               %.32s
+# face size in points 3-48
+>2     uleshort        x               %u
+# face ID (must be unique)
+>0     uleshort        x               \b, ID 0x%4.4x
+# lowest character index in face (usually 32 for disk-loaded fonts).
+#>36   uleshort        x               \b, low character index %u
+# width of the widest character
+#>50   uleshort        x               \b, %u char width
+# width of the widest character cell
+#>52   uleshort        x               \b, %u cell width
+# thickening size
+#>58   uleshort        x               \b, %u thick
+# lightening mask to eliminate pixels, usually 5555h
+>62    uleshort        !0x5555         \b, lightening mask 0x%x
+# skewing mask to determine when to perform additional rotation when skewing, usually 5555h
+>64    uleshort        !0x5555         \b, skewing mask 0x%x
+# offset to horizontal offset table 58h~88 5eh
+#>68   ulelong         >88             \b, 0x%x horizontal table offset
+# offset character offset table
+#>72   ulelong         x               \b, 0x%x coffset
+# offset to font data
+#>72   ulelong         x               \b, 0x%x foffset
+# form width in bytes
+#>80   uleshort        x               \b, %u fwidth
+# pointer to the next font, set by GDOS after loading
+#>84   ulelong         x               \b, 0x%x noffset
+
 # downloadable fonts for browser (prints type) anthon@mnt.org
 # https://tools.ietf.org/html/rfc3073
 0      string          PFR1            Portable Font Resource font data (new)
 
 # TrueType/OpenType font collections (.ttc)
 # URL: https://en.wikipedia.org/wiki/OpenType
-# http://www.microsoft.com/typography/otspec/otff.htm
+# https://www.microsoft.com/typography/otspec/otff.htm
 # Modified by: Joerg Jenderek
 # Note:        container for TrueType, OpenType font
 0      string          ttcf
 #>14   beshort         x               \b, reserved %d
 #>16   belong          x               \b, totalSfntSize %d
 
-# http://www.w3.org/TR/WOFF/
+# https://www.w3.org/TR/WOFF/
 0      string          wOFF    Web Open Font Format
 >0     use             woff
 >20    beshort         x       \b, version %d
 >22    beshort         x       \b.%d
-# http://www.w3.org/TR/WOFF2/
+# https://www.w3.org/TR/WOFF2/
 0      string          wOF2    Web Open Font Format (Version 2)
 >0     use             woff
 #>20   belong          x       \b, totalCompressedSize %d
index 8661983..7ea0941 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: fsav,v 1.18 2018/12/10 20:57:41 christos Exp $
+# $File: fsav,v 1.19 2019/04/19 00:42:27 christos Exp $
 # fsav:  file(1) magic for datafellows fsav virus definition files
 # Anthon van der Neut (anthon@mnt.org)
 
 >33    string  -STANDARD-ANTIVIRUS-TEST-FILE!$H+H*     EICAR virus test files
 
 # From: Joerg Jenderek
-# URL: http://www.avira.com/
+# URL: https://www.avira.com/
 # Note: found in directory %ProgramData%\Avira\Antivirus\INFECTED (Windows)
 # tested with version 15.0.43.23 at November 2019
 0      string          AntiVir\ Qua    Avira AntiVir quarantined
index c5a5e4d..30e6159 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: games,v 1.16 2017/10/19 16:40:37 christos Exp $
+# $File: games,v 1.17 2019/04/19 00:42:27 christos Exp $
 # games:  file(1) for games
 
 # Fabio Bonelli <fabiobonelli@libero.it>
 
 # Summary: SGF Smart Game Format
 # Extension: .sgf
-# Reference: http://www.red-bean.com/sgf/
+# Reference: https://www.red-bean.com/sgf/
 # Created by: Eduardo Sabbatella <eduardo_sabbatella@yahoo.com.ar>
 # Modified by (1): Abel Cheung (regex, more game format)
 # FIXME: Some games don't have GM (game type)
 >>&0           regex           [0-9a-z.]+                              \b, version %s
 
 # Type:        SGF Smart Game Format
-# URL: http://www.red-bean.com/sgf/
+# URL: https://www.red-bean.com/sgf/
 # From:        Eduardo Sabbatella <eduardo_sabbatella@yahoo.com.ar>
 2      regex/c \\(;.*GM\\[[0-9]{1,2}\\]        Smart Game Format
 >2     regex/c GM\\[1\\]                       - Go Game
index 3e75b70..d72e514 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: geo,v 1.6 2018/03/11 00:48:16 christos Exp $
+# $File: geo,v 1.7 2019/04/19 00:42:27 christos Exp $
 # Geo- files from Kurt Schwehr <schwehr@ccom.unh.edu>
 
 ######################################################################
@@ -49,7 +49,7 @@
 
 ######################################################################
 #
-# MULTIBEAM SONARS http://www.ldeo.columbia.edu/res/pi/MB-System/formatdoc/
+# MULTIBEAM SONARS https://www.ldeo.columbia.edu/res/pi/MB-System/formatdoc/
 #
 ######################################################################
 
 # format. It is the format of our upgraded SeaBeam 2112 on R/V KNORR.
 0    string $HSF    XSE multibeam
 
-# mb121 http://www.saic.com/maritime/gsf/
+# mb121 https://www.saic.com/maritime/gsf/
 8      string  GSF-v   SAIC generic sensor format (GSF) sonar data,
 >&0    regex [0-9]*\.[0-9]*    version %s
 
-# MGD77 - http://www.ngdc.noaa.gov/mgg/dat/geodas/docs/mgd77.htm
+# MGD77 - https://www.ngdc.noaa.gov/mgg/dat/geodas/docs/mgd77.htm
 # mb161
 9      string MGD77    MGD77 Header, Marine Geophysical Data Exchange Format
 
 # https://midas.psi.ch/elog/
 0      string  $@MID@$ elog journal entry
 
-# Geospatial Designs http://www.geospatialdesigns.com/surfer6_format.htm
+# Geospatial Designs https://www.geospatialdesigns.com/surfer6_format.htm
 0      string          DSBB    Surfer 6 binary grid file
 >4     leshort         x       \b, %d
 >6     leshort         x       \bx%d
 
 # magic for LAS format files
 # alex myczko <alex@aiei.ch>
-# http://www.asprs.org/wp-content/uploads/2010/12/LAS_1_3_r11.pdf
+# https://www.asprs.org/wp-content/uploads/2010/12/LAS_1_3_r11.pdf
 0      string          LASF    LIDAR point data records
 >24    byte            >0      \b, version %u
 >25    byte            >0      \b.%u
index b7eae52..2905340 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: gnome,v 1.4 2014/04/28 12:04:50 christos Exp $
+# $File: gnome,v 1.6 2019/04/19 00:42:27 christos Exp $
 # GNOME related files
 
 # Contributed by Josh Triplett
@@ -42,7 +42,7 @@
 # It's always "GVariant", it's byte swapped on incompatible archs
 # See https://github.com/GNOME/gvdb/blob/master/gvdb-builder.c
 # file_builder_serialise()
-# http://developer.gnome.org/glib/2.34/glib-GVariant.html#GVariant
+# https://developer.gnome.org/glib/2.34/glib-GVariant.html#GVariant
 0      string  GVariant        GVariant Database file,
 # version is never filled. probably future extension
 >8     lelong  x               version %d
@@ -51,7 +51,7 @@
 #>>>20 lelong  x               end %d
 
 # G-IR database made by gobject-introspect toolset,
-# http://live.gnome.org/GObjectIntrospection
+# https://live.gnome.org/GObjectIntrospection
 0      string          GOBJ\nMETADATA\r\n\032  G-IR binary database
 >16    byte            x                       \b, v%d
 >17    byte            x                       \b.%d
index f30f8d7..bf6b93d 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: gnu,v 1.20 2018/02/24 16:11:23 christos Exp $
+# $File: gnu,v 1.21 2019/04/19 00:42:27 christos Exp $
 # gnu:  file(1) magic for various GNU tools
 #
 # GNU nlsutils message catalog file format
 
 
 # GnuPG Keybox file
-# <http://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob;f=kbx/keybox-blob.c;hb=HEAD>
+# <https://git.gnupg.org/cgi-bin/gitweb.cgi?p=gnupg.git;a=blob;f=kbx/keybox-blob.c;hb=HEAD>
 # From: Philipp Hahn <hahn@univention.de>
 0      belong  32
 >4     byte    1
index d1ca1d0..d8bf22d 100644 (file)
@@ -1,7 +1,7 @@
 
 #------------------------------------------------------------------------------
-# $File: graphviz,v 1.7 2009/09/19 16:28:09 christos Exp $
-# graphviz:  file(1) magic for http://www.graphviz.org/
+# $File: graphviz,v 1.9 2019/04/30 04:01:40 christos Exp $
+# graphviz:  file(1) magic for https://www.graphviz.org/
 
 # FIXME: These patterns match too generally. For example, the first
 # line matches a LaTeX file containing the word "graph" (with a {
index 045fa87..99f8371 100644 (file)
@@ -1,9 +1,9 @@
 
 #------------------------------------------------------------------------------
-# $File: grace,v 1.4 2009/09/19 16:28:09 christos Exp $
+# $File: guile,v 1.2 2019/04/19 00:42:27 christos Exp $
 # Guile file magic from <dalepsmith@gmail.com>
-# http://www.gnu.org/s/guile/
-# http://git.savannah.gnu.org/gitweb/?p=guile.git;f=libguile/_scm.h;hb=HEAD#l250
+# https://www.gnu.org/s/guile/
+# https://git.savannah.gnu.org/gitweb/?p=guile.git;f=libguile/_scm.h;hb=HEAD#l250
 
 0      string  GOOF----        Guile Object
 >8     string  LE              \b, little endian
index 8b48f37..2112e71 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: ibm6000,v 1.13 2017/03/17 21:35:28 christos Exp $
+# $File: ibm6000,v 1.14 2019/03/07 17:21:54 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
@@ -17,6 +17,8 @@
 0      belong          0x000001f9      AIX compiled message catalog
 0      string          \<aiaff>        archive
 0      string          \<bigaf>        archive (big format)
+0      belong          0x09006bea      AIX backup/restore format file
+0      belong          0x09006fea      AIX backup/restore format file
 
 0      beshort         0x01f7          64-bit XCOFF executable or object module
 >20    belong          0               not stripped
index 099bd55..0e314ad 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: images,v 1.154 2019/02/09 17:56:01 christos Exp $
+# $File: images,v 1.160 2019/04/19 00:42:27 christos Exp $
 # images:  file(1) magic for image formats (see also "iff", and "c-lang" for
 # XPM bitmaps)
 #
 # and Image Type 1 2 3 9 10 11 32 33
 # and Color Map Entry Size 0 15 16 24 32
 0      ubequad&0x00FeC400000000C0      0
+# Prevent conflicts with CRI ADX.
+>(2.S-2) belong        !0x28632943
 # skip more garbage like *.iso by looking for positive image type
->    ubyte                   >0
+>>2    ubyte                   >0
 # skip some compiled terminfo like xterm+tmux by looking for image type less equal 33
->>   ubyte                   <34
+>>>2   ubyte                   <34
 # skip arches.3200 , Finder.Root , Slp.1 by looking for low pixel depth 1 8 15 16 24 32
->>>16  ubyte                   1
->>>>         use             tga-image
->>>16  ubyte                   8
->>>>         use             tga-image
->>>16  ubyte                   15
->>>>         use             tga-image
->>>16  ubyte                   16
->>>>         use             tga-image
->>>16  ubyte                   24
->>>>         use             tga-image
->>>16  ubyte                   32
->>>>         use             tga-image
+>>>>16 ubyte                   1
+>>>>>0         use             tga-image
+>>>>16 ubyte                   8
+>>>>>0         use             tga-image
+>>>>16 ubyte                   15
+>>>>>0         use             tga-image
+>>>>16 ubyte                   16
+>>>>>0         use             tga-image
+>>>>16 ubyte                   24
+>>>>>0         use             tga-image
+>>>>16 ubyte                   32
+>>>>>0         use             tga-image
 #      display tga bitmap image information
 0      name                            tga-image
 >2     ubyte           <34             Targa image data
 # Canon RAW version 1 (CRW) files are a type of Canon Image File Format
 # (CIFF) file. These are apparently all little-endian.
 # From: Adam Buchbinder <adam.buchbinder@gmail.com>
-# URL: http://www.sno.phy.queensu.ca/~phil/exiftool/canon_raw.html
+# URL: https://www.sno.phy.queensu.ca/~phil/exiftool/canon_raw.html
 0      string          II\x1a\0\0\0HEAPCCDR    Canon CIFF raw image data
 !:mime image/x-canon-crw
 >16    leshort         x       \b, version %d.
 # number. Put this above the TIFF test to make sure we detect them.
 # These are apparently all little-endian.
 # From: Adam Buchbinder <adam.buchbinder@gmail.com>
-# URL: http://libopenraw.freedesktop.org/wiki/Canon_CR2
+# URL: https://libopenraw.freedesktop.org/wiki/Canon_CR2
 0      string          II\x2a\0\x10\0\0\0CR    Canon CR2 raw image data
 !:mime image/x-canon-cr2
 !:strength +80
 # at offset 8 starts imagedata followed by "RGB " marker
 
 # PC bitmaps (OS/2, Windows BMP files)  (Greg Roelofs, newt@uchicago.edu)
-# http://en.wikipedia.org/wiki/BMP_file_format#DIB_header_.\
+# https://en.wikipedia.org/wiki/BMP_file_format#DIB_header_.\
 # 28bitmap_information_header.29
 0      string          BM
 >14    leshort         12              PC bitmap, OS/2 1.x format
 >5     byte    0xFF            (black background)
 
 # From: Alex Myczko <alex@aiei.ch>
-# http://www.atarimax.com/jindroush.atari.org/afmtatr.html
+# https://www.atarimax.com/jindroush.atari.org/afmtatr.html
 0      leshort 0x0296          Atari ATR image
 
 # XXX:
 
 # PCX image files
 # From: Dan Fandrich <dan@coneharvesters.com>
-# updated by Joerg Jenderek at Feb 2013 by http://de.wikipedia.org/wiki/PCX
-# http://web.archive.org/web/20100206055706/http://www.qzx.com/pc-gpe/pcx.txt
+# updated by Joerg Jenderek at Feb 2013 by https://de.wikipedia.org/wiki/PCX
+# https://web.archive.org/web/20100206055706/http://www.qzx.com/pc-gpe/pcx.txt
 # GRR: original test was still too general as it catches xbase examples T5.DBT,T6.DBT with 0xa000000
 # test for bytes 0x0a,version byte (0,2,3,4,5),compression byte flag(0,1), bit depth (>0) of PCX or T5.DBT,T6.DBT
 0      ubelong&0xffF8fe00      0x0a000000
 # Update: Joerg Jenderek
 # See http://fileformats.archiveteam.org/wiki/GEM_Raster
 # For variations, also see:
-#    http://www.seasip.info/Gem/ff_img.html (Ventura)
+#    https://www.seasip.info/Gem/ff_img.html (Ventura)
 #    http://www.atari-wiki.com/?title=IMG_file (XIMG, STTT)
 #    http://www.fileformat.info/format/gemraster/spec/index.htm (XIMG, STTT)
 #    http://sylvana.net/1stguide/1STGUIDE.ENG (TIMG)
 0   name        gem_info
 # version is 2 for some XIMG and 1 for all others
 >0     beshort         <0x0003         GEM
-# http://www.snowstone.org.uk/riscos/mimeman/mimemap.txt
+# https://www.snowstone.org.uk/riscos/mimeman/mimemap.txt
 !:mime image/x-gem
 # header_size 24 25 27 59 779 words for colored bitmaps
 >>2    beshort         >9
 # and related image processing software used by biologists.
 # From: Vebjorn Ljosa <vebjorn@ljosa.com>
 # BOOL values are two-byte integers; use them to rule out false positives.
-# http://web.archive.org/web/20050317223257/www.cs.ubc.ca/spider/ladic/text/biorad.txt
-# Samples: http://www.loci.wisc.edu/software/sample-data
+# https://web.archive.org/web/20050317223257/www.cs.ubc.ca/spider/ladic/text/biorad.txt
+# Samples: https://www.loci.wisc.edu/software/sample-data
 14     leshort <2
 >62    leshort <2
 >>54   leshort 12345           Bio-Rad .PIC Image File
 
 # Originally by Marc Espie
 # Modified by Robert Minsk <robertminsk at yahoo.com>
-# http://www.openexr.com/openexrfilelayout.pdf
+# https://www.openexr.com/openexrfilelayout.pdf
 0      lelong          20000630        OpenEXR image data,
 !:mime image/x-exr
 >4     lelong&0x000000ff x             version %d,
 >768   beshort         7       bottom to top/right to left
 
 # From: Tom Hilinski <tom.hilinski@comcast.net>
-# http://www.unidata.ucar.edu/packages/netcdf/
+# https://www.unidata.ucar.edu/packages/netcdf/
 0      string  CDF\001                 NetCDF Data Format data
 
 #-----------------------------------------------------------------------
 # http://www.xara.com/ for Windows and as GPL application for Linux
 0      string  XARA\243\243    Xara graphics file
 
-# http://www.cartesianinc.com/Tech/
+# https://www.cartesianinc.com/Tech/
 0      string  CPC\262         Cartesian Perceptual Compression image
 !:mime image/x-cpi
 
 # extension is also used for
 # Sony SRF raw image (image/x-sony-srf)
 # SRF map
-# Terragen Surface Map (http://www.planetside.co.uk/terragen)
-# FileLocator Pro search criteria file (http://www.mythicsoft.com/filelocatorpro)
+# Terragen Surface Map (https://www.planetside.co.uk/terragen)
+# FileLocator Pro search criteria file (https://www.mythicsoft.com/filelocatorpro)
 !:ext srf
 #!:mime        image/x-garmin-srf
 # version 1.00,2.00,2.10,2.40,2.50
 0      string  Xcur                    X11 cursor
 
 # Type:        Olympus ORF raw images.
-# URL: http://libopenraw.freedesktop.org/wiki/Olympus_ORF
+# URL: https://libopenraw.freedesktop.org/wiki/Olympus_ORF
 # From:        Adam Buchbinder <adam.buchbinder@gmail.com>
 0      string          MMOR            Olympus ORF raw image data, big-endian
 !:mime image/x-olympus-orf
 #!mime image/vnd.radiance
 
 # From: Adam Buchbinder <adam.buchbinder@gmail.com>
-# URL: http://www.mpi-inf.mpg.de/resources/pfstools/pfs_format_spec.pdf
+# URL: https://www.mpi-inf.mpg.de/resources/pfstools/pfs_format_spec.pdf
 # Used by the pfstools packages. The regex matches for the image size could
 # probably use some work. The MIME type is made up; if there's one in
 # actual common use, it should replace the one below.
 >>1    regex   \ [0-9]{4}              \bx%s
 
 # Type: Foveon X3F
-# URL:  http://www.photofo.com/downloads/x3f-raw-format.pdf
+# URL:  https://www.photofo.com/downloads/x3f-raw-format.pdf
 # From: Adam Buchbinder <adam.buchbinder@gmail.com>
 # Note that the MIME type isn't defined anywhere that I can find; if
 # there's a canonical type for this format, it should replace this one.
 # From: "Tano M. Fotang" <mfotang@quanteq.com>
 0      string  \x46\x4d\x52\x00        ISO/IEC 19794-2 Format Minutiae Record (FMR)
 
-# doc: http://www.shikino.co.jp/eng/products/images/FLOWER.jpg.zip
-# example: http://www.shikino.co.jp/eng/products/images/FLOWER.wdp.zip
+# doc: https://www.shikino.co.jp/eng/products/images/FLOWER.jpg.zip
+# example: https://www.shikino.co.jp/eng/products/images/FLOWER.wdp.zip
 90     bequad          0x574D50484F544F00      JPEG-XR Image
 >98    byte&0x08       =0x08                   \b, hard tiling
 >99    byte&0x80       =0x80                   \b, tiling present
 # From: Johan van der Knijff <johan.vanderknijff@kb.nl>
 #
 # BPG (Better Portable Graphics) format
-# http://bellard.org/bpg/
+# https://bellard.org/bpg/
 # http://fileformats.archiveteam.org/wiki/BPG
 #
 0      string  \x42\x50\x47\xFB        BPG (Better Portable Graphics)
 >12            ubelong         x               \b%d
 
 # Type: Microsoft DirectDraw Surface (common data)
-# URL: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp
+# URL: https://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp
 # From: Morten Hustveit <morten@debian.org>
 # Updated by: David Korth <gerbilsoft@gerbilsoft.com>
 0      name    ms-directdraw-surface
 >>>>0x64       ulequad 0xC00000003FF00000      \b, A2B10G10R10
 
 # Type: Microsoft DirectDraw Surface
-# URL: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp
+# URL: https://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp
 # From: Morten Hustveit <morten@debian.org>
 # Updated by: David Korth <gerbilsoft@gerbilsoft.com>
 0      string/b        DDS\040\174\000\000\000 Microsoft DirectDraw Surface (DDS):
 # Type: Sega PVR image.
 # From: David Korth <gerbilsoft@gerbilsoft.com>
 # References:
-# - http://fabiensanglard.net/Mykaruga/tools/segaPVRFormat.txt
+# - https://fabiensanglard.net/Mykaruga/tools/segaPVRFormat.txt
 # - https://github.com/yazgoo/pvrx2png
 # - https://github.com/nickworonekin/puyotools
 
 0      string  GBIX
 >0x10  string  PVRT
 >>0x10 string  DDS\040\174\000\000\000 Sega PVR (Xbox) image:
->>0x20 use     ms-directdraw-surface
+>>>0x20        use     ms-directdraw-surface
 >>0x10 belong  !0x44445320             Sega PVR image:
 >>>0x10        use     sega-pvr-image-header
 >>0x08 lelong  x       \b, global index = %u
 >12    lelong  0x04030201                      (little-endian)
 >>16   use     khronos-ktx-endian-header
 >12    belong  0x04030201                      (big-endian)
->>16   use     ^khronos-ktx-endian-header
+>>16   use     \^khronos-ktx-endian-header
 
 # Type: Valve VTF texture.
 # From: David Korth <gerbilsoft@gerbilsoft.com>
 >>>24          string  version=
 >>>>32         byte    x       reMarkable tablet page (v%c), 1404 x 1872,
 >>>>>43                lelong  x       %d layer(s)
+
+# Type: PVR3 texture.
+# From: David Korth <gerbilsoft@gerbilsoft.com>
+# References:
+# - http://cdn.imgtec.com/sdk-documentation/PVR+File+Format.Specification.pdf
+
+# PVR3 pixel formats.
+0      name            pvr3-pixel-format
+>4     ulelong 0
+>>0    ulelong 0       PVRTC 2bpp RGB
+>>0    ulelong 1       PVRTC 2bpp RGBA
+>>0    ulelong 2       PVRTC 4bpp RGB
+>>0    ulelong 3       PVRTC 4bpp RGBA
+>>0    ulelong 4       PVRTC-II 2bpp
+>>0    ulelong 5       PVRTC-II 4bpp
+>>0    ulelong 6       ETC1
+>>0    ulelong 7       DXT1
+>>0    ulelong 8       DXT2
+>>0    ulelong 9       DXT3
+>>0    ulelong 10      DXT4
+>>0    ulelong 11      DXT5
+>>0    ulelong 12      BC4
+>>0    ulelong 13      BC5
+>>0    ulelong 14      BC6
+>>0    ulelong 15      BC7
+>>0    ulelong 16      UYVY
+>>0    ulelong 17      YUY2
+>>0    ulelong 18      BW1bpp
+>>0    ulelong 19      R9G9B9E5 Shared Exponent
+>>0    ulelong 20      RGBG8888
+>>0    ulelong 21      GRGB8888
+>>0    ulelong 22      ETC2 RGB
+>>0    ulelong 23      ETC2 RGBA
+>>0    ulelong 24      ETC2 RGB A1
+>>0    ulelong 25      EAC R11
+>>0    ulelong 26      EAC RG11
+>>0    ulelong 27      ASTC_4x4
+>>0    ulelong 28      ASTC_5x4
+>>0    ulelong 29      ASTC_5x5
+>>0    ulelong 30      ASTC_6x5
+>>0    ulelong 31      ASTC_6x6
+>>0    ulelong 32      ASTC_8x5
+>>0    ulelong 33      ASTC_8x6
+>>0    ulelong 34      ASTC_8x8
+>>0    ulelong 35      ASTC_10x5
+>>0    ulelong 36      ASTC_10x6
+>>0    ulelong 37      ASTC_10x8
+>>0    ulelong 38      ASTC_10x10
+>>0    ulelong 39      ASTC_12x10
+>>0    ulelong 40      ASTC_12x12
+>>0    ulelong 41      ASTC_3x3x3
+>>0    ulelong 42      ASTC_4x3x3
+>>0    ulelong 43      ASTC_4x4x3
+>>0    ulelong 44      ASTC_4x4x4
+>>0    ulelong 45      ASTC_5x4x4
+>>0    ulelong 46      ASTC_5x5x4
+>>0    ulelong 47      ASTC_5x5x5
+>>0    ulelong 48      ASTC_6x5x5
+>>0    ulelong 49      ASTC_6x6x5
+>>0    ulelong 50      ASTC_6x6x6
+>4     ulelong !0
+>>0    byte    !0      %c
+>>1    byte    !0      \b%c
+>>2    byte    !0      \b%c
+>>3    byte    !0      \b%c
+
+0      string          PVR\x03                 PVR 3.0 texture:
+>0x18  ulelong         x       %u x
+>0x1C  ulelong         x       %u
+>0x20  ulelong         >1      x %u
+>0x08  byte            x       \b,
+>0x08  use     pvr3-pixel-format
+>0x10  ulelong         1       \b, sRGB
+>0x04  ulelong&0x02    0x02    \b, premultiplied alpha
+
+# Type: Microsoft Xbox XPR0 texture.
+# From: David Korth <gerbilsoft@gerbilsoft.com>
+# References:
+# - https://github.com/Cxbx-Reloaded/Cxbx-Reloaded/blob/develop/src/core/hle/D3D8/XbD3D8Types.h
+
+# XPR pixel formats.
+0      name    xbox-xpr-pixel-format
+>0     byte    0x00    L8
+>0     byte    0x01    AL8
+>0     byte    0x02    ARGB1555
+>0     byte    0x03    RGB555
+>0     byte    0x04    ARGB4444
+>0     byte    0x05    RGB565
+>0     byte    0x06    ARGB8888
+>0     byte    0x07    xRGB8888
+>0     byte    0x0B    P8
+>0     byte    0x0C    DXT1
+>0     byte    0x0E    DXT2
+>0     byte    0x0F    DXT4
+>0     byte    0x10    Linear ARGB1555
+>0     byte    0x11    Linear RGB565
+>0     byte    0x12    Linear ARGB8888
+>0     byte    0x13    Linear L8
+>0     byte    0x16    Linear R8B8
+>0     byte    0x17    Linear G8B8
+>0     byte    0x19    A8
+>0     byte    0x1A    A8L8
+>0     byte    0x1B    Linear AL8
+>0     byte    0x1C    Linear RGB555
+>0     byte    0x1D    Linear ARGB4444
+>0     byte    0x1E    Linear xRGB8888
+>0     byte    0x1F    Linear A8
+>0     byte    0x20    Linear A8L8
+>0     byte    0x24    YUY2
+>0     byte    0x25    UYVY
+>0     byte    0x27    L6V5U5
+>0     byte    0x28    V8U8
+>0     byte    0x29    R8B8
+>0     byte    0x2A    D24S8
+>0     byte    0x2B    F24S8
+>0     byte    0x2C    D16
+>0     byte    0x2D    F16
+>0     byte    0x2E    Linear D24S8
+>0     byte    0x2F    Linear F24S8
+>0     byte    0x30    Linear D16
+>0     byte    0x31    Linear F16
+>0     byte    0x32    L16
+>0     byte    0x33    V16U16
+>0     byte    0x35    Linear L16
+>0     byte    0x36    Linear V16U16
+>0     byte    0x37    Linear L6V5U5
+>0     byte    0x38    RGBA5551
+>0     byte    0x39    RGBA4444
+>0     byte    0x3A    QWVU8888
+>0     byte    0x3B    BGRA8888
+>0     byte    0x3C    RGBA8888
+>0     byte    0x3D    Linear RGBA5551
+>0     byte    0x3E    Linear RGBA4444
+>0     byte    0x3F    Linear ABGR8888
+>0     byte    0x40    Linear BGRA8888
+>0     byte    0x41    Linear RGBA8888
+>0     byte    0x64    Vertex Data
+
+0      string          XPR0    Microsoft Xbox XPR0 texture
+>0x19  byte    x       \b, format:
+>>0x19 use     xbox-xpr-pixel-format
index af68db2..4d9c030 100644 (file)
@@ -1,8 +1,8 @@
 
 #------------------------------------------------------------------------------
-# $File: isz,v 1.4 2017/03/17 21:35:28 christos Exp $
+# $File: isz,v 1.5 2019/04/19 00:42:27 christos Exp $
 # ISO Zipped file format
-# http://www.ezbsystems.com/isz/iszspec.txt
+# https://www.ezbsystems.com/isz/iszspec.txt
 0      string  IsZ!    ISO Zipped file
 >4     byte    x       \b, header size %u
 >5     byte    x       \b, version %u
index d885fea..3d26efa 100644 (file)
@@ -1,12 +1,12 @@
 
 #------------------------------------------------------------------------------
-# $File: kml,v 1.3 2010/11/25 15:00:12 christos Exp $
+# $File: keepass,v 1.2 2019/04/19 00:42:27 christos Exp $
 # keepass: file(1) magic for KeePass file
 #
 # Keepass Password Safe:
-#  * original one: http://keepass.info/
-#  * *nix port:    http://www.keepassx.org/
-#  * android port: http://code.google.com/p/keepassdroid/
+#  * original one: https://keepass.info/
+#  * *nix port:    https://www.keepassx.org/
+#  * android port: https://code.google.com/p/keepassdroid/
 
 0      lelong          0x9AA2D903      Keepass password database
 >4     lelong          0xB54BFB65      1.x KDB
index 93b8f79..df6dc52 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: kerberos,v 1.2 2017/03/17 21:35:28 christos Exp $
+# $File: kerberos,v 1.3 2019/04/19 00:42:27 christos Exp $
 # kerberos: MIT kerberos file binary formats
 #
 
@@ -24,7 +24,7 @@
 #              can refer to ${name}
 #      - Provide a way to format strings as hex values
 #
-# http://www.gnu.org/software/shishi/manual/html_node/\
+# https://www.gnu.org/software/shishi/manual/html_node/\
 #      The-Keytab-Binary-File-Format.html
 #
 
index d603ea8..dcdf64c 100644 (file)
@@ -1,14 +1,14 @@
 
 #------------------------------------------------------------------------------
-# $File: kml,v 1.4 2017/03/17 21:35:28 christos Exp $
+# $File: kml,v 1.5 2019/04/19 00:42:27 christos Exp $
 # Type: Google KML, formerly Keyhole Markup Language
 # Future development of this format has been handed
 # over to the Open Geospatial Consortium.
-# http://www.opengeospatial.org/standards/kml/
+# https://www.opengeospatial.org/standards/kml/
 # From: Asbjoern Sloth Toennesen <asbjorn@lila.io>
 0 string/t    \<?xml
 >20  search/400 \ xmlns=
->>&0 regex ['"]http://earth.google.com/kml Google KML document
+>>&0 regex ['"]https://earth.google.com/kml Google KML document
 !:mime application/vnd.google-earth.kml+xml
 >>>&1 string 2.0' \b, version 2.0
 >>>&1 string 2.1' \b, version 2.1
 # Type: OpenGIS KML, formerly Keyhole Markup Language
 # This standard is maintained by the
 # Open Geospatial Consortium.
-# http://www.opengeospatial.org/standards/kml/
+# https://www.opengeospatial.org/standards/kml/
 # From: Asbjoern Sloth Toennesen <asbjorn@lila.io>
->>&0 regex ['"]http://www.opengis.net/kml OpenGIS KML document
+>>&0 regex ['"]https://www.opengis.net/kml OpenGIS KML document
 !:mime application/vnd.google-earth.kml+xml
 >>>&1 string/t 2.2 \b, version 2.2
 
 #------------------------------------------------------------------------------
 # Type: Google KML Archive (ZIP based)
-# http://code.google.com/apis/kml/documentation/kml_tut.html
+# https://code.google.com/apis/kml/documentation/kml_tut.html
 # From: Asbjoern Sloth Toennesen <asbjorn@lila.io>
 0 string    PK\003\004
 >4  byte    0x14
index 0486656..ed7dcd1 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: linux,v 1.65 2018/07/16 12:32:08 christos Exp $
+# $File: linux,v 1.67 2019/04/19 00:42:27 christos Exp $
 # linux:  file(1) magic for Linux files
 #
 # Values for Linux/i386 binaries, from Daniel Quinlan <quinlan@yggdrasil.com>
@@ -56,7 +56,7 @@
 #
 # PSF fonts, from H. Peter Anvin <hpa@yggdrasil.com>
 # Updated by Adam Buchbinder <adam.buchbinder@gmail.com>
-# See: http://www.win.tue.nl/~aeb/linux/kbd/font-formats-1.html
+# See: https://www.win.tue.nl/~aeb/linux/kbd/font-formats-1.html
 0      leshort         0x0436          Linux/i386 PC Screen Font v1 data,
 >2     byte&0x01       0               256 characters,
 >2     byte&0x01       !0              512 characters,
@@ -79,7 +79,7 @@
 4076    string          SWAPSPACE2LINHIB0001    Linux/i386 swap file (new style) (compressed hibernate)
 # according to man page of mkswap (8) March 1999
 # volume label and UUID Russell Coker
-# http://etbe.coker.com.au/2008/07/08/label-vs-uuid-vs-device/
+# https://etbe.coker.com.au/2008/07/08/label-vs-uuid-vs-device/
 4086   string          SWAPSPACE2      Linux/i386 swap file (new style),
 >0x400 long            x               version %d (4K pages),
 >0x404 long            x               size %d pages,
 # and Nicolas Lichtmaier <nick@debian.org>
 # All known start with: b8 c0 07 8e d8 b8 00 90 8e c0 b9 00 01 29 f6 29
 # Linux kernel boot images (i386 arch) (Wolfram Kleff)
+# URL: https://www.kernel.org/doc/Documentation/x86/boot.txt
 514    string          HdrS            Linux kernel
 !:strength + 55
+# often no extension like in linux, vmlinuz, bzimage or memdisk but sometimes
+# Acronis Recovery kernel64.dat and Plop Boot Manager plpbtrom.bin
+# DamnSmallLinux 1.5 damnsmll.lnx 
+!:ext  /dat/bin/lnx
 >510   leshort         0xAA55          x86 boot executable
 >>518  leshort         >0x1ff
 >>>529 byte            0               zImage,
 
 # Linux ARM compressed kernel image
 # From: Kevin Cernekee <cernekee@gmail.com>
+# Update: Joerg Jenderek
 36     lelong  0x016f2818      Linux kernel ARM boot executable zImage (little-endian)
+# raspian "kernel7.img", Vu+ Ultimo4K "kernel_auto.bin"
+!:ext  img/bin
 36     belong  0x016f2818      Linux kernel ARM boot executable zImage (big-endian)
 
 ############################################################################
 # 0    lelong&0xFF00FFFF 0x17000301    ld86 SPARC executable
 
 # SYSLINUX boot logo files (from 'ppmtolss16' sources)
-# http://www.syslinux.org/wiki/index.php/SYSLINUX#Display_graphic_from_filename:
+# https://www.syslinux.org/wiki/index.php/SYSLINUX#Display_graphic_from_filename:
 # file extension .lss .16
 0      lelong  =0x1413f33d             SYSLINUX' LSS16 image data
 # syslinux-4.05/mime/image/x-lss16.xml
 >>&1   string          x                       %s...)
 
 # Systemd journald files
-# See http://www.freedesktop.org/wiki/Software/systemd/journal-files/.
+# See https://www.freedesktop.org/wiki/Software/systemd/journal-files/.
 # From: Zbigniew Jedrzejewski-Szmek <zbyszek@in.waw.pl>
 
 # check magic
 #              the default version of locate on Arch Linux (and others).
 # File path:   /var/lib/mlocate/mlocate.db by default (but configurable)
 # Site:        https://fedorahosted.org/mlocate/
-# Format docs: http://linux.die.net/man/5/mlocate.db
+# Format docs: https://linux.die.net/man/5/mlocate.db
 # Type: mlocate database file
 # URL:  https://fedorahosted.org/mlocate/
 # From: Wander Nauta <info@wandernauta.nl>
 0              lelong          0x47361222      iproute2 addresses dump
 
 # Image and service files for CRIU tool.
-# URL: http://criu.org
+# URL: https://criu.org
 # From: Pavel Emelyanov <xemul@parallels.com>
 0              lelong          0x54564319      CRIU image file v1.1
 0              lelong          0x55105940      CRIU service file
 0              lelong          0x58313116      CRIU inventory
 
 # Kdump compressed dump files
-# http://sourceforge.net/p/makedumpfile/code/ci/master/tree/IMPLEMENTATION
+# https://sourceforge.net/p/makedumpfile/code/ci/master/tree/IMPLEMENTATION
 
 0              string          KDUMP           Kdump compressed dump
 >8             long            x               v%d
index 43d102e..d32cc10 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: lisp,v 1.25 2017/03/17 21:35:28 christos Exp $
+# $File: lisp,v 1.26 2019/04/19 00:42:27 christos Exp $
 # lisp:  file(1) magic for lisp programs
 #
 # various lisp types, from Daniel Quinlan (quinlan@yggdrasil.com)
@@ -27,7 +27,7 @@
 !:mime text/x-lisp
 
 # URL: https://en.wikipedia.org/wiki/Emacs_Lisp
-# Reference: http://ftp.gnu.org/old-gnu/emacs/elisp-manual-18-1.03.tar.gz
+# Reference: https://ftp.gnu.org/old-gnu/emacs/elisp-manual-18-1.03.tar.gz
 # Update: Joerg Jenderek
 # Emacs 18 - this is always correct, but not very magical.
 0      string  \012(
index 8acddfe..2691ef1 100644 (file)
@@ -1,8 +1,8 @@
 
 #------------------------------------------------------------------------------
-# $File: llvm,v 1.7 2013/01/08 01:34:38 christos Exp $
+# $File: llvm,v 1.9 2019/04/19 00:42:27 christos Exp $
 # llvm:  file(1) magic for LLVM byte-codes
-# URL:  http://llvm.org/docs/BitCodeFormat.html
+# URL:  https://llvm.org/docs/BitCodeFormat.html
 # From: Al Stone <ahs3@fc.hp.com>
 
 0      string  llvm    LLVM byte-codes, uncompressed
index fbb9f09..0e47c2f 100644 (file)
@@ -1,8 +1,8 @@
 
 #------------------------------------------------------------------------------
-# $File: lua,v 1.5 2009/09/19 16:28:10 christos Exp $
+# $File: lua,v 1.7 2019/04/19 00:42:27 christos Exp $
 # lua:  file(1) magic for Lua scripting language
-# URL:  http://www.lua.org/
+# URL:  https://www.lua.org/
 # From: Reuben Thomas <rrt@sc3d.org>, Seo Sanghyeon <tinuviel@sparcs.kaist.ac.kr>
 
 # Lua scripts
index 3a1c6d1..587ebe8 100644 (file)
@@ -1,9 +1,11 @@
 #------------------------------------------------------------------------------
-# $File: m4,v 1.2 2017/08/14 07:40:38 christos Exp $
+# $File: m4,v 1.3 2019/02/27 16:46:23 christos Exp $
 # make:  file(1) magic for M4 scripts
 #
-0      regex   \^dnl\          M4 macro processor script text
+0      search/8192     dnl
+>0     regex   \^dnl\          M4 macro processor script text
 !:mime text/x-m4
-0      regex   \^AC_DEFUN\\(\\[        M4 macro processor script text
+0      search/8192     AC_DEFUN
+>0     regex   \^AC_DEFUN\\(\\[        M4 macro processor script text
 !:strength + 15
 !:mime text/x-m4
index 249a4d8..2a9f7a7 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: macintosh,v 1.28 2017/12/05 02:17:48 christos Exp $
+# $File: macintosh,v 1.29 2019/04/19 00:42:27 christos Exp $
 # macintosh description
 #
 # BinHex is the Macintosh ASCII-encoded file format (see also "apple")
@@ -62,7 +62,7 @@
 # MacBinary format (Eric Fischer, enf@pobox.com)
 # Update: Joerg Jenderek 
 # URL: https://en.wikipedia.org/wiki/MacBinary
-# Reference: http://files.stairways.com/other/macbinaryii-standard-info.txt
+# Reference: https://files.stairways.com/other/macbinaryii-standard-info.txt
 #
 # Unfortunately MacBinary doesn't really have a magic number prior
 # to the MacBinary III format.
 
 # Apple Type/Creator Database
 # URL: https://en.wikipedia.org/wiki/Type_code
-# Reference:   http://www.lacikam.co.il/tcdb/
-#              http://www.macdisk.com/macsigen.php
+# Reference:   https://www.lacikam.co.il/tcdb/
+#              https://www.macdisk.com/macsigen.php
 # Note:        classic Mac OS files have two 4 character codes for type and creator.
 #      Thereby the Finder attach documents types to applications.
 
 >0x424 pstring                 x               volume name: %s
 
 # *.hfs updated by Joerg Jenderek
-# http://en.wikipedia.org/wiki/Hierarchical_File_System
+# https://en.wikipedia.org/wiki/Hierarchical_File_System
 # "BD" gives many false positives
 0x400  beshort                 0x4244
 # ftp://ftp.mars.org/pub/hfs/hfsutils-3.2.6.tar.gz/hfsutils-3.2.6/libhfs/apple.h
 !:mime application/x-apple-diskimage
 #!:apple       hfsdINIT
 #!:apple       MACSdisk
-# http://www.macdisk.com/macsigen.php
+# https://www.macdisk.com/macsigen.php
 #!:apple       ddskdevi
 !:apple        ????devi
 # https://en.wikipedia.org/wiki/Apple_Disk_Image
 >>>0x40a       beshort                 &0x0200 (spared blocks)
 >>>0x40a       beshort                 &0x0800 (unclean)
 >>>0x47C       beshort                 0x482B  (Embedded HFS+ Volume)
-# http://www.epochconverter.com/
+# https://www.epochconverter.com/
 # 0x7C245F00 seconds   ~ 2082758400    ~ 01 Jan 2036 00:00:00  ~ 66 years to 1970
 # 0x7C25B080 seconds   ~ 2082844800    ~ 02 Jan 2036 00:00:00
 # construct not working
 0              string          BOMStore        Mac OS X bill of materials (BOM) file
 
 # From: Adam Buchbinder <adam.buchbinder@gmail.com>
-# URL: http://en.wikipedia.org/wiki/Datafork_TrueType
+# URL: https://en.wikipedia.org/wiki/Datafork_TrueType
 # Derived from the 'fondu' and 'ufond' source code (fondu.sf.net). 'sfnt' is
 # TrueType; 'POST' is PostScript. 'FONT' and 'NFNT' sometimes appear, but I
 # don't know what they mean.
index e54f0e7..c58b371 100644 (file)
@@ -1,5 +1,5 @@
 #------------------------------------------------------------------------------
-# $File: mail.news,v 1.22 2013/01/04 14:22:07 christos Exp $
+# $File: mail.news,v 1.24 2019/04/19 00:42:27 christos Exp $
 # mail.news:  file(1) magic for mail and news
 #
 # Unfortunately, saved netnews also has From line added in some news software.
@@ -57,7 +57,7 @@
 #0     string          \<!--\ MHonArc          text/html; x-type=mhonarc
 
 # Cyrus: file(1) magic for compiled Cyrus sieve scripts
-# URL: http://www.cyrusimap.org/docs/cyrus-imapd/2.4.6/internal/bytecode.php
+# URL: https://www.cyrusimap.org/docs/cyrus-imapd/2.4.6/internal/bytecode.php
 # URL: http://git.cyrusimap.org/cyrus-imapd/tree/sieve/bytecode.h?h=master
 # From: Philipp Hahn <hahn@univention.de>
 
index 5a91d9f..af5f24e 100644 (file)
@@ -1,16 +1,16 @@
 
 
 #------------------------------------------------------------------------------
-# $File: map,v 1.5 2018/12/28 00:22:34 christos Exp $
+# $File: map,v 1.7 2019/04/30 04:02:04 christos Exp $
 # map:  file(1) magic for Map data
 #
 
-# Garmin .FIT files http://pub.ks-and-ks.ne.jp/cycling/edge500_fit.shtml
+# Garmin .FIT files https://pub.ks-and-ks.ne.jp/cycling/edge500_fit.shtml
 8      string  .FIT            FIT Map data
 >15    byte    0
 >>35   belong  x               \b, unit id %d
 >>39   lelong  x               \b, serial %u
-# http://pub.ks-and-ks.ne.jp/cycling/edge500_fit.shtml
+# https://pub.ks-and-ks.ne.jp/cycling/edge500_fit.shtml
 # 20 years after unix epoch
 # TZ=GMT date -d '1989-12-31 0:00' +%s
 >>43   leldate+631065600       x       \b, %s
 #>0xF  ubyte           x               \b, Checksum 0x%x
 # Signature: DSKIMG 0x00 or DSDIMG 0x00 for demo map 
 >0x10  string          !DSKIMG         \b, signature "%.7s"
-# Creation year
->0x39  uleshort        x               \b, created %u
-# Creation month (0-11)
->0x3b  ubyte           x               \b-%.2u
-# Creation day (1-31)
->0x3c  ubyte           x               \b-%.2u
-# Creation hour (0-23)
->0x3d  ubyte           x               %u
-# Creation minute (0-59)
->0x3e  ubyte           x               \b:%.2u
-# Creation second (0-59)
->0x3f  ubyte           x               \b:%.2u
+>0x39  use             garmin-date
 # Map file identifier like GARMIN\0
 >0x41  string          !GARMIN         \b, id "%.7s"
 # Block size exponent, E1; appears to always be 0x09; minimum block size 512 bytes
 # 32-bit block sequence numbers
 #>>>0x20       ubequad         x               \b, seq. 0x%16.16llx
 
+#      display date stored inside Garmin maps like yyyy-mm-dd h:mm:ss
+0      name                            garmin-date
+# year like 2018
+>0     uleshort        x               \b, created %u
+# month (0-11)
+>2     ubyte           x               \b-%.2u
+# day (1-31)
+>3     ubyte           x               \b-%.2u
+# hour (0-23)
+>4     ubyte           x               %u
+# minute (0-59)
+>5     ubyte           x               \b:%.2u
+# second (0-59)
+>6     ubyte           x               \b:%.2u
+
+# Summary: Garmin Map subfiles
+# From:        Joerg Jenderek
+# URL: https://wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin/IMG_File_Format
+# Garmin Common Header
+2      string  GARMIN\ 
+# skip ASCII text by checking for low header length
+>0     uleshort <0x1000        Garmin map,
+# URL: https://wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin/GMP_Subfile_Format
+>>9    string  GMP                             subtile
+!:mime                 application/x-garmin-gpm
+!:ext                  gmp
+# copyright message
+>>>(0.s)               string          x       %s
+>>>0x0E                use             garmin-date
+# URL: https://wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin/MDR_Subfile_Format
+# This contains the searchable address table used for finding routing destinations
+>>9    string  MDR                             address table
+!:mime                 application/x-garmin-mdr
+!:ext                  mdr
+# URL: https://wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin/NOD_Subfile_Format
+# http://svn.parabola.me.uk/display/trunk/doc/nod.txt
+# This contains the routing information
+>>9    string  NOD                             routing
+!:mime                 application/x-garmin-nod
+!:ext                  nod
+>>>0x0E                use             garmin-date
+#>>>0x15                       ulelong         x       \b, at 0x%x
+#>>>0x19                       ulelong         x       0x%x bytes NOD1
+#>>>0x25                       ulelong         x       \b, at 0x%x
+#>>>0x29                       ulelong         x       0x%x bytes NOD2
+#>>>0x31                       ulelong         x       \b, at 0x%x
+#>>>0x35                       ulelong         x       0x%x bytes NOD3
+# URL: http://www.pinns.co.uk/osm/net.html
+# routable highways (length, direction, allowed speed,house address information)
+>>9    string  NET                             highways
+!:mime                 application/x-garmin-net
+!:ext                  net
+#>>>0x15                       ulelong         x       \b, at 0x%x
+#>>>0x19                       ulelong         x       0x%x bytes NET1
+#>>>0x22                       ulelong         >0
+#>>>>0x1E              ulelong         x       \b, at 0x%x
+#>>>>0x22              ulelong         x       0x%x bytes NET2
+#>>>0x2B                       ulelong         >0
+#>>>>0x27              ulelong         x       \b, at 0x%x
+#>>>>0x2B              ulelong         x       0x%x bytes NET3
+# URL: https://wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin/LBL_Subfile_Format
+>>9    string  LBL                             labels
+!:mime                 application/x-garmin-lbl
+!:ext                  lbl
+>>>(0.s)               string  x       %s
+# Label coding type 6h 9h and ah
+>>>0x1E                        ubyte           x       \b, coding type 0x%x
+#>>>0x15                       ulelong         x       \b, at 0x%x
+#>>>0x19                       ulelong         x       0x%x bytes LBL1
+#>>>0x1F                       ulelong         x       \b, at 0x%x
+#>>>0x23                       ulelong         x       0x%x bytes LBL2
+#>>>0x2D                       ulelong         x       \b, at 0x%x
+#>>>0x31                       ulelong         x       0x%x bytes LBL3
+# URL: https://wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin/SRT_Subfile_Format
+# A lookup table of the chars in the map's codepage, and their collating sequence
+>>9    string  SRT                             sort table
+!:mime                 application/x-garmin-srt
+!:ext                  srt
+>>>0x0E                use             garmin-date
+# URL: https://wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin/TRE_Subfile_Format
+>>9    string  TRE                             tree
+!:mime                 application/x-garmin-tre
+!:ext                  tre
+# title like City Nav Europe NTU 2019.2 Basemap
+# or OSM Street map
+>>>(0.s)               string          x       %s
+# 2nd title like Copyright 1995-2018 by GARMIN Corporation.
+# or http://www.openstreetmap.org/
+>>>>&1                 string          x       %s
+>>>0x0E                use             garmin-date
+#>>>0x21                       ulelong         x       \b, at 0x%x
+#>>>0x25                       ulelong         x       0x%x bytes TRE1
+#>>>0x29                       ulelong         x       \b, at 0x%x
+#>>>0x2D                       ulelong         x       0x%x bytes TRE2
+#>>>0x31                       ulelong         x       \b, at 0x%x
+#>>>0x35                       ulelong         x       0x%x bytes TRE3
+# Copyright record size
+#>>>0x39                       uleshort        x       \b, copyright record size %u
+# Map ID
+>>>0x74                        ulelong         x       \b, ID 0x%x
+# URL: https://www.gpspower.net/garmin-tutorials/353310-basecamp-installing-free-desktop-map.html
+# For road traffic information service (RDS/TMS/TMC). Commonly seen in City Navigator maps
+>>9    string  TRF                             traffic,
+!:mime                 application/x-garmin-trf
+!:ext                  trf
+# city/region like Preitenegg
+>>>(0.s+1)             string          x       1st %s
+# highway part like L606/L148
+>>>>&1                 string          x       %s
+# URL: https://wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin/Format
+# Reference: http://www.pinns.co.uk/osm/typformat.html
+# customize the appearance of objects. For GPS and MapSource/Qlandkarte better looking maps
+>>9    string  TYP                             types
+!:mime                 application/x-garmin-typ
+!:ext                  typ
+>>>0x0E                use             garmin-date
+# character set 1252 65001~UTF8
+>>>0x15                        uleshort        x       \b, code page %u
+# POIs
+#>>>0x17                       ulelong         x       \b, at 0x%x
+#>>>0x1B                       ulelong         x       0x%x bytes TYP1
+# extra pois
+#>>>0x5B                       ulelong         x       \b, at 0x%x
+#>>>0x5F                       ulelong         x       0x%x bytes TYP8
+# URL: https://wiki.openstreetmap.org/wiki/OSM_Map_On_Garmin/RGN_Subfile_Format
+# http://www.pinns.co.uk/osm/RGN.html
+# region data used by the Garmin software
+>>9    string  RGN                             region
+!:mime                 application/x-garmin-rgn
+!:ext                  rgn
+# POIs,Indexed POIs,Polylines or Polygons or first map level
+#>>>0x15                       ulelong        x        \b, at 0x%x
+#>>>0x19                       ulelong        x        0x%x bytes RGN1
+# polygons with extended types
+#>>>0x21                       ulelong        >0
+#>>>>0x1D              ulelong        x        \b, at 0x%x
+#>>>>0x21              ulelong        x        0x%x bytes RGN2
+# polylines with extended types
+#>>>0x3D                       ulelong        >0
+#>>>>0x39              ulelong        x        \b, at 0x%x
+#>>>>0x3D              ulelong        x        0x%x bytes RGN3
+# extended POIs
+#>>>0x59                       ulelong        >0
+#>>>>0x55              ulelong        x        \b, at 0x%x
+#>>>>0x59              ulelong        x        0x%x bytes RGN3
+#>>9   default         x               unknown map type
+# Header length; GMP:31h 35h 3Dh,MDR:11Eh 238h 2C4h 310h,NOD:3Fh 7Fh,NET:64h,
+# LBL:2A9h,SRT:1Dh 25h 27h,TRE:CFh 135h,TRF:5Ah,TYP:5Bh 6Eh 7Ch AEh,RGN:7Dh
+>>0    uleshort        x               \b, header length 0x%x
+
 # TOM TOM GPS watches ttbin files:
-# http://github.com/ryanbinns/ttwatch/tree/master/ttbin
+# https://github.com/ryanbinns/ttwatch/tree/master/ttbin
 # From: Daniel Lenski
 0      byte    0x20
 >1     leshort 0x0007
index fd509ec..bb4998e 100644 (file)
@@ -5,7 +5,7 @@
 #
 # MARC21 formats are for the representation and communication
 # of bibliographic and related information in machine-readable
-# form.  For more info, see http://www.loc.gov/marc/
+# form.  For more info, see https://www.loc.gov/marc/
 
 
 # leader position 20-21 must be 45
index 7a201db..271af55 100644 (file)
@@ -1,9 +1,9 @@
 
 #------------------------------------------------------------------------------
-# $File: matroska,v 1.7 2012/08/26 10:06:15 christos Exp $
+# $File: matroska,v 1.9 2019/04/19 00:42:27 christos Exp $
 # matroska:  file(1) magic for Matroska files
 #
-# See http://www.matroska.org/
+# See https://www.matroska.org/
 #
 
 # EBML id:
index 009220f..b8f3cdd 100644 (file)
@@ -1,8 +1,8 @@
 
 #------------------------------------------------------------------------------
-# $File$
+# $File: mercurial,v 1.5 2019/04/19 00:42:27 christos Exp $
 # mercurial:  file(1) magic for Mercurial changeset bundles
-# http://www.selenic.com/mercurial/wiki/
+# https://www.selenic.com/mercurial/wiki/
 #
 # Jesse Glick (jesse.glick@sun.com)
 #
index 53f5b37..e64e704 100644 (file)
@@ -1,8 +1,8 @@
 
 #------------------------------------------------------------------------------
-# $File: metastore,v 1.2 2017/03/17 21:35:28 christos Exp $
+# $File: metastore,v 1.3 2019/04/19 00:42:27 christos Exp $
 # metastore:  file(1) magic for metastore files
 # From: Thomas Wissen
-# see http://david.hardeman.nu/software.php#metastore
+# see https://david.hardeman.nu/software.php#metastore
 0      string          MeTaSt00r3      Metastore data file,
 >10    bequad          x               version %0llx
index e5b247c..93e39aa 100644 (file)
@@ -1,9 +1,9 @@
 
 #------------------------------------------------------------------------------
-# $File: microfocus,v 1.2 2017/03/17 21:35:28 christos Exp $
+# $File: microfocus,v 1.3 2019/04/19 00:42:27 christos Exp $
 # Micro Focus COBOL data files.
 
-# http://documentation.microfocus.com/help/index.jsp?topic=\
+# https://documentation.microfocus.com/help/index.jsp?topic=\
 # %2FGUID-0E0191D8-C39A-44D1-BA4C-D67107BAF784%2FHRFLRHFILE05.html
 # http://www.cobolproducts.com/datafile/data-viewer.html
 # https://github.com/miracle2k/mfcobol-export
index 3ce91b5..cef1da5 100644 (file)
@@ -1,6 +1,6 @@
 
 #-----------------------------------------------------------------------------
-# $File: misctools,v 1.17 2017/03/17 21:35:28 christos Exp $
+# $File: misctools,v 1.18 2019/04/19 00:42:27 christos Exp $
 # misctools:  file(1) magic for miscellaneous UNIX tools.
 #
 0      search/1        %%!!                    X-Post-It-Note text
@@ -8,7 +8,7 @@
 !:mime text/calendar
 # updated by Joerg Jenderek at Apr 2015
 # Extension: .vcf
-# http://en.wikipedia.org/wiki/VCard
+# https://en.wikipedia.org/wiki/VCard
 0      string/c        BEGIN:VCARD             vCard visiting card
 # deprecated
 #!:mime        text/x-vcard
@@ -36,7 +36,7 @@
 # "Windows Minidump" by TrID
 # ./misctools (version 5.25) labeled the entry as "MDMP crash report data"
 0      string          MDMP                                    Mini DuMP crash report
-# http://filext.com/file-extension/DMP
+# https://filext.com/file-extension/DMP
 !:mime application/x-dmp
 !:ext  dmp/mdmp
 # The high-order word is an internal value that is implementation specific.
index d988e90..c7a53ee 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: modem,v 1.8 2017/03/17 21:35:28 christos Exp $
+# $File: modem,v 1.9 2019/04/19 00:42:27 christos Exp $
 # modem:  file(1) magic for modem programs
 #
 # From: Florian La Roche <florian@knorke.saar.de>
@@ -11,7 +11,7 @@
 # Summary: CCITT Group 3 Facsimile in "raw" form (i.e. no header).
 # Modified by: Joerg Jenderek
 # URL: https://de.wikipedia.org/wiki/Fax
-# Reference: http://web.archive.org/web/20020628195336/http://www.netnam.vn/unescocourse/computervision/104.htm
+# Reference: https://web.archive.org/web/20020628195336/http://www.netnam.vn/unescocourse/computervision/104.htm
 # GRR: EOL of G3 is too general as it catches also TrueType fonts, Postscript PrinterFontMetric, others
 0      short           0x0100
 # 16 0-bits near beginning like True Type fonts *.ttf, Postscript PrinterFontMetric *.pfm, FTYPE.HYPERCARD, XFER
index 2aa8206..bc6b6a6 100644 (file)
@@ -1,9 +1,9 @@
 
 #------------------------------------------------------------------------------
-# $File: mozilla,v 1.9 2018/11/26 16:24:40 christos Exp $
+# $File: mozilla,v 1.10 2019/04/19 00:42:27 christos Exp $
 # mozilla:  file(1) magic for Mozilla XUL fastload files
 # (XUL.mfasl and XPC.mfasl)
-# URL: http://www.mozilla.org/
+# URL: https://www.mozilla.org/
 # From:        Josh Triplett <josh@freedesktop.org>
 
 0      string  XPCOM\nMozFASL\r\n\x1A          Mozilla XUL fastload data
index ac93b36..eda0ddb 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: msdos,v 1.126 2018/11/11 01:58:19 christos Exp $
+# $File: msdos,v 1.128 2019/04/19 00:42:27 christos Exp $
 # msdos:  file(1) magic for MS-DOS files
 #
 
 >>49824 leshort                =1                      \b, 1 file
 >>49824 leshort                >1                      \b, %u files
 
-# added by Joerg Jenderek of http://www.freedos.org/software/?prog=kc
-# and http://www.freedos.org/software/?prog=kpdos
+# added by Joerg Jenderek of https://www.freedos.org/software/?prog=kc
+# and https://www.freedos.org/software/?prog=kpdos
 # for FreeDOS files like KEYBOARD.SYS, KEYBRD2.SYS, KEYBRD3.SYS, *.KBD
 0      string/b        KCF             FreeDOS KEYBoard Layout collection
 # only version=0x100 found
 # modified by Joerg Jenderek
 # syslinux COM32 or COM32R executable
 >>1    lelong&0xFFFFFFFe 0x21CD4CFe    COM executable (32-bit COMBOOT
-# http://www.syslinux.org/wiki/index.php/Comboot_API
+# https://www.syslinux.org/wiki/index.php/Comboot_API
 # Since version 5.00 c32 modules switched from the COM32 object format to ELF
 !:mime application/x-c32-comboot-syslinux-exec
 !:ext c32
-# http://syslinux.zytor.com/comboot.php
+# https://syslinux.zytor.com/comboot.php
 # older syslinux version ( <4 )
 # (32-bit COMBOOT) programs *.C32 contain 32-bit code and run in flat-memory 32-bit protected mode
 # start with assembler instructions mov eax,21cd4cffh
 0      lelong          0x4C
 >4     lelong          0x00021401      Windows shortcut file
 
-# .PIF files added by Joerg Jenderek from http://smsoft.ru/en/pifdoc.htm
+# .PIF files added by Joerg Jenderek from https://smsoft.ru/en/pifdoc.htm
 # only for windows versions equal or greater 3.0
 0x171  string  MICROSOFT\ PIFEX\0      Windows Program Information File
 !:mime application/x-dosexec
 
 # Norton Guide (.NG , .HLP) files added by Joerg Jenderek from source NG2HTML.C
 # of http://www.davep.org/norton-guides/ng2h-105.tgz
-# http://en.wikipedia.org/wiki/Norton_Guides
+# https://en.wikipedia.org/wiki/Norton_Guides
 0      string          NG\0\001
 # only value 0x100 found at offset 2
 >2     ulelong         0x00000100      Norton Guide
 >>114  string          >\0             %-.66s
 
 # 4DOS help (.HLP) files added by Joerg Jenderek from source TPHELP.PAS
-# of http://www.4dos.info/
+# of https://www.4dos.info/
 # pointer,HelpID[8]=4DHnnnmm
 0      ulelong 0x48443408              4DOS help file
 >4     string  x                       \b, version %-4.4s
 !:mime application/vnd.ms-cab-compressed
 !:ext  cab
 
-# http://support.microsoft.com/kb/934307/en-US
+# https://support.microsoft.com/kb/934307/en-US
 # All inspected MSU contain a file with name WSUSSCAN.cab
 # that is called "Windows Update meta data" by Microsoft
 >>>&-1 string/c        wsusscan.cab    \b, Microsoft Standalone Update
 # or Windows 8 Desktop Theme Pack like in PanoramicGlaciers.deskthemepack
 >>>>>&0        string/c        theme           \b, Windows
 !:mime application/x-windows-themepack
-# http://www.drewkeller.com/content/using-theme-both-windows-7-and-windows-8
+# https://www.drewkeller.com/content/using-theme-both-windows-7-and-windows-8
 # 1st member Panoramic.theme or Panoramas.theme implies Windows 8-10 Theme Pack
 # with MTSM=RJSPBS in [MasterThemeSelector] inside *.theme
 >>>>>>(16.l+16)        string  =Panoram        8
 >>48   string x                        version %.3s
 
 # Type: Microsoft Document Imaging Format (.mdi)
-# URL: http://en.wikipedia.org/wiki/Microsoft_Document_Imaging_Format
+# URL: https://en.wikipedia.org/wiki/Microsoft_Document_Imaging_Format
 # From: Daniele Sempione <scrows@oziosi.org>
 # Too weak (EP)
 #0     short   0x5045                  Microsoft Document Imaging Format
 # From: Dr. Jesus <j@hug.gs>
 0      string/b        B000FF\n        Windows Embedded CE binary image
 
-# Windows Imaging (WIM) Image
-0      string/b        MSWIM\000\000\000       Windows imaging (WIM) image
-0      string/b        WLPWM\000\000\000       Windows imaging (WIM) image, wimlib pipable format
-
 # The second byte of these signatures is a file version; I don't know what,
 # if anything, produced files with version numbers 0-2.
 # From: John Elliott <johne@seasip.demon.co.uk>
index 9253862..194cf53 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: msooxml,v 1.11 2019/01/18 15:39:18 christos Exp $
+# $File: msooxml,v 1.12 2019/04/19 00:42:27 christos Exp $
 # msooxml:  file(1) magic for Microsoft Office XML
 # From: Ralf Brown <ralf.brown@gmail.com>
 
@@ -35,7 +35,7 @@
 >>>&26         search/6000     PK\003\004
 # and check the subdirectory name to determine which type of OOXML
 # file we have.  Correct the mimetype with the registered ones:
-# http://technet.microsoft.com/en-us/library/cc179224.aspx
+# https://technet.microsoft.com/en-us/library/cc179224.aspx
 >>>>&26                use             msooxml 
 >>>>&26                default         x
 # OpenOffice/Libreoffice orders ZIP entry differently, so check the 4th file
index 3cae17b..6bedc22 100644 (file)
@@ -1,9 +1,9 @@
 
 #------------------------------------------------------------
-# $File: java,v 1.12 2009/09/19 16:28:10 christos Exp $
+# $File: neko,v 1.2 2019/04/19 00:42:27 christos Exp $
 
 # From: Mikhail Gusarov <dottedmag@dottedmag.net>
-# NekoVM (http://nekovm.org/) bytecode
+# NekoVM (https://nekovm.org/) bytecode
 0      string          NEKO    NekoVM bytecode
 >4     lelong          x       (%d global symbols,
 >8     lelong          x       %d global fields,
index 48c3d63..bea96c3 100644 (file)
@@ -1,8 +1,8 @@
 
 #------------------------------------------------------------------------------
-# $File: nitpicker,v 1.7 2017/03/17 21:35:28 christos Exp $
+# $File: nitpicker,v 1.8 2019/04/19 00:42:27 christos Exp $
 # nitpicker:  file(1) magic for Flowfiles.
-# From: Christian Jachmann <C.Jachmann@gmx.net> http://www.nitpicker.de
+# From: Christian Jachmann <C.Jachmann@gmx.net> https://www.nitpicker.de
 0      string  NPFF    NItpicker Flow File
 >4     byte    x       V%d.
 >5     byte    x       %d
diff --git a/magic/Magdir/numpy b/magic/Magdir/numpy
new file mode 100644 (file)
index 0000000..c1520dd
--- /dev/null
@@ -0,0 +1,9 @@
+
+#------------------------------------------------------------------------------
+# $File: numpy,v 1.1 2019/05/09 16:24:36 christos Exp $
+# numpy: file(1) magic for NumPy array binary serialization format
+# Reference: https://docs.scipy.org/doc/numpy/reference/generated/numpy.lib.format.html
+0      string          \x93NUMPY       NumPy array,
+>6     ubyte           x               version %d
+>7     ubyte           x               \b.%d,
+>8     uleshort        x               header length %d
index 7b93e61..f4046cc 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: ole2compounddocs,v 1.5 2017/10/27 21:43:23 christos Exp $
+# $File: ole2compounddocs,v 1.6 2019/04/19 00:42:27 christos Exp $
 # Microsoft OLE 2 Compound Documents : file(1) magic for Microsoft Structured
 # storage (https://en.wikipedia.org/wiki/Compound_File_Binary_Format)
 # Additional tests for OLE 2 Compound Documents should be under this recipe.
@@ -15,7 +15,7 @@
 
 # Note: moved & merged Microsoft Office parts from ./msdos Oct 2017
 # Update: Joerg Jenderek
-# from http://filext.com by Derek M Jones <derek@knosof.co.uk>
+# from https://filext.com by Derek M Jones <derek@knosof.co.uk>
 # False positive with PPT (also currently this string is too long)
 #0     string/b        \xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3E\x00\x03\x00\xFE\xFF\x09\x00\x06    Microsoft Installer
 #0     string/b        \320\317\021\340\241\261\032\341        Microsoft Office Document
index b30f164..8cec9df 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: palm,v 1.12 2014/03/28 19:11:40 christos Exp $
+# $File: palm,v 1.14 2019/04/19 00:42:27 christos Exp $
 # palm:         file(1) magic for PalmOS {.prc,.pdb}: applications, docfiles, and hacks
 #
 # Brian Lalor <blalor@hcirisc.cs.binghamton.edu>
 # Palm OS .prc file types
 60             string          libr
 # flags, only bit 0 or bit 6
-# http://en.wikipedia.org/wiki/PRC_%28Palm_OS%29
-# http://web.mit.edu/tytso/www/pilot/prc-format.html
+# https://en.wikipedia.org/wiki/PRC_%28Palm_OS%29
+# https://web.mit.edu/tytso/www/pilot/prc-format.html
 >0x20          beshort&0xffbe  0
 >>0            string          >\0             Palm OS dynamic library data "%s"
 60             string          ptch            Palm OS operating system patch data
index 400b311..b2a56c8 100644 (file)
@@ -1,7 +1,7 @@
 #------------------------------------------------------------------------------
-# $File$
+# $File: parrot,v 1.2 2019/04/19 00:42:27 christos Exp $
 # parrot: file(1) magic for Parrot Virtual Machine
-# URL: http://www.lua.org/
+# URL: https://www.lua.org/
 # From: Lubomir Rintel <lkundrak@v3.sk>
 
 # Compiled Parrot byte code
index b87578c..0ab7a88 100644 (file)
@@ -1,10 +1,10 @@
 
 #------------------------------------------------------------------------------
-# $File: pbf,v 1.1 2013/12/21 14:27:24 christos Exp $
+# $File: pbf,v 1.3 2019/04/19 00:42:27 christos Exp $
 # file(1) magic(5) data for OpenStreetMap
 
 # OpenStreetMap Protocolbuffer Binary Format (.osm.pbf)
-# http://wiki.openstreetmap.org/wiki/PBF_Format
+# https://wiki.openstreetmap.org/wiki/PBF_Format
 # From: Markus Heidelberg <markus.heidelberg@web.de>
 0      belong&0xfffffff0       0
 >4     beshort                 0x0A09
index 3b995ed..e8f6b8a 100644 (file)
@@ -21,7 +21,7 @@
 
 # Maki-chan v2 Graphic format
 # http://www.jisyo.com/viewer/faq/mag_tech.htm
-# http://mooncore.eu/bunny/txt/makichan.htm
+# https://mooncore.eu/bunny/txt/makichan.htm
 # http://metanest.jp/mag/mag.xhtml
 0      string/b                MAKI02\ \       Maki-chan v2 image,
 >8     byte            x               system ID: %c
index d6e18d9..acb5395 100644 (file)
@@ -1,8 +1,8 @@
 
 #------------------------------------------------------------------------------
-# $File: pgp,v 1.16 2018/10/28 22:37:02 christos Exp $
+# $File: pgp,v 1.17 2019/04/19 00:42:27 christos Exp $
 # pgp:  file(1) magic for Pretty Good Privacy
-# see http://lists.gnupg.org/pipermail/gnupg-devel/1999-September/016052.html
+# see https://lists.gnupg.org/pipermail/gnupg-devel/1999-September/016052.html
 #
 # Update: Joerg Jenderek
 # Note: verified by `gpg -v --debug 0x02 --list-packets < PUBRING263_10.PGP`
@@ -74,7 +74,7 @@
 # Decode the type of the packet based on it's base64 encoding.
 # Idea from Mark Martinec
 # The specification is in RFC 4880, section 4.2 and 4.3:
-# http://tools.ietf.org/html/rfc4880#section-4.2
+# https://tools.ietf.org/html/rfc4880#section-4.2
 
 0      name            pgp
 >0     byte            0x67            Reserved (old)
index 3298277..1cc0109 100644 (file)
@@ -1,13 +1,13 @@
 
 #------------------------------------------------------------------------------
-# $File: animation,v 1.57 2015/11/29 22:11:07 christos Exp $
+# $File: polyml,v 1.2 2019/04/19 00:42:27 christos Exp $
 # polyml:  file(1) magic for PolyML
 #
 # PolyML
 # MPEG, FLI, DL originally from vax@ccwf.cc.utexas.edu (VaX#n8)
 # FLC, SGI, Apple originally from Daniel Quinlan (quinlan@yggdrasil.com)
 
-# [0]: http://www.polyml.org/
+# [0]: https://www.polyml.org/
 # [1]: https://github.com/polyml/polyml/blob/master/\
 #      libpolyml/savestate.cpp#L146-L147
 # [2]: https://github.com/polyml/polyml/blob/master/\
index 98fc1df..e8fccd2 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: printer,v 1.28 2017/03/17 22:20:22 christos Exp $
+# $File: printer,v 1.29 2019/04/19 00:42:27 christos Exp $
 # printer:  file(1) magic for printer-formatted files
 #
 
@@ -40,7 +40,7 @@
 
 # Summary: Adobe's PostScript Printer Description File
 # Extension: .ppd
-# Reference: http://partners.adobe.com/public/developer/en/ps/5003.PPD_Spec_v4.3.pdf, Section 3.8
+# Reference: https://partners.adobe.com/public/developer/en/ps/5003.PPD_Spec_v4.3.pdf, Section 3.8
 # Submitted by: Yves Arrouye <arrouye@marin.fdn.fr>
 #
 0      string          *PPD-Adobe:\x20 PPD file
index e5a1e3a..0296540 100644 (file)
@@ -1,10 +1,10 @@
 
 #------------------------------------------------------------------------------
-# $File: psl,v 1.1 2016/07/14 15:26:48 christos Exp $
+# $File: psl,v 1.3 2019/04/19 00:42:27 christos Exp $
 # psl:  file(1) magic for Public Suffix List representations
 # From: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
 # URL: https://publicsuffix.org
-# see also: http://thread.gmane.org/gmane.network.dns.libpsl.bugs/162/focus=166
+# see also: https://thread.gmane.org/gmane.network.dns.libpsl.bugs/162/focus=166
 
 0      search/512      \n\n//\ ===BEGIN\ ICANN\ DOMAINS===\n\n Public Suffix List data
 
index 4083df0..549093f 100644 (file)
@@ -1,14 +1,14 @@
 
 #------------------------------------------------------------------------------
-# $File: vax,v 1.7 2009/09/19 16:28:13 christos Exp $
+# $File: pwsafe,v 1.2 2019/04/19 00:42:27 christos Exp $
 # pwsafe: file(1) magic for passwordsafe file
 #
 # Password Safe
 # http://passwordsafe.sourceforge.net/
 # file format specs
-# http://passwordsafe.svn.sourceforge.net/viewvc/passwordsafe/trunk/pwsafe/pwsafe/docs/formatV3.txt
-# V2 http://passwordsafe.svn.sourceforge.net/viewvc/passwordsafe/trunk/pwsafe/pwsafe/docs/formatV2.txt
-# V1 http://passwordsafe.svn.sourceforge.net/viewvc/passwordsafe/trunk/pwsafe/pwsafe/docs/notes.txt
+# https://passwordsafe.svn.sourceforge.net/viewvc/passwordsafe/trunk/pwsafe/pwsafe/docs/formatV3.txt
+# V2 https://passwordsafe.svn.sourceforge.net/viewvc/passwordsafe/trunk/pwsafe/pwsafe/docs/formatV2.txt
+# V1 https://passwordsafe.svn.sourceforge.net/viewvc/passwordsafe/trunk/pwsafe/pwsafe/docs/notes.txt
 # V2 and V1 have no easy identifier that I can find
 # .psafe3
 0      string  PWS3    Password Safe V3 database
index f21ff65..acf05dd 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: python,v 1.34 2017/08/14 07:40:38 christos Exp $
+# $File: python,v 1.36 2019/04/09 18:28:25 christos Exp $
 # python:  file(1) magic for python
 #
 # Outlook puts """ too for urgent messages
@@ -27,7 +27,7 @@
 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      belong          0x420d0d0a      python 3.7 byte-compiled
 
 
 0      search/1/w      #!\ /usr/bin/python     Python script text executable
@@ -45,7 +45,8 @@
 
 
 # from module.submodule import func1, func2
-0      regex           \^from[\040\t\f\r\n]+([A-Za-z0-9_]|\\.)+[\040\t\f\r\n]+import.*$        Python script text executable
+0      search/8192     import
+>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
 
@@ -63,7 +64,8 @@
 !:mime text/x-python
 
 # import module [as abrev]
-0      regex   \^import\ [_[:alpha:]]+\ as\ [[:alpha:]][[:space:]]*$ Python script text executable
+0      search/8192     import
+>0     regex   \^import\ [_[:alpha:]]+\ as\ [[:alpha:]][[:space:]]*$ Python script text executable
 !:mime text/x-python
 
 # comments
 !:mime text/x-python
 
 # class name[(base classes,)]: [pass]
-0      regex   \^class\ [_[:alpha:]]+(\\(.*\\))?(\ )*:([\ \t]+pass)?$          Python script text executable
+0      search/8192     class
+>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
+0      search/8192     def\ 
+>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
index f9106a2..83aa124 100644 (file)
@@ -1,9 +1,9 @@
 
 #------------------------------------------------------------------------------
-# $File: qt,v 1.1 2014/12/12 16:48:39 christos Exp $
+# $File: qt,v 1.3 2019/04/19 00:42:27 christos Exp $
 # qt:  file(1) magic for Qt
 
-# http://doc.qt.io/qt-5/resources.html
+# https://doc.qt.io/qt-5/resources.html
 0      string          \<!DOCTYPE\040RCC\>     Qt Resource Collection file
 
 # https://qt.gitorious.org/qt/qtbase/source/\
index 4ae4f75..824220a 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: revision,v 1.10 2017/10/19 16:40:37 christos Exp $
+# $File: revision,v 1.11 2019/04/19 00:42:27 christos Exp $
 # file(1) magic for revision control files
 # From Hendrik Scholz <hendrik@scholz.net>
 0      string/t        /1\ :pserver:   cvs password text file
@@ -60,7 +60,7 @@
 >28    string  >\0                             (version: %s)
 
 # Type:        Bazaar revision bundles and merge requests
-# URL: http://www.bazaar-vcs.org/
+# URL: https://www.bazaar-vcs.org/
 # From:        Jelmer Vernooij <jelmer@samba.org>
 0      string  #\ Bazaar\ revision\ bundle\ v Bazaar Bundle
 0      string  #\ Bazaar\ merge\ directive\ format Bazaar merge directive
index e11c553..33d439a 100644 (file)
@@ -1,10 +1,10 @@
 
 #------------------------------------------------------------------------------
-# $File: riff,v 1.33 2017/10/06 01:11:24 christos Exp $
+# $File: riff,v 1.34 2019/04/19 00:42:27 christos Exp $
 # riff:  file(1) magic for RIFF format
 # See
 #
-#      http://www.seanet.com/users/matts/riffmci/riffmci.htm
+#      https://www.seanet.com/users/matts/riffmci/riffmci.htm
 #      http://www-mmsp.ece.mcgill.ca/Documents/AudioFormats/WAVE/Docs/riffmci.pdf
 #
 
@@ -73,7 +73,7 @@
 # RIFF Palette format
 # Update: Joerg Jenderek
 # URL: https://en.wikipedia.org/wiki/Resource_Interchange_File_Format
-# Reference: http://worms2d.info/Palette_file
+# Reference: https://worms2d.info/Palette_file
 >8     string          PAL\            \b, palette
 !:mime application/x-riff
 # color palette by Microsoft Corporation
 # MPEG-1 wrapped in a RIFF, apparently
 >8      string          CDXA            \b, wrapped MPEG-1 (CDXA)
 >8     string          4XMV            \b, 4X Movie file
-# AMV-type AVI file: http://wiki.multimedia.cx/index.php?title=AMV
+# AMV-type AVI file: https://wiki.multimedia.cx/index.php?title=AMV
 >8     string          AMV\040         \b, AMV
 >8      string          WEBP            \b, Web/P image
 !:mime image/webp
 
 #------------------------------------------------------------------------------
 # MBWF/RF64
-# see EBU TECH 3306 http://tech.ebu.ch/docs/tech/tech3306-2009.pdf
+# see EBU TECH 3306 https://tech.ebu.ch/docs/tech/tech3306-2009.pdf
 0      string  RF64\xff\xff\xff\xffWAVEds64            MBWF/RF64 audio
 !:mime audio/x-wav
 >40    search/256      fmt\x20         \b
diff --git a/magic/Magdir/rpmsg b/magic/Magdir/rpmsg
new file mode 100644 (file)
index 0000000..cbbbb2b
--- /dev/null
@@ -0,0 +1,7 @@
+
+#------------------------------------------------------------------------------
+# $File: rpmsg,v 1.1 2019/04/19 00:40:47 christos Exp $
+# rpmsg: file(1) magic for restricted-permission messages (or "rights-protected" messages)
+# see https://en.wikipedia.org/wiki/Rpmsg
+
+0      string  \x76\xe8\x04\x60\xc4\x11\xe3\x86        rpmsg Restricted Permission Message
index 45a253c..87af47d 100644 (file)
@@ -1,8 +1,8 @@
 
 #------------------------------------------------------------------------------
-# $File: ruby,v 1.7 2017/08/14 13:39:18 christos Exp $
+# $File: ruby,v 1.9 2019/04/19 00:42:27 christos Exp $
 # ruby:  file(1) magic for Ruby scripting language
-# URL:  http://www.ruby-lang.org/
+# URL:  https://www.ruby-lang.org/
 # From: Reuben Thomas <rrt@sc3d.org>
 
 # Ruby scripts
 # What looks like ruby, but does not have a shebang
 # (modules and such)
 # From: Lubomir Rintel <lkundrak@v3.sk>
-0      regex           \^[[:space:]]*require[[:space:]]'[A-Za-z_/]+'
->0     regex           def\ [a-z]|\ do$
->>&0   regex           \^[[:space:]]*end([[:space:]]+[;#].*)?$         Ruby script text
+0      search/8192     require
+>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           \^[[:space:]]*(class|module)[[:space:]][A-Z]
 # 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
+0      search/8192     def\ 
+>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
+0      search/8192     require
+>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
+0      search/8192     include
+>0 regex       \^[[:space:]]*include\ ([A-Z]+[a-z]*(::))+      Ruby script text
 !:mime text/x-ruby
index 2e0cf49..0e78712 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: scientific,v 1.12 2017/03/17 22:20:22 christos Exp $
+# $File: scientific,v 1.13 2019/04/19 00:42:27 christos Exp $
 # scientific:  file(1) magic for scientific formats
 #
 # From: Joe Krahn <krahn@niehs.nih.gov>
@@ -75,8 +75,8 @@
 # PDB: Protein Data Bank files
 # Adam Buchbinder <adam.buchbinder@gmail.com>
 #
-# http://www.wwpdb.org/documentation/format32/sect2.html
-# http://www.ch.ic.ac.uk/chemime/
+# https://www.wwpdb.org/documentation/format32/sect2.html
+# https://www.ch.ic.ac.uk/chemime/
 #
 # The PDB file format is fixed-field, 80 columns. From the spec:
 #
index 5f22946..89d5f53 100644 (file)
@@ -1,6 +1,6 @@
 # Type:        SE Linux policy modules *.pp reference policy
 #      for Fedora 5 to 9, RHEL5, and Debian Etch and Lenny.
-# URL: http://doc.coker.com.au/computers/selinux-magic
+# URL: https://doc.coker.com.au/computers/selinux-magic
 # From:        Russell Coker <russell@coker.com.au>
 
 0              lelong  0xf97cff8f      SE Linux modular policy
index 840859c..54028fd 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: sendmail,v 1.10 2017/08/13 00:21:47 christos Exp $
+# $File: sendmail,v 1.11 2019/04/19 00:42:27 christos Exp $
 # sendmail:  file(1) magic for sendmail config files
 #
 # XXX - byte order?
@@ -12,7 +12,7 @@
 # Email_23_f217153422.ts Sendmail frozen configuration
 # - version \330jK\354
 0      byte    046
-# http://www.sendmail.com/sm/open_source/docs/older_release_notes/
+# https://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 similar to output of commands
index 780d77e..da38de6 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: sequent,v 1.13 2017/03/17 21:35:28 christos Exp $
+# $File: sequent,v 1.14 2019/04/19 00:42:27 christos Exp $
 # sequent:  file(1) magic for Sequent machines
 #
 # Sequent information updated by Don Dwiggins <atsun!dwiggins>.
@@ -30,7 +30,7 @@
 0      leshort 0x32eb          SYMMETRY i386 executable (invalid @ 0)
 >16    lelong  >0              not stripped
 >124   lelong  >0              version %d
-# http://en.wikipedia.org/wiki/Sequent_Computer_Systems
+# https://en.wikipedia.org/wiki/Sequent_Computer_Systems
 # below test line conflicts with MS-DOS 2.11 floppies and Acronis loader
 #0     leshort 0x42eb          SYMMETRY i386 standalone executable
 0      leshort 0x42eb
index 4aa6aea..987fe10 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: sgml,v 1.38 2017/10/11 11:40:43 christos Exp $
+# $File: sgml,v 1.39 2019/04/19 00:42:27 christos Exp $
 # Type:        SVG Vectorial Graphics
 # From:        Noel Torres <tecnico@ejerciciosresueltos.com>
 0      string          \<?xml\ version=
@@ -19,7 +19,7 @@
 !:mime application/xml-sitemap
 
 # OpenStreetMap XML (.osm)
-# http://wiki.openstreetmap.org/wiki/OSM_XML
+# https://wiki.openstreetmap.org/wiki/OSM_XML
 # From: Markus Heidelberg <markus.heidelberg@web.de>
 0      string          \<?xml\ version=
 >14    regex           ['"\ \t]*[0-9.]+['"\ \t]*
index 8cee245..14a23ab 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: sniffer,v 1.21 2019/02/09 17:52:18 christos Exp $
+# $File: sniffer,v 1.25 2019/05/05 17:03:41 christos Exp $
 # sniffer:  file(1) magic for packet capture files
 #
 # From: guy@alum.mit.edu (Guy Harris)
@@ -85,6 +85,8 @@
 0      name            pcap-be
 >4     beshort         x               - version %d
 >6     beshort         x               \b.%d
+# clear that continuation level match
+>20    clear           x
 >20    belong          0               (No link-layer encapsulation
 >20    belong          1               (Ethernet
 >20    belong          2               (3Mb Ethernet
 >20    belong          108             (OpenBSD loopback
 >20    belong          109             (OpenBSD IPsec encrypted
 >20    belong          112             (Cisco HDLC
->20    belong          113             (Linux "cooked"
+>20    belong          113             (Linux cooked v1
 >20    belong          114             (LocalTalk
 >20    belong          117             (OpenBSD PFLOG
 >20    belong          119             (802.11 with Prism header
 >20    belong          123             (SunATM
 >20    belong          127             (802.11 with radiotap header
 >20    belong          129             (Linux ARCNET
+>20    belong          130             (Juniper Multi-Link PPP
+>20    belong          131             (Juniper Multi-Link Frame Relay
+>20    belong          132             (Juniper Encryption Services PIC
+>20    belong          133             (Juniper GGSN PIC
+>20    belong          134             (Juniper FRF.16 Frame Relay
+>20    belong          135             (Juniper ATM2 PIC
+>20    belong          136             (Juniper Advanced Services PIC
+>20    belong          137             (Juniper ATM1 PIC
 >20    belong          138             (Apple IP over IEEE 1394
->20    belong          139             (MTP2 with pseudo-header
->20    belong          140             (MTP2
->20    belong          141             (MTP3
->20    belong          142             (SCCP
+>20    belong          139             (SS7 MTP2 with pseudo-header
+>20    belong          140             (SS7 MTP2
+>20    belong          141             (SS7 MTP3
+>20    belong          142             (SS7 SCCP
 >20    belong          143             (DOCSIS
->20    belong          144             (IrDA
+>20    belong          144             (Linux IrDA
 >20    belong          147             (Private use 0
 >20    belong          148             (Private use 1
 >20    belong          149             (Private use 2
 >20    belong          161             (Private use 14
 >20    belong          162             (Private use 15
 >20    belong          163             (802.11 with AVS header
+>20    belong          164             (Juniper Passive Monitor PIC
 >20    belong          165             (BACnet MS/TP
 >20    belong          166             (PPPD
+>20    belong          167             (Juniper PPPoE
+>20    belong          168             (Juniper PPPoE/ATM
 >20    belong          169             (GPRS LLC
+>20    belong          170             (GPF-T
+>20    belong          171             (GPF-F
+>20    belong          174             (Juniper PIC Peer
+>20    belong          175             (Ethernet with Endace ERF header
+>20    belong          176             (Packet-over-SONET with Endace ERF header
 >20    belong          177             (Linux LAPD
+>20    belong          178             (Juniper Ethernet
+>20    belong          179             (Juniper PPP
+>20    belong          180             (Juniper Frame Relay
+>20    belong          181             (Juniper C-HDLC
+>20    belong          182             (FRF.16 Frame Relay
+>20    belong          183             (Juniper Voice PIC
+>20    belong          184             (Arinc 429
+>20    belong          185             (Arinc 653 Interpartition Communication
+>20    belong          186             (USB with FreeBSD header
 >20    belong          187             (Bluetooth HCI H4
+>20    belong          188             (802.16 MAC Common Part Sublayer
 >20    belong          189             (Linux USB
+>20    belong          190             (Controller Area Network (CAN) v. 2.0B
+>20    belong          191             (802.15.4 with Linux padding
 >20    belong          192             (PPI
->20    belong          195             (802.15.4
+>20    belong          193             (802.16 MAC Common Part Sublayer plus radiotap header
+>20    belong          194             (Juniper Integrated Service Module
+>20    belong          195             (802.15.4 with FCS
 >20    belong          196             (SITA
 >20    belong          197             (Endace ERF
+>20    belong          198             (Ethernet with u10 Networks pseudo-header
+>20    belong          199             (IPMB
+>20    belong          200             (Juniper Secure Tunnel
 >20    belong          201             (Bluetooth HCI H4 with pseudo-header
 >20    belong          202             (AX.25 with KISS header
 >20    belong          203             (LAPD
 >20    belong          206             (Frame Relay with direction pseudo-header
 >20    belong          209             (Linux IPMB
 >20    belong          215             (802.15.4 with non-ASK PHY header
+>20    belong          216             (Linux evdev events
+>20    belong          219             (MPLS with label as link-layer header
 >20    belong          220             (Memory-mapped Linux USB
+>20    belong          221             (DECT
+>20    belong          222             (AOS Space Data Link protocol
+>20    belong          223             (Wireless HART
 >20    belong          224             (Fibre Channel FC-2
 >20    belong          225             (Fibre Channel FC-2 with frame delimiters
 >20    belong          226             (Solaris IPNET
 >20    belong          229             (Raw IPv6
 >20    belong          230             (802.15.4 without FCS
 >20    belong          231             (D-Bus messages
+>20    belong          232             (Juniper Virtual Server
+>20    belong          233             (Juniper SRX E2E
+>20    belong          234             (Juniper Fibre Channel
 >20    belong          235             (DVB-CI
 >20    belong          236             (MUX27010
 >20    belong          237             (STANAG 5066 D_PDUs
->20    belong          239             (Linux netlink NFLOG messages
+>20    belong          238             (Juniper ATM CEMIC
+>20    belong          239             (Linux netfilter log messages
 >20    belong          240             (Hilscher netAnalyzer
 >20    belong          241             (Hilscher netAnalyzer with delimiters
 >20    belong          242             (IP-over-Infiniband
 >20    belong          243             (MPEG-2 Transport Stream packets
 >20    belong          244             (ng4t ng40
 >20    belong          245             (NFC LLCP
->20    belong          247             (Infiniband
+>20    belong          246             (Packet filter state syncing
+>20    belong          247             (InfiniBand
 >20    belong          248             (SCTP
->16    belong          x               \b, capture length %d)
+>20    belong          249             (USB with USBPcap header
+>20    belong          250             (Schweitzer Engineering Laboratories RTAC packets
+>20    belong          251             (Bluetooth Low Energy air interface
+>20    belong          252             (Wireshark Upper PDU export
+>20    belong          253             (Linux netlink
+>20    belong          254             (Bluetooth Linux Monitor
+>20    belong          255             (Bluetooth Basic Rate/Enhanced Data Rate baseband packets
+>20    belong          256             (Bluetooth Low Energy air interface with pseudo-header
+>20    belong          257             (PROFIBUS data link layer
+>20    belong          258             (Apple DLT_PKTAP
+>20    belong          259             (Ethernet with 802.3 Clause 65 EPON preamble
+>20    belong          260             (IPMI trace packets
+>20    belong          261             (Z-Wave RF profile R1 and R2 packets
+>20    belong          262             (Z-Wave RF profile R3 packets
+>20    belong          263             (WattStopper Digital Lighting Mngmt/Legrand Nitoo Open Proto
+>20    belong          264             (ISO 14443 messages
+>20    belong          265             (IEC 62106 Radio Data System groups
+>20    belong          266             (USB with Darwin header
+>20    belong          267             (OpenBSD DLT_OPENFLOW
+>20    belong          268             (IBM SDLC frames
+>20    belong          269             (TI LLN sniffer frames
+>20    belong          271             (Linux vsock
+>20    belong          272             (Nordic Semiconductor Bluetooth LE sniffer frames
+>20    belong          273             (Excentis XRA-31 DOCSIS 3.1 RF sniffer frames
+>20    belong          274             (802.3br mPackets
+>20    belong          275             (DisplayPort AUX channel monitoring data
+>20    belong          276             (Linux cooked v2
+>20    belong          278             (OpenVizsla USB
+>20    belong          279             (Elektrobit High Speed Capture and Replay (EBHSCR)
+>20    belong          281             (Broadcom tag
+>20    belong          282             (Broadcom tag (prepended)
+# print default match
+>20    default         x
+>>20   belong          x               (linktype#%u
+>16    belong          x               \b, capture length %u)
 
 # packets time stamps in seconds and microseconds.
 0      ubelong         0xa1b2c3d4      pcap capture file, microseconds ts (big-endian)
index acc4529..28d89e6 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: sql,v 1.21 2017/03/17 21:35:28 christos Exp $
+# $File: sql,v 1.22 2019/04/19 00:42:27 christos Exp $
 # sql:  file(1) magic for SQL files
 #
 # From: "Marty Leisner" <mleisner@eng.mc.xerox.com>
 
 
 # SQLite Write-Ahead Log from SQLite version >= 3.7.0
-# http://www.sqlite.org/fileformat.html#walformat
+# https://www.sqlite.org/fileformat.html#walformat
 0      belong&0xfffffffe       0x377f0682      SQLite Write-Ahead Log,
 !:ext sqlite-wal/db-wal
 >4     belong  x       version %d
 
 # SQLite Rollback Journal
-# http://www.sqlite.org/fileformat.html#rollbackjournal
+# https://www.sqlite.org/fileformat.html#rollbackjournal
 0      string  \xd9\xd5\x05\xf9\x20\xa1\x63\xd7        SQLite Rollback Journal
 
 # Panasonic channel list database svl.bin or svl.db added by Joerg Jenderek
 #!:mime        application/x-panasonic-sqlite3
 >>&-15 indirect        x                       \b; contains
 
-# H2 Database from http://www.h2database.com/
+# H2 Database from https://www.h2database.com/
 0      string          --\ H2\ 0.5/B\ --\ \n   H2 Database file
index 1a0935c..df83834 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: sun,v 1.26 2014/03/29 15:40:34 christos Exp $
+# $File: sun,v 1.28 2019/04/19 00:42:27 christos Exp $
 # sun:  file(1) magic for Sun machines
 #
 # Values for big-endian Sun (MC680x0, SPARC) binaries on pre-5.x
@@ -93,7 +93,7 @@
 0      string          #SUNPC_CONFIG   SunPC 4.0 Properties Values
 # Sun snoop (see RFC 1761, which describes the capture file format,
 # RFC 3827, which describes some additional datalink types, and
-# http://www.iana.org/assignments/snoop-datalink-types/snoop-datalink-types.xml,
+# https://www.iana.org/assignments/snoop-datalink-types/snoop-datalink-types.xml,
 # which is the IANA registry of Snoop datalink types)
 #
 0      string          snoop           Snoop capture file
index fc9cbf4..967ac0c 100644 (file)
@@ -1,11 +1,11 @@
 
 #------------------------------------------------------------------------
-# $File: sysex,v 1.9 2017/03/17 21:35:28 christos Exp $
+# $File: sysex,v 1.10 2019/04/19 00:42:27 christos Exp $
 # sysex: file(1) magic for MIDI sysex files
 #
 # GRR: original 1 byte test at offset was too general as it catches also many FATs of DOS filesystems
 # where real SYStem EXclusive messages at offset 1 are limited to seven bits
-# http://en.wikipedia.org/wiki/MIDI
+# https://en.wikipedia.org/wiki/MIDI
 0      ubeshort&0xFF80         0xF000          SysEx File -
 
 # North American Group
 >1     byte                    0x52            Zoom
 >1     byte                    0x54            Matsushita
 >1     byte                    0x57            Acoustic tech. lab.
-# http://www.midi.org/techspecs/manid.php
+# https://www.midi.org/techspecs/manid.php
 >1     belong&0xffffff00       0x00007400      Ta Horng
 >1     belong&0xffffff00       0x00007500      e-Tek
 >1     belong&0xffffff00       0x00007600      E-Voice
index 515fa8d..edc3ec4 100644 (file)
@@ -1,6 +1,6 @@
 #------------------------------------------------------------------------------
 # file:  file(1) magic for Tcl scripting language
-# URL:  http://www.tcl.tk/
+# URL:  https://www.tcl.tk/
 # From: gustaf neumann
 
 # Tcl scripts
index c0c4ee2..fc3bf74 100644 (file)
@@ -1,10 +1,10 @@
 
 #------------------------------------------------------------------------------
-# $File: terminfo,v 1.10 2018/01/21 03:26:33 christos Exp $
+# $File: terminfo,v 1.11 2019/04/19 00:42:27 christos Exp $
 # terminfo:  file(1) magic for terminfo
 #
-# URL: http://invisible-island.net/ncurses/man/term.5.html
-# URL: http://invisible-island.net/ncurses/man/scr_dump.5.html
+# URL: https://invisible-island.net/ncurses/man/term.5.html
+# URL: https://invisible-island.net/ncurses/man/scr_dump.5.html
 #
 # Workaround for Targa image type by Joerg Jenderek
 # GRR: line below too general as it catches also
index 68e029d..aaeae16 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: tex,v 1.19 2013/09/17 17:39:16 christos Exp $
+# $File: tex,v 1.21 2019/04/19 00:42:27 christos Exp $
 # tex:  file(1) magic for TeX files
 #
 # XXX - needs byte-endian stuff (big-endian and little-endian DVI?)
 0      string          #LyX            LyX document text
 
 # ConTeXt documents
-#      http://wiki.contextgarden.net/
+#      https://wiki.contextgarden.net/
 0      search/4096     \\setupcolors[          ConTeXt document text
 !:strength + 15
 0      search/4096     \\definecolor[          ConTeXt document text
index 8044ef4..6ba6822 100644 (file)
@@ -1,10 +1,10 @@
 
 #------------------------------------------------------------------------------
-# $File: tplink,v 1.3 2018/12/21 17:37:33 christos Exp $
+# $File: tplink,v 1.4 2019/04/19 00:42:27 christos Exp $
 # tplink: File magic for openwrt firmware files
 
 # URL: https://wiki.openwrt.org/doc/techref/header
-# Reference: http://git.openwrt.org/?p=openwrt.git;a=blob;f=tools/firmware-utils/src/mktplinkfw.c
+# Reference: https://git.openwrt.org/?p=openwrt.git;a=blob;f=tools/firmware-utils/src/mktplinkfw.c
 # From: Joerg Jenderek
 # check for valid header version 1 or 2
 0              ulelong         <3
index 60635f8..11e6eb5 100644 (file)
@@ -1,5 +1,5 @@
 #------------------------------------------------------------------------------
-# $File: varied.script,v 1.10 2014/03/01 22:32:39 christos Exp $
+# $File: varied.script,v 1.12 2019/04/19 00:42:27 christos Exp $
 # varied.script:  file(1) magic for various interpreter scripts
 
 0      string/t                #!\ /                   a
@@ -45,7 +45,7 @@
 
 # From: arno <arenevier@fdn.fr>
 # mozilla xpconnect typelib
-# see http://www.mozilla.org/scriptable/typelib_file.html
+# see https://www.mozilla.org/scriptable/typelib_file.html
 0      string          XPCOM\nTypeLib\r\n\032          XPConnect Typelib
 >0x10  byte        x       version %d
 >>0x11 byte        x      \b.%d
index 81d6035..347895a 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: virtual,v 1.9 2018/12/15 18:56:07 christos Exp $
+# $File: virtual,v 1.10 2019/04/19 00:42:27 christos Exp $
 # From: James Nobis <quel@quelrod.net>
 # Microsoft hard disk images for:
 # Virtual Server
 >>0x40000      ulelong         !0x69676572     \b, 2nd region INVALID
 # check in vhdx images for known id and show names instead hexadecimal
 0      name            vhdx-id
-# http://www.windowstricks.in/online-windows-guid-converter
+# https://www.windowstricks.in/online-windows-guid-converter
 # 2DC27766-F623-4200-9D64-115E9BFD4A08         BAT GUID
 # 6677C22D23F600429D64115E9BFD4A08             BAT ID
 >0     ubequad         =0x6677C22D23F60042
 #>0    string/b        x       , Magic: %s
 
 # There are currently 2 Versions: "1" and "2".
-# http://www.gnome.org/~markmc/qcow-image-format-version-1.html
+# https://www.gnome.org/~markmc/qcow-image-format-version-1.html
 >4     belong          !1      QEMU QCOW2 Image
 >4     belong          1       QEMU QCOW Image (v1)
 
 # 1 for AES encryption, 0 for none.
 >>36   belong  1       \b, AES-encrypted
 
-# http://www.gnome.org/~markmc/qcow-image-format.html
+# https://www.gnome.org/~markmc/qcow-image-format.html
 >4     belong  2       (v2)
 # Using the existence of the Backing File Offset to determine whether
 # to read Backing File Information
 0      string/b        QEVM            QEMU suspend to disk image
 
 # QEMU QED Image
-# http://wiki.qemu.org/Features/QED/Specification
+# https://wiki.qemu.org/Features/QED/Specification
 0      string/b        QED\0           QEMU QED Image
 
 # VDI Image
index 9bce3da..5942867 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: warc,v 1.2 2009/09/19 16:28:13 christos Exp $
+# $File: warc,v 1.4 2019/04/19 00:42:27 christos Exp $
 # warc:  file(1) magic for WARC files
 
 0      string  WARC/   WARC Archive
@@ -9,7 +9,7 @@
 
 #------------------------------------------------------------------------------
 # Arc File Format from Internet Archive
-# see http://www.archive.org/web/researcher/ArcFileFormat.php
+# see https://www.archive.org/web/researcher/ArcFileFormat.php
 0      string          filedesc://     Internet Archive File
 !:mime application/x-ia-arc
 >11    search/256      \x0A    \b
index 8a4ce1b..3b1d37e 100644 (file)
@@ -1,12 +1,12 @@
 #------------------------------------------------------------------------------
-# $File: webassembly,v 1.2 2017/05/02 14:05:29 christos Exp $
+# $File: webassembly,v 1.3 2019/04/19 00:42:27 christos Exp $
 # webassembly:  file(1) magic for WebAssembly modules
 #
 # WebAssembly is a virtual architecture developed by a W3C Community
-# Group at http://webassembly.org/. The file extension is .wasm, and
+# Group at https://webassembly.org/. The file extension is .wasm, and
 # the MIME type is application/wasm.
 #
-# http://webassembly.org/docs/binary-encoding/ is the main
+# https://webassembly.org/docs/binary-encoding/ is the main
 # document describing the binary format.
 # From: Pip Cet <pipcet@gmail.com> and Joel Martin
 
index f36fc9b..39ed3e2 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: windows,v 1.23 2019/01/11 21:00:26 christos Exp $
+# $File: windows,v 1.26 2019/05/01 17:55:25 christos Exp $
 # windows:  file(1) magic for Microsoft Windows
 #
 # This file is mainly reserved for files where programs
@@ -26,8 +26,8 @@
 
 # Summary: Windows crash dump
 # Extension: .dmp
-# Created by: Andreas Schuster (http://computer.forensikblog.de/)
-# Reference (1): http://computer.forensikblog.de/en/2008/02/64bit_magic.html
+# Created by: Andreas Schuster (https://computer.forensikblog.de/)
+# Reference (1): https://computer.forensikblog.de/en/2008/02/64bit_magic.html
 # Modified by (1): Abel Cheung (Avoid match with first 4 bytes only)
 0      string          PAGE
 >4     string          DUMP            MS Windows 32bit crash dump
@@ -46,8 +46,8 @@
 
 # Summary: Vista Event Log
 # Extension: .evtx
-# Created by: Andreas Schuster (http://computer.forensikblog.de/)
-# Reference (1): http://computer.forensikblog.de/en/2007/05/some_magic.html
+# Created by: Andreas Schuster (https://computer.forensikblog.de/)
+# Reference (1): https://computer.forensikblog.de/en/2007/05/some_magic.html
 0      string          ElfFile\0       MS Windows Vista Event Log
 >0x2a  leshort         x               \b, %d chunks
 >>0x10 lelong          x               \b (no. %d in use)
 >0x78  lelong          &1              \b, DIRTY
 >0x78  lelong          &2              \b, FULL
 
+# Summary: Windows System Deployment Image
+# Created by: Joerg Jenderek
+# URL: http://en.wikipedia.org/wiki/System_Deployment_Image
+# Reference: http://skolk.livejournal.com/1320.html
+0      string                  $SDI
+>4     string                  0001            System Deployment Image
+!:mime application/x-ms-sdi
+#!:mime        application/octet-stream
+# \Boot\boot.sdi
+!:ext  sdi
+# MDBtype: 0~Unspecified 1~RAM 2~ROM
+>>8    ulequad                 !0              \b, MDBtype 0x%llx
+# BootCodeOffset
+>>16   ulequad                 !0              \b, BootCodeOffset 0x%llx
+# BootCodeSize
+>>24   ulequad                 !0              \b, BootCodeSize 0x%llx
+# VendorID
+>>32   ulequad                 !0              \b, VendorID 0x%llx
+# DeviceID
+>>40   ulequad                 !0              \b, DeviceID 0x%llx
+# DeviceModel
+>>48   ulequad                 !0              \b, DeviceModel 0x%llx
+>>>56  ulequad                 !0              \b%llx
+# DeviceRole
+>>64   ulequad                 !0              \b, DeviceRole 0x%llx
+# Reserved1; reserved fields and gaps between BLOBs are padded with \0
+#>>72  ulequad                 !0              \b, Reserved1 0x%llx
+# RuntimeGUID
+>>80   ulequad                 !0              \b, RuntimeGUID 0x%llx
+>>>88  ulequad                 !0              \b%llx
+# RuntimeOEMrev
+>>96   ulequad                 !0              \b, RuntimeOEMrev 0x%llx
+# Reserved2
+#>>104 ulequad                 !0              \b, Reserved2 0x%llx
+# BLOB alignment value in pages, as specified in sdimgr /pack: 1~4K 2~8k
+>>112  ulequad                 !0              \b, PageAlignment %llu
+# Reserved3[48]
+#>>120 ulequad                 !0              \b, Reserved3 0x%llx
+# SDI checksum 39h
+>>0x1f8        ulequad                 x               \b, checksum 0x%llx
+# BLOBtype[8] \0-padded: PART, WIM , BOOT, LOAD, DISK
+>>0x400        string                  >\0             \b, type %-3.8s
+# 0~non-filesystem 7~NTFS 6~BIGFAT
+>>>0x420       ulequad         !0              (0x%llx)
+# ATTRibutes
+>>>0x408       ulequad         !0              0x%llx attributes
+# Offset
+>>>0x410       ulequad         x               at 0x%llx
+# print 1 space after size and then handles NTFS boot sector by ./filesystems
+>>>0x418       ulequad         >0              %llu bytes 
+>>>>(0x410.l)  indirect        x
+# 2nd BLOB: WIM
+>>0x440                string          >\0             \b, type %-3.8s
+>>>0x428       ulequad         !0              (0x%llx)
+# ATTRibutes
+>>>0x448       ulequad         !0              0x%llx attributes
+# Offset
+>>>0x450       ulequad         x               at 0x%llx
+>>>0x458       ulequad         >0              %llu bytes 
+>>>>(0x450.l)  indirect        x
+# 3rd BLOB
+>>0x480                string          >\0             \b, type %-3.8s
+
 # Summary:     Windows Error Report text files
 # URL:         https://en.wikipedia.org/wiki/Windows_Error_Reporting
 # Reference:   https://www.nirsoft.net/utils/app_crash_view.html
 
 # Summary: Old format help files
 # URL: https://en.wikipedia.org/wiki/WinHelp
-# Reference: http://www.oocities.org/mwinterhoff/helpfile.htm
+# Reference: https://www.oocities.org/mwinterhoff/helpfile.htm
 # Update: Joerg Jenderek
 # Created by: Dirk Jagdmann <doj@cubic.org>
 #
 0      string          HyperTerminal\040
 >15    string          1.0\ --\ HyperTerminal\ data\ file      MS Windows HyperTerminal profile
 
-# http://ithreats.files.wordpress.com/2009/05/\040
+# https://ithreats.files.wordpress.com/2009/05/\040
 # lnk_the_windows_shortcut_file_format.pdf
 # Summary: Windows shortcut
 # Extension: .lnk
 0      name            ini-file
 # look for left bracket in section line
 >0     search/8192     [
-# http://en.wikipedia.org/wiki/Autorun.inf
-# http://msdn.microsoft.com/en-us/library/windows/desktop/cc144200.aspx
+# https://en.wikipedia.org/wiki/Autorun.inf
+# https://msdn.microsoft.com/en-us/library/windows/desktop/cc144200.aspx
 # space after right bracket
 # or AutoRun.Amd64 for 64 bit systems
 # or only NL separator
 >>>&0  string          !]\r\n[                                 Microsoft Windows Autorun file
 !:mime application/x-setupscript
 !:ext  inf
-# http://msdn.microsoft.com/en-us/library/windows/hardware/ff549520(v=vs.85).aspx
+# https://msdn.microsoft.com/en-us/library/windows/hardware/ff549520(v=vs.85).aspx
 # version strings ASCII coded case-independent for Windows setup information script file
 >>&0   regex/c         \^(version|strings)]                            Windows setup INFormation
 !:mime application/x-setupscript
 !:mime application/x-setupscript
 !:ext  inf
 # http://www.winfaq.de/faq_html/Content/tip2500/onlinefaq.php?h=tip2653.htm
-# http://msdn.microsoft.com/en-us/library/windows/desktop/cc144102.aspx
+# https://msdn.microsoft.com/en-us/library/windows/desktop/cc144102.aspx
 # .ShellClassInfo DeleteOnCopy LocalizedFileNames ASCII coded case-independent
 >>&0   regex/c \^(\.ShellClassInfo|DeleteOnCopy|LocalizedFileNames)]   Windows desktop.ini
 !:mime application/x-wine-extension-ini
 #!:mime text/plain
-# http://support.microsoft.com/kb/84709/
+# https://support.microsoft.com/kb/84709/
 >>&0   regex/c         \^(don't\ load)]                                Windows CONTROL.INI
 !:mime application/x-wine-extension-ini
 !:ext  ini
 >>&0   regex/c         \^(ndishlp\\$|protman\\$|NETBEUI\\$)]           Windows PROTOCOL.INI
 !:mime application/x-wine-extension-ini
 !:ext  ini
-# http://technet.microsoft.com/en-us/library/cc722567.aspx
+# https://technet.microsoft.com/en-us/library/cc722567.aspx
 # http://www.winfaq.de/faq_html/Content/tip0000/onlinefaq.php?h=tip0137.htm
 >>&0   regex/c         \^(windows|Compatibility|embedding)]            Windows WIN.INI
 !:mime application/x-wine-extension-ini
 !:ext  ini
-# http://en.wikipedia.org/wiki/SYSTEM.INI
+# https://en.wikipedia.org/wiki/SYSTEM.INI
 >>&0   regex/c         \^(boot|386enh|drivers)]                        Windows SYSTEM.INI
 !:mime application/x-wine-extension-ini
 !:ext  ini
 >>&0   regex/c         \^(SafeList)]                                   Windows IOS.INI
 !:mime application/x-wine-extension-ini
 !:ext  ini
-# http://en.wikipedia.org/wiki/NTLDR   Windows Boot Loader information
+# https://en.wikipedia.org/wiki/NTLDR  Windows Boot Loader information
 >>&0   regex/c         \^(boot\x20loader)]                             Windows boot.ini
 !:mime application/x-wine-extension-ini
 !:ext  ini
-# http://en.wikipedia.org/wiki/CONFIG.SYS
+# https://en.wikipedia.org/wiki/CONFIG.SYS
 >>&0   regex/c         \^(menu)]                                       MS-DOS CONFIG.SYS
 # @CONFIG.UI configuration file of previous DOS version saved by Caldera OPENDOS INSTALL.EXE
 # CONFIG.PSS saved version of file CONFIG.SYS created by %WINDIR%\SYTEM\MSCONFIG.EXE
 # CONFIG.TSH renamed file CONFIG.SYS.BAT by %WINDIR%\SYTEM\MSCONFIG.EXE
 # dos and w40 used in dual booting scene
 !:ext  sys/dos/w40
-# http://support.microsoft.com/kb/118579/
+# https://support.microsoft.com/kb/118579/
 >>&0   regex/c         \^(Paths)]\r\n                                  MS-DOS MSDOS.SYS
 !:ext  sys/dos
 # http://chmspec.nongnu.org/latest/INI.html#HHP
 >>>>&0 string/c                        version                         Windows setup INFormation
 !:mime application/x-setupscript
 !:ext  inf
-# http://en.wikipedia.org/wiki/Initialization_file     Windows Initialization File or other
+# https://en.wikipedia.org/wiki/Initialization_file    Windows Initialization File or other
 >>>>&0 default                         x
 >>>>>&0        ubyte                           x
 # characters, digits, underscore and white space followed by right bracket
 # Summary: backup file created with utility like NTBACKUP.EXE shipped with Windows NT/2K/XP/2003
 # Extension: .bkf
 # Created by: Joerg Jenderek
-# URL: http://en.wikipedia.org/wiki/NTBackup
+# URL: https://en.wikipedia.org/wiki/NTBackup
 # Reference: http://laytongraphics.com/mtf/MTF_100a.PDF
 # Descriptor BloCK name of Microsoft Tape Format
 0      string                  TAPE
 #
 
 # URL: https://en.wikipedia.org/wiki/PaintShop_Pro
-# Reference: http://www.cryer.co.uk/file-types/p/pal.htm
+# Reference: https://www.cryer.co.uk/file-types/p/pal.htm
 # Created by: Joerg Jenderek
 # Note: there exist other color palette formats also with .pal extension
 0      string  JASC-PAL\r\n    PaintShop Pro color palette
 # third line contains the number of colours: 16 256 ...
 >16    string  x               \b, %.3s colors
 
-# URL: http://en.wikipedia.org/wiki/Innosetup
+# URL: https://en.wikipedia.org/wiki/Innosetup
 # Reference: https://github.com/jrsoftware/issrc/blob/master/Projects/Undo.pas
 # Created by: Joerg Jenderek
 # Note:        created by like "InnoSetup self-extracting archive" inside ./msdos
 # directory like C:\Program Files\GIMP 2
 >>>>&0 lestring16      x                               \b, %-.42s
 
+# Windows Imaging (WIM) Image
+# Update: Joerg Jenderek at Mar 2019
+# URL: https://en.wikipedia.org/wiki/Windows_Imaging_Format
+# Reference: https://download.microsoft.com/download/f/e/f/
+# fefdc36e-392d-4678-9e4e-771ffa2692ab/Windows%20Imaging%20File%20Format.rtf
+# Note: verified by like `7z t boot.wim` `wiminfo install.esd --header`
+0      string          MSWIM\000\000\000
+>0     use             wim-archive
+# https://wimlib.net/man1/wimoptimize.html
+0      string          WLPWM\000\000\000
+>0     use             wim-archive
+0      name            wim-archive
+# _WIMHEADER_V1_PACKED ImageTag[8]
+>0     string          x                       Windows imaging
+!:mime application/x-ms-wim
+# TO avoid in file version 5.36 error like
+# Magdir/windows, 760: Warning: Current entry does not yet have a description
+# file: could not find any valid magic files! (No error)
+# splitted WIM
+>16    ulelong         &0x00000008             (SWM
+!:ext  swm
+# usPartNumber; 1, unless the file was split into multiple parts
+>>40   uleshort        x                       \b %u
+# usTotalParts; The total number of WIM file parts in a spanned set
+>>42   uleshort        x                       \b of %u) image
+# non splitted WIM
+>16    ulelong         ^0x00000008
+# https://wimlib.net/man1/wimmount.html
+# solid WIMs; version 3584; usually contain LZMS-compressed and the .esd extension
+>>12   ulelong         3584                    (ESD) image
+!:ext  esd
+>>12   ulelong         !3584                   (WIM) image
+!:ext  wim
+>0     string/b        WLPWM\000\000\000       \b, wimlib pipable format
+# cbSize size of the WIM header in bytes like 208
+#>8    ulelong         x                       \b, headersize %u
+# dwVersion version of the WIM file 00010d00h~1.13 00000e00h~0.14
+>14    uleshort        x                       v%u
+>13    ubyte           x                       \b.%u
+# dwImageCount; The number of images contained in the WIM file
+>44    ulelong         >1                      \b, %u images
+# dwBootIndex
+# 1-based index of the bootable image of the WIM, or 0 if no image is bootable
+>0x78  ulelong         >0                      \b, bootable no. %u
+# dwFlags
+#>16   ulelong         x                       \b, flags 0x%8.8x
+#define FLAG_HEADER_COMPRESSION                0x00000002
+#define FLAG_HEADER_READONLY            0x00000004
+#define FLAG_HEADER_SPANNED            0x00000008
+#define FLAG_HEADER_RESOURCE_ONLY       0x00000010
+#define FLAG_HEADER_METADATA_ONLY       0x00000020
+#define FLAG_HEADER_WRITE_IN_PROGRESS   0x00000040
+#define FLAG_HEADER_RP_FIX             0x00000080 reparse point fixup
+#define FLAG_HEADER_COMPRESS_RESERVED   0x00010000
+#define FLAG_HEADER_COMPRESS_XPRESS     0x00020000
+#define FLAG_HEADER_COMPRESS_LZX       0x00040000
+#define FLAG_HEADER_COMPRESS_LZMS      0x00080000
+#define FLAG_HEADER_COMPRESS_XPRESS2    0x00100000 wimlib-1.13.0\include\wimlib\header.h 
+# XPRESS, with small chunk size
+>16    ulelong         &0x00100000             \b, XPRESS2
+>16    ulelong         &0x00080000             \b, LZMS
+>16    ulelong         &0x00040000             \b, LZX
+>16    ulelong         &0x00020000             \b, XPRESS
+>16    ulelong         &0x00000002             compressed
+>16    ulelong         &0x00000004             \b, read only
+>16    ulelong         &0x00000010             \b, resource only
+>16    ulelong         &0x00000020             \b, metadata only
+>16    ulelong         &0x00000080             \b, reparse point fixup
+#>16   ulelong         &0x00010000             \b, RESERVED
+# dwCompressionSize; Uncompressed chunk size for resources or 0 if uncompressed
+#>20   ulelong         >0                      \b, chunk size %u bytes
+# gWIMGuid
+#>24   ubequad         x                       \b, GUID 0x%16.16llx
+#>>32  ubequad         x                       \b%16.16llx
+# rhOffsetTable; the location of the resource lookup table
+# wim_reshdr_disk[24]= u8 size_in_wim[7] + u8 flags + le64 offset_in_wim + le64 uncompressed_size
+#>48   ubequad         x                       \b, rhOffsetTable 0x%16.16llx
+# rhXmlData; the location of the XML data
+#>0x50 ulelong         x                       \b, at 0x%8.8x
+# NOT WORKING \xff\xfe<\0W\0I\0M\0
+#>(0x50.l)     ubequad x                       \b, xml=%16.16llx
+# rhBootMetadata; the location of the metadata resource
+#>0x60 ubequad         x                       \b, rhBootMetadata 0x%16.16llx
+# rhIntegrity; the location of integrity table used to verify files
+#>0x7c ubequad         x                       \b, rhIntegrity 0x%16.16llx
+# Unused[60]
+#>148  ubequad         !0                      \b,unused 0x%16.16llx
+#
+
index c8cb8d5..4b08c43 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: wordprocessors,v 1.18 2013/06/03 19:07:29 christos Exp $
+# $File: wordprocessors,v 1.20 2019/04/19 00:42:27 christos Exp $
 # wordprocessors:  file(1) magic fo word processors.
 #
 ####### PWP file format used on Smith Corona Personal Word Processors:
 >5      string          >\0             version %s
 0       string          \\1cw           ChiWriter file
 
-# Quark Express from http://www.garykessler.net/library/file_sigs.html
+# Quark Express from https://www.garykessler.net/library/file_sigs.html
 2      string  IIXPR3                  Intel Quark Express Document (English)
 2      string  IIXPRa                  Intel Quark Express Document (Korean)
 2      string  MMXPR3                  Motorola Quark Express Document (English)
index 0edd377..35edafc 100644 (file)
@@ -1,9 +1,9 @@
 
 #------------------------------------------------------------------------------
-# $File: wsdl,v 1.4 2018/10/01 19:12:33 christos Exp $
-# wsdl: PHP WSDL Cache, http://www.php.net/manual/en/book.soap.php
+# $File: wsdl,v 1.5 2019/04/19 00:42:27 christos Exp $
+# wsdl: PHP WSDL Cache, https://www.php.net/manual/en/book.soap.php
 # Cache format extracted from source:
-# http://svn.php.net/viewvc/php/php-src/trunk/ext/soap/php_sdl.c?revision=HEAD&view=markup
+# https://svn.php.net/viewvc/php/php-src/trunk/ext/soap/php_sdl.c?revision=HEAD&view=markup
 # Requires file >= 5.05
 # By Elan Ruusamae <glen@delfi.ee>, Patryk Zawadzki <patrys@pld-linux.org>, 2010-2011
 0              string          wsdl            PHP WSDL cache,
index 85f64c8..7118cad 100644 (file)
@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: xwindows,v 1.10 2017/03/17 21:35:28 christos Exp $
+# $File: xwindows,v 1.11 2019/04/19 00:42:27 christos Exp $
 # xwindows:  file(1) magic for various X/Window system file formats.
 
 # Compiled X Keymap
@@ -27,8 +27,8 @@
 
 # Xcursor data
 # X11 mouse cursor format defined in libXcursor, see
-# http://www.x.org/archive/X11R6.8.1/doc/Xcursor.3.html
-# http://cgit.freedesktop.org/xorg/lib/libXcursor/tree/include/X11/Xcursor/Xcursor.h
+# https://www.x.org/archive/X11R6.8.1/doc/Xcursor.3.html
+# https://cgit.freedesktop.org/xorg/lib/libXcursor/tree/include/X11/Xcursor/Xcursor.h
 0      string          Xcur            Xcursor data
 !:mime image/x-xcursor
 >10    leshort         x               version %d
index 523a2d0..e581c43 100644 (file)
@@ -1,8 +1,8 @@
 
 
 #------------------------------------------------------------------------------
-# $File: yara,v 1.2 2017/05/25 20:07:23 christos Exp $
-# yara:  file(1) magic for http://virustotal.github.io/yara/
+# $File: yara,v 1.3 2019/04/19 00:42:27 christos Exp $
+# yara:  file(1) magic for https://virustotal.github.io/yara/
 #
 
 0      string  YARA
index 17919a3..f214ad0 100644 (file)
@@ -1,12 +1,12 @@
 #------------------------------------------------------------------------------
-# $File: zip,v 1.1 2017/11/03 23:36:17 christos Exp $
+# $File: zip,v 1.2 2019/04/09 18:34:15 christos Exp $
 # zip:  file(1) magic for zip files; this is not use
 # Note the version of magic in archive is currently stronger, this is
 # just an example until negative offsets are supported better
 
 # Zip Central Cirectory record
 0      name            zipcd
->0     string          PK\001\002
+>0     string          PK\001\002      Zip archive data
 >>4    leshort         x               \b, made by
 >>4    use             zipversion
 >>6    leshort         x               \b, extract using at least
@@ -53,7 +53,7 @@
 >>0    leshort         x               v?[%#x]
 
 # Zip End Of Central Directory record
--22    string          PK\005\006      Zip archive data
+-22    string          PK\005\006
 #>4    leshort         >1              \b, %d disks
 #>6    leshort         >1              \b, central directory disk %d
 #>8    leshort         >1              \b, %d central directories on this disk
index fbc6c95..a52f522 100644 (file)
@@ -1,5 +1,5 @@
 #
-# $File: Makefile.am,v 1.140 2019/01/16 19:31:06 christos Exp $
+# $File: Makefile.am,v 1.143 2019/05/09 16:24:36 christos Exp $
 #
 MAGIC_FRAGMENT_BASE = Magdir
 MAGIC_DIR = $(top_srcdir)/magic
@@ -33,8 +33,8 @@ $(MAGIC_FRAGMENT_DIR)/asterix \
 $(MAGIC_FRAGMENT_DIR)/att3b \
 $(MAGIC_FRAGMENT_DIR)/audio \
 $(MAGIC_FRAGMENT_DIR)/basis \
-$(MAGIC_FRAGMENT_DIR)/ber \
 $(MAGIC_FRAGMENT_DIR)/beetle \
+$(MAGIC_FRAGMENT_DIR)/ber \
 $(MAGIC_FRAGMENT_DIR)/bflt \
 $(MAGIC_FRAGMENT_DIR)/bhl \
 $(MAGIC_FRAGMENT_DIR)/bioinformatics \
@@ -58,8 +58,8 @@ $(MAGIC_FRAGMENT_DIR)/cisco \
 $(MAGIC_FRAGMENT_DIR)/citrus \
 $(MAGIC_FRAGMENT_DIR)/clarion \
 $(MAGIC_FRAGMENT_DIR)/claris \
-$(MAGIC_FRAGMENT_DIR)/clojure \
 $(MAGIC_FRAGMENT_DIR)/clipper \
+$(MAGIC_FRAGMENT_DIR)/clojure \
 $(MAGIC_FRAGMENT_DIR)/coff \
 $(MAGIC_FRAGMENT_DIR)/commands \
 $(MAGIC_FRAGMENT_DIR)/communications \
@@ -84,6 +84,7 @@ $(MAGIC_FRAGMENT_DIR)/dolby \
 $(MAGIC_FRAGMENT_DIR)/dump \
 $(MAGIC_FRAGMENT_DIR)/dyadic \
 $(MAGIC_FRAGMENT_DIR)/ebml \
+$(MAGIC_FRAGMENT_DIR)/edid \
 $(MAGIC_FRAGMENT_DIR)/editors \
 $(MAGIC_FRAGMENT_DIR)/efi \
 $(MAGIC_FRAGMENT_DIR)/elf \
@@ -108,8 +109,8 @@ $(MAGIC_FRAGMENT_DIR)/gcc \
 $(MAGIC_FRAGMENT_DIR)/gconv \
 $(MAGIC_FRAGMENT_DIR)/geo \
 $(MAGIC_FRAGMENT_DIR)/geos \
-$(MAGIC_FRAGMENT_DIR)/glibc \
 $(MAGIC_FRAGMENT_DIR)/gimp \
+$(MAGIC_FRAGMENT_DIR)/glibc \
 $(MAGIC_FRAGMENT_DIR)/gnome \
 $(MAGIC_FRAGMENT_DIR)/gnu \
 $(MAGIC_FRAGMENT_DIR)/gnumeric \
@@ -153,8 +154,8 @@ $(MAGIC_FRAGMENT_DIR)/lua \
 $(MAGIC_FRAGMENT_DIR)/luks \
 $(MAGIC_FRAGMENT_DIR)/m4 \
 $(MAGIC_FRAGMENT_DIR)/mach \
-$(MAGIC_FRAGMENT_DIR)/macos \
 $(MAGIC_FRAGMENT_DIR)/macintosh \
+$(MAGIC_FRAGMENT_DIR)/macos \
 $(MAGIC_FRAGMENT_DIR)/magic \
 $(MAGIC_FRAGMENT_DIR)/mail.news \
 $(MAGIC_FRAGMENT_DIR)/make \
@@ -182,8 +183,8 @@ $(MAGIC_FRAGMENT_DIR)/motorola \
 $(MAGIC_FRAGMENT_DIR)/mozilla \
 $(MAGIC_FRAGMENT_DIR)/msdos \
 $(MAGIC_FRAGMENT_DIR)/msooxml \
-$(MAGIC_FRAGMENT_DIR)/msx \
 $(MAGIC_FRAGMENT_DIR)/msvc \
+$(MAGIC_FRAGMENT_DIR)/msx \
 $(MAGIC_FRAGMENT_DIR)/mup \
 $(MAGIC_FRAGMENT_DIR)/music \
 $(MAGIC_FRAGMENT_DIR)/nasa \
@@ -195,6 +196,7 @@ $(MAGIC_FRAGMENT_DIR)/netscape \
 $(MAGIC_FRAGMENT_DIR)/netware \
 $(MAGIC_FRAGMENT_DIR)/news \
 $(MAGIC_FRAGMENT_DIR)/nitpicker \
+$(MAGIC_FRAGMENT_DIR)/numpy \
 $(MAGIC_FRAGMENT_DIR)/oasis \
 $(MAGIC_FRAGMENT_DIR)/ocaml \
 $(MAGIC_FRAGMENT_DIR)/octave \
@@ -234,6 +236,7 @@ $(MAGIC_FRAGMENT_DIR)/revision \
 $(MAGIC_FRAGMENT_DIR)/riff \
 $(MAGIC_FRAGMENT_DIR)/rpi \
 $(MAGIC_FRAGMENT_DIR)/rpm \
+$(MAGIC_FRAGMENT_DIR)/rpmsg \
 $(MAGIC_FRAGMENT_DIR)/rtf \
 $(MAGIC_FRAGMENT_DIR)/ruby \
 $(MAGIC_FRAGMENT_DIR)/sc \
@@ -277,8 +280,8 @@ $(MAGIC_FRAGMENT_DIR)/unicode \
 $(MAGIC_FRAGMENT_DIR)/unknown \
 $(MAGIC_FRAGMENT_DIR)/uterus \
 $(MAGIC_FRAGMENT_DIR)/uuencode \
-$(MAGIC_FRAGMENT_DIR)/varied.out \
 $(MAGIC_FRAGMENT_DIR)/vacuum-cleaner \
+$(MAGIC_FRAGMENT_DIR)/varied.out \
 $(MAGIC_FRAGMENT_DIR)/varied.script \
 $(MAGIC_FRAGMENT_DIR)/vax \
 $(MAGIC_FRAGMENT_DIR)/vicar \
index bcebeab..624ac90 100644 (file)
@@ -35,7 +35,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: ascmagic.c,v 1.102 2019/02/20 02:35:27 christos Exp $")
+FILE_RCSID("@(#)$File: ascmagic.c,v 1.104 2019/05/07 02:27:11 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -110,9 +110,10 @@ file_ascmagic_with_encoding(struct magic_set *ms,
        const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
        size_t nbytes = b->flen;
        unsigned char *utf8_buf = NULL, *utf8_end;
-       size_t mlen, i;
+       size_t mlen, i, len;
        int rv = -1;
        int mime = ms->flags & MAGIC_MIME;
+       int need_separator = 0;
 
        const char *subtype = NULL;
        const char *subtype_mime = NULL;
@@ -150,12 +151,14 @@ file_ascmagic_with_encoding(struct magic_set *ms,
                if ((utf8_end = encode_utf8(utf8_buf, mlen, ubuf, ulen))
                    == NULL)
                        goto done;
-               buffer_init(&bb, b->fd, utf8_buf,
+               buffer_init(&bb, b->fd, &b->st, utf8_buf,
                    CAST(size_t, utf8_end - utf8_buf));
 
                if ((rv = file_softmagic(ms, &bb, NULL, NULL,
                    TEXTTEST, text)) == 0)
                        rv = -1;
+               else
+                       need_separator = 1;
                buffer_fini(&bb);
                if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) {
                        rv = rv == -1 ? 0 : 1;
@@ -206,8 +209,21 @@ file_ascmagic_with_encoding(struct magic_set *ms,
                rv = 0;
                goto done;
        }
+       len = file_printedlen(ms);
        if (mime) {
-               if (!file_printedlen(ms) && (mime & MAGIC_MIME_TYPE) != 0) {
+               if ((mime & MAGIC_MIME_TYPE) != 0) {
+                       if (len) {
+                               /*
+                                * Softmagic printed something, we
+                                * are either done, or we need a separator
+                                */
+                               if ((ms->flags & MAGIC_CONTINUE) == 0) {
+                                       rv = 1;
+                                       goto done;
+                               }
+                               if (need_separator && file_separator(ms) == -1)
+                                       goto done;
+                       }
                        if (subtype_mime) {
                                if (file_printf(ms, "%s", subtype_mime) == -1)
                                        goto done;
@@ -217,7 +233,7 @@ file_ascmagic_with_encoding(struct magic_set *ms,
                        }
                }
        } else {
-               if (file_printedlen(ms)) {
+               if (len) {
                        switch (file_replace(ms, " text$", ", ")) {
                        case 0:
                                switch (file_replace(ms, " text executable$",
index fd40416..6d8967d 100644 (file)
@@ -27,7 +27,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: buffer.c,v 1.5 2019/02/20 02:35:27 christos Exp $")
+FILE_RCSID("@(#)$File: buffer.c,v 1.6 2019/05/07 02:27:11 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -37,10 +37,13 @@ FILE_RCSID("@(#)$File: buffer.c,v 1.5 2019/02/20 02:35:27 christos Exp $")
 #include <sys/stat.h>
 
 void
-buffer_init(struct buffer *b, int fd, const void *data, size_t len)
+buffer_init(struct buffer *b, int fd, const struct stat *st, const void *data,
+    size_t len)
 {
        b->fd = fd;
-       if (b->fd == -1 || fstat(b->fd, &b->st) == -1)
+       if (st)
+               memcpy(&b->st, st, sizeof(b->st));
+       else if (b->fd == -1 || fstat(b->fd, &b->st) == -1)
                memset(&b->st, 0, sizeof(b->st));
        b->fbuf = data;
        b->flen = len;
index bdb2d3a..e4eea4c 100644 (file)
@@ -27,7 +27,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: cdf_time.c,v 1.18 2019/02/20 02:35:27 christos Exp $")
+FILE_RCSID("@(#)$File: cdf_time.c,v 1.19 2019/03/12 20:43:05 christos Exp $")
 #endif
 
 #include <time.h>
@@ -68,7 +68,7 @@ cdf_getday(int year, int days)
 {
        size_t m;
 
-       for (m = 0; m < sizeof(mdays) / sizeof(mdays[0]); m++) {
+       for (m = 0; m < __arraycount(mdays); m++) {
                int sub = mdays[m] + (m == 1 && isleap(year));
                if (days < sub)
                        return days;
@@ -85,7 +85,7 @@ cdf_getmonth(int year, int days)
 {
        size_t m;
 
-       for (m = 0; m < sizeof(mdays) / sizeof(mdays[0]); m++) {
+       for (m = 0; m < __arraycount(mdays); m++) {
                days -= mdays[m];
                if (m == 1 && isleap(year))
                        days--;
index 89fc570..95e42a2 100644 (file)
@@ -35,7 +35,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: compress.c,v 1.115 2019/02/20 02:35:27 christos Exp $")
+FILE_RCSID("@(#)$File: compress.c,v 1.121 2019/05/07 02:27:11 christos Exp $")
 #endif
 
 #include "magic.h"
@@ -179,7 +179,7 @@ private const struct {
 
 private ssize_t swrite(int, const void *, size_t);
 #if HAVE_FORK
-private size_t ncompr = sizeof(compr) / sizeof(compr[0]);
+private size_t ncompr = __arraycount(compr);
 private int uncompressbuf(int, size_t, size_t, const unsigned char *,
     unsigned char **, size_t *);
 #ifdef BUILTIN_DECOMPRESS
@@ -226,12 +226,12 @@ file_zmagic(struct magic_set *ms, const struct buffer *b, const char *name)
        int fd = b->fd;
        const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
        size_t nbytes = b->flen;
-       sig_t osigpipe;
+       int sa_saved = 0;
+       struct sigaction sig_act;
 
        if ((ms->flags & MAGIC_COMPRESS) == 0)
                return 0;
 
-       osigpipe = signal(SIGPIPE, SIG_IGN);
        for (i = 0; i < ncompr; i++) {
                int zm;
                if (nbytes < compr[i].maglen)
@@ -246,6 +246,16 @@ file_zmagic(struct magic_set *ms, const struct buffer *b, const char *name)
 
                if (!zm)
                        continue;
+
+               /* Prevent SIGPIPE death if child dies unexpectedly */
+               if (!sa_saved) {
+                       //We can use sig_act for both new and old, but
+                       struct sigaction new_act;
+                       memset(&new_act, 0, sizeof(new_act));
+                       new_act.sa_handler = SIG_IGN;
+                       sa_saved = sigaction(SIGPIPE, &new_act, &sig_act) != -1;
+               }
+
                nsz = nbytes;
                urv = uncompressbuf(fd, ms->bytes_max, i, buf, &newbuf, &nsz);
                DPRINTF("uncompressbuf = %d, %s, %" SIZE_T_FORMAT "u\n", urv,
@@ -257,7 +267,7 @@ file_zmagic(struct magic_set *ms, const struct buffer *b, const char *name)
                        if (urv == ERRDATA)
                                prv = format_decompression_error(ms, i, newbuf);
                        else
-                               prv = file_buffer(ms, -1, name, newbuf, nsz);
+                               prv = file_buffer(ms, -1, NULL, name, newbuf, nsz);
                        if (prv == -1)
                                goto error;
                        rv = 1;
@@ -274,7 +284,7 @@ file_zmagic(struct magic_set *ms, const struct buffer *b, const char *name)
                         * XXX: If file_buffer fails here, we overwrite
                         * the compressed text. FIXME.
                         */
-                       if (file_buffer(ms, -1, NULL, buf, nbytes) == -1) {
+                       if (file_buffer(ms, -1, NULL, NULL, buf, nbytes) == -1) {
                                if (file_pop_buffer(ms, pb) != NULL)
                                        abort();
                                goto error;
@@ -302,7 +312,9 @@ file_zmagic(struct magic_set *ms, const struct buffer *b, const char *name)
 out:
        DPRINTF("rv = %d\n", rv);
 
-       (void)signal(SIGPIPE, osigpipe);
+       if (sa_saved && sig_act.sa_handler != SIG_IGN)
+               (void)sigaction(SIGPIPE, &sig_act, NULL);
+
        free(newbuf);
        ms->flags |= MAGIC_COMPRESS;
        DPRINTF("Zmagic returns %d\n", rv);
@@ -595,52 +607,42 @@ closep(int *fd)
                closefd(fd, i);
 }
 
-static void
-copydesc(int i, int *fd)
+static int
+copydesc(int i, int fd)
 {
-       int j = fd[i == STDIN_FILENO ? 0 : 1];
-       if (j == i)
-               return;
-       if (dup2(j, i) == -1) {
-               DPRINTF("dup(%d, %d) failed (%s)\n", j, i, strerror(errno));
+       if (fd == i)
+               return 0; /* "no dup was necessary" */
+       if (dup2(fd, i) == -1) {
+               DPRINTF("dup(%d, %d) failed (%s)\n", fd, i, strerror(errno));
                exit(1);
        }
-       closep(fd);
+       return 1;
 }
 
-static void
-writechild(int fdp[3][2], const void *old, size_t n)
+static pid_t
+writechild(int fd, const void *old, size_t n)
 {
-       int status;
+       pid_t pid;
 
-       closefd(fdp[STDIN_FILENO], 0);
        /*
         * fork again, to avoid blocking because both
         * pipes filled
         */
-       switch (fork()) {
-       case 0: /* child */
-               closefd(fdp[STDOUT_FILENO], 0);
-               if (swrite(fdp[STDIN_FILENO][1], old, n) != CAST(ssize_t, n)) {
-                       DPRINTF("Write failed (%s)\n", strerror(errno));
-                       exit(1);
-               }
-               exit(0);
-               /*NOTREACHED*/
-
-       case -1:
+       pid = fork();
+       if (pid == -1) {
                DPRINTF("Fork failed (%s)\n", strerror(errno));
                exit(1);
-               /*NOTREACHED*/
-
-       default:  /* parent */
-               if (wait(&status) == -1) {
-                       DPRINTF("Wait failed (%s)\n", strerror(errno));
+       }
+       if (pid == 0) {
+               /* child */
+               if (swrite(fd, old, n) != CAST(ssize_t, n)) {
+                       DPRINTF("Write failed (%s)\n", strerror(errno));
                        exit(1);
                }
-               DPRINTF("Grandchild wait return %#x\n", status);
+               exit(0);
        }
-       closefd(fdp[STDIN_FILENO], 1);
+       /* parent */
+       return pid;
 }
 
 static ssize_t
@@ -687,7 +689,9 @@ uncompressbuf(int fd, size_t bytes_max, size_t method, const unsigned char *old,
     unsigned char **newch, size_t* n)
 {
        int fdp[3][2];
-       int status, rv;
+       int status, rv, w;
+       pid_t pid;
+       pid_t writepid = -1;
        size_t i;
        ssize_t r;
 
@@ -711,43 +715,68 @@ uncompressbuf(int fd, size_t bytes_max, size_t method, const unsigned char *old,
                return makeerror(newch, n, "Cannot create pipe, %s",
                    strerror(errno));
        }
-       switch (fork()) {
-       case 0: /* child */
+
+       /* For processes with large mapped virtual sizes, vfork
+        * may be _much_ faster (10-100 times) than fork.
+        */
+       pid = vfork();
+       if (pid == -1) {
+               return makeerror(newch, n, "Cannot vfork, %s",
+                   strerror(errno));
+       }
+       if (pid == 0) {
+               /* child */
+               /* Note: we are after vfork, do not modify memory
+                * in a way which confuses parent. In particular,
+                * do not modify fdp[i][j].
+                */
                if (fd != -1) {
-                       fdp[STDIN_FILENO][0] = fd;
                        (void) lseek(fd, CAST(off_t, 0), SEEK_SET);
+                       if (copydesc(STDIN_FILENO, fd))
+                               (void) close(fd);
+               } else {
+                       if (copydesc(STDIN_FILENO, fdp[STDIN_FILENO][0]))
+                               (void) close(fdp[STDIN_FILENO][0]);
+                       if (fdp[STDIN_FILENO][1] > 2)
+                               (void) close(fdp[STDIN_FILENO][1]);
                }
+///FIXME: if one of the fdp[i][j] is 0 or 1, this can bomb spectacularly
+               if (copydesc(STDOUT_FILENO, fdp[STDOUT_FILENO][1]))
+                       (void) close(fdp[STDOUT_FILENO][1]);
+               if (fdp[STDOUT_FILENO][0] > 2)
+                       (void) close(fdp[STDOUT_FILENO][0]);
 
-               for (i = 0; i < __arraycount(fdp); i++)
-                       copydesc(CAST(int, i), fdp[i]);
+               if (copydesc(STDERR_FILENO, fdp[STDERR_FILENO][1]))
+                       (void) close(fdp[STDERR_FILENO][1]);
+               if (fdp[STDERR_FILENO][0] > 2)
+                       (void) close(fdp[STDERR_FILENO][0]);
 
                (void)execvp(compr[method].argv[0],
                    RCAST(char *const *, RCAST(intptr_t, compr[method].argv)));
                dprintf(STDERR_FILENO, "exec `%s' failed, %s",
                    compr[method].argv[0], strerror(errno));
-               exit(1);
-               /*NOTREACHED*/
-       case -1:
-               return makeerror(newch, n, "Cannot fork, %s",
-                   strerror(errno));
-
-       default: /* parent */
-               for (i = 1; i < __arraycount(fdp); i++)
-                       closefd(fdp[i], 1);
-
-               /* Write the buffer data to the child, if we don't have fd */
-               if (fd == -1)
-                       writechild(fdp, old, *n);
+               _exit(1); /* _exit(), not exit(), because of vfork */
+       }
+       /* parent */
+       /* Close write sides of child stdout/err pipes */
+       for (i = 1; i < __arraycount(fdp); i++)
+               closefd(fdp[i], 1);
+       /* Write the buffer data to child stdin, if we don't have fd */
+       if (fd == -1) {
+               closefd(fdp[STDIN_FILENO], 0);
+               writepid = writechild(fdp[STDIN_FILENO][1], old, *n);
+               closefd(fdp[STDIN_FILENO], 1);
+       }
 
-               *newch = CAST(unsigned char *, malloc(bytes_max + 1));
-               if (*newch == NULL) {
-                       rv = makeerror(newch, n, "No buffer, %s",
-                           strerror(errno));
-                       goto err;
-               }
-               rv = OKDATA;
-               if ((r = sread(fdp[STDOUT_FILENO][0], *newch, bytes_max, 0)) > 0)
-                       break;
+       *newch = CAST(unsigned char *, malloc(bytes_max + 1));
+       if (*newch == NULL) {
+               rv = makeerror(newch, n, "No buffer, %s",
+                   strerror(errno));
+               goto err;
+       }
+       rv = OKDATA;
+       r = sread(fdp[STDOUT_FILENO][0], *newch, bytes_max, 0);
+       if (r <= 0) {
                DPRINTF("Read stdout failed %d (%s)\n", fdp[STDOUT_FILENO][0],
                    r != -1 ? strerror(errno) : "no data");
 
@@ -756,7 +785,7 @@ uncompressbuf(int fd, size_t bytes_max, size_t method, const unsigned char *old,
                    (r = sread(fdp[STDERR_FILENO][0], *newch, bytes_max, 0)) > 0)
                {
                        r = filter_error(*newch, r);
-                       break;
+                       goto ok;
                }
                free(*newch);
                if  (r == 0)
@@ -766,7 +795,7 @@ uncompressbuf(int fd, size_t bytes_max, size_t method, const unsigned char *old,
                        rv = makeerror(newch, n, "No data");
                goto err;
        }
-
+ok:
        *n = r;
        /* NUL terminate, as every buffer is handled here. */
        (*newch)[*n] = '\0';
@@ -774,7 +803,10 @@ err:
        closefd(fdp[STDIN_FILENO], 1);
        closefd(fdp[STDOUT_FILENO], 0);
        closefd(fdp[STDERR_FILENO], 0);
-       if (wait(&status) == -1) {
+
+       w = waitpid(pid, &status, 0);
+wait_err:
+       if (w == -1) {
                free(*newch);
                rv = makeerror(newch, n, "Wait failed, %s", strerror(errno));
                DPRINTF("Child wait return %#x\n", status);
@@ -783,8 +815,17 @@ err:
        } else if (WEXITSTATUS(status) != 0) {
                DPRINTF("Child exited (%#x)\n", WEXITSTATUS(status));
        }
+       if (writepid > 0) {
+               /* _After_ we know decompressor has exited, our input writer
+                * definitely will exit now (at worst, writing fails in it,
+                * since output fd is closed now on the reading size).
+                */
+               w = waitpid(writepid, &status, 0);
+               writepid = -1;
+               goto wait_err;
+       }
 
-       closefd(fdp[STDIN_FILENO], 0);
+       closefd(fdp[STDIN_FILENO], 0); //why? it is already closed here!
        DPRINTF("Returning %p n=%" SIZE_T_FORMAT "u rv=%d\n", *newch, *n, rv);
 
        return rv;
index 81cd925..76244f8 100644 (file)
@@ -35,7 +35,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: encoding.c,v 1.17 2019/02/20 02:35:27 christos Exp $")
+FILE_RCSID("@(#)$File: encoding.c,v 1.20 2019/04/15 16:48:41 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -94,7 +94,8 @@ file_encoding(struct magic_set *ms, const struct buffer *b, unichar **ubuf,
                goto done;
        }
        mlen = (nbytes + 1) * sizeof(nbuf[0]);
-       if ((nbuf = CAST(unsigned char *, calloc(CAST(size_t, 1), mlen))) == NULL) {
+       if ((nbuf = CAST(unsigned char *,
+           calloc(CAST(size_t, 1), mlen))) == NULL) {
                file_oomem(ms, mlen);
                goto done;
        }
@@ -442,9 +443,11 @@ looks_ucs16(const unsigned char *bf, size_t nbytes, unichar *ubf,
                /* XXX fix to properly handle chars > 65536 */
 
                if (bigend)
-                       ubf[(*ulen)++] = bf[i + 1] + 256 * bf[i];
+                       ubf[(*ulen)++] = bf[i + 1]
+                           | (CAST(unichar, bf[i]) << 8);
                else
-                       ubf[(*ulen)++] = bf[i] + 256 * bf[i + 1];
+                       ubf[(*ulen)++] = bf[i]
+                           | (CAST(unichar, bf[i + 1]) << 8);
 
                if (ubf[*ulen - 1] == 0xfffe)
                        return 0;
@@ -475,15 +478,19 @@ looks_ucs32(const unsigned char *bf, size_t nbytes, unichar *ubf,
 
        *ulen = 0;
 
-       for (i = 4; i + 1 < nbytes; i += 4) {
+       for (i = 4; i + 3 < nbytes; i += 4) {
                /* XXX fix to properly handle chars > 65536 */
 
                if (bigend)
-                       ubf[(*ulen)++] = bf[i + 3] | (bf[i + 2] << 8)
-                           | (bf[i + 1] << 16) | bf[i] << 24;
+                       ubf[(*ulen)++] = CAST(unichar, bf[i + 3])
+                           | (CAST(unichar, bf[i + 2]) << 8)
+                           | (CAST(unichar, bf[i + 1]) << 16)
+                           | (CAST(unichar, bf[i]) << 24);
                else
-                       ubf[(*ulen)++] = bf[i] | (bf[i + 1] << 8) 
-                           | (bf[i + 2] << 16) | (bf[i + 3] << 24);
+                       ubf[(*ulen)++] = CAST(unichar, bf[i + 0])
+                           | (CAST(unichar, bf[i + 1]) << 8) 
+                           | (CAST(unichar, bf[i + 2]) << 16)
+                           | (CAST(unichar, bf[i + 3]) << 24);
 
                if (ubf[*ulen - 1] == 0xfffe)
                        return 0;
index 5f0303e..5b60b95 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: file.c,v 1.179 2019/02/20 02:35:27 christos Exp $")
+FILE_RCSID("@(#)$File: file.c,v 1.181 2019/03/28 20:54:03 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -186,9 +186,7 @@ main(int argc, char *argv[])
        char *progname;
 
        /* makes islower etc work for other langs */
-#ifdef HAVE_SETLOCALE
        (void)setlocale(LC_CTYPE, "");
-#endif
 
 #ifdef __EMX__
        /* sh-like wildcard expansion! Shouldn't hurt at least ... */
@@ -244,11 +242,11 @@ main(int argc, char *argv[])
                        flags |= MAGIC_ERROR;
                        break;
                case 'e':
-                       for (i = 0; i < sizeof(nv) / sizeof(nv[0]); i++)
+                       for (i = 0; i < __arraycount(nv); i++)
                                if (strcmp(nv[i].name, optarg) == 0)
                                        break;
 
-                       if (i == sizeof(nv) / sizeof(nv[0]))
+                       if (i == __arraycount(nv))
                                errflg++;
                        else
                                flags |= nv[i].value;
index f8e0835..69a586a 100644 (file)
@@ -27,7 +27,7 @@
  */
 /*
  * file.h - definitions for file(1) program
- * @(#)$File: file.h,v 1.202 2019/02/18 17:46:56 christos Exp $
+ * @(#)$File: file.h,v 1.206 2019/05/07 02:27:11 christos Exp $
  */
 
 #ifndef __file_h__
@@ -454,12 +454,13 @@ protected const char *file_fmttime(uint64_t, int, char *);
 protected struct magic_set *file_ms_alloc(int);
 protected void file_ms_free(struct magic_set *);
 protected int file_default(struct magic_set *, size_t);
-protected int file_buffer(struct magic_set *, int, const char *, const void *,
-    size_t);
+protected int file_buffer(struct magic_set *, int, struct stat *, const char *,
+    const void *, size_t);
 protected int file_fsmagic(struct magic_set *, const char *, struct stat *);
 protected int file_pipe2file(struct magic_set *, int, const void *, size_t);
 protected int file_vprintf(struct magic_set *, const char *, va_list)
     __attribute__((__format__(__printf__, 2, 0)));
+protected int file_separator(struct magic_set *);
 protected size_t file_printedlen(const struct magic_set *);
 protected int file_replace(struct magic_set *, const char *, const char *);
 protected int file_printf(struct magic_set *, const char *, ...)
@@ -512,7 +513,8 @@ protected int file_os2_apptype(struct magic_set *, const char *, const void *,
     size_t);
 #endif /* __EMX__ */
 
-protected void buffer_init(struct buffer *, int, const void *, size_t);
+protected void buffer_init(struct buffer *, int, const struct stat *,
+    const void *, size_t);
 protected void buffer_fini(struct buffer *);
 protected int buffer_fill(const struct buffer *);
 
@@ -553,17 +555,6 @@ extern const char *file_names[];
 extern const size_t file_nnames;
 #endif
 
-#ifndef HAVE_STRERROR
-extern int sys_nerr;
-extern char *sys_errlist[];
-#define strerror(e) \
-       (((e) >= 0 && (e) < sys_nerr) ? sys_errlist[(e)] : "Unknown error")
-#endif
-
-#ifndef HAVE_STRTOUL
-#define strtoul(a, b, c)       strtol(a, b, c)
-#endif
-
 #ifndef HAVE_PREAD
 ssize_t pread(int, void *, size_t, off_t);
 #endif
index 3d74255..25c4f81 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: fsmagic.c,v 1.79 2018/10/02 00:38:33 christos Exp $")
+FILE_RCSID("@(#)$File: fsmagic.c,v 1.80 2019/04/23 18:59:27 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -46,11 +46,14 @@ FILE_RCSID("@(#)$File: fsmagic.c,v 1.79 2018/10/02 00:38:33 christos Exp $")
 # include <sys/mkdev.h>
 # define HAVE_MAJOR
 #endif
-#ifdef MAJOR_IN_SYSMACROS
+#ifdef HAVE_SYS_SYSMACROS_H
 # include <sys/sysmacros.h>
+#endif
+#ifdef MAJOR_IN_SYSMACROS
 # define HAVE_MAJOR
 #endif
-#ifdef major                   /* Might be defined in sys/types.h.  */
+#if defined(major) && !defined(HAVE_MAJOR)
+/* Might be defined in sys/types.h.  */
 # define HAVE_MAJOR
 #endif
 #ifdef WIN32
index eca99ad..23e7f32 100644 (file)
@@ -27,7 +27,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: funcs.c,v 1.102 2019/02/20 02:35:27 christos Exp $")
+FILE_RCSID("@(#)$File: funcs.c,v 1.104 2019/05/07 02:27:11 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -160,12 +160,18 @@ file_badread(struct magic_set *ms)
 
 #ifndef COMPILE_ONLY
 
+protected int
+file_separator(struct magic_set *ms)
+{
+       return file_printf(ms, "\n- ");
+}
+
 static int
 checkdone(struct magic_set *ms, int *rv)
 {
        if ((ms->flags & MAGIC_CONTINUE) == 0)
                return 1;
-       if (file_printf(ms, "\n- ") == -1)
+       if (file_separator(ms) == -1)
                *rv = -1;
        return 0;
 }
@@ -201,7 +207,8 @@ file_default(struct magic_set *ms, size_t nb)
  */
 /*ARGSUSED*/
 protected int
-file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((__unused__)),
+file_buffer(struct magic_set *ms, int fd, struct stat *st,
+    const char *inname __attribute__ ((__unused__)),
     const void *buf, size_t nb)
 {
        int m = 0, rv = 0, looks_text = 0;
@@ -212,7 +219,7 @@ file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((__u
        char *rbuf = NULL;
        struct buffer b;
 
-       buffer_init(&b, fd, buf, nb);
+       buffer_init(&b, fd, st, buf, nb);
        ms->mode = b.st.st_mode;
 
        if (nb == 0) {
@@ -335,8 +342,7 @@ file_buffer(struct magic_set *ms, int fd, const char *inname __attribute__ ((__u
                if ((ms->flags & MAGIC_DEBUG) != 0)
                        (void)fprintf(stderr, "[try ascmagic %d]\n", m);
                if (m) {
-                       if (checkdone(ms, &rv))
-                               goto done;
+                       goto done;
                }
        }
 
index a8a6eca..206ec37 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: is_json.c,v 1.12 2018/10/19 00:26:26 christos Exp $")
+FILE_RCSID("@(#)$File: is_json.c,v 1.13 2019/03/02 01:08:10 christos Exp $")
 #endif
 
 #include <string.h>
@@ -52,7 +52,8 @@ FILE_RCSID("@(#)$File: is_json.c,v 1.12 2018/10/19 00:26:26 christos Exp $")
 #define JSON_NUMBER    2
 #define JSON_OBJECT    3
 #define JSON_STRING    4
-#define JSON_MAX       5
+#define JSON_ARRAYN    5
+#define JSON_MAX       6
 
 /*
  * if JSON_COUNT != 0:
@@ -171,6 +172,7 @@ json_parse_array(const unsigned char **ucp, const unsigned char *ue,
        size_t *st, size_t lvl)
 {
        const unsigned char *uc = *ucp;
+       int more = 0;   /* Array has more than 1 element */
 
        DPRINTF("Parse array: ", uc, *ucp);
        while (uc < ue) {
@@ -180,9 +182,12 @@ json_parse_array(const unsigned char **ucp, const unsigned char *ue,
                        goto out;
                switch (*uc) {
                case ',':
+                       more++;
                        uc++;
                        continue;
                case ']':
+                       if (more)
+                               st[JSON_ARRAYN]++;
                        *ucp = uc + 1;
                        return 1;
                default:
@@ -330,7 +335,7 @@ json_parse(const unsigned char **ucp, const unsigned char *ue,
                return 0;
 #if JSON_COUNT
        /* bail quickly if not counting */
-       if (lvl > 1 && (st[JSON_OBJECT] || st[JSON_ARRAY]))
+       if (lvl > 1 && (st[JSON_OBJECT] || st[JSON_ARRAYN]))
                return 1;
 #endif
 
@@ -373,7 +378,7 @@ out:
        *ucp = uc;
        DPRINTF("End general: ", uc, *ucp);
        if (lvl == 0)
-               return rv && (st[JSON_ARRAY] || st[JSON_OBJECT]);
+               return rv && (st[JSON_ARRAYN] || st[JSON_OBJECT]);
        return rv;
 }
 
@@ -408,8 +413,10 @@ file_is_json(struct magic_set *ms, const struct buffer *b)
 #define P(n) st[n], st[n] > 1 ? "s" : ""
        if (file_printf(ms, " (%" SIZE_T_FORMAT "u object%s, %" SIZE_T_FORMAT
            "u array%s, %" SIZE_T_FORMAT "u string%s, %" SIZE_T_FORMAT
-           "u constant%s, %" SIZE_T_FORMAT "u number%s)", P(JSON_OBJECT),
-           P(JSON_ARRAY), P(JSON_STRING), P(JSON_CONSTANT), P(JSON_NUMBER))
+           "u constant%s, %" SIZE_T_FORMAT "u number%s, %" SIZE_T_FORMAT
+           "u >1array%s)",
+           P(JSON_OBJECT), P(JSON_ARRAY), P(JSON_STRING), P(JSON_CONSTANT),
+           P(JSON_NUMBER), P(JSON_ARRAYN))
            == -1)
                return -1;
 #endif
index 2207f08..da5baf1 100644 (file)
@@ -33,7 +33,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: magic.c,v 1.109 2019/02/20 02:35:27 christos Exp $")
+FILE_RCSID("@(#)$File: magic.c,v 1.111 2019/05/07 02:27:11 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -406,6 +406,7 @@ file_or_fd(struct magic_set *ms, const char *inname, int fd)
        struct stat     sb;
        ssize_t nbytes = 0;     /* number of bytes read from a datafile */
        int     ispipe = 0;
+       int     okstat = 0;
        off_t   pos = CAST(off_t, -1);
 
        if (file_reset(ms, 1) == -1)
@@ -438,7 +439,7 @@ file_or_fd(struct magic_set *ms, const char *inname, int fd)
                int flags = O_RDONLY|O_BINARY|O_NONBLOCK;
                errno = 0;
                if ((fd = open(inname, flags)) < 0) {
-                       int okstat = stat(inname, &sb) == 0;
+                       okstat = stat(inname, &sb) == 0;
                        if (okstat && S_ISFIFO(sb.st_mode))
                                ispipe = 1;
 #ifdef WIN32
@@ -462,7 +463,9 @@ file_or_fd(struct magic_set *ms, const char *inname, int fd)
        }
 
        if (fd != -1) {
-               if (fstat(fd, &sb) == 0 && S_ISFIFO(sb.st_mode))
+               if (!okstat)
+                       okstat = fstat(fd, &sb) == 0;
+               if (okstat && S_ISFIFO(sb.st_mode))
                        ispipe = 1;
                if (inname == NULL)
                        pos = lseek(fd, CAST(off_t, 0), SEEK_CUR);
@@ -472,12 +475,14 @@ file_or_fd(struct magic_set *ms, const char *inname, int fd)
         * try looking at the first ms->bytes_max bytes
         */
        if (ispipe) {
-               ssize_t r = 0;
+               if (fd != -1) {
+                       ssize_t r = 0;
 
-               while ((r = sread(fd, RCAST(void *, &buf[nbytes]),
-                   CAST(size_t, ms->bytes_max - nbytes), 1)) > 0) {
-                       nbytes += r;
-                       if (r < PIPE_BUF) break;
+                       while ((r = sread(fd, RCAST(void *, &buf[nbytes]),
+                           CAST(size_t, ms->bytes_max - nbytes), 1)) > 0) {
+                               nbytes += r;
+                               if (r < PIPE_BUF) break;
+                       }
                }
 
                if (nbytes == 0 && inname) {
@@ -488,13 +493,13 @@ file_or_fd(struct magic_set *ms, const char *inname, int fd)
                        goto done;
                }
 
-       } else {
+       } else if (fd != -1) {
                /* Windows refuses to read from a big console buffer. */
                size_t howmany =
 #if defined(WIN32)
-                               _isatty(fd) ? 8 * 1024 :
+                   _isatty(fd) ? 8 * 1024 :
 #endif
-                               ms->bytes_max;
+                   ms->bytes_max;
                if ((nbytes = read(fd, RCAST(void *, buf), howmany)) == -1) {
                        if (inname == NULL && fd != STDIN_FILENO)
                                file_error(ms, errno, "cannot read fd %d", fd);
@@ -506,7 +511,7 @@ file_or_fd(struct magic_set *ms, const char *inname, int fd)
        }
 
        (void)memset(buf + nbytes, 0, SLOP); /* NUL terminate */
-       if (file_buffer(ms, fd, inname, buf, CAST(size_t, nbytes)) == -1)
+       if (file_buffer(ms, fd, okstat ? &sb : NULL, inname, buf, CAST(size_t, nbytes)) == -1)
                goto done;
        rv = 0;
 done:
@@ -532,7 +537,7 @@ magic_buffer(struct magic_set *ms, const void *buf, size_t nb)
         * The main work is done here!
         * We have the file name and/or the data buffer to be identified.
         */
-       if (file_buffer(ms, -1, NULL, buf, nb) == -1) {
+       if (file_buffer(ms, -1, NULL, NULL, buf, nb) == -1) {
                return NULL;
        }
        return file_getbuffer(ms);
index 6dad1de..391a7fb 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: print.c,v 1.84 2019/02/20 02:35:27 christos Exp $")
+FILE_RCSID("@(#)$File: print.c,v 1.85 2019/03/12 20:43:05 christos Exp $")
 #endif  /* lint */
 
 #include <string.h>
@@ -43,8 +43,6 @@ FILE_RCSID("@(#)$File: print.c,v 1.84 2019/02/20 02:35:27 christos Exp $")
 #endif
 #include <time.h>
 
-#define SZOF(a)        (sizeof(a) / sizeof(a[0]))
-
 #include "cdf.h"
 
 #ifndef COMPILE_ONLY
@@ -66,8 +64,8 @@ file_mdump(struct magic *m)
                        (void) fputc('~', stderr);
                (void) fprintf(stderr, "%c%u),",
                    (CAST(size_t, m->in_op & FILE_OPS_MASK) <
-                   SZOF(optyp)) ? optyp[m->in_op & FILE_OPS_MASK] : '?',
-                   m->in_offset);
+                   __arraycount(optyp)) ?
+                   optyp[m->in_op & FILE_OPS_MASK] : '?', m->in_offset);
        }
        (void) fprintf(stderr, " %s%s", (m->flag & UNSIGNED) ? "u" : "",
            /* Note: type is unsigned */
@@ -112,7 +110,8 @@ file_mdump(struct magic *m)
                        (void) fprintf(stderr, "/%u", m->str_range);
        }
        else {
-               if (CAST(size_t, m->mask_op & FILE_OPS_MASK) < SZOF(optyp))
+               if (CAST(size_t, m->mask_op & FILE_OPS_MASK) <
+                   __arraycount(optyp))
                        (void) fputc(optyp[m->mask_op & FILE_OPS_MASK], stderr);
                else
                        (void) fputc('?', stderr);
index 5fa98e8..e6ea8e4 100644 (file)
@@ -26,7 +26,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: readcdf.c,v 1.72 2019/02/20 02:35:27 christos Exp $")
+FILE_RCSID("@(#)$File: readcdf.c,v 1.73 2019/03/12 20:43:05 christos Exp $")
 #endif
 
 #include <assert.h>
@@ -39,10 +39,6 @@ FILE_RCSID("@(#)$File: readcdf.c,v 1.72 2019/02/20 02:35:27 christos Exp $")
 #include "cdf.h"
 #include "magic.h"
 
-#ifndef __arraycount
-#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
-#endif
-
 #define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
 
 static const struct nv {
index db43c6c..ef61d4c 100644 (file)
@@ -27,7 +27,7 @@
 #include "file.h"
 
 #ifndef lint
-FILE_RCSID("@(#)$File: readelf.c,v 1.162 2019/02/20 02:35:27 christos Exp $")
+FILE_RCSID("@(#)$File: readelf.c,v 1.165 2019/05/07 02:27:11 christos Exp $")
 #endif
 
 #ifdef BUILTIN_ELF
@@ -285,8 +285,8 @@ static const size_t prpsoffsets64[] = {
        16,             /* FreeBSD, 64-bit */
 };
 
-#define        NOFFSETS32      (sizeof(prpsoffsets32) / sizeof(prpsoffsets32[0]))
-#define NOFFSETS64     (sizeof(prpsoffsets64) / sizeof(prpsoffsets64[0]))
+#define        NOFFSETS32      __arraycount(prpsoffsets32)
+#define NOFFSETS64     __arraycount(prpsoffsets64)
 
 #define NOFFSETS       (clazz == ELFCLASS32 ? NOFFSETS32 : NOFFSETS64)
 
@@ -410,7 +410,7 @@ dophn_core(struct magic_set *ms, int clazz, int swap, int fd, off_t off,
 }
 #endif
 
-static void
+static int
 do_note_netbsd_version(struct magic_set *ms, int swap, void *v)
 {
        uint32_t desc;
@@ -418,7 +418,7 @@ do_note_netbsd_version(struct magic_set *ms, int swap, void *v)
        desc = elf_getu32(swap, desc);
 
        if (file_printf(ms, ", for NetBSD") == -1)
-               return;
+               return -1;
        /*
         * The version number used to be stuck as 199905, and was thus
         * basically content-free.  Newer versions of NetBSD have fixed
@@ -438,24 +438,25 @@ do_note_netbsd_version(struct magic_set *ms, int swap, void *v)
                uint32_t ver_maj = desc / 100000000;
 
                if (file_printf(ms, " %u.%u", ver_maj, ver_min) == -1)
-                       return;
+                       return -1;
                if (ver_rel == 0 && ver_patch != 0) {
                        if (file_printf(ms, ".%u", ver_patch) == -1)
-                               return;
+                               return -1;
                } else if (ver_rel != 0) {
                        while (ver_rel > 26) {
                                if (file_printf(ms, "Z") == -1)
-                                       return;
+                                       return -1;
                                ver_rel -= 26;
                        }
                        if (file_printf(ms, "%c", 'A' + ver_rel - 1)
                            == -1)
-                               return;
+                               return -1;
                }
        }
+       return 0;
 }
 
-static void
+static int
 do_note_freebsd_version(struct magic_set *ms, int swap, void *v)
 {
        uint32_t desc;
@@ -463,7 +464,7 @@ do_note_freebsd_version(struct magic_set *ms, int swap, void *v)
        memcpy(&desc, v, sizeof(desc));
        desc = elf_getu32(swap, desc);
        if (file_printf(ms, ", for FreeBSD") == -1)
-               return;
+               return -1;
 
        /*
         * Contents is __FreeBSD_version, whose relation to OS
@@ -493,41 +494,42 @@ do_note_freebsd_version(struct magic_set *ms, int swap, void *v)
         */
        if (desc == 460002) {
                if (file_printf(ms, " 4.6.2") == -1)
-                       return;
+                       return -1;
        } else if (desc < 460100) {
                if (file_printf(ms, " %d.%d", desc / 100000,
                    desc / 10000 % 10) == -1)
-                       return;
+                       return -1;
                if (desc / 1000 % 10 > 0)
                        if (file_printf(ms, ".%d", desc / 1000 % 10) == -1)
-                               return;
+                               return -1;
                if ((desc % 1000 > 0) || (desc % 100000 == 0))
                        if (file_printf(ms, " (%d)", desc) == -1)
-                               return;
+                               return -1;
        } else if (desc < 500000) {
                if (file_printf(ms, " %d.%d", desc / 100000,
                    desc / 10000 % 10 + desc / 1000 % 10) == -1)
-                       return;
+                       return -1;
                if (desc / 100 % 10 > 0) {
                        if (file_printf(ms, " (%d)", desc) == -1)
-                               return;
+                               return -1;
                } else if (desc / 10 % 10 > 0) {
                        if (file_printf(ms, ".%d", desc / 10 % 10) == -1)
-                               return;
+                               return -1;
                }
        } else {
                if (file_printf(ms, " %d.%d", desc / 100000,
                    desc / 1000 % 100) == -1)
-                       return;
+                       return -1;
                if ((desc / 100 % 10 > 0) ||
                    (desc % 100000 / 100 == 0)) {
                        if (file_printf(ms, " (%d)", desc) == -1)
-                               return;
+                               return -1;
                } else if (desc / 10 % 10 > 0) {
                        if (file_printf(ms, ".%d", desc / 10 % 10) == -1)
-                               return;
+                               return -1;
                }
        }
+       return 0;
 }
 
 private int
@@ -557,11 +559,11 @@ do_bid_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
                    break;
                }
                if (file_printf(ms, ", BuildID[%s]=", btype) == -1)
-                       return 1;
+                       return -1;
                memcpy(desc, &nbuf[doff], descsz);
                for (i = 0; i < descsz; i++)
                    if (file_printf(ms, "%02x", desc[i]) == -1)
-                       return 1;
+                       return -1;
                return 1;
        }
        if (namesz == 4 && strcmp(RCAST(char *, &nbuf[noff]), "Go") == 0 &&
@@ -597,42 +599,43 @@ do_os_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
 
                *flags |= FLAGS_DID_OS_NOTE;
                if (file_printf(ms, ", for GNU/") == -1)
-                       return 1;
+                       return -1;
                switch (elf_getu32(swap, desc[0])) {
                case GNU_OS_LINUX:
                        if (file_printf(ms, "Linux") == -1)
-                               return 1;
+                               return -1;
                        break;
                case GNU_OS_HURD:
                        if (file_printf(ms, "Hurd") == -1)
-                               return 1;
+                               return -1;
                        break;
                case GNU_OS_SOLARIS:
                        if (file_printf(ms, "Solaris") == -1)
-                               return 1;
+                               return -1;
                        break;
                case GNU_OS_KFREEBSD:
                        if (file_printf(ms, "kFreeBSD") == -1)
-                               return 1;
+                               return -1;
                        break;
                case GNU_OS_KNETBSD:
                        if (file_printf(ms, "kNetBSD") == -1)
-                               return 1;
+                               return -1;
                        break;
                default:
                        if (file_printf(ms, "<unknown>") == -1)
-                               return 1;
+                               return -1;
                }
                if (file_printf(ms, " %d.%d.%d", elf_getu32(swap, desc[1]),
                    elf_getu32(swap, desc[2]), elf_getu32(swap, desc[3])) == -1)
-                       return 1;
+                       return -1;
                return 1;
        }
 
        if (namesz == 7 && strcmp(name, "NetBSD") == 0) {
                if (type == NT_NETBSD_VERSION && descsz == 4) {
                        *flags |= FLAGS_DID_OS_NOTE;
-                       do_note_netbsd_version(ms, swap, &nbuf[doff]);
+                       if (do_note_netbsd_version(ms, swap, &nbuf[doff]) == -1)
+                               return -1;
                        return 1;
                }
        }
@@ -640,7 +643,9 @@ do_os_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
        if (namesz == 8 && strcmp(name, "FreeBSD") == 0) {
                if (type == NT_FREEBSD_VERSION && descsz == 4) {
                        *flags |= FLAGS_DID_OS_NOTE;
-                       do_note_freebsd_version(ms, swap, &nbuf[doff]);
+                       if (do_note_freebsd_version(ms, swap, &nbuf[doff])
+                           == -1)
+                               return -1;
                        return 1;
                }
        }
@@ -649,7 +654,7 @@ do_os_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
            type == NT_OPENBSD_VERSION && descsz == 4) {
                *flags |= FLAGS_DID_OS_NOTE;
                if (file_printf(ms, ", for OpenBSD") == -1)
-                       return 1;
+                       return -1;
                /* Content of note is always 0 */
                return 1;
        }
@@ -659,12 +664,12 @@ do_os_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
                uint32_t desc;
                *flags |= FLAGS_DID_OS_NOTE;
                if (file_printf(ms, ", for DragonFly") == -1)
-                       return 1;
+                       return -1;
                memcpy(&desc, &nbuf[doff], sizeof(desc));
                desc = elf_getu32(swap, desc);
                if (file_printf(ms, " %d.%d.%d", desc / 100000,
                    desc / 10000 % 10, desc % 10000) == -1)
-                       return 1;
+                       return -1;
                return 1;
        }
        return 0;
@@ -696,14 +701,14 @@ do_pax_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
                desc = elf_getu32(swap, desc);
 
                if (desc && file_printf(ms, ", PaX: ") == -1)
-                       return 1;
+                       return -1;
 
                for (i = 0; i < __arraycount(pax); i++) {
                        if (((1 << CAST(int, i)) & desc) == 0)
                                continue;
                        if (file_printf(ms, "%s%s", did++ ? "," : "",
                            pax[i]) == -1)
-                               return 1;
+                               return -1;
                }
                return 1;
        }
@@ -750,7 +755,7 @@ do_core_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
        if (os_style != -1 && (*flags & FLAGS_DID_CORE_STYLE) == 0) {
                if (file_printf(ms, ", %s-style", os_style_names[os_style])
                    == -1)
-                       return 1;
+                       return -1;
                *flags |= FLAGS_DID_CORE_STYLE;
                *flags |= os_style;
        }
@@ -774,7 +779,7 @@ do_core_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
                            elf_getu32(swap, CAST(uint32_t, pi.cpi_siglwp)),
                            elf_getu32(swap, pi.cpi_signo),
                            elf_getu32(swap, pi.cpi_sigcode)) == -1)
-                               return 1;
+                               return -1;
 
                        *flags |= FLAGS_DID_CORE;
                        return 1;
@@ -791,13 +796,13 @@ do_core_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
                                argoff = 4 + 4 + 8 + 17;
                        if (file_printf(ms, ", from '%.80s'", nbuf + doff +
                            argoff) == -1)
-                               return 1;
+                               return -1;
                        pidoff = argoff + 81 + 2;
                        if (doff + pidoff + 4 <= size) {
                                if (file_printf(ms, ", pid=%u",
                                    elf_getu32(swap, *RCAST(uint32_t *, (nbuf +
                                    doff + pidoff)))) == -1)
-                                       return 1;
+                                       return -1;
                        }
                        *flags |= FLAGS_DID_CORE;
                }                           
@@ -898,7 +903,7 @@ do_core_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
                                        cp--;
                                if (file_printf(ms, ", from '%.*s'",
                                    CAST(int, cp - cname), cname) == -1)
-                                       return 1;
+                                       return -1;
                                *flags |= FLAGS_DID_CORE;
                                return 1;
 
@@ -1069,11 +1074,11 @@ do_auxv_note(struct magic_set *ms, unsigned char *nbuf, uint32_t type,
                                continue;
 
                        if (file_printf(ms, ", %s: '%s'", tag, buf) == -1)
-                               return 0;
+                               return -1;
                } else {
                        if (file_printf(ms, ", %s: %d", tag,
                            CAST(int, xauxv_val)) == -1)
-                               return 0;
+                               return -1;
                }
        }
        return 1;
@@ -1152,14 +1157,14 @@ donote(struct magic_set *ms, void *vbuf, size_t offset, size_t size,
        if (namesz & 0x80000000) {
                if (file_printf(ms, ", bad note name size %#lx",
                    CAST(unsigned long, namesz)) == -1)
-                       return 0;
+                       return -1;
            return 0;
        }
 
        if (descsz & 0x80000000) {
                if (file_printf(ms, ", bad note description size %#lx",
                    CAST(unsigned long, descsz)) == -1)
-                       return 0;
+                       return -1;
            return 0;
        }
 
@@ -1729,6 +1734,7 @@ file_tryelf(struct magic_set *ms, const struct buffer *b)
        int clazz;
        int swap;
        struct stat st;
+       const struct stat *stp;
        off_t fsize;
        int flags = 0;
        Elf32_Ehdr elf32hdr;
@@ -1757,12 +1763,25 @@ file_tryelf(struct magic_set *ms, const struct buffer *b)
            && (errno == ESPIPE))
                fd = file_pipe2file(ms, fd, buf, nbytes);
 
-       if (fd == -1 || fstat(fd, &st) == -1) {
-               file_badread(ms);
+       if (fd == -1) {
+               file_badread(ms);
                return -1;
        }
-       if (S_ISREG(st.st_mode) || st.st_size != 0)
-               fsize = st.st_size;
+
+       stp = &b->st;
+       /*
+        * b->st.st_size != 0 if previous fstat() succeeded,
+        * which is likely, we can avoid extra stat() call.
+        */
+       if (b->st.st_size == 0) {
+               stp = &st;
+               if (fstat(fd, &st) == -1) {
+                       file_badread(ms);
+                       return -1;
+               }
+       }
+       if (S_ISREG(stp->st_mode) || stp->st_size != 0)
+               fsize = stp->st_size;
        else
                fsize = SIZE_UNKNOWN;
 
index e7829ff..1b9d9b8 100644 (file)
@@ -27,7 +27,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: seccomp.c,v 1.7 2018/09/09 20:33:28 christos Exp $")
+FILE_RCSID("@(#)$File: seccomp.c,v 1.8 2019/02/24 18:12:04 christos Exp $")
 #endif /* lint */
 
 #if HAVE_LIBSECCOMP
@@ -176,6 +176,7 @@ enable_sandbox_full(void)
        ALLOW_RULE(_llseek);
        ALLOW_RULE(lstat);
        ALLOW_RULE(lstat64);
+       ALLOW_RULE(madvise);
        ALLOW_RULE(mmap);
        ALLOW_RULE(mmap2);
        ALLOW_RULE(mprotect);
index cfc1781..2edae41 100644 (file)
@@ -32,7 +32,7 @@
 #include "file.h"
 
 #ifndef        lint
-FILE_RCSID("@(#)$File: softmagic.c,v 1.278 2019/02/20 02:35:27 christos Exp $")
+FILE_RCSID("@(#)$File: softmagic.c,v 1.286 2019/05/17 02:24:59 christos Exp $")
 #endif /* lint */
 
 #include "magic.h"
@@ -147,7 +147,12 @@ private const char * __attribute__((__format_arg__(3)))
 file_fmtcheck(struct magic_set *ms, const char *desc, const char *def,
        const char *file, size_t line)
 {
-       const char *ptr = fmtcheck(desc, def);
+       const char *ptr;
+
+       if (strchr(desc, '%') == NULL)
+               return desc;
+
+       ptr = fmtcheck(desc, def);
        if (ptr == def)
                file_magerror(ms,
                    "%s, %" SIZE_T_FORMAT "u: format `%s' does not match"
@@ -443,8 +448,12 @@ flush:
                if (*printed_something) {
                        firstline = 0;
                }
-               if ((ms->flags & MAGIC_CONTINUE) == 0 && *found_match) {
+               if (*found_match) {
+                   if ((ms->flags & MAGIC_CONTINUE) == 0)
                        return *returnval; /* don't keep searching */
+                   // So that we print a separator
+                   *printed_something = 0;
+                   firstline = 0;
                }
                cont_level = 0;
        }
@@ -1482,13 +1491,13 @@ msetoffset(struct magic_set *ms, struct magic *m, struct buffer *bb,
                }
                if (CAST(size_t, -m->offset) > b->elen)
                        return -1;
-               buffer_init(bb, -1, b->ebuf, b->elen);
+               buffer_init(bb, -1, NULL, b->ebuf, b->elen);
                ms->eoffset = ms->offset = CAST(int32_t, b->elen + m->offset);
        } else {
                if (cont_level == 0) {
 normal:
                        // XXX: Pass real fd, then who frees bb?
-                       buffer_init(bb, -1, b->fbuf, b->flen);
+                       buffer_init(bb, -1, NULL, b->fbuf, b->flen);
                        ms->offset = m->offset;
                        ms->eoffset = 0;
                } else {
@@ -2063,6 +2072,22 @@ magiccheck(struct magic_set *ms, struct magic *m)
                slen = MIN(m->vallen, sizeof(m->value.s));
                l = 0;
                v = 0;
+#ifdef HAVE_MEMMEM
+               if (slen > 0 && m->str_flags == 0) {
+                       const char *found;
+                       idx = m->str_range + slen;
+                       if (m->str_range == 0 || ms->search.s_len < idx)
+                               idx = ms->search.s_len;
+                       found = CAST(const char *, memmem(ms->search.s, idx,
+                           m->value.s, slen));
+                       if (!found)
+                               return 0;
+                       idx = found - ms->search.s;
+                       ms->search.offset += idx;
+                       ms->search.rm_len = ms->search.s_len - idx;
+                       break;
+               }
+#endif
 
                for (idx = 0; m->str_range == 0 || idx < m->str_range; idx++) {
                        if (slen + idx > ms->search.s_len)
@@ -2291,13 +2316,11 @@ handle_annotation(struct magic_set *ms, struct magic *m, int firstline)
 private int
 print_sep(struct magic_set *ms, int firstline)
 {
-//     if (ms->flags & MAGIC_NODESC)
-//             return 0;
        if (firstline)
                return 0;
        /*
         * we found another match
         * put a newline and '-' to do some simple formatting
         */
-       return file_printf(ms, "\n- ");
+       return file_separator(ms);
 }