Browse Source

Merge upstream version 5.37

Christoph Biedl 1 year ago
parent
commit
9a00e188e5
100 changed files with 2090 additions and 751 deletions
  1. 50 0
      ChangeLog
  2. 2 2
      README
  3. 6 15
      config.h.in
  4. 18 16
      configure
  5. 10 9
      configure.ac
  6. 4 2
      doc/file.man
  7. 4 4
      doc/magic.man
  8. 2 2
      magic/Magdir/acorn
  9. 4 4
      magic/Magdir/adventure
  10. 5 5
      magic/Magdir/algol68
  11. 42 7
      magic/Magdir/android
  12. 25 18
      magic/Magdir/animation
  13. 94 19
      magic/Magdir/apple
  14. 193 30
      magic/Magdir/archive
  15. 218 11
      magic/Magdir/audio
  16. 2 2
      magic/Magdir/basis
  17. 3 3
      magic/Magdir/ber
  18. 4 4
      magic/Magdir/bioinformatics
  19. 1 1
      magic/Magdir/biosig
  20. 1 1
      magic/Magdir/blcr
  21. 2 2
      magic/Magdir/blender
  22. 44 25
      magic/Magdir/c-lang
  23. 13 13
      magic/Magdir/cad
  24. 30 0
      magic/Magdir/clojure
  25. 3 3
      magic/Magdir/commands
  26. 77 10
      magic/Magdir/compress
  27. 65 28
      magic/Magdir/console
  28. 6 6
      magic/Magdir/coverage
  29. 1 1
      magic/Magdir/ctf
  30. 2 2
      magic/Magdir/cups
  31. 16 16
      magic/Magdir/database
  32. 8 8
      magic/Magdir/dataone
  33. 2 2
      magic/Magdir/dbpf
  34. 2 2
      magic/Magdir/dolby
  35. 3 3
      magic/Magdir/dyadic
  36. 2 2
      magic/Magdir/ebml
  37. 11 0
      magic/Magdir/edid
  38. 5 1
      magic/Magdir/elf
  39. 2 2
      magic/Magdir/erlang
  40. 57 0
      magic/Magdir/espressif
  41. 2 2
      magic/Magdir/esri
  42. 82 58
      magic/Magdir/filesystems
  43. 2 2
      magic/Magdir/finger
  44. 3 3
      magic/Magdir/flash
  45. 62 13
      magic/Magdir/fonts
  46. 79 19
      magic/Magdir/fsav
  47. 3 3
      magic/Magdir/games
  48. 6 6
      magic/Magdir/geo
  49. 3 3
      magic/Magdir/gnome
  50. 2 2
      magic/Magdir/gnu
  51. 2 2
      magic/Magdir/graphviz
  52. 3 3
      magic/Magdir/guile
  53. 1 7
      magic/Magdir/hp
  54. 3 1
      magic/Magdir/ibm6000
  55. 198 47
      magic/Magdir/images
  56. 2 2
      magic/Magdir/isz
  57. 19 1
      magic/Magdir/java
  58. 4 4
      magic/Magdir/keepass
  59. 2 2
      magic/Magdir/kerberos
  60. 6 6
      magic/Magdir/kml
  61. 16 8
      magic/Magdir/linux
  62. 2 2
      magic/Magdir/lisp
  63. 2 2
      magic/Magdir/llvm
  64. 2 2
      magic/Magdir/lua
  65. 5 3
      magic/Magdir/m4
  66. 8 8
      magic/Magdir/macintosh
  67. 2 2
      magic/Magdir/mail.news
  68. 294 4
      magic/Magdir/map
  69. 1 1
      magic/Magdir/marc21
  70. 2 2
      magic/Magdir/matroska
  71. 2 2
      magic/Magdir/mercurial
  72. 2 2
      magic/Magdir/metastore
  73. 2 2
      magic/Magdir/microfocus
  74. 3 3
      magic/Magdir/misctools
  75. 2 2
      magic/Magdir/modem
  76. 17 2
      magic/Magdir/mozilla
  77. 16 18
      magic/Magdir/msdos
  78. 3 3
      magic/Magdir/msooxml
  79. 2 2
      magic/Magdir/neko
  80. 105 159
      magic/Magdir/netbsd
  81. 2 2
      magic/Magdir/nitpicker
  82. 9 0
      magic/Magdir/numpy
  83. 2 2
      magic/Magdir/ole2compounddocs
  84. 3 3
      magic/Magdir/palm
  85. 2 2
      magic/Magdir/parrot
  86. 2 2
      magic/Magdir/pbf
  87. 1 1
      magic/Magdir/pc98
  88. 5 5
      magic/Magdir/pgp
  89. 2 2
      magic/Magdir/polyml
  90. 2 2
      magic/Magdir/printer
  91. 2 2
      magic/Magdir/psl
  92. 4 4
      magic/Magdir/pwsafe
  93. 11 7
      magic/Magdir/python
  94. 2 2
      magic/Magdir/qt
  95. 2 2
      magic/Magdir/revision
  96. 5 5
      magic/Magdir/riff
  97. 7 0
      magic/Magdir/rpmsg
  98. 13 9
      magic/Magdir/ruby
  99. 3 3
      magic/Magdir/scientific
  100. 0 0
      magic/Magdir/selinux

