Browse Source

Import upstream version 5.31

Christos Zoulas 2 years ago
parent
commit
1392a39afa
100 changed files with 1393 additions and 1180 deletions
  1. 6 0
      ChangeLog
  2. 1 1
      aclocal.m4
  3. 10 10
      configure
  4. 1 1
      configure.ac
  5. 6 6
      doc/magic.man
  6. 1 1
      magic/Localstuff
  7. 3 3
      magic/Magdir/adventure
  8. 2 2
      magic/Magdir/amanda
  9. 3 3
      magic/Magdir/amigaos
  10. 6 6
      magic/Magdir/android
  11. 15 8
      magic/Magdir/animation
  12. 28 0
      magic/Magdir/apache
  13. 28 28
      magic/Magdir/apple
  14. 61 54
      magic/Magdir/archive
  15. 2 2
      magic/Magdir/att3b
  16. 61 9
      magic/Magdir/audio
  17. 2 2
      magic/Magdir/blackberry
  18. 3 3
      magic/Magdir/blender
  19. 2 2
      magic/Magdir/c-lang
  20. 29 29
      magic/Magdir/cad
  21. 4 4
      magic/Magdir/cafebabe
  22. 4 4
      magic/Magdir/clipper
  23. 6 6
      magic/Magdir/coff
  24. 2 2
      magic/Magdir/commands
  25. 2 2
      magic/Magdir/compress
  26. 5 5
      magic/Magdir/console
  27. 3 3
      magic/Magdir/cups
  28. 112 102
      magic/Magdir/database
  29. 8 8
      magic/Magdir/der
  30. 7 7
      magic/Magdir/diff
  31. 2 2
      magic/Magdir/dolby
  32. 7 7
      magic/Magdir/dump
  33. 3 3
      magic/Magdir/dyadic
  34. 3 3
      magic/Magdir/editors
  35. 425 408
      magic/Magdir/filesystems
  36. 17 17
      magic/Magdir/fonts
  37. 12 12
      magic/Magdir/fsav
  38. 3 3
      magic/Magdir/games
  39. 2 2
      magic/Magdir/geo
  40. 2 2
      magic/Magdir/gnu
  41. 7 7
      magic/Magdir/gpt
  42. 13 1
      magic/Magdir/gpu
  43. 5 5
      magic/Magdir/gringotts
  44. 9 9
      magic/Magdir/hitachi-sh
  45. 5 5
      magic/Magdir/ibm370
  46. 2 2
      magic/Magdir/ibm6000
  47. 14 14
      magic/Magdir/icc
  48. 58 58
      magic/Magdir/images
  49. 3 3
      magic/Magdir/intel
  50. 2 2
      magic/Magdir/isz
  51. 5 5
      magic/Magdir/jpeg
  52. 2 2
      magic/Magdir/kerberos
  53. 3 3
      magic/Magdir/kml
  54. 7 7
      magic/Magdir/linux
  55. 8 8
      magic/Magdir/lisp
  56. 10 10
      magic/Magdir/macintosh
  57. 3 3
      magic/Magdir/maple
  58. 10 8
      magic/Magdir/marc21
  59. 3 3
      magic/Magdir/mathematica
  60. 2 2
      magic/Magdir/metastore
  61. 2 2
      magic/Magdir/meteorological
  62. 2 2
      magic/Magdir/microfocus
  63. 2 2
      magic/Magdir/mime
  64. 3 3
      magic/Magdir/misctools
  65. 13 13
      magic/Magdir/modem
  66. 2 2
      magic/Magdir/mozilla
  67. 139 98
      magic/Magdir/msdos
  68. 6 6
      magic/Magdir/msvc
  69. 3 3
      magic/Magdir/msx
  70. 7 7
      magic/Magdir/mup
  71. 1 1
      magic/Magdir/nasa
  72. 11 11
      magic/Magdir/netbsd
  73. 3 3
      magic/Magdir/netscape
  74. 2 2
      magic/Magdir/nitpicker
  75. 4 4
      magic/Magdir/os2
  76. 2 2
      magic/Magdir/os9
  77. 1 1
      magic/Magdir/pc88
  78. 1 1
      magic/Magdir/pc98
  79. 3 3
      magic/Magdir/pdp
  80. 5 5
      magic/Magdir/perl
  81. 2 2
      magic/Magdir/pgf
  82. 10 10
      magic/Magdir/pgp
  83. 11 11
      magic/Magdir/printer
  84. 2 2
      magic/Magdir/project
  85. 2 2
      magic/Magdir/psdbms
  86. 7 3
      magic/Magdir/python
  87. 6 6
      magic/Magdir/riff
  88. 2 2
      magic/Magdir/sccs
  89. 3 3
      magic/Magdir/scientific
  90. 5 5
      magic/Magdir/sendmail
  91. 3 3
      magic/Magdir/sequent
  92. 2 2
      magic/Magdir/sharc
  93. 2 2
      magic/Magdir/sketch
  94. 4 4
      magic/Magdir/sql
  95. 2 2
      magic/Magdir/sysex
  96. 39 12
      magic/Magdir/terminfo
  97. 2 2
      magic/Magdir/vms
  98. 2 2
      magic/Magdir/vmware
  99. 5 5
      magic/Magdir/vorbis
  100. 0 0
      magic/Magdir/webassembly

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2017-03-17  20:32  Christos Zoulas <christos@zoulas.com>
+
+	* remove trailing spaces from magic files
+	* refactor is_tar
+	* better bounds checks for cdf
+
 2017-02-10  12:24  Christos Zoulas <christos@zoulas.com>
 
 	* release 5.30

+ 1 - 1
aclocal.m4

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

+ 10 - 10
configure

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

+ 1 - 1
configure.ac

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

+ 6 - 6
doc/magic.man

@@ -1,5 +1,5 @@
-.\" $File: magic.man,v 1.90 2017/02/08 21:52:03 christos Exp $
-.Dd February 8, 2017
+.\" $File: magic.man,v 1.91 2017/02/12 15:30:08 christos Exp $
+.Dd February 12, 2017
 .Dt MAGIC __FSECTION__
 .Os
 .\" install as magic.4 on USG, magic.5 on V7, Berkeley and Linux systems.
@@ -104,13 +104,13 @@ The following modifiers are supported:
 .It B
 A byte length (default).
 .It H
-A 2 byte big endian length.
+A 4 byte big endian length.
 .It h
-A 2 byte big little length.
+A 2 byte big endian length.
 .It L
-A 4 byte big endian length.
+A 4 byte little endian length.
 .It l
-A 4 byte big little length.
+A 2 byte little endian length.
 .It J
 The length includes itself in its count.
 .El

+ 1 - 1
magic/Localstuff

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

+ 3 - 3
magic/Magdir/adventure

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: adventure,v 1.15 2015/09/07 10:03:21 christos Exp $
+# $File: adventure,v 1.16 2017/03/17 21:35:28 christos Exp $
 # adventure: file(1) magic for Adventure game files
 #
 # from Allen Garvin <earendil@faeryland.tamu-commerce.edu>
@@ -78,7 +78,7 @@
 !:mime	application/x-tads
 #  Some saved game files start with "TADS2 save/g\n\r\032\0", a little-endian
 #  2-byte length N, the N-char name of the game file *without* a NUL (darn!),
-# "TADS2 save\n\r\032\0" and the interpreter version. 
+# "TADS2 save\n\r\032\0" and the interpreter version.
 0	string	TADS2\ save/g	TADS
 >12	belong	!0x0A0D1A00	saved game data, CORRUPTED
 >12	belong	 0x0A0D1A00
@@ -109,7 +109,7 @@
 # edited by David Griffith <dave@661.org>
 # 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 
+# Checked from source at (http://www.adrift.co/) and various taf files
 # found at the Interactive Fiction Archive (http://ifarchive.org/)
 0	belong  0x3C423FC9
 >4	belong  0x6A87C2CF	Adrift game file version

+ 2 - 2
magic/Magdir/amanda

@@ -1,9 +1,9 @@
 
 #------------------------------------------------------------------------------
-# $File: amanda,v 1.5 2009/09/19 16:28:07 christos Exp $
+# $File: amanda,v 1.6 2017/03/17 21:35:28 christos Exp $
 # amanda:  file(1) magic for amanda file format
 #
-0	string	AMANDA:\ 		AMANDA 
+0	string	AMANDA:\ 		AMANDA
 >8	string	TAPESTART\ DATE		tape header file,
 >>23	string	X
 >>>25	string	>\ 			Unused %s

+ 3 - 3
magic/Magdir/amigaos

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: amigaos,v 1.15 2012/06/21 01:13:59 christos Exp $
+# $File: amigaos,v 1.16 2017/03/17 21:35:28 christos Exp $
 # amigaos:  file(1) magic for AmigaOS binary formats:
 
 #
@@ -11,7 +11,7 @@
 0	belong		0x000003e7	AmigaOS object/library data
 #
 0	beshort		0xe310		Amiga Workbench
->2	beshort		1		
+>2	beshort		1
 >>48	byte		1		disk icon
 >>48	byte		2		drawer icon
 >>48	byte		3		tool icon
@@ -49,7 +49,7 @@
 0	string/c	@database	AmigaGuide file
 
 # Amiga disk types
-# 
+#
 0	string		RDSK		Rigid Disk Block
 >160	string		x		on %.24s
 0	string		DOS\0		Amiga DOS disk

+ 6 - 6
magic/Magdir/android

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------
-# $File: android,v 1.9 2016/01/11 21:19:18 christos Exp $
+# $File: android,v 1.10 2017/03/17 21:35:28 christos Exp $
 # Various android related magic entries
 #------------------------------------------------------------
 
@@ -61,9 +61,9 @@
 # http://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	
+0		ulelong			0x12349876
 # 1st pit entry marker
->0x01C	ulequad&0xFFFFFFFCFFFFFFFC	=0x0000000000000000	
+>0x01C	ulequad&0xFFFFFFFCFFFFFFFC	=0x0000000000000000
 # minimal 13 and maximal 18 PIT entries found
 >>4		ulelong			<128	Partition Information Table for Samsung smartphone
 >>>4		ulelong			x	\b, %d entries
@@ -109,9 +109,9 @@
 
 0	name			PIT-entry
 # garbage value implies end of pit entries
->0x00		ulequad&0xFFFFFFFCFFFFFFFC	=0x0000000000000000	
+>0x00		ulequad&0xFFFFFFFCFFFFFFFC	=0x0000000000000000
 # skip empty partition name
->>0x24		ubyte				!0			
+>>0x24		ubyte				!0
 # partition name
 >>>0x24		string				>\0			%-.32s
 # flags
@@ -122,7 +122,7 @@
 >>>0x08	ulelong		x			(0x%x)
 # filename
 >>>0x44		string				>\0			"%-.64s"
-#>>>0x18	ulelong				>0			
+#>>>0x18	ulelong				>0
 # blocksize in 512 byte units ?
 #>>>>0x18	ulelong				x			\b, %db
 # partition size in blocks ?

+ 15 - 8
magic/Magdir/animation

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: animation,v 1.59 2017/01/21 16:07:14 christos Exp $
+# $File: animation,v 1.61 2017/04/01 18:26:03 christos Exp $
 # animation:  file(1) magic for animation/movie formats
 #
 # animation formats
@@ -34,6 +34,13 @@
 !:mime	image/jp2
 # http://www.ftyps.com/ with local additions
 4	string		ftyp		ISO Media
+# http://aeroquartet.com/wordpress/2016/03/05/3-xavc-s/
+>8	string		XAVC		\b, MPEG v4 system, Sony XAVC Codec
+>>96	string		x		\b, Audio "%.4s"
+>>118	beshort		x		at %dHz
+>>140	string		x		\b, Video "%.4s"
+>>168	beshort		x		%d
+>>170	beshort		x		\bx%d
 >8	string		3g2		\b, MPEG v4 system, 3GPP2
 !:mime	video/3gpp2
 >>11	byte		4		\b v4 (H.263/AMR GSM 6.10)
@@ -186,13 +193,13 @@
 
 # MPEG sequences
 # Scans for all common MPEG header start codes
-0	 belong		    0x00000001     
+0	 belong		    0x00000001
 >4	 byte&0x1F	    0x07	   JVT NAL sequence, H.264 video
 >>5      byte               66             \b, baseline
 >>5      byte               77             \b, main
 >>5      byte               88             \b, extended
 >>7      byte               x              \b @ L %u
-0        belong&0xFFFFFF00  0x00000100     
+0        belong&0xFFFFFF00  0x00000100
 >3       byte               0xBA           MPEG sequence
 !:mime  video/mpeg
 >>4      byte               &0x40          \b, v2, program multiplex
@@ -493,8 +500,8 @@
 # GRR the original test are too common for many DOS files, so test 32 <= kbits <= 448
 # GRR this test is still too general as it catches a BOM of UTF-16 files (0xFFFE)
 # FIXME: Almost all little endian UTF-16 text with BOM are clobbered by these entries
-#0	beshort&0xFFFE		0xFFFE	
-#>2	ubyte&0xF0	>0x0F		
+#0	beshort&0xFFFE		0xFFFE
+#>2	ubyte&0xF0	>0x0F
 #>>2	ubyte&0xF0	<0xE1		MPEG ADTS, layer I, v1
 ## rate
 #>>>2      byte&0xF0       0x10           \b,  32 kbps
