Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/external/bsd/file/dist 2017-09-02 11:53 Christos Zoulas <c...
details: https://anonhg.NetBSD.org/src/rev/e397a58c327f
branches: trunk
changeset: 356191:e397a58c327f
user: christos <christos%NetBSD.org@localhost>
date: Fri Sep 08 13:22:41 2017 +0000
description:
2017-09-02 11:53 Christos Zoulas <christos%zoulas.com@localhost>
* release 5.32
2017-08-28 16:37 Christos Zoulas <christos%zoulas.com@localhost>
* Always reset state in {file,buffer}_apprentice (Krzysztof Wilczynski)
2017-08-27 03:55 Christos Zoulas <christos%zoulas.com@localhost>
* Fix always true condition (Thomas Jarosch)
2017-05-24 17:30 Christos Zoulas <christos%zoulas.com@localhost>
* pickier parsing of numeric values in magic files.
2017-05-23 17:55 Christos Zoulas <christos%zoulas.com@localhost>
* PR/615 add magic_getflags()
2017-05-23 13:55 Christos Zoulas <christos%zoulas.com@localhost>
* release 5.31
2017-03-17 20:32 Christos Zoulas <christos%zoulas.com@localhost>
* remove trailing spaces from magic files
* refactor is_tar
* better bounds checks for cdf
diffstat:
external/bsd/file/dist/magic/magdir/adventure | 11 +-
external/bsd/file/dist/magic/magdir/animation | 10 +-
external/bsd/file/dist/magic/magdir/audio | 4 +-
external/bsd/file/dist/magic/magdir/bhl | 10 +
external/bsd/file/dist/magic/magdir/c-lang | 59 ++++--
external/bsd/file/dist/magic/magdir/cad | 11 +-
external/bsd/file/dist/magic/magdir/cafebabe | 4 +-
external/bsd/file/dist/magic/magdir/commands | 6 +-
external/bsd/file/dist/magic/magdir/compress | 4 +-
external/bsd/file/dist/magic/magdir/console | 13 +-
external/bsd/file/dist/magic/magdir/database | 4 +-
external/bsd/file/dist/magic/magdir/dump | 4 +-
external/bsd/file/dist/magic/magdir/flash | 76 ++++----
external/bsd/file/dist/magic/magdir/fonts | 156 +++++++++++++++++-
external/bsd/file/dist/magic/magdir/gconv | 10 +
external/bsd/file/dist/magic/magdir/icc | 4 +-
external/bsd/file/dist/magic/magdir/images | 64 ++++---
external/bsd/file/dist/magic/magdir/m4 | 5 +-
external/bsd/file/dist/magic/magdir/msdos | 8 +-
external/bsd/file/dist/magic/magdir/msvc | 5 +-
external/bsd/file/dist/magic/magdir/pdf | 7 +-
external/bsd/file/dist/magic/magdir/python | 32 +++-
external/bsd/file/dist/magic/magdir/ruby | 39 +++-
external/bsd/file/dist/magic/magdir/sendmail | 4 +-
external/bsd/file/dist/magic/magdir/sgml | 14 +-
external/bsd/file/dist/magic/magdir/yara | 4 +-
external/bsd/file/dist/src/magic.h.in | 30 +++
external/bsd/file/dist/src/readelf.h | 4 +-
external/bsd/file/dist/src/vasprintf.c | 8 +-
external/bsd/file/dist/tests/Makefile.am | 2 +
external/bsd/file/dist/tests/hddrawcopytool.result | 1 +
external/bsd/file/dist/tests/hddrawcopytool.testfile | Bin
external/bsd/file/dist/tests/test.c | 5 +-
33 files changed, 458 insertions(+), 160 deletions(-)
diffs (truncated from 1242 to 300 lines):
diff -r b0d958373bcf -r e397a58c327f external/bsd/file/dist/magic/magdir/adventure
--- a/external/bsd/file/dist/magic/magdir/adventure Fri Sep 08 10:53:55 2017 +0000
+++ b/external/bsd/file/dist/magic/magdir/adventure Fri Sep 08 13:22:41 2017 +0000
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: adventure,v 1.16 2017/03/17 21:35:28 christos Exp $
+# $File: adventure,v 1.17 2017/07/03 16:03:40 christos Exp $
# adventure: file(1) magic for Adventure game files
#
# from Allen Garvin <earendil%faeryland.tamu-commerce.edu@localhost>
@@ -36,11 +36,12 @@
>0 ubyte <9
>>16 belong&0xfe00f0f0 0x3030
>>>0 ubyte < 10
->>>>2 ubeshort < 10
+>>>>2 ubeshort x
>>>>>18 regex [0-9][0-9][0-9][0-9][0-9][0-9]
->>>>>>0 ubyte < 10 Infocom (Z-machine %d,
->>>>>>>2 ubeshort < 10 Release %d /
->>>>>>>>18 string >\0 Serial %.6s)
+>>>>>>0 ubyte < 10 Infocom (Z-machine %d
+>>>>>>>2 ubeshort x \b, Release %d
+>>>>>>>>18 string >\0 \b, Serial %.6s
+>>>>>>>>18 string x \b)
!:strength + 40
!:mime application/x-zmachine
diff -r b0d958373bcf -r e397a58c327f external/bsd/file/dist/magic/magdir/animation
--- a/external/bsd/file/dist/magic/magdir/animation Fri Sep 08 10:53:55 2017 +0000
+++ b/external/bsd/file/dist/magic/magdir/animation Fri Sep 08 13:22:41 2017 +0000
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: animation,v 1.61 2017/04/01 18:26:03 christos Exp $
+# $File: animation,v 1.63 2017/05/26 14:33:07 christos Exp $
# animation: file(1) magic for animation/movie formats
#
# animation formats
@@ -46,9 +46,11 @@
>>11 byte 4 \b v4 (H.263/AMR GSM 6.10)
>>11 byte 5 \b v5 (H.263/AMR GSM 6.10)
>>11 byte 6 \b v6 (ITU H.264/AMR GSM 6.10)
->>11 byte a \b C.S0050-0 V1.0
->>11 byte b \b C.S0050-0-A V1.0.0
->>11 byte c \b C.S0050-0-B V1.0
+# http://www.3gpp2.org/Public_html/Specs/C.S0050-B_v1.0_070521.pdf
+# Section 8.1.1, corresponds to a, b, c
+>>11 byte 0x61 \b C.S0050-0 V1.0
+>>11 byte 0x62 \b C.S0050-0-A V1.0.0
+>>11 byte 0x63 \b C.S0050-0-B V1.0
>8 string 3ge \b, MPEG v4 system, 3GPP
!:mime video/3gpp
>>11 byte 6 \b, Release 6 MBMS Extended Presentations
diff -r b0d958373bcf -r e397a58c327f external/bsd/file/dist/magic/magdir/audio
--- a/external/bsd/file/dist/magic/magdir/audio Fri Sep 08 10:53:55 2017 +0000
+++ b/external/bsd/file/dist/magic/magdir/audio Fri Sep 08 13:22:41 2017 +0000
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: audio,v 1.79 2017/03/17 22:20:22 christos Exp $
+# $File: audio,v 1.80 2017/08/13 00:21:47 christos Exp $
# audio: file(1) magic for sound formats (see also "iff")
#
# Jan Nicolai Langfeldt (janl%ifi.uio.no@localhost), Dan Quinlan (quinlan%yggdrasil.com@localhost),
@@ -745,7 +745,7 @@
# second of release (0-59)
>>9 ubyte x \b:%.2d
# if you select a language like german on your garmin device
-# you can only select voice modules with correponding language byte ID like 1
+# you can only select voice modules with corresponding language byte ID like 1
>>18 ubyte x \b, language ID %d
# pointer to 1st audio WAV sample
>>16 uleshort >0
diff -r b0d958373bcf -r e397a58c327f external/bsd/file/dist/magic/magdir/bhl
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/external/bsd/file/dist/magic/magdir/bhl Fri Sep 08 13:22:41 2017 +0000
@@ -0,0 +1,10 @@
+
+#------------------------------------------------------------------------------
+# $File: bhl,v 1.1 2017/06/11 22:20:02 christos Exp $
+# BlockHashLoc
+# ext: bhl
+# Marco Pontello marcopon%gmail.com@localhost
+# reference: https://github.com/MarcoPon/BlockHashLoc
+0 string BlockHashLoc\x1a BlockHashLoc recovery info,
+>13 byte x version %d
+!:ext bhl
diff -r b0d958373bcf -r e397a58c327f external/bsd/file/dist/magic/magdir/c-lang
--- a/external/bsd/file/dist/magic/magdir/c-lang Fri Sep 08 10:53:55 2017 +0000
+++ b/external/bsd/file/dist/magic/magdir/c-lang Fri Sep 08 13:22:41 2017 +0000
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
-# $File: c-lang,v 1.25 2017/03/17 21:35:28 christos Exp $
+# $File: c-lang,v 1.26 2017/08/14 07:40:38 christos Exp $
# c-lang: file(1) magic for C and related languages programs
#
# The strength is to beat standard HTML
@@ -11,46 +11,69 @@
!:mime text/x-bcpl
# C
-0 regex \^#include C source text
-!:strength +25
+# Check for class if include is found, otherwise class is beaten by include becouse of lowered strength
+0 regex \^#include C
+>0 regex \^class[[:space:]]+
+>>&0 regex \\{[\.\*]\\}(;)?$ \b++
+>&0 clear x source text
+!:strength + 13
!:mime text/x-c
-0 regex \^char[\ \t\n]+ C source text
+0 regex \^#[[:space:]]*pragma C source text
!:mime text/x-c
-0 regex \^double[\ \t\n]+ C source text
+0 regex \^#[[:space:]]*(if\|ifn)def
+>&0 regex \^#[[:space:]]*endif$ C source text
+!:mime text/x-c
+0 regex \^#[[:space:]]*(if\|ifn)def
+>&0 regex \^#[[:space:]]*define C source text
!:mime text/x-c
-0 regex \^extern[\ \t\n]+ C source text
+0 regex \^[[:space:]]*char(\ \\*|\\*)(.+)(=.*)?;[[:space:]]*$ C source text
!:mime text/x-c
-0 regex \^float[\ \t\n]+ C source text
+0 regex \^[[:space:]]*double(\ \\*|\\*)(.+)(=.*)?;[[:space:]]*$ C source text
+!:mime text/x-c
+0 regex \^[[:space:]]*extern[[:space:]]+ C source text
!:mime text/x-c
-0 regex \^struct[\ \t\n]+ C source text
+0 regex \^[[:space:]]*float(\ \\*|\\*)(.+)(=.*)?;[[:space:]]*$ C source text
+!:mime text/x-c
+0 regex \^struct[[:space:]]+ C source text
!:mime text/x-c
-0 regex \^union[\ \t\n]+ C source text
+0 regex \^union[[:space:]]+ C source text
!:mime text/x-c
-0 search/8192 main( C source text
+0 search/8192 main(
+>&0 regex \\)[[:space:]]*\\{ C source text
!:mime text/x-c
# C++
# The strength of these rules is increased so they beat the C rules above
-0 regex \^template[\ \t]+<.*>[\ \t\n]+ C++ source text
+0 regex \^namespace[[:space:]]+[_[:alpha:]]{1,30}[[:space:]]*\\{ C++ source text
!:strength + 30
!:mime text/x-c++
-0 regex \^virtual[\ \t\n]+ C++ source text
+# using namespace [namespace] or using std::[lib]
+0 regex \^using[[:space:]]+(namespace\ )?std(::)?[[:alpha:]]*[[:space:]]*; C++ source text
+!:strength + 30
+!:mime text/x-c++
+0 regex \^[[:space:]]*template[[:space:]]*<.*>[[:space:]]*$ C++ source text
!:strength + 30
!:mime text/x-c++
-0 regex \^class[\ \t\n]+ C++ source text
-# But class is reduced to avoid beating php (Jens Schleusener)
+0 regex \^[[:space:]]*virtual[[:space:]]+.*[};][[:space:]]*$ C++ source text
+!:strength + 30
+!:mime text/x-c++
+# But class alone is reduced to avoid beating php (Jens Schleusener)
+0 regex \^[[:space:]]*class[[:space:]]+[[:digit:][:alpha:]:_]+[[:space:]]*\\{(.*[\n]*)*\\}(;)?$ C++ source text
!:strength + 13
!:mime text/x-c++
-0 regex \^public: C++ source text
+0 regex \^[[:space:]]*public: C++ source text
!:strength + 30
!:mime text/x-c++
-0 regex \^private: C++ source text
+0 regex \^[[:space:]]*private: C++ source text
+!:strength + 30
+!:mime text/x-c++
+0 regex \^[[:space:]]*protected: C++ source text
!:strength + 30
!:mime text/x-c++
# Objective-C
-0 regex \^#import Objective-C source text
-!:strength +25
+0 regex \^#import Objective-C source text
+!:strength + 25
!:mime text/x-objective-c
# From: Mikhail Teterin <mi%aldan.algebra.com@localhost>
diff -r b0d958373bcf -r e397a58c327f external/bsd/file/dist/magic/magdir/cad
--- a/external/bsd/file/dist/magic/magdir/cad Fri Sep 08 10:53:55 2017 +0000
+++ b/external/bsd/file/dist/magic/magdir/cad Fri Sep 08 13:22:41 2017 +0000
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: cad,v 1.14 2017/03/17 21:35:28 christos Exp $
+# $File: cad,v 1.15 2017/06/24 15:24:56 christos Exp $
# autocad: file(1) magic for cad files
#
@@ -147,8 +147,13 @@
>0x02 byte 0xfe
>>0x04 beshort 0x1800 CIT raster CAD
-# 3DS (3d Studio files) Conflicts with diff output 0x3d '='
-#16 beshort 0x3d3d image/x-3ds
+# 3DS (3d Studio files)
+0 leshort 0x4d4d
+>6 leshort 0x2
+>>8 lelong 0xa
+>>>16 leshort 0x3d3d 3D Studio model
+!:mime image/x-3ds
+!:extension 3ds
# MegaCAD 2D/3D drawing (.prt)
# http://megacad.de/
diff -r b0d958373bcf -r e397a58c327f external/bsd/file/dist/magic/magdir/cafebabe
--- a/external/bsd/file/dist/magic/magdir/cafebabe Fri Sep 08 10:53:55 2017 +0000
+++ b/external/bsd/file/dist/magic/magdir/cafebabe Fri Sep 08 13:22:41 2017 +0000
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: cafebabe,v 1.22 2017/03/17 21:35:28 christos Exp $
+# $File: cafebabe,v 1.23 2017/05/25 20:07:23 christos Exp $
# Cafe Babes unite!
#
# Since Java bytecode and Mach-O universal binaries have the same magic number,
@@ -47,7 +47,7 @@
0 name mach-o \b [
>0 use mach-o-cpu \b
->(8.L) indirect \b:
+>(8.L) indirect x \b:
>0 belong x \b]
0 belong 0xcafebabe
diff -r b0d958373bcf -r e397a58c327f external/bsd/file/dist/magic/magdir/commands
--- a/external/bsd/file/dist/magic/magdir/commands Fri Sep 08 10:53:55 2017 +0000
+++ b/external/bsd/file/dist/magic/magdir/commands Fri Sep 08 13:22:41 2017 +0000
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: commands,v 1.57 2017/04/04 20:34:24 christos Exp $
+# $File: commands,v 1.59 2017/08/14 07:40:38 christos Exp $
# commands: file(1) magic for various shells and interpreters
#
#0 string/w : shell archive or script for antique kernel text
@@ -56,7 +56,7 @@
!:mime text/x-awk
0 string/wt #!\ /usr/bin/awk awk script text executable
!:mime text/x-awk
-0 regex/4096 =^[A-Za-z0-9_]{0,100}BEGIN[A-Za-z0-9_]{0,100}[{] awk or perl script text
+0 regex/4096 =^[\040\t\f\r\n]{0,100}BEGIN[\040\t\f\r\n]{0,100}[{] awk or perl script text
# AT&T Bell Labs' Plan 9 shell
0 string/wt #!\ /bin/rc Plan 9 rc shell script text executable
@@ -84,7 +84,7 @@
# PHP scripts
# Ulf Harnhammar <ulfh%update.uu.se@localhost>
0 search/1/c =<?php PHP script text
-!:strength + 10
+!:strength + 30
!:mime text/x-php
0 search/1 =<?\n PHP script text
!:mime text/x-php
diff -r b0d958373bcf -r e397a58c327f external/bsd/file/dist/magic/magdir/compress
--- a/external/bsd/file/dist/magic/magdir/compress Fri Sep 08 10:53:55 2017 +0000
+++ b/external/bsd/file/dist/magic/magdir/compress Fri Sep 08 13:22:41 2017 +0000
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
-# $File: compress,v 1.67 2017/03/17 21:35:28 christos Exp $
+# $File: compress,v 1.68 2017/05/25 20:07:23 christos Exp $
# compress: file(1) magic for pure-compression formats (no archives)
#
# compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc.
@@ -223,7 +223,7 @@
# Zstandard/LZ4 skippable frames
# https://github.com/facebook/zstd/blob/dev/zstd_compression_format.md
0 lelong&0xFFFFFFF0 0x184D2A50
->(4.l+8) indirect
+>(4.l+8) indirect x
# Zstandard Dictionary ID subroutine
0 name zstd-dictionary-id
diff -r b0d958373bcf -r e397a58c327f external/bsd/file/dist/magic/magdir/console
--- a/external/bsd/file/dist/magic/magdir/console Fri Sep 08 10:53:55 2017 +0000
+++ b/external/bsd/file/dist/magic/magdir/console Fri Sep 08 13:22:41 2017 +0000
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: console,v 1.30 2017/03/17 21:35:28 christos Exp $
+# $File: console,v 1.32 2017/08/13 00:21:47 christos Exp $
# Console game magic
# Toby Deshane <hac%shoelace.digivill.net@localhost>
@@ -413,6 +413,15 @@
>0x1E byte x \b, Rev.%02u)
>0x12 byte 2 (DSi enhanced)
>0x12 byte 3 (DSi only)
+# Secure Area check.
+>0x20 lelong <0x4000 (homebrew)
+>0x20 lelong >0x3FFF
+>>0x4000 lequad 0x0000000000000000 (multiboot)
+>>0x4000 lequad !0x0000000000000000
Home |
Main Index |
Thread Index |
Old Index