+ 50 - 0
ChangeLog

@@ -1,3 +1,53 @@
+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
+
+2019-02-19  15:30  Christos Zoulas <christos@zoulas.com>
+
+	* Fix cast to use cast macros
+	* Add UCS-32 builtin detection (PR/61) reported by tmc
+
+2019-02-18  18:24  Christos Zoulas <christos@zoulas.com>
+
+	* Fix stack read (PR/62) and write (PR/64) stack overflows
+	  reported by spinpx 
+
 2018-10-18  19:32  Christos Zoulas <christos@zoulas.com>
 
 	* release 5.35

+ 2 - 2
README

@@ -1,6 +1,6 @@
-## README for file(1) Command ##
+## README for file(1) Command and the libmagic(3) library ##
 
-    @(#) $File: README,v 1.56 2018/09/09 20:33:28 christos Exp $
+    @(#) $File: README,v 1.57 2019/02/06 00:20:56 christos Exp $
 
 Mailing List: file@astron.com
 Mailing List archives: http://mailman.astron.com/pipermail/file/

+ 6 - 15
config.h.in

@@ -83,9 +83,6 @@
 /* Define to 1 if you have the `z' library (-lz). */
 #undef HAVE_LIBZ
 
-/* Define to 1 if you have the <limits.h> header file. */
-#undef HAVE_LIMITS_H
-
 /* Define to 1 if you have the `localtime_r' function. */
 #undef HAVE_LOCALTIME_R
 
@@ -95,6 +92,9 @@
 /* Define to 1 if <wchar.h> declares mbstate_t. */
 #undef HAVE_MBSTATE_T
 
+/* Define to 1 if you have the `memmem' function. */
+#undef HAVE_MEMMEM
+
 /* Define to 1 if you have the <memory.h> header file. */
 #undef HAVE_MEMORY_H
 
@@ -113,15 +113,9 @@
 /* Define to 1 if you have the `pread' function. */
 #undef HAVE_PREAD
 
-/* Define to 1 if you have the `setlocale' function. */
-#undef HAVE_SETLOCALE
-
 /* Have sig_t type */
 #undef HAVE_SIG_T
 
-/* Define to 1 if you have the <stddef.h> header file. */
-#undef HAVE_STDDEF_H
-
 /* Define to 1 if you have the <stdint.h> header file. */
 #undef HAVE_STDINT_H
 
@@ -131,9 +125,6 @@
 /* Define to 1 if you have the `strcasestr' function. */
 #undef HAVE_STRCASESTR
 
-/* Define to 1 if you have the `strerror' function. */
-#undef HAVE_STRERROR
-
 /* Define to 1 if you have the <strings.h> header file. */
 #undef HAVE_STRINGS_H
 
@@ -152,9 +143,6 @@
 /* Define to 1 if you have the `strtof' function. */
 #undef HAVE_STRTOF
 
-/* Define to 1 if you have the `strtoul' function. */
-#undef HAVE_STRTOUL
-
 /* HAVE_STRUCT_OPTION */
 #undef HAVE_STRUCT_OPTION
 
@@ -176,6 +164,9 @@
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
+/* Define to 1 if you have the <sys/sysmacros.h> header file. */
+#undef HAVE_SYS_SYSMACROS_H
+
 /* Define to 1 if you have the <sys/time.h> header file. */
 #undef HAVE_SYS_TIME_H
 

+ 18 - 16
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.35.
+# Generated by GNU Autoconf 2.69 for file 5.37.
 #
 # Report bugs to <christos@astron.com>.
 #
@@ -590,8 +590,8 @@ MAKEFLAGS=
 # Identity of this package.
 PACKAGE_NAME='file'
 PACKAGE_TARNAME='file'
-PACKAGE_VERSION='5.35'
-PACKAGE_STRING='file 5.35'
+PACKAGE_VERSION='5.37'
+PACKAGE_STRING='file 5.37'
 PACKAGE_BUGREPORT='christos@astron.com'
 PACKAGE_URL=''
 
@@ -1329,7 +1329,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.35 to adapt to many kinds of systems.
+\`configure' configures file 5.37 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1399,7 +1399,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of file 5.35:";;
+     short | recursive ) echo "Configuration of file 5.37:";;
    esac
   cat <<\_ACEOF
 
@@ -1511,7 +1511,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-file configure 5.35
+file configure 5.37
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2167,7 +2167,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.35, which was
+It was created by file $as_me 5.37, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3033,7 +3033,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='file'
- VERSION='5.35'
+ VERSION='5.37'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -12784,7 +12784,7 @@ $as_echo "#define HAVE_SYS_WAIT_H 1" >>confdefs.h
 
 fi
 
-for ac_header in stdint.h fcntl.h stdint.h inttypes.h unistd.h
+for ac_header in stdint.h fcntl.h inttypes.h unistd.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -12797,7 +12797,7 @@ fi
 
 done
 
-for ac_header in stddef.h utime.h wchar.h wctype.h limits.h
+for ac_header in utime.h wchar.h wctype.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -12823,7 +12823,7 @@ fi
 
 done
 
-for ac_header in sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h
+for ac_header in sys/mman.h sys/stat.h sys/types.h sys/utime.h sys/time.h sys/sysmacros.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -12973,7 +12973,8 @@ _ACEOF
 fi
 
 
-ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "$ac_includes_default"
+ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include <time.h>
+"
 if test "x$ac_cv_member_struct_tm_tm_gmtoff" = xyes; then :
 
 cat >>confdefs.h <<_ACEOF
@@ -14226,7 +14227,7 @@ fi
 fi
 
 
-for ac_func in strerror strndup strtoul mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale setlocale
+for ac_func in strndup mkstemp mkostemp utimes utime wcwidth strtof newlocale uselocale freelocale memmem
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -14580,7 +14581,8 @@ if test "$enable_zlib" = "yes"; then
   if test "$ac_cv_header_zlib_h$ac_cv_lib_z_gzopen" != "yesyes"; then
     as_fn_error $? "zlib support requested but not found" "$LINENO" 5
   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
 
 $as_echo "#define ZLIBSUPPORT 1" >>confdefs.h
 
@@ -15131,7 +15133,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.35, which was
+This file was extended by file $as_me 5.37, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -15197,7 +15199,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.35
+file config.status 5.37
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 

+ 10 - 9
configure.ac

@@ -1,5 +1,5 @@
 dnl Process this file with autoconf to produce a configure script.
-AC_INIT([file],[5.35],[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
 

+ 4 - 2
doc/file.man

@@ -1,5 +1,5 @@
-.\" $File: file.man,v 1.133 2018/10/01 18:51:39 christos Exp $
-.Dd October 1, 2018
+.\" $File: file.man,v 1.135 2019/03/03 02:32:40 christos Exp $
+.Dd February 18, 2019
 .Dt FILE __CSECTION__
 .Os
 .Sh NAME
@@ -171,6 +171,8 @@ 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.
+This option works properly only for file formats that have the
+apple-style output defined.
 .It Fl b , Fl Fl brief
 Do not prepend filenames to output lines (brief mode).
 .It Fl C , Fl Fl compile

+ 4 - 4
doc/magic.man

@@ -1,5 +1,5 @@
-.\" $File: magic.man,v 1.95 2018/10/01 19:59:53 christos Exp $
-.Dd October 1, 2018
+.\" $File: magic.man,v 1.96 2019/01/21 14:56:53 christos Exp $
+.Dd January 21, 2019
 .Dt MAGIC __FSECTION__
 .Os
 .\" install as magic.4 on USG, magic.5 on V7, Berkeley and Linux systems.
@@ -116,13 +116,13 @@ The following modifiers are supported:
 .It B
 A byte length (default).
 .It H
-A 4 byte big endian length.
+A 2 byte big endian length.
 .It h
 A 2 byte little endian length.
 .It L
 A 4 byte big endian length.
 .It l
-A 2 byte little endian length.
+A 4 byte little endian length.
 .It J
 The length includes itself in its count.
 .El

+ 2 - 2
magic/Magdir/acorn

@@ -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

+ 4 - 4
magic/Magdir/adventure

@@ -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.
@@ -111,7 +111,7 @@
 # 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

+ 5 - 5
magic/Magdir/algol68

@@ -1,17 +1,17 @@
 
 #------------------------------------------------------------------------------
-# $File: algol68,v 1.2 2016/10/17 14:17:48 christos Exp $
+# $File: algol68,v 1.3 2018/10/19 01:04:21 christos Exp $
 # algol68:  file(1) magic for Algol 68 source
 #
 0	search/8192	(input,			Algol 68 source text
 !:mime	text/x-Algol68
-0	regex		\^PROC			Algol 68 source text
+0	regex/1024	\^PROC			Algol 68 source text
 !:mime	text/x-Algol68
-0	regex           MODE[\t\ ]		Algol 68 source text
+0	regex/1024	\bMODE[\t\ ]		Algol 68 source text
 !:mime	text/x-Algol68
-0	regex          	REF[\t\ ]		Algol 68 source text
+0	regex/1024	\bREF[\t\ ]		Algol 68 source text
 !:mime	text/x-Algol68
-0	regex          	FLEX[\t\ ]\*\\[		Algol 68 source text
+0	regex/1024	\bFLEX[\t\ ]\*\\[	Algol 68 source text
 !:mime	text/x-Algol68
 #0	regex          	[\t\ ]OD		Algol 68 source text
 #!:mime	text/x-Algol68

+ 42 - 7
magic/Magdir/android

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------
-# $File: android,v 1.10 2017/03/17 21:35:28 christos Exp $
+# $File: android,v 1.12 2019/04/19 00:42:27 christos Exp $
 # Various android related magic entries
 #------------------------------------------------------------
 
@@ -32,33 +32,68 @@
 
 # Android Backup archive
 # From: Ariel Shkedi
-# File extension: .ab
-# No mime-type defined
+# Update: Joerg Jenderek 
 # URL: https://github.com/android/platform_frameworks_base/blob/\
 # 0bacfd2ba68d21a68a3df345b830bc2a1e515b5a/services/java/com/\
 # android/server/BackupManagerService.java#L2367
+# 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
 # If compressed, the entire tar file is compressed with JAVA deflate
 #
 # Include the version number hardcoded with the magic string to avoid
 # false positives
-0	string/b	ANDROID\ BACKUP\n1\n	Android Backup
+0	string/b	ANDROID\ BACKUP\n	Android Backup
+# maybe look for some more characteristics like linefeed '\n' or version
+#>16	string		\n			
+# No mime-type defined offically
+!:mime	application/x-google-ab
+!:ext	ab
+# on 2nd line version (often 1, 2 on kitkat 4.4.3+, 4 on 7.1.2)
+>15	string		>\0			\b, version %s
+# "1" on 3rd line means compressed
 >17	string		0\n			\b, Not-Compressed
 >17	string		1\n			\b, Compressed
+# The 4th line is encryption "none" or "AES-256"
 # any string as long as it's not the word none (which is matched below)
+>19	string		none\n			\b, Not-Encrypted
+# look for backup content after line with encryption info
+#>>19	search/7	\n
+# data part after header for not encrypted Android Backup 
+#>>>&0	ubequad		x	\b, content 0x%16.16llx...
+# look for zlib compressed by ./compress after message with 1 space at end
+#>>>&0	indirect	x	\b; contains 
+# look for tar archive block by ./archive for package name manifest
+>>288	string		ustar	\b; contains
+>>>31	use	tar-file
+# look for zip/jar archive by ./archive ./zip after message with 1 space at end
+#>>2079	search/1025/s	PK\003\004	\b; contains 
+#>>>&0	indirect	x
+>19	string		!none			
 >>19    regex/1l	\^([^n\n]|n[^o]|no[^n]|non[^e]|none.+).*	\b, Encrypted (%s)
->>19	string		none\n			\b, Not-Encrypted
 # Commented out because they don't seem useful to print
 # (but they are part of the header - the tar file comes after them):
+# The 5th line is User Password Salt (128 Hex)
+# string length too high with standard src configuration
+#>>>&1		string	>\0	\b, PASSWORD salt: "%-128.128s"
 #>>>&1		regex/1l .*	\b, Password salt: %s
+# The 6th line is Master Key Checksum Salt (128 Hex)
 #>>>>&1		regex/1l .*	\b, Master salt: %s
+# The 7th line is Number of PBDKF2 Rounds (10000)
 #>>>>>&1	regex/1l .*	\b, PBKDF2 rounds: %s
+# The 8th line is User key Initialization Vector (IV) (32 Hex)
 #>>>>>>&1	regex/1l .*	\b, IV: %s
+#>>>>>>&1	regex/1l .*	\b, IV: %s
+# The 9th line is Master IV+Key+Checksum (192 Hex)
 #>>>>>>>&1	regex/1l .*	\b, Key: %s
+# look for new line separator char after line number 9
+#>>>0x204	ubyte	0x0a	NL found
+#>>>>&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

+ 25 - 18
magic/Magdir/animation

@@ -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
@@ -893,10 +893,10 @@
 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
@@ -968,7 +968,7 @@
 
 # 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
@@ -989,61 +989,61 @@
 #>>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,
@@ -1065,3 +1065,10 @@
 >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

+ 94 - 19
magic/Magdir/apple

@@ -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
@@ -11,22 +11,97 @@
 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>
@@ -88,7 +163,7 @@
 # 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øÿ
+#:apple pdosp^Z\xf8\xff
 !:ext awp
 # minimum version needed to read this files. SFMinVers (0 , 30~3.0 )
 >>>183	ubyte		30	3.0
@@ -354,7 +429,7 @@
 >>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.
@@ -396,8 +471,8 @@
 # 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)

+ 193 - 30
magic/Magdir/archive

@@ -1,5 +1,5 @@
 #------------------------------------------------------------------------------
-# $File: archive,v 1.119 2018/04/24 23:19:45 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)
 #
@@ -148,7 +148,7 @@
 >>>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
 
@@ -226,21 +226,48 @@
 # 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
@@ -257,15 +284,35 @@
 >19	string	B			and an EB hash table
 >22	string	X			-- out of date
 
-0	search/1	-h-		Software Tools format archive text
-
 #
 # BSD/SVR2-and-later portable archive formats.
 #
+# Update: Joerg Jenderek
+# URL:		http://fileformats.archiveteam.org/wiki/AR
+# Reference:	https://www.unix.com/man-page/opensolaris/3HEAD/ar.h/
+# Note:		Mach-O universal binary in ./cafebabe is dependent
+# TODO:		unify current ar archive, MIPS archive, Debian package
+#		distinguish BSD, SVR; 32, 64 bit; HP from other 32-bit SVR;
+#		*.ar packages from *.a libraries. handle empty archive
 0	string		=!<arch>\n		current ar archive
+# print first and possibly second ar_name[16] for debugging purpose
+#>8			string	x	\b, 1st "%.16s"
+#>68			string	x	\b, 2nd "%.16s"
 !:mime	application/x-archive
+# a in most case for libraries; lib for Microsoft libraries; ar else cases
+!:ext	a/lib/ar
 >8	string		__.SYMDEF	random library
+# first member with long marked name __.SYMDEF SORTED implies BSD library
 >68	string		__.SYMDEF\ SORTED	random library
+# Reference: https://parisc.wiki.kernel.org/images-parisc/b/b2/Rad_11_0_32.pdf
+# "archive file" entry moved from ./hp
+# LST header system_id 0210h~PA-RISC 1.1,... identifies the target architecture
+# LST header a_magic 0619h~relocatable library
+>68	belong 		0x020b0619	- PA-RISC1.0 relocatable library
+>68	belong	 	0x02100619	- PA-RISC1.1 relocatable library
+>68	belong 		0x02110619	- PA-RISC1.2 relocatable library
+>68	belong 		0x02140619	- PA-RISC2.0 relocatable library
+#EOF for common ar archives
 
 #
 # "Thin" archive, as can be produced by GNU ar.
@@ -275,6 +322,8 @@
 >68	belong		1		%d symbol entry
 >68	belong		>1		%d symbol entries
 
+0	search/1	-h-		Software Tools format archive text
+
 # ARC archiver, from Daniel Quinlan (quinlan@yggdrasil.com)
 #
 # The first byte is the magic (0x1a), byte 2 is the compression type for
@@ -799,7 +848,7 @@
 # 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
@@ -999,7 +1048,7 @@
 !: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
@@ -1020,7 +1069,9 @@
 0	string		PK\005\006	Zip archive data (empty)
 !:mime application/zip
 !: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.
@@ -1063,7 +1114,7 @@
 >>>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
@@ -1112,7 +1163,7 @@
 !: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
@@ -1306,6 +1357,16 @@
 >5	byte	x		\b.%d
 >6	belong	x		(%d bytes)
 
+# From:		Joerg Jenderek
+# URL:		https://help.foxitsoftware.com/kb/install-fzip-file.php
+# reference:	http://mark0.net/download/triddefs_xml.7z/
+#		defs/f/fzip.trid.xml
+# Note: unknown compression; No "PK" zip magic; normally in directory like
+#	"%APPDATA%\Foxit Software\Addon\Foxit Reader\Install"
+0	ubequad	0x2506781901010000	Foxit add-on/update
+!:mime	application/x-fzip
+!:ext	fzip
+
 # From: "Robert Dale" <robdale@gmail.com>
 0	belong	123		dar archive,
 >4	belong	x		label "%.8x
@@ -1316,7 +1377,7 @@
 >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
@@ -1334,24 +1395,74 @@
 >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
@@ -1366,11 +1477,11 @@
 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
@@ -1380,8 +1491,8 @@
 >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
@@ -1427,3 +1538,55 @@
 
 # LyNX archive
 56	string	USE\040LYNX\040TO\040DISSOLVE\040THIS\040FILE	 LyNX archive
+
+# From: Joerg Jenderek
+# 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
+!:ext	tib
+# 01000000
+#>20	ubelong		x			\b, at 20 0x%x
+# 20000000
+#>28	ubelong		x			\b, at 28 0x%x
+# strings like "Generic- SD/MMC 1.00" "Unknown Disk" "Msft Virtual Disk 1.0"
+# ???
+# strings like "\Device\0000011e" "\Device\0000015a"
+#>0	search/0x6852300/cs	\\Device\\
+#>>&-1	pstring		x			\b, %s
+# "\Device\HarddiskVolume30" "\Device\HarddiskVolume39"
+#>>>&1	search/180/cs	\\Device\\
+#>>>>&-1	pstring		x			\b, %s
+#>>>>>&0	search/29/cs	\0\0\xc8\0
+# disk label
+#>>>>>>&10	lestring16	x		\b, disk label %11.11s
+#>>>>>>&9	plestring16	x		\b, disk label "%11.11s"
+#>>>>>>&10	ubequad	x			%16.16llx
+
+
+# Gentoo XPAK binary package
+# by Michal Gorny <mgorny@gentoo.org>
+# 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
+

+ 218 - 11
magic/Magdir/audio

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: audio,v 1.93 2018/10/18 23:35:42 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),
@@ -541,6 +541,18 @@
 
 # adlib sound files
 # From: Alex Myczko <alex@aiei.ch>
+
+# https://github.com/rerrahkr/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
 
 1068	string		RoR		AMUSIC Adlib Tracker
@@ -645,7 +657,7 @@
 
 # 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
@@ -670,12 +682,12 @@
 >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
 
@@ -683,6 +695,8 @@
 # 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
@@ -729,6 +743,54 @@
 >>>>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
@@ -743,8 +805,8 @@
 
 # Summary:	Garmin Voice Processing Module (WAVE audios)
 # From:		Joerg Jenderek
-# URL:		http://www.garmin.com/
-# Reference:	http://turboccc.wikispaces.com/share/view/28622555
+# URL:		https://www.garmin.com/
+# Reference:	http://www.poi-factory.com/node/19580
 # NOTE:		there exist 2 other Garmin VPM formats
 0		string	AUDIMG
 # skip text files starting with string "AUDIMG"
@@ -768,16 +830,35 @@
 # if you select a language like german on your garmin device
 # you can only select voice modules with corresponding language byte ID like 1
 >>18		ubyte		x	\b, language ID %d
+# structure for phrases/sentences?
+# number of voice sample in the 1st phrase?
+#>>19		uleshort		x	\b, 0x%x samples
+#>>>21		uleshort		>0	\b, at 0x%4.4x
+#>>>(21.s)	ubequad			x	0x%llx
+# 2nd phrase?
+#>>23		uleshort		x	\b, 0x%x samples
+#>>>25		uleshort		>0	\b, at 0x%4.4x
+#>>>(25.s)	ubequad			x	0x%llx
 # pointer to 1st audio WAV sample
 >>16		uleshort	>0
->>>(16.s)	ulelong		>0	\b, at offset 0x%x
+>>>(16.s)	ulelong		>0	\b, at 0x%x
 # WAV length
->>>>(16.s+4)	ulelong		>0	%d Bytes
+# 1 space char after "bytes" to get phrase "bytes RIFF"
+>>>>(16.s+4)	ulelong		>0	%u bytes 
 # look for magic
 >>>>>(&-8.l)	string		RIFF
 # determine type by ./riff
->>>>>>&-4	indirect	x	\b
+>>>>>>&-4	indirect	x
 # 2 - ~ 131 WAV samples following same way
+#
+# Summary:	encrypted Garmin Voice Processing Module
+# From:		Joerg Jenderek
+# URL:		https://www.garmin.com/us/products/ontheroad/voicestudio
+# NOTE:		Encrypted variant used in voices like DrNightmare, Elfred, Yeti.
+#		There exist 2 other Garmin VPM formats
+0	ubequad		0xa141190fecc8ced6	Garmin Voice Processing Module (encrypted)
+!:mime	audio/x-vpm-garmin
+!:ext	vpm
 
 # From Martin Mueller Skarbiniks Pedersen
 0		string		GDM
@@ -832,7 +913,7 @@
 >>>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
@@ -882,11 +963,15 @@
 # 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
@@ -904,3 +989,125 @@
 # 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

+ 2 - 2
magic/Magdir/basis

@@ -1,9 +1,9 @@
 
 #----------------------------------------------------------------
-# $File: basis,v 1.4 2009/09/19 16:28:08 christos Exp $
+# $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

+ 3 - 3
magic/Magdir/ber

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: ber,v 1.1 2016/06/05 00:21:30 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

+ 4 - 4
magic/Magdir/bioinformatics

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: bioinformatics,v 1.4 2016/06/20 16:13:46 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
@@ -129,7 +129,7 @@
 
 ###############################################################################
 # 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\ ]+$

+ 1 - 1
magic/Magdir/biosig

@@ -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
 #
 ##############################################################################
 #

+ 1 - 1
magic/Magdir/blcr

@@ -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

+ 2 - 2
magic/Magdir/blender

@@ -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,

+ 44 - 25
magic/Magdir/c-lang

@@ -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
@@ -12,31 +12,41 @@
 
 # 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
@@ -44,35 +54,44 @@
 
 # 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
 

+ 13 - 13
magic/Magdir/cad

@@ -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
 #
 
@@ -11,12 +11,12 @@
 # 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
@@ -102,13 +102,13 @@
 # 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
@@ -156,7 +156,7 @@
 !: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
 

+ 30 - 0
magic/Magdir/clojure

@@ -0,0 +1,30 @@
+#------------------------------------------------------------------------------
+# file:  file(1) magic for Clojure
+# URL:  https://clojure.org/
+# From: Jason Felice <jason.m.felice@gmail.com>
+
+0	string/w	#!\ /usr/bin/clj	Clojure script text executable
+!:mime	text/x-clojure
+0	string/w	#!\ /usr/local/bin/clj	Clojure script text executable
+!:mime	text/x-clojure
+0	string/w	#!\ /usr/bin/clojure	Clojure script text executable
+!:mime	text/x-clojure
+0	string/w	#!\ /usr/local/bin/clojure	Clojure script text executable
+!:mime	text/x-clojure
+0	string/W	#!/usr/bin/env\ clj	Clojure script text executable
+!:mime	text/x-clojure
+0	string/W	#!/usr/bin/env\ clojure	Clojure script text executable
+!:mime	text/x-clojure
+0	string/W	#!\ /usr/bin/env\ clj	Clojure script text executable
+!:mime	text/x-clojure
+0	string/W	#!\ /usr/bin/env\ clojure	Clojure script text executable
+!:mime	text/x-clojure
+
+0	regex	\^\\\(ns[[:space:]]+[a-z]	Clojure module source text
+!:mime	text/x-clojure
+
+0	regex	\^\\\(ns[[:space:]]+\\\^\\{:	Clojure module source text
+!:mime	text/x-clojure
+
+0	regex	\^\\\(defn-?[[:space:]]	Clojure module source text
+!:mime	text/x-clojure

+ 3 - 3
magic/Magdir/commands

@@ -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]
@@ -109,7 +109,7 @@
 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
 

+ 77 - 10
magic/Magdir/compress

@@ -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.
@@ -16,13 +16,78 @@
 >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
@@ -49,7 +114,9 @@
 >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
@@ -160,7 +227,7 @@
 >>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>
@@ -174,7 +241,7 @@
 >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
@@ -203,7 +270,7 @@
 >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
@@ -292,11 +359,11 @@
 >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
 

+ 65 - 28
magic/Magdir/console

@@ -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.
 
@@ -186,7 +186,7 @@
 # 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
 #
 
@@ -269,7 +269,7 @@
 # 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.
@@ -359,7 +359,7 @@
 #------------------------------------------------------------------------------
 # 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.
@@ -422,7 +422,7 @@
 
 #------------------------------------------------------------------------------
 # 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>
@@ -435,7 +435,7 @@
 
 #------------------------------------------------------------------------------
 # 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>
@@ -469,7 +469,7 @@
 # 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
@@ -507,7 +507,21 @@
 
 #------------------------------------------------------------------------------
 # 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
@@ -515,22 +529,43 @@
 >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>
 
@@ -563,7 +598,7 @@
 >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>
@@ -654,7 +689,7 @@
 
 # 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
@@ -668,7 +703,7 @@
 
 # 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
@@ -685,13 +720,13 @@
 
 # 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
@@ -754,13 +789,15 @@
 
 # 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
 
 #------------------------------------------------------------------------------

+ 6 - 6
magic/Magdir/coverage

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: coverage,v 1.1 2016/06/05 00:26:32 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
 
@@ -78,10 +78,10 @@
 
 # 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
 

+ 1 - 1
magic/Magdir/ctf

@@ -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

+ 2 - 2
magic/Magdir/cups

@@ -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

+ 16 - 16
magic/Magdir/database

@@ -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)
@@ -147,8 +147,8 @@
 
 ## 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
@@ -187,13 +187,13 @@
 >>>>>>>>>>>>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
@@ -261,13 +261,13 @@
 # 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!
@@ -276,7 +276,7 @@
 # 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!
@@ -287,7 +287,7 @@
 !: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
@@ -296,12 +296,12 @@
 # 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)
@@ -332,7 +332,7 @@
 >>>>>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
@@ -495,7 +495,7 @@
 >>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
@@ -542,7 +542,7 @@
 >>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
 
@@ -582,7 +582,7 @@
 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)
@@ -593,7 +593,7 @@
 # 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)

+ 8 - 8
magic/Magdir/dataone

@@ -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>
@@ -13,35 +13,35 @@
 >&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

+ 2 - 2
magic/Magdir/dbpf

@@ -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.

+ 2 - 2
magic/Magdir/dolby

@@ -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

+ 3 - 3
magic/Magdir/dyadic

@@ -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

+ 2 - 2
magic/Magdir/ebml

@@ -1,8 +1,8 @@
 
 #------------------------------------------------------------------------------
-# $File: ebml,v 1.1 2010/07/02 00:07:03 christos Exp $
+# $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

+ 11 - 0
magic/Magdir/edid

@@ -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

+ 5 - 1
magic/Magdir/elf

@@ -1,6 +1,6 @@
 
 #------------------------------------------------------------------------------
-# $File: elf,v 1.74 2018/06/23 16:39:53 christos Exp $
+# $File: elf,v 1.77 2019/01/16 19:33:35 christos Exp $
 # elf:  file(1) magic for ELF executables
 #
 # We have to check the byte order flag to see what byte order all the
@@ -38,6 +38,8 @@
 >0	lelong&0x3		2		relaxed memory ordering,