@@ -566,9 +573,9 @@
 # MP2, M2A
 0       beshort&0xFFFE  0xFFF4         MPEG ADTS, layer II, v2
 !:mime	audio/mpeg
-# rate 
+# rate
 >2      byte&0xF0       0x10           \b,   8 kbps
->2      byte&0xF0       0x20           \b,  16 kbps 
+>2      byte&0xF0       0x20           \b,  16 kbps
 >2      byte&0xF0       0x30           \b,  24 kbps
 >2      byte&0xF0       0x40           \b,  32 kbps
 >2      byte&0xF0       0x50           \b,  40 kbps
@@ -636,7 +643,7 @@
 # MP3, M25A
 0       beshort&0xFFFE  0xFFE2         MPEG ADTS, layer III,  v2.5
 !:mime	audio/mpeg
-# rate  
+# rate
 >2      byte&0xF0       0x10           \b,   8 kbps
 >2      byte&0xF0       0x20           \b,  16 kbps
 >2      byte&0xF0       0x30           \b,  24 kbps

+ 28 - 0
magic/Magdir/apache

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

+ 28 - 28
magic/Magdir/apple

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: apple,v 1.35 2016/08/17 09:45:13 christos Exp $
+# $File: apple,v 1.36 2017/03/17 21:35:28 christos Exp $
 # apple:  file(1) magic for Apple file formats
 #
 0	search/1/t	FiLeStArTfIlEsTaRt	binscii (apple ][) text
@@ -67,15 +67,15 @@
 # AppleWorks word processor:
 # URL: https://en.wikipedia.org/wiki/AppleWorks
 # Reference: http://www.gno.org/pub/apple2/doc/apple/filetypes/ftn.1a.xxxx
-# Update: Joerg Jenderek 
+# Update: Joerg Jenderek
 # NOTE:
 # The "O" is really the magic number, but that's so common that it's
 # necessary to check the tab stops that follow it to avoid false positives.
 # and/or look for unused bits of booleans bytes like zoom, paginated, mail merge
 # the newer AppleWorks is from claris with extension CWK
-4	string		O	
+4	string		O
 # test for unused bits of zoom- , paginated-boolean bytes
->84	ubequad		^0x00Fe00000000Fe00		
+>84	ubequad		^0x00Fe00000000Fe00
 # look for tabstop definitions "=" no tab, "|" no tab
 # "<" left tab,"^" center tab,">" right tab, "." decimal tab,
 # unofficial "!" other , "\x8a" other
@@ -92,9 +92,9 @@
 !:ext awp
 # minimum version needed to read this files. SFMinVers (0 , 30~3.0 )
 >>>183	ubyte		30	3.0
->>>183	ubyte		!30	
+>>>183	ubyte		!30
 >>>>183	ubyte		!0	0x%x
-# usual tabstop start sequence "=====<" 
+# usual tabstop start sequence "=====<"
 >>>5	string		x	\b, tabstop ruler "%6.6s"
 # tabstop ruler
 #>>>5	string		>\0	\b, tabstops "%-79s"
@@ -105,7 +105,7 @@
 # contains any mail-merge commands
 >>>92	  byte&0x01	>0	\b, with mail merge
 # left margin in 1/10 inches ( normally 0 or 10 )
->>>91	ubyte		>0	
+>>>91	ubyte		>0
 >>>>91	ubyte		x	\b, %d/10 inch left margin
 
 # AppleWorks database:
@@ -140,13 +140,13 @@
 
 # GRR: this test is still too general as it catches also Gujin BOOT144.SYS (0xfa080000)
 #0       belong&0xff00ff 0x80000 Applesoft BASIC program data
-0	belong&0x00ff00ff	0x00080000	
+0	belong&0x00ff00ff	0x00080000
 # assuming that line number must be positive
 >2	leshort			>0		Applesoft BASIC program data, first line number %d
 #>2     leshort         x       \b, first line number %d
 
 # ORCA/EZ assembler:
-# 
+#
 # This will not identify ORCA/M source files, since those have
 # some sort of date code instead of the two zero bytes at 6 and 7
 # XXX Conflicts with ELF
@@ -186,18 +186,18 @@
 # From Johan Gade.
 # These entries are disabled for now until we fix the following issues.
 #
-# Note there might be some problems with the "VAX COFF executable" 
-# entry. Note this entry should be placed before the mac filesystem section, 
+# Note there might be some problems with the "VAX COFF executable"
+# entry. Note this entry should be placed before the mac filesystem section,
 # particularly the "Apple Partition data" entry.
 #
-# The intended meaning of these tests is, that the file is only of the 
+# The intended meaning of these tests is, that the file is only of the
 # specified type if both of the lines are correct - i.e. if the first
 # line matches and the second doesn't then it is not of that type.
 #
 #0	long	0x7801730d
 #>4	long	0x62626060	UDIF read-only zlib-compressed image (UDZO)
 #
-# Note that this entry is recognized correctly by the "Apple Partition 
+# Note that this entry is recognized correctly by the "Apple Partition
 # data" entry - however since this entry is more specific - this
 # information seems to be more useful.
 #0	long	0x45520200
@@ -288,7 +288,7 @@
 # Apple disk partition stuff
 # URL: https://en.wikipedia.org/wiki/Apple_Partition_Map
 # Reference: https://ftp.netbsd.org/pub/NetBSD/NetBSD-current/src/sys/sys/bootblock.h
-# Update: Joerg Jenderek 
+# Update: Joerg Jenderek
 # "ER" is APPLE_DRVR_MAP_MAGIC signature
 0	beshort	0x4552
 # display Apple Driver Map (strength=50) after Syslinux bootloader (71)
@@ -315,7 +315,7 @@
 # device id 0 1 (37008 garbage for super_grub2_disk_hybrid_2.02s3.iso)
 >>10	ubeshort	x		\b, devid %u
 # driver data 0 (2425393296 garbage for super_grub2_disk_hybrid_2.02s3.iso)
->>12	ubelong		>0		
+>>12	ubelong		>0
 >>>12	ubelong		x		\b, driver data %u
 # number of driver descriptors sbDrvrCount <= 61
 # (37008 garbage for super_grub2_disk_hybrid_2.02s3.iso)
@@ -327,26 +327,26 @@
 # >>500	use		apple-driver-map
 # number of partitions is always same in every partition (map block count)
 #>>0x0204	ubelong		x	\b, %u partitions
->>0x0204	ubelong		>0	\b, contains[@0x200]: 
+>>0x0204	ubelong		>0	\b, contains[@0x200]:
 >>>0x0200	use		apple-apm
->>0x0204	ubelong		>1	\b, contains[@0x400]: 
+>>0x0204	ubelong		>1	\b, contains[@0x400]:
 >>>0x0400	use		apple-apm
->>0x0204	ubelong		>2	\b, contains[@0x600]: 
+>>0x0204	ubelong		>2	\b, contains[@0x600]:
 >>>0x0600	use		apple-apm
->>0x0204	ubelong		>3	\b, contains[@0x800]: 
+>>0x0204	ubelong		>3	\b, contains[@0x800]:
 >>>0x0800	use		apple-apm
->>0x0204	ubelong		>4	\b, contains[@0xA00]: 
+>>0x0204	ubelong		>4	\b, contains[@0xA00]:
 >>>0x0A00	use		apple-apm
->>0x0204	ubelong		>5	\b, contains[@0xC00]: 
+>>0x0204	ubelong		>5	\b, contains[@0xC00]:
 >>>0x0C00	use		apple-apm
->>0x0204	ubelong		>6	\b, contains[@0xE00]: 
+>>0x0204	ubelong		>6	\b, contains[@0xE00]:
 >>>0x0E00	use		apple-apm
->>0x0204	ubelong		>7	\b, contains[@0x1000]: 
+>>0x0204	ubelong		>7	\b, contains[@0x1000]:
 >>>0x1000	use		apple-apm
 #	display apple driver descriptor map (start-block, # blocks in sbBlkSize sizes, type)
 0	name				apple-driver-map
->0	ubequad		!0		
-# descBlock first block of driver 
+>0	ubequad		!0
+# descBlock first block of driver
 >>0	ubelong	x			\b, driver start block %u
 # descSize driver size in blocks
 >>4	ubeshort	x		\b, size %u
@@ -355,11 +355,11 @@
 
 # URL: https://en.wikipedia.org/wiki/Apple_Partition_Map
 # Reference: http://opensource.apple.com/source/IOStorageFamily/IOStorageFamily-116/IOApplePartitionScheme.h
-# Update: Joerg Jenderek 
+# Update: Joerg Jenderek
 # Yes, the 3rd and 4th bytes pmSigPad are reserved, but we use them to make the
 # magic stronger.
 # for apple partition map stored as a single file
-0	belong	0x504d0000		
+0	belong	0x504d0000
 # to display Apple Partition Map (strength=70) after Syslinux bootloader (71)
 #!:strength +0
 >0	use		apple-apm
@@ -417,7 +417,7 @@
 0	name			appleworks
 >0	belong&0x00ffffff	0x07e100	AppleWorks CWK Document
 >0	belong&0x00ffffff	0x008803	ClarisWorks CWK Document
->0	default			x	
+>0	default			x
 >>0	belong			x		AppleWorks/ClarisWorks CWK Document
 >0	byte			x		\b, version %d
 >30	beshort			x		\b, %d

+ 61 - 54
magic/Magdir/archive

@@ -1,5 +1,5 @@
 #------------------------------------------------------------------------------
-# $File: archive,v 1.104 2017/02/10 14:03:22 christos Exp $
+# $File: archive,v 1.107 2017/03/20 19:51:15 christos Exp $
 # archive:  file(1) magic for archive formats (see also "msdos" for self-
 #           extracting compressed archives)
 #
@@ -249,9 +249,9 @@
 # URL: http://fileformats.archiveteam.org/wiki/TTComp_archive
 # Update: Joerg Jenderek
 # GRR: line below is too general as it matches also Panorama database "TCDB 2003-10 demo.pan", others
-0	string	\0\6 
+0	string	\0\6
 # look for first keyword of Panorama database *.pan
->12	search/261	DESIGN	
+>12	search/261	DESIGN
 # skip keyword with low entropy
 >12	default		x	TTComp archive, binary, 4K dictionary
 # (version 5.25) labeled the above entry as "TTComp archive data"
@@ -447,9 +447,9 @@
 0	string	SZ\x0a\4 SZip archive data
 # XPack DiskImage
 # *.XDI updated by Joerg Jenderek Sep 2015
-# ftp://ftp.sac.sk/pub/sac/pack/0index.txt 
+# ftp://ftp.sac.sk/pub/sac/pack/0index.txt
 # GRR: this test is still too general as it catches also text files starting with jm
-0	string	jm	
+0	string	jm
 # only found examples with this additional characteristic 2 bytes
 >2	string	\x2\x4	Xpack DiskImage archive data
 #!:ext xdi
@@ -462,7 +462,7 @@
 # ftp://ftp.elf.stuba.sk/pub/pc/pack/xpa32.zip
 # created by XPA32.EXE version 1.0.2 for Windows
 >0	string	xpa\0\1 \b32 archive data
-# created by XPACK.COM version 1.67m or 1.67r with short 0x1800 
+# created by XPACK.COM version 1.67m or 1.67r with short 0x1800
 >3	ubeshort	!0x0001	\bck archive data
 # XPack Single Data
 # changed by Joerg Jenderek Sep 2015 back to like in version 5.12
@@ -552,7 +552,7 @@
 >>0x36	string		>\0			fstype %.8s
 
 # LHARC/LHA archiver (Greg Roelofs, newt@uchicago.edu)
-# Update: Joerg Jenderek 
+# 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
 #
@@ -561,16 +561,16 @@
 # check 1st character of method id like -lz4- -lh5- or -pm2-
 >2	string		-
 # check 5th character of method id
->>6	string		-		
+>>6	string		-
 # check header level 0 1 2 3
->>>20	ubyte		<4		
+>>>20	ubyte		<4
 # check 2nd, 3th and 4th character of method id
->>>>3	regex		\^(lh[0-9a-ex]|lz[s2-8]|pm[012]|pc1)		\b 
+>>>>3	regex		\^(lh[0-9a-ex]|lz[s2-8]|pm[012]|pc1)		\b\040
 !:mime	application/x-lzh-compressed
 # creator type "LHA "
-!:apple	????LHA 
+!:apple	????LHA
 # display archive type name like "LHa/LZS archive data" or "LArc archive"
->>>>>2	string		-lz		\b 
+>>>>>2	string		-lz		\b\040
 !:ext	lzs
 # already known  -lzs- -lz4- -lz5- with old names
 >>>>>>2	string	-lzs		LHa/LZS archive data
@@ -578,18 +578,18 @@
 # missing -lz?- with wikipedia names
 >>>>>>3	regex	\^lz[2378]	LArc archive
 # display archive type name like "LHa (2.x) archive data"
->>>>>2	string		-lh		\b 
+>>>>>2	string		-lh		\b
 # already known -lh0- -lh1- -lh2- -lh3-  -lh4- -lh5- -lh6- -lh7- -lhd- variants with old names
 >>>>>>3	regex		\^lh[01]	LHarc 1.x/ARX archive data
 # LHice archiver use ".ICE" as name extension instead usual one ".lzh"
 # FOOBAR archiver use ".foo" as name extension instead usual one
 # "Florain Orjanov's and Olga Bachetska's ARchiver" not found at the moment
->>>>>>>2	string	-lh1		\b 
+>>>>>>>2	string	-lh1		\b\040
 !:ext lha/lzh/ice
 >>>>>>3	regex		\^lh[23d]	LHa 2.x? archive data
 >>>>>>3	regex		\^lh[7]		LHa (2.x)/LHark archive data
 >>>>>>3	regex		\^lh[456]	LHa (2.x) archive data
->>>>>>>2	string	-lh5		\b 
+>>>>>>>2	string	-lh5		\b\040
 # https://en.wikipedia.org/wiki/BIOS
 # Some mainboard BIOS like Award use LHa compression. So archives with unusal extension are found like
 # bios.rom , kd7_v14.bin, 1010.004, ...
@@ -599,7 +599,7 @@
 # UNLHA32 2.67a
 >>>>>>2	string		-lhx		LHa (UNLHA32) archive
 # lha archives with standard file name extensions ".lha" ".lzh"
->>>>>>3	regex		!\^(lh1|lh5)	\b 
+>>>>>>3	regex		!\^(lh1|lh5)	\b\040
 !:ext lha/lzh
 # this should not happen if all -lh variants are described
 >>>>>>2	default		x		LHa (unknown) archive
@@ -614,28 +614,28 @@
 #	check and display information of lharc header
 0	name				lharc-header
 # header size 0x4 , 0x1b-0x61
->0	ubyte		x		
+>0	ubyte		x
 # compressed data size != compressed file size
 #>7	ulelong		x		\b, data size %d
-# attribute: 0x2~?? 0x10~symlink|target 0x20~normal 
+# attribute: 0x2~?? 0x10~symlink|target 0x20~normal
 #>19	ubyte		x		\b, 19_0x%x
 # level identifier 0 1 2 3
 #>20	ubyte		x		\b, level %d
 # time stamp
 #>15		ubelong	x		DATE 0x%8.8x
 # OS ID for level 1
->20	ubyte		1		
+>20	ubyte		1
 # 0x20 types find for *.rom files
 >>(21.b+24)	ubyte	<0x21		\b, 0x%x OS
 # ascii type like M for MSDOS
 >>(21.b+24)	ubyte	>0x20		\b, '%c' OS
 # OS ID for level 2
->20	ubyte		2		
+>20	ubyte		2
 #>>23	ubyte		x		\b, OS ID 0x%x
 >>23	ubyte		<0x21		\b, 0x%x OS
 >>23	ubyte		>0x20		\b, '%c' OS
 # filename only for level 0 and 1
->20	ubyte		<2		
+>20	ubyte		<2
 # length of filename
 >>21		ubyte	>0		\b, with
 # filename
@@ -643,73 +643,73 @@
 #
 #2	string		-lh0-		LHarc 1.x/ARX archive data [lh0]
 #!:mime	application/x-lharc
-2	string		-lh0-		
+2	string		-lh0-
 >0	use	lharc-file
 #2	string		-lh1-		LHarc 1.x/ARX archive data [lh1]
 #!:mime	application/x-lharc
-2	string		-lh1-		
+2	string		-lh1-
 >0	use	lharc-file
 # NEW -lz2- ... -lz8-
-2	string		-lz2-		
+2	string		-lz2-
 >0	use	lharc-file
-2	string		-lz3-		
+2	string		-lz3-
 >0	use	lharc-file
-2	string		-lz4-		
+2	string		-lz4-
 >0	use	lharc-file
-2	string		-lz5-		
+2	string		-lz5-
 >0	use	lharc-file
-2	string		-lz7-		
+2	string		-lz7-
 >0	use	lharc-file
-2	string		-lz8-		
+2	string		-lz8-
 >0	use	lharc-file
 #	[never seen any but the last; -lh4- reported in comp.compression:]
 #2	string		-lzs-		LHa/LZS archive data [lzs]
-2	string		-lzs-		
+2	string		-lzs-
 >0	use	lharc-file
 # According to wikipedia and others such a version does not exist
 #2	string		-lh\40-		LHa 2.x? archive data [lh ]
 #2	string		-lhd-		LHa 2.x? archive data [lhd]
-2	string		-lhd-		
+2	string		-lhd-
 >0	use	lharc-file
 #2	string		-lh2-		LHa 2.x? archive data [lh2]
-2	string		-lh2-		
+2	string		-lh2-
 >0	use	lharc-file
 #2	string		-lh3-		LHa 2.x? archive data [lh3]
-2	string		-lh3-		
+2	string		-lh3-
 >0	use	lharc-file
 #2	string		-lh4-		LHa (2.x) archive data [lh4]
-2	string		-lh4-		
+2	string		-lh4-
 >0	use	lharc-file
 #2	string		-lh5-		LHa (2.x) archive data [lh5]
-2	string		-lh5-		
+2	string		-lh5-
 >0	use	lharc-file
 #2	string		-lh6-		LHa (2.x) archive data [lh6]
-2	string		-lh6-		
+2	string		-lh6-
 >0	use	lharc-file
 #2	string		-lh7-		LHa (2.x)/LHark archive data [lh7]
-2	string		-lh7-		
+2	string		-lh7-
 # !:mime	application/x-lha
 # >20	byte		x		- header level %d
 >0	use	lharc-file
 # NEW -lh8- ... -lhe- , -lhx-
-2	string		-lh8-		
+2	string		-lh8-
 >0	use	lharc-file
-2	string		-lh9-		
+2	string		-lh9-
 >0	use	lharc-file
-2	string		-lha-		
+2	string		-lha-
 >0	use	lharc-file
-2	string		-lhb-		
+2	string		-lhb-
 >0	use	lharc-file
-2	string		-lhc-		
+2	string		-lhc-
 >0	use	lharc-file
-2	string		-lhe-		
+2	string		-lhe-
 >0	use	lharc-file
-2	string		-lhx-		
+2	string		-lhx-
 >0	use	lharc-file
 # taken from idarc [JW]
 2   string      -lZ         PUT archive data
 # already done by LHarc magics
-# this should never happen if all sub types of LZS archive are identified 
+# this should never happen if all sub types of LZS archive are identified
 #2   string      -lz         LZS archive data
 2   string      -sw1-       Swag archive data
 
@@ -950,17 +950,17 @@
 0       string  \0\ \ \ \ \ \ \ \ \ \ \ \0\0    LBR archive data
 #
 # PMA (CP/M derivative of LHA)
-# Update: Joerg Jenderek 
+# Update: Joerg Jenderek
 # URL: https://en.wikipedia.org/wiki/LHA_(file_format)
 #
 #2       string          -pm0-           PMarc archive data [pm0]
-2	string		-pm0-		
+2	string		-pm0-
 >0	use	lharc-file
 #2       string          -pm1-           PMarc archive data [pm1]
-2	string		-pm1-		
+2	string		-pm1-
 >0	use	lharc-file
 #2       string          -pm2-           PMarc archive data [pm2]
-2	string		-pm2-		
+2	string		-pm2-
 >0	use	lharc-file
 2       string          -pms-           PMarc SFX archive (CP/M, DOS)
 #!:mime	application/x-foobar-exec
@@ -1155,12 +1155,12 @@
 >3		ubyte			0		\b, no compression
 >3		ubyte			2		\b, fast compression (Z1)
 >3		ubyte			3		\b, medium compression (Z2)
->3		ubyte			>3		
+>3		ubyte			>3
 >>3		ubyte			<11		\b, compression (Z%d-1)
->2		ubyte&0x08		0x00		
+>2		ubyte&0x08		0x00
 # ~ 30 byte password field only for *.gho
 >>12		ubequad			!0		\b, password protected
->>44		ubyte			!1		
+>>44		ubyte			!1
 # 1~Image All, sector-by-sector only for *.gho
 >>>10		ubyte			1		\b, sector copy
 # 1~Image Boot track only for *.gho
@@ -1170,8 +1170,8 @@
 # optional image description only *.gho
 >>0xff		string			>\0		"%-.254s"
 # look for DOS sector end sequence
->0xE08	search/7776		\x55\xAA	
->>&-512	indirect		x		\b; contains 
+>0xE08	search/7776		\x55\xAA
+>>&-512	indirect		x		\b; contains
 
 # Google Chrome extensions
 # https://developer.chrome.com/extensions/crx
@@ -1179,3 +1179,10 @@
 0	string	Cr24	Google Chrome extension
 !:mime	application/x-chrome-extension
 >4	ulong	x	\b, version %u
+
+# SeqBox - Sequenced container
+# ext: sbx, seqbox
+# Marco Pontello marcopon@gmail.com
+# reference: https://github.com/MarcoPon/SeqBox
+0	string	SBx	SeqBox,
+>3	byte	x	version %d

+ 2 - 2
magic/Magdir/att3b

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: att3b,v 1.9 2014/04/30 21:41:02 christos Exp $
+# $File: att3b,v 1.10 2017/03/17 21:35:28 christos Exp $
 # att3b:  file(1) magic for AT&T 3B machines
 #
 # The `versions' should be un-commented if they work for you.
@@ -36,6 +36,6 @@
 #>18	beshort		&00040000	and MAU hardware required
 #>22	beshort		>0		- version %d
 #
-# core file for 3b2 
+# core file for 3b2
 0	string		\000\004\036\212\200	3b2 core file
 >364	string		>\0		of '%s'

+ 61 - 9
magic/Magdir/audio

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: audio,v 1.76 2016/11/02 23:06:32 christos Exp $
+# $File: audio,v 1.79 2017/03/17 22:20:22 christos Exp $
 # audio:  file(1) magic for sound formats (see also "iff")
 #
 # Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
@@ -300,7 +300,7 @@
 >>5	byte		&0x40	\b, extended header
 >>5	byte		&0x20	\b, experimental
 >>5	byte		&0x10	\b, footer present
->(6.I+10)	indirect	x	\b, contains: 
+>(6.I+10)	indirect	x	\b, contains:
 
 # NSF (NES sound file) magic
 0	string		NESM\x1a	NES Sound File
@@ -314,7 +314,7 @@
 >122	byte&0x1	=0		NTSC
 
 # NSFE (Extended NES sound file) magic
-# http://slickproductions.org/docs/NSF/nsfespec.txt 
+# http://slickproductions.org/docs/NSF/nsfespec.txt
 # From: David Pflug <david@pflug.email>
 0	string		NSFE		Extended NES Sound File
 >48	search/0x1000	auth
@@ -660,7 +660,7 @@
 
 # From Fabio R. Schmidlin <frs@pop.com.br>
 # VGM music file
-0	string		Vgm\ 
+0	string		Vgm\040
 >9	ubyte		>0	VGM Video Game Music dump v
 >>9	ubyte/16	>0	\b%d
 >>9	ubyte&0x0F	x	\b%d
@@ -725,7 +725,7 @@
 # URL:		http://www.garmin.com/
 # Reference:	http://turboccc.wikispaces.com/share/view/28622555
 # NOTE:		there exist 2 other Garmin VPM formats
-0		string	AUDIMG		
+0		string	AUDIMG
 # skip text files starting with string "AUDIMG"
 >13		ubyte		<13	Garmin Voice Processing Module
 !:mime	audio/x-vpm-wav-garmin
@@ -745,16 +745,68 @@
 # second of release (0-59)
 >>9		ubyte		x	\b:%.2d
 # if you select a language like german on your garmin device
-# you can only select voice modules with correponding language byte ID like 1 
+# you can only select voice modules with correponding language byte ID like 1
 >>18		ubyte		x	\b, language ID %d
 # pointer to 1st audio WAV sample
->>16		uleshort	>0	
+>>16		uleshort	>0
 >>>(16.s)	ulelong		>0	\b, at offset 0x%x
 # WAV length
 >>>>(16.s+4)	ulelong		>0	%d Bytes
 # look for magic
->>>>>(&-8.l)	string		RIFF	
+>>>>>(&-8.l)	string		RIFF
 # determine type by ./riff
->>>>>>&-4	indirect	x	\b 
+>>>>>>&-4	indirect	x	\b
 # 2 - ~ 131 WAV samples following same way
 
+# From Martin Mueller Skarbiniks Pedersen
+0		string		GDM
+>0x3		byte		0xFE	General Digital Music.
+>0x4		string		>\0	title: "%s"
+>0x24		string		>\0	musician: "%s"
+>>0x44		beshort		0x0D0A
+>>>0x46		byte		0x1A
+>>>>0x47	string		GMFS	Version
+>>>>0x4B	byte		x	%d.
+>>>>0x4C	byte		x	\b%02d
+>>>>0x4D	beshort		0x000	(2GDM v
+>>>>0x4F	byte		x	\b%d.
+>>>>>0x50	byte		x	\b%d)
+
+0		string		MTM	Multitracker
+>0x3		byte/16		x	Version %d.
+>0x3		byte&0x0F	x	\b%02d
+>>0x4		string		>\0	title: "%s"
+
+0		string		HVL
+>3		byte		<2	Hively Tracker Song
+>3		byte		0	1 module data
+>3		byte		1	2 module data
+
+0		string		MO3
+>3		ubyte		<6	MOdule with MP3
+>>3		byte		0	Version	0	(With MP3 and lossless)
+>>3		byte		1	Version	1	(With ogg and lossless)
+>>3		byte		3	Version 2.2
+>>3		byte		4	(With no LAME header)
+>>3		byte		5	Version 2.4
+
+0		string		ADRVPACK	AProSys	module
+
+# ftp://ftp.modland.com/pub/documents/format_documentation/\
+# Art%20Of%20Noise%20(.aon).txt
+0		string		AON
+>4		string		"ArtOfNoise by Bastian Spiegel(twice/lego)"
+>0x2e		string		NAME	Art of Noise Tracker Song
+>3		string		<9
+>3		string		4	(4 voices)
+>3		string		8	(8 voices)
+>>0x36		string		>\0	Title: "%s"
+
+0		string		FAR
+>0x2c		byte		0x0d
+>0x2d		byte		0x0a
+>0x2e		byte		0x1a
+>>0x3		byte		0xFE	Farandole Tracker Song
+>>>0x31		byte/16		x	Version %d.
+>>>0x31		byte&0x0F	x	\b%02d
+>>>>0x4		string		>\0	\b, title: "%s"

+ 2 - 2
magic/Magdir/blackberry

@@ -1,8 +1,8 @@
 
 #------------------------------------------------------------------------------
-# $File: blackberry,v 1.1 2014/01/31 01:51:32 christos Exp $
+# $File: blackberry,v 1.2 2017/03/17 21:35:28 christos Exp $
 # blackberry:  file(1) magic for BlackBerry file formats
 #
-5	belong	0		
+5	belong	0
 >8	belong  010010010	BlackBerry RIM ETP file
 >>22	string	x		\b for %s

+ 3 - 3
magic/Magdir/blender

@@ -1,11 +1,11 @@
 
 #------------------------------------------------------------------------------
-# $File: blender,v 1.6 2014/08/30 08:34:17 christos Exp $
+# $File: blender,v 1.7 2017/03/17 21:35:28 christos Exp $
 # blender: file(1) magic for Blender 3D related files
 #
-# Native format rule v1.2. For questions use the developers list 
+# Native format rule v1.2. For questions use the developers list
 # http://lists.blender.org/mailman/listinfo/bf-committers
-# GLOB chunk was moved near start and provides subversion info since 2.42 
+# GLOB chunk was moved near start and provides subversion info since 2.42
 
 0		string	=BLENDER	Blender3D,
 >7		string	=_		saved as 32-bits

+ 2 - 2
magic/Magdir/c-lang

@@ -1,5 +1,5 @@
 #------------------------------------------------------------------------------
-# $File: c-lang,v 1.24 2016/07/01 23:31:13 christos Exp $
+# $File: c-lang,v 1.25 2017/03/17 21:35:28 christos Exp $
 # c-lang:  file(1) magic for C and related languages programs
 #
 # The strength is to beat standard HTML
@@ -53,7 +53,7 @@
 !:strength +25
 !:mime	text/x-objective-c
 
-# From: Mikhail Teterin <mi@aldan.algebra.com> 
+# From: Mikhail Teterin <mi@aldan.algebra.com>
 0	string		cscope		cscope reference data
 >7	string		x		version %.2s
 # We skip the path here, because it is often long (so file will

+ 29 - 29
magic/Magdir/cad

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: cad,v 1.13 2014/03/23 18:05:38 christos Exp $
+# $File: cad,v 1.14 2017/03/17 21:35:28 christos Exp $
 # autocad:  file(1) magic for cad files
 #
 
@@ -9,7 +9,7 @@
 # DGN is the default file extension of Microstation/Intergraph CAD files.
 # CIT is the proprietary raster format (similar to TIFF) used to attach
 # 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
@@ -42,7 +42,7 @@
 >4	string	\030\000\000			CITFile
 >4	string	\030\000\003			CITFile
 
-# AutoCAD 
+# 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
 0	string	MC0.0	DWG AutoDesk AutoCAD Release 1.0
@@ -99,42 +99,42 @@
 0	string	AC1027	DWG AutoDesk AutoCAD 2013/2014
 !:mime image/vnd.dwg
 
-# KOMPAS 2D drawing from ASCON 
+# 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
-# Extension is CDW for drawing and FRW for fragment of drawing 
+# 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)
 # From:
 # http://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 
->2	belong	0x4D00000C	Kompas drawing 12.0 
->2	belong	0x3200000B	Kompas drawing 11.0 SP1 
->2	belong	0x3100000B	Kompas drawing 11.0 
->2	belong	0x2310000A	Kompas drawing 10.0 SP1 
->2	belong	0x2110000A	Kompas drawing 10.0 
->2	belong	0x08000009	Kompas drawing 9.0 SP1 
->2	belong	0x05000009	Kompas drawing 9.0 
->2	belong	0x33010008	Kompas drawing 8+ 
->2	belong	0x1A000008	Kompas drawing 8.0 
->2	belong	0x2C010107	Kompas drawing 7+ 
->2	belong	0x05000007	Kompas drawing 7.0 
->2	belong	0x32000006	Kompas drawing 6+ 
->2	belong	0x09000006	Kompas drawing 6.0 
->2	belong	0x5C009005	Kompas drawing 5.11R03 
->2	belong	0x54009005	Kompas drawing 5.11R02 
->2	belong	0x51009005	Kompas drawing 5.11R01 
->2	belong	0x22009005	Kompas drawing 5.10R03 
->2	belong	0x22009005	Kompas drawing 5.10R02 mar 
->2	belong	0x21009005	Kompas drawing 5.10R02 febr 
->2	belong	0x19009005	Kompas drawing 5.10R01 
->2	belong	0xF4008005	Kompas drawing 5.9R01.003 
->2	belong	0x1C008005	Kompas drawing 5.9R01.002 
->2	belong	0x11008005	Kompas drawing 5.8R01.003 
+>2	belong	0x4E00000C	Kompas drawing 12.0 SP1
+>2	belong	0x4D00000C	Kompas drawing 12.0
+>2	belong	0x3200000B	Kompas drawing 11.0 SP1
+>2	belong	0x3100000B	Kompas drawing 11.0
+>2	belong	0x2310000A	Kompas drawing 10.0 SP1
+>2	belong	0x2110000A	Kompas drawing 10.0
+>2	belong	0x08000009	Kompas drawing 9.0 SP1
+>2	belong	0x05000009	Kompas drawing 9.0
+>2	belong	0x33010008	Kompas drawing 8+
+>2	belong	0x1A000008	Kompas drawing 8.0
+>2	belong	0x2C010107	Kompas drawing 7+
+>2	belong	0x05000007	Kompas drawing 7.0
+>2	belong	0x32000006	Kompas drawing 6+
+>2	belong	0x09000006	Kompas drawing 6.0
+>2	belong	0x5C009005	Kompas drawing 5.11R03
+>2	belong	0x54009005	Kompas drawing 5.11R02
+>2	belong	0x51009005	Kompas drawing 5.11R01
+>2	belong	0x22009005	Kompas drawing 5.10R03
+>2	belong	0x22009005	Kompas drawing 5.10R02 mar
+>2	belong	0x21009005	Kompas drawing 5.10R02 febr
+>2	belong	0x19009005	Kompas drawing 5.10R01
+>2	belong	0xF4008005	Kompas drawing 5.9R01.003
+>2	belong	0x1C008005	Kompas drawing 5.9R01.002
+>2	belong	0x11008005	Kompas drawing 5.8R01.003
 
 # CAD: file(1) magic for computer aided design files
 # Phillip Griffith <phillip dot griffith at gmail dot com>

+ 4 - 4
magic/Magdir/cafebabe

@@ -1,14 +1,14 @@
 
 #------------------------------------------------------------------------------
-# $File: cafebabe,v 1.21 2015/10/15 20:56:51 christos Exp $
+# $File: cafebabe,v 1.22 2017/03/17 21:35:28 christos Exp $
 # Cafe Babes unite!
 #
 # Since Java bytecode and Mach-O universal binaries have the same magic number,
 # the test must be performed in the same "magic" sequence to get both right.
 # The long at offset 4 in a Mach-O universal binary tells the number of
 # architectures; the short at offset 4 in a Java bytecode file is the JVM minor
-# version and the short at offset 6 is the JVM major version.  Since there are only 
-# only 18 labeled Mach-O architectures at current, and the first released 
+# version and the short at offset 6 is the JVM major version.  Since there are only
+# only 18 labeled Mach-O architectures at current, and the first released
 # Java class format was version 43.0, we can safely choose any number
 # between 18 and 39 to test the number of architectures against
 # (and use as a hack). Let's not use 18, because the Mach-O people
@@ -47,7 +47,7 @@
 
 0	name		mach-o		\b [
 >0	use		mach-o-cpu	\b
->(8.L)	indirect			\b: 
+>(8.L)	indirect			\b:
 >0	belong		x		\b]
 
 0	belong		0xcafebabe

+ 4 - 4
magic/Magdir/clipper

@@ -1,13 +1,13 @@
 
 #------------------------------------------------------------------------------
-# $File: clipper,v 1.7 2014/04/30 21:41:02 christos Exp $
+# $File: clipper,v 1.8 2017/03/17 21:35:28 christos Exp $
 # clipper:  file(1) magic for Intergraph (formerly Fairchild) Clipper.
 #
 # XXX - what byte order does the Clipper use?
 #
 # XXX - what's the "!" stuff:
 #
-# >18	short		!074000,000000	C1 R1 
+# >18	short		!074000,000000	C1 R1
 # >18	short		!074000,004000	C2 R1
 # >18	short		!074000,010000	C3 R1
 # >18	short		!074000,074000	TEST
@@ -15,7 +15,7 @@
 # I shall assume it's ANDing the field with the first value and
 # comparing it with the second, and rewrite it as:
 #
-# >18	short&074000	000000		C1 R1 
+# >18	short&074000	000000		C1 R1
 # >18	short&074000	004000		C2 R1
 # >18	short&074000	010000		C3 R1
 # >18	short&074000	074000		TEST
@@ -37,7 +37,7 @@
 >12	long		>0		not stripped
 >22	short		>0		- version %d
 0	short		0577		CLIPPER COFF executable
->18	short&074000	000000		C1 R1 
+>18	short&074000	000000		C1 R1
 >18	short&074000	004000		C2 R1
 >18	short&074000	010000		C3 R1
 >18	short&074000	074000		TEST

+ 6 - 6
magic/Magdir/coff

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: coff,v 1.1 2015/09/30 20:32:35 christos Exp $
+# $File: coff,v 1.2 2017/03/17 21:35:28 christos Exp $
 # coff: file(1) magic for Common Object Files not specific to known cpu types or manufactures
 #
 # COFF
@@ -15,7 +15,7 @@
 # mips,motorola,msdos,osf1,sharc,varied.out,vax
 0	name				display-coff
 # test for unused flag bits (0x8000,0x0800,0x0400,0x0200,x0080) in f_flags
->18	uleshort&0x8E80	0		
+>18	uleshort&0x8E80	0
 >>0	clear		x
 # f_magic - magic number
 # DJGPP, 80386 COFF executable, MS Windows COFF Intel 80386 object file (./intel)
@@ -25,7 +25,7 @@
 # Hitachi SH little-endian COFF (./hitachi-sh)
 >>0	uleshort	0x0550		Hitachi SH little-endian
 # executable (RISC System/6000 V3.1) or obj module (./ibm6000)
-#>>0	uleshort	0x01DF		
+#>>0	uleshort	0x01DF
 # TODO for other COFFs
 #>>0	uleshort	0xABCD		COFF_TEMPLATE
 >>0	default		x
@@ -45,12 +45,12 @@
 >>18	leshort		&0x0008		\b, stripped
 >>18	leshort		^0x0008		\b, not stripped
 # flags in other COFF versions
-#0x0010    F_FDPR_PROF 
+#0x0010    F_FDPR_PROF
 #0x0020    F_FDPR_OPTI
 #0x0040    F_DSA
 # F_AR32WR flag bit
 #>>>18	leshort		&0x0100		\b, 32 bit little endian
-#0x1000    F_DYNLOAD 
+#0x1000    F_DYNLOAD
 #0x2000    F_SHROBJ
 #0x4000    F_LOADONLY
 # f_nscns - number of sections
@@ -62,7 +62,7 @@
 >>8	ulelong		>0		\b, symbol offset=0x%x
 # f_nsyms - number of symbols, only for not stripped
 >>12	ulelong		>0		\b, %d symbols
-# f_opthdr - optional header size 
+# f_opthdr - optional header size
 >>16	uleshort	>0		\b, optional header size %d
 # at offset 20 can be optional header, extra bytes FILHSZ-20 because
 # do not rely on sizeof(FILHDR) to give the correct size for header.

+ 2 - 2
magic/Magdir/commands

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: commands,v 1.56 2016/07/14 19:01:12 christos Exp $
+# $File: commands,v 1.57 2017/04/04 20:34:24 christos Exp $
 # commands:  file(1) magic for various shells and interpreters
 #
 #0	string/w	:			shell archive or script for antique kernel text
@@ -56,7 +56,7 @@
 !:mime	text/x-awk
 0	string/wt	#!\ /usr/bin/awk	awk script text executable
 !:mime	text/x-awk
-0	regex/4096	=^\\s{0,100}BEGIN\\s{0,100}[{]	awk or perl script text
+0	regex/4096	=^[A-Za-z0-9_]{0,100}BEGIN[A-Za-z0-9_]{0,100}[{]	awk or perl script text
 
 # AT&T Bell Labs' Plan 9 shell
 0	string/wt	#!\ /bin/rc	Plan 9 rc shell script text executable

+ 2 - 2
magic/Magdir/compress

@@ -1,5 +1,5 @@
 #------------------------------------------------------------------------------
-# $File: compress,v 1.66 2016/09/16 12:12:05 christos Exp $
+# $File: compress,v 1.67 2017/03/17 21:35:28 christos Exp $
 # compress:  file(1) magic for pure-compression formats (no archives)
 #
 # compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc.
@@ -310,7 +310,7 @@
 
 # Zlib https://www.ietf.org/rfc/rfc6713.txt
 0	string/b	x
->0	beshort%31	=0	
+>0	beshort%31	=0
 >>0	byte&0xf	=8
 >>>0	byte&0x80 	=0	zlib compressed data
 !:mime	application/zlib

+ 5 - 5
magic/Magdir/console

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: console,v 1.29 2017/02/08 21:53:06 christos Exp $
+# $File: console,v 1.30 2017/03/17 21:35:28 christos Exp $
 # Console game magic
 # Toby Deshane <hac@shoelace.digivill.net>
 
@@ -436,7 +436,7 @@
 #------------------------------------------------------------------------------
 # msx: file(1) magic for MSX game cartridge dumps
 # Too simple - MPi
-#0 beshort 0x4142 MSX game cartridge dump 
+#0 beshort 0x4142 MSX game cartridge dump
 
 #------------------------------------------------------------------------------
 # Sony Playstation executables (Adam Sjoegren <asjo@diku.dk>) :
@@ -491,7 +491,7 @@
 
 # Double-check that the image type matches too, 0x8008 conflicts with
 # 8 character OMF-86 object file headers.
-0	beshort		0x8008		
+0	beshort		0x8008
 >6	string		BS93		Lynx homebrew cartridge
 >>2	beshort		x		\b, RAM start $%04x
 >6	string		LYNX		Lynx cartridge
@@ -506,7 +506,7 @@
 # is the offset 12 or the offset 16 correct?
 # GBS (Game Boy Sound) magic
 # ftp://ftp.modland.com/pub/documents/format_documentation/\
-# Gameboy%20Sound%20System%20(.gbs).txt 
+# Gameboy%20Sound%20System%20(.gbs).txt
 0	string		GBS		Nintendo Gameboy Music/Audio Data
 #12	string		GameBoy\ Music\ Module	Nintendo Gameboy Music Module
 >16	string		>\0	("%s" by
@@ -546,7 +546,7 @@
 # SNES9x .smv "movie" file format.
 0		string		SMV\x1A	SNES9x input recording
 >0x4		lelong		x	\b, version %d
-# version 4 is latest so far 
+# version 4 is latest so far
 >0x4		lelong		<5
 >>0x8		ledate		x	\b, recorded at %s
 >>0xc		lelong		>0	\b, rerecorded %d times

+ 3 - 3
magic/Magdir/cups

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: cups,v 1.4 2016/10/17 18:51:02 christos Exp $
+# $File: cups,v 1.5 2017/03/17 21:35:28 christos Exp $
 # Cups: file(1) magic for the cups raster file format
 # From: Laurent Martelli <martellilaurent@gmail.com>
 # http://www.cups.org/documentation.php/spec-raster.html
@@ -39,7 +39,7 @@
 >404	lelong		20		ColorSpace=AdobeRGB
 
 # Cups Raster image format, Big Endian
-0	string		RaS		
+0	string		RaS
 >3	string		t		Cups Raster version 1, Big Endian
 >3	string		2		Cups Raster version 2, Big Endian
 >3	string		3		Cups Raster version 3, Big Endian
@@ -48,7 +48,7 @@
 
 
 # Cups Raster image format, Little Endian
-1	string		SaR		
+1	string		SaR
 >0	string		t		Cups Raster version 1, Little Endian
 >0	string		2		Cups Raster version 2, Little Endian
 >0	string		3		Cups Raster version 3, Little Endian

+ 112 - 102
magic/Magdir/database

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: database,v 1.49 2016/06/11 17:01:51 christos Exp $
+# $File: database,v 1.51 2017/04/28 16:28:16 christos Exp $
 # database:  file(1) magic for various databases
 #
 # extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
@@ -84,7 +84,7 @@
 # From Max Bowsher.
 12	long	0x00040988	Berkeley DB
 >16	long	>0		(Log, version %d, native byte-order)
-12	belong	0x00040988	Berkeley DB 
+12	belong	0x00040988	Berkeley DB
 >16	belong	>0		(Log, version %d, big-endian)
 12	lelong	0x00040988	Berkeley DB
 >16	lelong	>0		(Log, version %d, little-endian)
@@ -103,7 +103,7 @@
 >>>12	long		!0		32bit aligned
 >>>>12	bedouble	8.642135e+130	big-endian
 >>>>>20 long		0		64bit long
->>>>>20 long		!0		32bit long  
+>>>>>20 long		!0		32bit long
 >>>>12	ledouble	8.642135e+130	little-endian
 >>>>>24 long		0		64bit long
 >>>>>24 long		!0		32bit long (i386)
@@ -128,22 +128,22 @@
 # XXX: Weak magic.
 # Alex Ott <ott@jet.msk.su>
 ## Paradox file formats
-#2	  leshort	0x0800	Paradox 
-#>0x39	  byte		3	v. 3.0 
-#>0x39	  byte		4	v. 3.5 
-#>0x39	  byte		9	v. 4.x 
-#>0x39	  byte		10	v. 5.x 
-#>0x39	  byte		11	v. 5.x 
-#>0x39	  byte		12	v. 7.x 
-#>>0x04	  byte		0	indexed .DB data file 
-#>>0x04	  byte		1	primary index .PX file 
-#>>0x04	  byte		2	non-indexed .DB data file 
-#>>0x04	  byte		3	non-incrementing secondary index .Xnn file 
-#>>0x04	  byte		4	secondary index .Ynn file 
-#>>0x04	  byte		5	incrementing secondary index .Xnn file 
-#>>0x04	  byte		6	non-incrementing secondary index .XGn file 
-#>>0x04	  byte		7	secondary index .YGn file 
-#>>>0x04	  byte		8	incrementing secondary index .XGn file 
+#2	  leshort	0x0800	Paradox
+#>0x39	  byte		3	v. 3.0
+#>0x39	  byte		4	v. 3.5
+#>0x39	  byte		9	v. 4.x
+#>0x39	  byte		10	v. 5.x
+#>0x39	  byte		11	v. 5.x
+#>0x39	  byte		12	v. 7.x
+#>>0x04	  byte		0	indexed .DB data file
+#>>0x04	  byte		1	primary index .PX file
+#>>0x04	  byte		2	non-indexed .DB data file
+#>>0x04	  byte		3	non-incrementing secondary index .Xnn file
+#>>0x04	  byte		4	secondary index .Ynn file
+#>>0x04	  byte		5	incrementing secondary index .Xnn file
+#>>0x04	  byte		6	non-incrementing secondary index .XGn file
+#>>0x04	  byte		7	secondary index .YGn file
+#>>>0x04	  byte		8	incrementing secondary index .XGn file
 
 ## XBase database files
 # updated by Joerg Jenderek at Feb 2013
@@ -151,33 +151,33 @@
 # http://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	
+0	ubelong&0x0000FFFF		<0x00000C20
 # skip Infocom game Z-machine
->2		ubyte			>0		
+>2		ubyte			>0
 # skip Androids *.xml
->>3		ubyte			>0		
->>>3		ubyte			<32		
+>>3		ubyte			>0
+>>>3		ubyte			<32
 # 1 < version VV
->>>>0		ubyte			>1		
+>>>>0		ubyte			>1
 # skip HELP.CA3 by test for reserved byte ( NULL )
->>>>>27		ubyte			0		
+>>>>>27		ubyte			0
 # reserved bytes not always 0 ; also found 0x3901 (T4.DBF) ,0x7101 (T5.DBF,T6.DBF)
 #>>>>>30		ubeshort     		x		30NULL?%x
-# possible production flag,tag numbers(<=0x30),tag length(<=0x20), reserved (NULL) 
->>>>>>24	ubelong&0xffFFFFff	>0x01302000	
+# possible production flag,tag numbers(<=0x30),tag length(<=0x20), reserved (NULL)
+>>>>>>24	ubelong&0xffFFFFff	>0x01302000
 # .DBF or .MDX
->>>>>>24	ubelong&0xffFFFFff	<0x01302001	
+>>>>>>24	ubelong&0xffFFFFff	<0x01302001
 # for Xbase Database file (*.DBF) reserved (NULL) for multi-user
->>>>>>>24	ubelong&0xffFFFFff	=0		
+>>>>>>>24	ubelong&0xffFFFFff	=0
 # test for 2 reserved NULL bytes,transaction and encryption byte flag
->>>>>>>>12	ubelong&0xFFFFfEfE	0		
+>>>>>>>>12	ubelong&0xFFFFfEfE	0
 # test for MDX flag
->>>>>>>>>28	ubyte			x		
->>>>>>>>>28	ubyte&0xf8		0		
+>>>>>>>>>28	ubyte			x
+>>>>>>>>>28	ubyte&0xf8		0
 # header size >= 32
->>>>>>>>>>8	uleshort		>31		
+>>>>>>>>>>8	uleshort		>31
 # skip PIC15736.PCX by test for language driver name or field name
->>>>>>>>>>>32	ubyte			>0		
+>>>>>>>>>>>32	ubyte			>0
 #!:mime	application/x-dbf; charset=unknown-8bit ??
 #!:mime	application/x-dbase
 >>>>>>>>>>>>0	use			xbase-type
@@ -202,22 +202,22 @@
 >>>>>>>>>>>>28	ubyte&0x02		2		\b, with memo .FPT
 >>>>>>>>>>>>28	ubyte&0x04		4		\b, DataBaseContainer
 # 1st record offset + 1 = header size
->>>>>>>>>>>>8	uleshort		>0		
->>>>>>>>>>>>(8.s+1)	ubyte		>0		
+>>>>>>>>>>>>8	uleshort		>0
+>>>>>>>>>>>>(8.s+1)	ubyte		>0
 >>>>>>>>>>>>>8		uleshort	>0		\b, at offset %d
->>>>>>>>>>>>>(8.s+1)	ubyte		>0		
+>>>>>>>>>>>>>(8.s+1)	ubyte		>0
 >>>>>>>>>>>>>>&-1	string		>\0		1st record "%s"
-# for multiple index files (*.MDX) Production flag,tag numbers(<=0x30),tag length(<=0x20), reserverd (NULL) 
->>>>>>>24	ubelong&0x0133f7ff	>0		
+# for multiple index files (*.MDX) Production flag,tag numbers(<=0x30),tag length(<=0x20), reserverd (NULL)
+>>>>>>>24	ubelong&0x0133f7ff	>0
 # test for reserved NULL byte
->>>>>>>>47	ubyte			0		
+>>>>>>>>47	ubyte			0
 # test for valid TAG key format (0x10 or 0)
->>>>>>>>>559	ubyte&0xeF		0		
+>>>>>>>>>559	ubyte&0xeF		0
 # test MM <= 12
->>>>>>>>>>45	ubeshort		<0x0C20		
->>>>>>>>>>>45	ubyte			>0		
->>>>>>>>>>>>46	ubyte			<32		
->>>>>>>>>>>>>46	ubyte			>0		
+>>>>>>>>>>45	ubeshort		<0x0C20
+>>>>>>>>>>>45	ubyte			>0
+>>>>>>>>>>>>46	ubyte			<32
+>>>>>>>>>>>>>46	ubyte			>0
 #!:mime	application/x-mdx
 >>>>>>>>>>>>>>0		use		xbase-type
 >>>>>>>>>>>>>>0		ubyte		x		\b MDX
@@ -236,11 +236,11 @@
 # 2nd tag name
 #>>>>>>>>>>>>(26.b+548)	string		x		\b, 2nd tag "%.11s"
 #
-#		Print the xBase names of different version variants 
+#		Print the xBase names of different version variants
 0	name				xbase-type
->0	ubyte		<2		
+>0	ubyte		<2
 # 1 < version
->0	ubyte		>1		
+>0	ubyte		>1
 >>0	ubyte		0x02		FoxBase
 # FoxBase+/dBaseIII+, no memo
 >>0	ubyte		0x03		FoxBase+/dBase III
@@ -293,7 +293,7 @@
 # dBASE IV with SQL table, with memo .DBT
 >>0	ubyte		0xCB		dBase IV with SQL table, with memo .DBT
 !:mime	application/x-dbf
-# HiPer-Six format;Clipper SIX, with SMT memo file		
+# 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
@@ -318,12 +318,12 @@
 #		test and print the date of xBase .DBF .MDX
 0	name				xbase-date
 # inspect YYMMDD , where 1<= MM <= 12 and 1<= DD <= 31
->0	ubelong		x		
->1	ubyte		<13		
->>1	ubyte		>0		
->>>2	ubyte		>0		
->>>>2	ubyte		<32		
->>>>>0	ubyte		x		
+>0	ubelong		x
+>1	ubyte		<13
+>>1	ubyte		>0
+>>>2	ubyte		>0
+>>>>2	ubyte		<32
+>>>>>0	ubyte		x
 # YY is interpreted as 20YY or 19YY
 >>>>>>0	ubyte		<100		\b %.2d
 # YY is interpreted 1900+YY; TODO: display yy or 20yy instead 1YY
@@ -333,56 +333,56 @@
 
 #	dBase memo files .DBT or .FPT
 # http://msdn.microsoft.com/en-us/library/8599s21w(v=vs.80).aspx
-16		ubyte		<4		
->16		ubyte		!2		
->>16		ubyte		!1		
+16		ubyte		<4
+>16		ubyte		!2
+>>16		ubyte		!1
 # next free block index is positive
->>>0		ulelong		>0		
+>>>0		ulelong		>0
 # skip many JPG. ZIP, BZ2 by test for reserved bytes NULL , 0|2 , 0|1 , low byte of block size
->>>>17		ubelong&0xFFfdFE00	0x00000000	
+>>>>17		ubelong&0xFFfdFE00	0x00000000
 # skip many RAR by test for low byte 0 ,high byte 0|2|even of block size, 0|a|e|d7 , 0|64h
->>>>>20		ubelong&0xFF01209B	0x00000000	
+>>>>>20		ubelong&0xFF01209B	0x00000000
 # dBASE III
->>>>>>16	ubyte		3		
+>>>>>>16	ubyte		3
 # dBASE III DBT
 >>>>>>>0	use		dbase3-memo-print
 # dBASE III DBT without version, dBASE IV DBT , FoxPro FPT , or many ZIP , DBF garbage
->>>>>>16	ubyte		0		
+>>>>>>16	ubyte		0
 # unusual dBASE III DBT like angest.dbt, dBASE IV DBT with block size 0 , FoxPro FPT ,  or garbage PCX DBF
->>>>>>>20	uleshort	0		
+>>>>>>>20	uleshort	0
 # FoxPro FPT , unusual dBASE III DBT like biblio.dbt or garbage
->>>>>>>>8	ulong		=0		
->>>>>>>>>6	ubeshort	>0		
+>>>>>>>>8	ulong		=0
+>>>>>>>>>6	ubeshort	>0
 # skip emacs.PIF
->>>>>>>>>>4	ushort		0		
+>>>>>>>>>>4	ushort		0
 >>>>>>>>>>>0	use		foxpro-memo-print
 # dBASE III DBT , garbage
->>>>>>>>>6	ubeshort	0		
+>>>>>>>>>6	ubeshort	0
 # skip MM*DD*.bin by test for for reserved NULL byte
->>>>>>>>>>510	ubeshort	0		
+>>>>>>>>>>510	ubeshort	0
 # skip TK-DOS11.img image by looking for memo text
->>>>>>>>>>>512	ubelong		<0xfeffff03	
+>>>>>>>>>>>512	ubelong		<0xfeffff03
 # skip EFI executables by looking for memo text
->>>>>>>>>>>>512	ubelong		>0x1F202020	
->>>>>>>>>>>>>513 ubyte		>0		
+>>>>>>>>>>>>512	ubelong		>0x1F202020
+>>>>>>>>>>>>>513 ubyte		>0
 # unusual dBASE III DBT like adressen.dbt
 >>>>>>>>>>>>>>0	use		dbase3-memo-print
 # dBASE III DBT like angest.dbt, or garbage PCX DBF
->>>>>>>>8	ubelong		!0		
+>>>>>>>>8	ubelong		!0
 # skip PCX and some DBF by test for for reserved NULL bytes
->>>>>>>>>510	ubeshort	0		
+>>>>>>>>>510	ubeshort	0
 # skip some DBF by test of invalid version
->>>>>>>>>>0	ubyte		>5		
->>>>>>>>>>>0	ubyte		<48		
+>>>>>>>>>>0	ubyte		>5
+>>>>>>>>>>>0	ubyte		<48
 >>>>>>>>>>>>0	use		dbase3-memo-print
 # dBASE IV DBT with positive block size
->>>>>>>20	uleshort	>0		
-# dBASE IV DBT with valid block length like 512, 1024 
+>>>>>>>20	uleshort	>0
+# dBASE IV DBT with valid block length like 512, 1024
 # multiple of 2 in between 16 and 16 K ,implies upper and lower bits are zero
->>>>>>>>20	uleshort&0x800f	0		
+>>>>>>>>20	uleshort&0x800f	0
 >>>>>>>>>0	use		dbase4-memo-print
 
-#		Print the information of dBase III DBT memo file 
+#		Print the information of dBase III DBT memo file
 0	name				dbase3-memo-print
 >0	ubyte			x		dBase III DBT
 # instead 3 as version number 0 for unusual examples like biblio.dbt
@@ -395,45 +395,45 @@
 >20	uleshort		!0		\b, block length %u
 # dBase III memo field terminated by \032\032
 >512	string			>\0		\b, 1st item "%s"
-#		Print the information of dBase IV DBT memo file 
+#		Print the information of dBase IV DBT memo file
 0	name				dbase4-memo-print
 >0		lelong		x		dBase IV DBT
 !:mime	application/x-dbt
 !:ext dbt
 # 8 character shorted main name of coresponding dBASE IV DBF file
->8		ubelong		>0x20000000	
+>8		ubelong		>0x20000000
 # skip unusual like for angest.dbt
->>20		uleshort	>0	
+>>20		uleshort	>0
 >>>8		string		>\0		\b of %-.8s.DBF
 # value 0 implies 512 as size
 #>4		ulelong		=0		\b, blocks size %u
 # size of blocks not reliable like 0x2020204C in angest.dbt
->4		ulelong		!0		
+>4		ulelong		!0
 >>4		ulelong&0x0000003f	0	\b, blocks size %u
 # dBase IV DBT with positive block length (found 512 , 1024)
 >20		uleshort	>0		\b, block length %u
 # next available block
 #>0		lelong		=0		\b, next free block index %u
 >0		lelong		!0		\b, next free block index %u
->20		uleshort	>0		
->>(20.s)	ubelong		x		
+>20		uleshort	>0
+>>(20.s)	ubelong		x
 >>>&-4		use		dbase4-memofield-print
 # unusual dBase IV DBT without block length (implies 512 as length)
->20		uleshort	=0		
->>512		ubelong		x		
+>20		uleshort	=0
+>>512		ubelong		x
 >>>&-4		use				dbase4-memofield-print
-#		Print the information of dBase IV memo field 
+#		Print the information of dBase IV memo field
 0	name			dbase4-memofield-print
 # free dBase IV memo field
->0		ubelong		!0xFFFF0800	
+>0		ubelong		!0xFFFF0800
 >>0		lelong		x		\b, next free block %u
 >>4		lelong		x		\b, next used block %u
 # used dBase IV memo field
->0		ubelong		=0xFFFF0800	
+>0		ubelong		=0xFFFF0800
 # length of memo field
 >>4		lelong		x		\b, field length %d
 >>>8		string		>\0		\b, 1st used item "%s"
-#		Print the information of FoxPro FPT memo file 
+#		Print the information of FoxPro FPT memo file
 0	name				foxpro-memo-print
 >0		belong		x		FoxPro FPT
 # Size of blocks for FoxPro ( 64,256 )
@@ -441,14 +441,14 @@
 # next available block
 #>0		belong		=0		\b, next free block index %u
 >0		belong		!0		\b, next free block index %u
-# field type ( 0~picture, 1~memo, 2~object ) 
+# field type ( 0~picture, 1~memo, 2~object )
 >512		ubelong		<3		\b, field type %u
 # length of memo field
->512		ubelong		1		
+>512		ubelong		1
 >>516		belong		>0		\b, field length %d
 >>>520		string		>\0		\b, 1st item "%s"
 
-# TODO: 
+# TODO:
 # DBASE index file *.NDX
 # DBASE Compound Index file *.CDX
 # dBASE IV Printer Driver *.PRF
@@ -465,9 +465,9 @@
 # Reference: https://github.com/libyal/libesedb/archive/master.zip
 #	libesedb-master/documentation/
 #	Extensible Storage Engine (ESE) Database File (EDB) format.asciidoc
-# Note: also known as "JET Blue". Used by numerous Windows components such as 
+# Note: also known as "JET Blue". Used by numerous Windows components such as
 # Windows Search, Mail, Exchange and Active Directory.
-4	ubelong		0xefcdab89	
+4	ubelong		0xefcdab89
 # unknown1
 >132	ubelong		0		Extensible storage engine
 !:mime	application/x-ms-ese
@@ -497,8 +497,8 @@
 # From: Joerg Jenderek
 # URL: http://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		
+8	string		sdbf
+>7	ubyte		0
 # TAG_TYPE_LIST+TAG_INDEXES
 >>12	uleshort	0x7802		Windows application compatibility Shim DataBase
 # version? 2 3
@@ -600,10 +600,10 @@
 # Reference: http://www.provue.com/Panorama/
 # From: Joerg Jenderek
 # NOTE: test only versions 4 and 6.0 with Windows
-# length of Panorama database name 
-5	ubyte				>0		
+# length of Panorama database name
+5	ubyte				>0
 # look after database name for "some" null bits
->(5.B+7)	ubelong&0xF3ffF000	0		
+>(5.B+7)	ubelong&0xF3ffF000	0
 # look for first keyword
 >>&1		search/2		DESIGN		Panorama database
 #!:mime	application/x-panorama-database
@@ -622,3 +622,13 @@
 # MUIbase Database Tool by Stefan A. Haubenthal <polluks@web.de>
 0	string	MBSTV\040	MUIbase DB
 >6	string	x		version %s
+
+#
+# CDB database
+0	string	NBCDB\012	NetBSD Constant Database
+>7	byte	x		\b, version %d
+>8	string	x		\b, for '%s'
+>24	lelong	x		\b, datasize %d
+>28	lelong	x		\b, entries %d
+>32	lelong	x		\b, index %d
+>36	lelong	x		\b, seed %#x

+ 8 - 8
magic/Magdir/der

@@ -1,5 +1,5 @@
 #------------------------------------------------------------------------------
-# $File: der,v 1.1 2016/01/19 15:07:45 christos Exp $
+# $File: der,v 1.2 2017/03/17 21:35:28 christos Exp $
 # der: file(1) magic for DER encoded files
 #
 
@@ -32,37 +32,37 @@
 
 # Key Pairs
 0	der	seq
->&0	der	int1=00	
+>&0	der	int1=00
 >&0	der	int65=x
 >&0	der	int3=010001	DER Encoded Key Pair, 512 bits
 
 0	der	seq
->&0	der	int1=00	
+>&0	der	int1=00
 >&0	der	int129=x
 >&0	der	int3=010001	DER Encoded Key Pair, 1024 bits
 
 0	der	seq
->&0	der	int1=00	
+>&0	der	int1=00
 >&0	der	int257=x
 >&0	der	int3=010001	DER Encoded Key Pair, 2048 bits
 
 0	der	seq
->&0	der	int1=00	
+>&0	der	int1=00
 >&0	der	int513=x
 >&0	der	int3=010001	DER Encoded Key Pair, 4096 bits
 
 0	der	seq
->&0	der	int1=00	
+>&0	der	int1=00
 >&0	der	int1025=x
 >&0	der	int3=010001	DER Encoded Key Pair, 8192 bits
 
 0	der	seq
->&0	der	int1=00	
+>&0	der	int1=00
 >&0	der	int2049=x
 >&0	der	int3=010001	DER Encoded Key Pair, 16k bits
 
 0	der	seq
->&0	der	int1=00	
+>&0	der	int1=00
 >&0	der	int4097=x
 >&0	der	int3=010001	DER Encoded Key Pair, 32k bits
 

+ 7 - 7
magic/Magdir/diff

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

+ 2 - 2
magic/Magdir/dolby

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: dolby,v 1.7 2014/01/08 22:37:23 christos Exp $
+# $File: dolby,v 1.8 2017/03/17 21:35:28 christos Exp $
 # ATSC A/53 aka AC-3 aka Dolby Digital <ashitaka@gmx.at>
 # from http://www.atsc.org/standards/a_52a.pdf
 # corrections, additions, etc. are always welcome!
@@ -23,7 +23,7 @@
 >5	byte&0x07 = 0x04	\b, dialogue (D)
 >5	byte&0x07 = 0x05	\b, commentary (C)
 >5	byte&0x07 = 0x06	\b, emergency (E)
->5	beshort&0x07e0  0x0720	\b, voiceover (VO) 
+>5	beshort&0x07e0  0x0720	\b, voiceover (VO)
 >5	beshort&0x07e0 >0x0720	\b, karaoke
 # acmod
 >6	byte&0xe0 = 0x00	1+1 front,

+ 7 - 7
magic/Magdir/dump

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: dump,v 1.13 2014/04/30 21:41:02 christos Exp $
+# $File: dump,v 1.14 2017/03/17 21:35:28 christos Exp $
 # dump:  file(1) magic for dump file format--for new and old dump filesystems
 #
 # We specify both byte orders in order to recognize byte-swapped dumps.
@@ -62,23 +62,23 @@
 >824	string	>\0		Host %s,
 >888	belong	>0		Flags %x
 
-24	belong	60012		new-fs dump file (big endian), 
+24	belong	60012		new-fs dump file (big endian),
 >0	use	new-dump-be
 
-24	belong	60011		old-fs dump file (big endian), 
+24	belong	60011		old-fs dump file (big endian),
 >0	use	old-dump-be
 
-24	lelong	60012		new-fs dump file (little endian), 
+24	lelong	60012		new-fs dump file (little endian),
 >0	use	\^new-dump-be
 
-24	lelong	60011		old-fs dump file (little endian), 
+24	lelong	60011		old-fs dump file (little endian),
 >0	use	\^old-dump-be
 
 
-24	belong	0x19540119	new-fs dump file (ufs2, big endian), 
+24	belong	0x19540119	new-fs dump file (ufs2, big endian),
 >0	use	ufs2-dump-be
 
-24	lelong	0x19540119	new-fs dump file (ufs2, little endian), 
+24	lelong	0x19540119	new-fs dump file (ufs2, little endian),
 >0	use	\^ufs2-dump-be
 
 18	leshort	60011		old-fs dump file (16-bit, assuming PDP-11 endianness),

+ 3 - 3
magic/Magdir/dyadic

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: dyadic,v 1.7 2015/05/27 18:02:48 christos Exp $
+# $File: dyadic,v 1.8 2017/03/17 21:35:28 christos Exp $
 # Dyadic: file(1) magic for Dyalog APL.
 #
 # updated by Joerg Jenderek at Oct 2013
@@ -10,9 +10,9 @@
 # .DIN Dyalog APL Input Table
 # .DOT Dyalog APL Output Table
 # .DFT Dyalog APL Format File
-0	ubeshort&0xFF60	0xaa00		
+0	ubeshort&0xFF60	0xaa00
 # skip biblio.dbt
->1	byte		!4		
+>1	byte		!4
 # real Dyalog APL have non zero version numbers like 7.3 or 13.4
 >>2	ubeshort	>0x0000		Dyalog APL
 >>>1	byte		0x00		aplcore

+ 3 - 3
magic/Magdir/editors

@@ -1,7 +1,7 @@
 
 #------------------------------------------------------------------------------
-# $File: editors,v 1.10 2016/07/18 17:44:49 christos Exp $
-# T602 editor documents 
+# $File: editors,v 1.11 2017/03/17 21:35:28 christos Exp $
+# T602 editor documents
 # by David Necas <yeti@physics.muni.cz>
 0	string	@CT\ 	T602 document data,
 >4	string	0	Kamenicky
@@ -9,7 +9,7 @@
 >4	string	2	KOI8-CS
 >4	string	>2	unknown encoding
 
-# Vi IMproved Encrypted file 
+# Vi IMproved Encrypted file
 # by David Necas <yeti@physics.muni.cz>
 0	string	VimCrypt~	Vim encrypted file data
 

File diff suppressed because it is too large
+ 425 - 408
magic/Magdir/filesystems


+ 17 - 17
magic/Magdir/fonts

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: fonts,v 1.34 2016/12/01 15:30:33 christos Exp $
+# $File: fonts,v 1.35 2017/03/17 21:35:28 christos Exp $
 # fonts:  file(1) magic for font data
 #
 0	search/1	FONT		ASCII vfont text
@@ -19,17 +19,17 @@
 # URL:		https://en.wikipedia.org/wiki/PostScript_fonts
 # Reference:	http://partners.adobe.com/public/developer/en/font/5178.PFM.pdf
 # Modified by:	Joerg Jenderek
-# Note:		moved from ./msdos magic 
-# dfVersion 256=0100h 
-0		uleshort	0x0100		
+# Note:		moved from ./msdos magic
+# dfVersion 256=0100h
+0		uleshort	0x0100
 # GRR: line above is too general as it catches also TrueType font,
 # raw G3 data FAX, WhatsApp encrypted and Panorama database
 # dfType 129=0081h
->66		uleshort	0x0081		
+>66		uleshort	0x0081
 # dfVertRes 300=012Ch not needed as additional test
-#>>70		uleshort	0x012c		
+#>>70		uleshort	0x012c
 # dfHorizRes 300=012Ch
-#>>>72		uleshort	0x012c		
+#>>>72		uleshort	0x012c
 # dfDriverInfo points to postscript information section
 >>(101.l)	string/c	Postscript	Printer Font Metrics
 # above labeled "PFM data" by ./msdos (version 5.28) or "Adobe Printer Font Metrics" by TrID
@@ -40,13 +40,13 @@
 # dfCopyright 60 byte null padded Copyright string. uncomment it to get old looking
 #>>>6		string		>\060		- %-.60s
 # dfDriverInfo
->>>139		ulelong		>0		
+>>>139		ulelong		>0
 # often abbreviated and same as filename
 >>>>(139.l)	string		x		%s
 # dfSize
 >>>2		ulelong		x		\b, %d bytes
 # dfFace 210=D2h 9Eh
->>>105		ulelong		>0		
+>>>105		ulelong		>0
 # Windows font name
 >>>>(105.l)	string		x		\b, %s
 # dfItalic
@@ -72,7 +72,7 @@
 #>104	belong		00000004		X11 SNF font data, MSB first
 !:mime	application/x-font-sfn
 # GRR: line below too general as it catches also Xbase index file t3-CHAR.NDX
-0	lelong		00000004		
+0	lelong		00000004
 >104	lelong		00000004		X11 SNF font data, LSB first
 !:mime	application/x-font-sfn
 
@@ -82,19 +82,19 @@
 # From: Joerg Jenderek
 # URL: http://grub.gibibit.com/New_font_format
 # Reference: util/grub-mkfont.c
-#		include/grub/fontformat.h 
+#		include/grub/fontformat.h
 # FONT_FORMAT_SECTION_NAMES_FILE
-0			string		FILE		
+0			string		FILE
 # FONT_FORMAT_PFF2_MAGIC
->8			string		PFF2		
+>8			string		PFF2
 # leng 4 only at the moment
->>4			ubelong		4		
+>>4			ubelong		4
 # FONT_FORMAT_SECTION_NAMES_FONT_NAME
 >>>12			string		NAME		GRUB2 font
 !:mime			application/x-font-pf2
 !:ext			pf2
 # length of font_name
->>>>16			ubelong		>0		
+>>>>16			ubelong		>0
 # font_name
 >>>>>20			string		>\0		"%-s"
 
@@ -156,8 +156,8 @@
 0	string		OTTO		OpenType font data
 !:mime application/vnd.ms-opentype
 
-# Gurkan Sengun <gurkan@linuks.mine.nu>, www.linuks.mine.nu 
-0	string		SplineFontDB:	Spline Font Database 
+# Gurkan Sengun <gurkan@linuks.mine.nu>, www.linuks.mine.nu
+0	string		SplineFontDB:	Spline Font Database
 !:mime application/vnd.font-fontforge-sfd
 >14	string		x		version %s
 

+ 12 - 12
magic/Magdir/fsav

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: fsav,v 1.13 2013/03/25 17:18:47 christos Exp $
+# $File: fsav,v 1.14 2017/03/17 21:35:28 christos Exp $
 # fsav:  file(1) magic for datafellows fsav virus definition files
 # Anthon van der Neut (anthon@mnt.org)
 
@@ -29,11 +29,11 @@
 #>>>>10	byte		11		\b12-
 #>>>>9	ubyte		>0		\b%02d)
 # ftp://ftp.f-prot.com/pub/sign2.zip
-#0	ubyte		0x62		
-#>1	ubyte		0xF5		
-#>>2	ubyte		0x1		
-#>>>3	ubyte		0x1		
-#>>>>4	ubyte		0x0e		
+#0	ubyte		0x62
+#>1	ubyte		0xF5
+#>>2	ubyte		0x1
+#>>>3	ubyte		0x1
+#>>>>4	ubyte		0x0e
 #>>>>>13		ubyte	>0		fsav virus signatures
 #>>>>>>11	ubyte	x		size 0x%02x
 #>>>>>>12	ubyte	x		\b%02x
@@ -44,16 +44,16 @@
 # .cvd files start with a 512 bytes colon separated header
 # ClamAV-VDB:buildDate:version:signaturesNumbers:functionalityLevelRequired:MD5:Signature:builder:buildTime
 # + gzipped tarball files
-0	string		ClamAV-VDB:	
+0	string		ClamAV-VDB:
 >11	string		>\0		Clam AntiVirus database %-.23s
->>34	string		:		
->>>35		string		!:	\b, version 
+>>34	string		:
+>>>35		string		!:	\b, version
 >>>>35		string		x 	\b%-.1s
->>>>>36		string 		!:	
+>>>>>36		string 		!:
 >>>>>>36	string		x 	\b%-.1s
->>>>>>>37	string		!:	
+>>>>>>>37	string		!:
 >>>>>>>>37	string		x 	\b%-.1s
->>>>>>>>>38	string		!:	
+>>>>>>>>>38	string		!:
 >>>>>>>>>>38	string		x 	\b%-.1s
 >512	string		\037\213	\b, gzipped
 >769	string		ustar\0		\b, tarred

+ 3 - 3
magic/Magdir/games

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: games,v 1.14 2014/04/30 21:41:02 christos Exp $
+# $File: games,v 1.15 2017/03/17 21:35:28 christos Exp $
 # games:  file(1) for games
 
 # Fabio Bonelli <fabiobonelli@libero.it>
@@ -39,7 +39,7 @@
 
 #0       string  -1\x0a  Quake I demo
 #>30     string  x        version %.4s
-#>61     string  x        level %s       
+#>61     string  x        level %s
 
 #0       string  5\x0a   Quake I save
 
@@ -240,7 +240,7 @@
 # Summary: NetImmerse game engine file
 # Extension .nif
 # Created by: Abel Cheung <abelcheung@gmail.com>
-0		string		NetImmerse\ File\ Format,\ Versio		
+0		string		NetImmerse\ File\ Format,\ Versio
 >&0		string		n\ 					NetImmerse game engine file
 >>&0		regex		[0-9a-z.]+				\b, version %s
 

+ 2 - 2
magic/Magdir/geo

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: geo,v 1.3 2013/01/04 00:47:02 christos Exp $
+# $File: geo,v 1.4 2017/03/17 21:35:28 christos Exp $
 # Geo- files from Kurt Schwehr <schwehr@ccom.unh.edu>
 
 ######################################################################
@@ -57,7 +57,7 @@
 4	beshort	0x2002	GeoSwath RDF
 0	string	Start:-	GeoSwatch auf text file
 
-# Seabeam 2100 
+# Seabeam 2100
 # mbsystem code mb41
 0	string SB2100	SeaBeam 2100 multibeam sonar
 0	string SB2100DR	SeaBeam 2100 DR multibeam sonar

+ 2 - 2
magic/Magdir/gnu

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: gnu,v 1.17 2016/07/16 22:17:04 christos Exp $
+# $File: gnu,v 1.18 2017/03/17 21:35:28 christos Exp $
 # gnu:  file(1) magic for various GNU tools
 #
 # GNU nlsutils message catalog file format
@@ -71,7 +71,7 @@
 # they will ordinarily reported as "compressed", but at least -z helps
 39      string          =<gmr:Workbook           Gnumeric spreadsheet
 
-# From: James Youngman <jay@gnu.org> 
+# From: James Youngman <jay@gnu.org>
 # gnu find magic
 0	string	\0LOCATE	GNU findutils locate database data
 >7	string	>\0		\b, format %s

+ 7 - 7
magic/Magdir/gpt

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: gpt,v 1.3 2014/04/30 21:41:02 christos Exp $
+# $File: gpt,v 1.4 2017/03/17 21:35:28 christos Exp $
 #
 # GPT Partition table patterns.
 # Author: Rogier Goossens (goossens.rogier@gmail.com)
@@ -36,7 +36,7 @@
 >>>>>>>>>>>>>(454.l*8192)	string		EFI\ PART	GPT partition table
 >>>>>>>>>>>>>>0			use		gpt-mbr-type
 >>>>>>>>>>>>>>&-8		use		gpt-table
->>>>>>>>>>>>>>0			ubyte		x		of 8192 bytes		
+>>>>>>>>>>>>>>0			ubyte		x		of 8192 bytes
 >>>>>>>>>>>>>(454.l*8192)	string		!EFI\ PART
 >>>>>>>>>>>>>>(454.l*4096)	string		EFI\ PART	GPT partition table
 >>>>>>>>>>>>>>>0		use		gpt-mbr-type
@@ -66,7 +66,7 @@
 >>>>>>>>>>>>>(470.l*8192)	string		EFI\ PART	GPT partition table
 >>>>>>>>>>>>>>0			use		gpt-mbr-type
 >>>>>>>>>>>>>>&-8		use		gpt-table
->>>>>>>>>>>>>>0			ubyte		x		of 8192 bytes		
+>>>>>>>>>>>>>>0			ubyte		x		of 8192 bytes
 >>>>>>>>>>>>>(470.l*8192)	string		!EFI\ PART
 >>>>>>>>>>>>>>(470.l*4096)	string		EFI\ PART	GPT partition table
 >>>>>>>>>>>>>>>0		use		gpt-mbr-type
@@ -96,7 +96,7 @@
 >>>>>>>>>>>>>(486.l*8192)	string		EFI\ PART	GPT partition table
 >>>>>>>>>>>>>>0			use		gpt-mbr-type
 >>>>>>>>>>>>>>&-8		use		gpt-table
->>>>>>>>>>>>>>0			ubyte		x		of 8192 bytes		
+>>>>>>>>>>>>>>0			ubyte		x		of 8192 bytes
 >>>>>>>>>>>>>(486.l*8192)	string		!EFI\ PART
 >>>>>>>>>>>>>>(486.l*4096)	string		EFI\ PART	GPT partition table
 >>>>>>>>>>>>>>>0		use		gpt-mbr-type
@@ -126,7 +126,7 @@
 >>>>>>>>>>>>>(502.l*8192)	string		EFI\ PART	GPT partition table
 >>>>>>>>>>>>>>0			use		gpt-mbr-type
 >>>>>>>>>>>>>>&-8		use		gpt-table
->>>>>>>>>>>>>>0			ubyte		x		of 8192 bytes		
+>>>>>>>>>>>>>>0			ubyte		x		of 8192 bytes
 >>>>>>>>>>>>>(502.l*8192)	string		!EFI\ PART
 >>>>>>>>>>>>>>(502.l*4096)	string		EFI\ PART	GPT partition table
 >>>>>>>>>>>>>>>0		use		gpt-mbr-type
@@ -166,7 +166,7 @@
 ##>(8.l*8192)	string		EFI\ PART
 ##>>(8.l*8192)	use		gpt-mbr-type
 ##>>&-8		use		gpt-table
-##>>0		ubyte		x		of 8192 bytes		
+##>>0		ubyte		x		of 8192 bytes
 ##>(8.l*8192)	string		!EFI\ PART
 ##>>(8.l*4096)	string		EFI\ PART	GPT partition table
 ##>>>0		use		gpt-mbr-type
@@ -212,7 +212,7 @@
 >>486		ulelong		!1									\b (nonstandard: not at LBA 1)
 # GPT with protective MBR entry in partition 4
 >498		ubyte		0xee
->>502		ulelong		1		
+>>502		ulelong		1
 >>>446		string		!\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0	\b (with hybrid MBR)
 >>502		ulelong		!1													\b (nonstandard: not at LBA 1)
 

+ 13 - 1
magic/Magdir/gpu

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

+ 5 - 5
magic/Magdir/gringotts

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: gringotts,v 1.5 2009/09/19 16:28:09 christos Exp $
+# $File: gringotts,v 1.6 2017/03/17 21:35:28 christos Exp $
 # gringotts:  file(1) magic for Gringotts
 # http://devel.pluto.linux.it/projects/Gringotts/
 # author: Germano Rizzo <mano@pluto.linux.it>
@@ -9,10 +9,10 @@
 #file format 1
 >3	string		1		v.1, MCRYPT S2K, SERPENT crypt, SHA-256 hash, ZLib lvl.9
 #file format 2
->3	string		2		v.2, MCRYPT S2K, 
+>3	string		2		v.2, MCRYPT S2K,
 >>8	byte&0x70	0x00		RIJNDAEL-128 crypt,
 >>8	byte&0x70	0x10		SERPENT crypt,
->>8	byte&0x70	0x20		TWOFISH crypt, 
+>>8	byte&0x70	0x20		TWOFISH crypt,
 >>8	byte&0x70	0x30		CAST-256 crypt,
 >>8	byte&0x70	0x40		SAFER+ crypt,
 >>8	byte&0x70	0x50		LOKI97 crypt,
@@ -27,10 +27,10 @@
 >>8	byte&0x03	0x02		lvl.6
 >>8	byte&0x03	0x03		lvl.9
 #file format 3
->3	string		3		v.3, OpenPGP S2K, 
+>3	string		3		v.3, OpenPGP S2K,
 >>8	byte&0x70	0x00		RIJNDAEL-128 crypt,
 >>8	byte&0x70	0x10		SERPENT crypt,
->>8	byte&0x70	0x20		TWOFISH crypt, 
+>>8	byte&0x70	0x20		TWOFISH crypt,
 >>8	byte&0x70	0x30		CAST-256 crypt,
 >>8	byte&0x70	0x40		SAFER+ crypt,
 >>8	byte&0x70	0x50		LOKI97 crypt,

+ 9 - 9
magic/Magdir/hitachi-sh

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: hitachi-sh,v 1.7 2015/09/30 20:32:35 christos Exp $
+# $File: hitachi-sh,v 1.8 2017/03/17 21:35:28 christos Exp $
 # hitach-sh: file(1) magic for Hitachi Super-H
 #
 # Super-H COFF
@@ -9,20 +9,20 @@
 # https://en.wikipedia.org/wiki/COFF
 # https://de.wikipedia.org/wiki/Common_Object_File_Format
 # http://www.delorie.com/djgpp/doc/coff/filhdr.html
-# below test line conflicts with 2nd NTFS filesystem sector 
+# below test line conflicts with 2nd NTFS filesystem sector
 # 2nd NTFS filesystem sector often starts with 0x05004e00 for unicode string 5 NTLDR
 # and Portable Gaming Notation Compressed format (*.WID http://pgn.freeservers.com/)
-0	beshort		0x0500		
+0	beshort		0x0500
 # test for unused flag bits (0x8000,0x0800,0x0400,0x0200,x0080) in f_flags
->18	ubeshort&0x8E80	0		
+>18	ubeshort&0x8E80	0
 # use big endian variant of subroutine to display name+variables+flags
-# for common object formated files 
+# for common object formated files
 >>0	use				\^display-coff
 
-0	leshort		0x0550		
+0	leshort		0x0550
 # test for unused flag bits in f_flags
->18	uleshort&0x8E80	0		
-# use little endian variant of subroutine to 
-# display name+variables+flags for common object formated files 
+>18	uleshort&0x8E80	0
+# use little endian variant of subroutine to
+# display name+variables+flags for common object formated files
 >>0	use				display-coff
 

+ 5 - 5
magic/Magdir/ibm370

@@ -1,28 +1,28 @@
 
 #------------------------------------------------------------------------------
-# $File: ibm370,v 1.9 2014/04/30 21:41:02 christos Exp $
+# $File: ibm370,v 1.10 2017/03/17 21:35:28 christos Exp $
 # ibm370:  file(1) magic for IBM 370 and compatibles.
 #
 # "ibm370" said that 0x15d == 0535 was "ibm 370 pure executable".
 # What the heck *is* "USS/370"?
 # AIX 4.1's "/etc/magic" has
 #
-#	0	short		0535		370 sysV executable 
+#	0	short		0535		370 sysV executable
 #	>12	long		>0		not stripped
 #	>22	short		>0		- version %d
 #	>30	long		>0		- 5.2 format
-#	0	short		0530		370 sysV pure executable 
+#	0	short		0530		370 sysV pure executable
 #	>12	long		>0		not stripped
 #	>22	short		>0		- version %d
 #	>30	long		>0		- 5.2 format
 #
 # instead of the "USS/370" versions of the same magic numbers.
 #
-0	beshort		0537		370 XA sysV executable 
+0	beshort		0537		370 XA sysV executable
 >12	belong		>0		not stripped
 >22	beshort		>0		- version %d
 >30	belong		>0		- 5.2 format
-0	beshort		0532		370 XA sysV pure executable 
+0	beshort		0532		370 XA sysV pure executable
 >12	belong		>0		not stripped
 >22	beshort		>0		- version %d
 >30	belong		>0		- 5.2 format

+ 2 - 2
magic/Magdir/ibm6000

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: ibm6000,v 1.12 2013/09/16 15:12:42 christos Exp $
+# $File: ibm6000,v 1.13 2017/03/17 21:35:28 christos Exp $
 # ibm6000:  file(1) magic for RS/6000 and the RT PC.
 #
 0	beshort		0x01df		executable (RISC System/6000 V3.1) or obj module
@@ -21,7 +21,7 @@
 0	beshort		0x01f7		64-bit XCOFF executable or object module
 >20	belong		0		not stripped
 # GRR: this test is still too general as it catches also many FATs of DOS filesystems
-4	belong		&0x0feeddb0	
+4	belong		&0x0feeddb0
 # real core dump could not be 32-bit and 64-bit together
 >7	byte&0x03	!3		AIX core file
 >>1	byte		&0x01		fulldump

+ 14 - 14
magic/Magdir/icc

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: icc,v 1.2 2016/12/02 19:32:15 christos Exp $
+# $File: icc,v 1.4 2017/03/17 22:20:22 christos Exp $
 # icc:  file(1) magic for International Color Consortium file formats
 
 #
@@ -21,9 +21,9 @@
 #
 #	check and display ICC/ICM color profile
 0	name	color-profile
->36	string		acsp		
+>36	string		acsp
 # skip ASCII like Cognacspirit.txt by month <= 12
->>26	ubeshort	<13		
+>>26	ubeshort	<13
 # platform/operating system. Only 5 mentioned
 
 #
@@ -53,7 +53,7 @@
 #>>>40	string		x		(%.4s)
 !:mime	application/vnd.iccprofile
 # for "ICM" extension only versions 2.x and for Kodak "CC" 2.0 is found
->>>8	ubyte		=2		
+>>>8	ubyte		=2
 # do not use empty message text to a avoid error like
 # icc, 82: Warning: Current entry does not yet have a description for adding a EXTENSION type
 # file.exe: could not find any valid magic files!
@@ -89,9 +89,9 @@
 # eleven device classes
 >>>12	string		x		\b-%.4s device
 # skip 00001964h in hpf69000.icc or 0h in XRDC50Q.ICM or " ROT" in brmsl05f.icm
->>>52	string		>\ 		
+>>>52	string		>\040
 # skip "none" model like in "Trinitron Compatible 9300K G2.2.icm"
->>>>52	ubelong		!0x6e6f6e65	
+>>>>52	ubelong		!0x6e6f6e65
 # device manufacturer field like "HP  " "IBM " EPSO
 >>>>>48	string		x		\b, %.2s
 >>>>>50	string		>\  		\b%.1s
@@ -107,7 +107,7 @@
 # profile size
 >>>0	ubelong		x		\b, %u bytes
 # skip invalid date 0 like in linearSRGB.icc
->>>24	ubequad		!0		
+>>>24	ubequad		!0
 # datetime dd-mm-yyyy hh:mm:ss
 >>>>28	ubeshort	x		\b, %u
 # month <= 12
@@ -181,10 +181,10 @@
 # tag table
 # 6 <= tags count <= 43
 #>>>128	ubelong		>43		\b, %u tags
->>>128	ubelong		x		
+>>>128	ubelong		x
 # shall contain the profileDescriptionTag "desc" , copyrightTag "cprt"
 # search range = tags count * 12 -8=< maximal tag count * 12 -8= 43 * 12 -8= 508
->>>>132	search/508	cprt		
+>>>>132	search/508	cprt
 # but no copyright tag in linearSRGB.icc
 # beneath /System/Library/Frameworks/WebKit.framework/
 # Versions/A/Frameworks/WebCore.framework/Versions/A/Resources
@@ -195,20 +195,20 @@
 #>>>140	ubelong		x		0x%x len
 # 2nd tag,...
 # look also for profileDescriptionTag "desc"
->>>132	search/508	desc		
+>>>132	search/508	desc
 # look further for TextDescriptionType "desc" signature
->>>>(&0.L)	string		=desc	
+>>>>(&0.L)	string		=desc
 >>>>>&4		pstring/l	x	"%s"
 # look alternative for multiLocalizedUnicodeType "mluc" signature like in VideoPAL.icc
->>>>(&0.L)	string		=mluc	
->>>>>&(&8.L)	ubequad		x		
+>>>>(&0.L)	string		=mluc
+>>>>>&(&8.L)	ubequad		x
 >>>>>>&4	bestring16	x	'%s'
 
 # Any other profile.
 # XXX - should we use "acsp\0\0\0\0" for "no primary platform" profiles,
 # and use "acsp" for everything else and dump the "primary platform"
 # string in those cases?
-36	string		acsp		
+36	string		acsp
 >0	use		color-profile
 
 

+ 58 - 58
magic/Magdir/images

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: images,v 1.121 2016/12/01 16:20:13 christos Exp $
+# $File: images,v 1.123 2017/04/04 20:34:24 christos Exp $
 # images:  file(1) magic for image formats (see also "iff", and "c-lang" for
 # XPM bitmaps)
 #
@@ -26,19 +26,19 @@
 # test of Color Map Type 0~no 1~color map
 # 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	
+0	ubequad&0x00FeC400000000C0	0
 # skip more garbage by looking for positive image type
->2	ubyte			>0		
+>2	ubyte			>0
 # skip some compiled terminfo by looking for image type less equal 33
->>2	ubyte			<34		
+>>2	ubyte			<34
 # skip arches.3200 , Finder.Root , Slp.1 by looking for low pixel sizes 15 16 24 32
->>>16	ubyte			<33		
+>>>16	ubyte			<33
 # skip more by looking for pixel size 0Fh 10h 18h 20h
->>>>16	ubyte&0xC0		0x00	
+>>>>16	ubyte&0xC0		0x00
 # skip 260-16.ico by looking for no color map
->>>>>1	ubyte			0	
+>>>>>1	ubyte			0
 # implies no first map entry
->>>>>>3	uleshort		0	
+>>>>>>3	uleshort		0
 >>>>>>>0	use		tga-image
 # Color Map
 >>>>>1	belong&0xfff7ffff	0x01010000
@@ -82,7 +82,7 @@
 >14	uleshort	=0		65536
 # Image Pixel Size 15 16 24 32
 >16	ubyte		x		x %d
-# X origin of image. 0 normal 
+# X origin of image. 0 normal
 >8	uleshort	>0		+%d
 # Y origin of image. 0 normal; positive for top
 >10	uleshort	>0		+%d
@@ -94,27 +94,27 @@
 >17	ubyte		&0x10		- right
 #>17	ubyte		^0x10		- left
 # some info say other bits 6-7 should be zero
-# but data storage interleave by http://www.fileformat.info/format/tga/corion.htm 
+# but data storage interleave by http://www.fileformat.info/format/tga/corion.htm
 # 00 - no interleave;01 - even/odd interleave; 10 - four way interleave; 11 - reserved
 #>17	ubyte&0xC0	0x00		- no interleave
 >17	ubyte&0xC0	0x40		- interleave
 >17	ubyte&0xC0	0x80		- four way interleave
 >17	ubyte&0xC0	0xC0		- reserved
-# positive length implies identification field 
->0	ubyte		>0