5220 lines
171 KiB
Diff
5220 lines
171 KiB
Diff
--- file-5.18.orig/ChangeLog 2014-03-26 19:27:39.000000000 +0400
|
|
+++ file-master/ChangeLog 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,10 +1,34 @@
|
|
+2014-05-06 6:12 Christos Zoulas <christos@zoulas.com>
|
|
+
|
|
+ * Fix uninitialized title in CDF files (Jan Kaluza)
|
|
+
|
|
+2014-05-04 14:55 Christos Zoulas <christos@zoulas.com>
|
|
+
|
|
+ * PR/351: Fix compilation of empty files
|
|
+
|
|
+2014-04-30 17:39 Christos Zoulas <christos@zoulas.com>
|
|
+
|
|
+ * Fix integer formats: We don't specify 'l' or
|
|
+ 'h' and 'hh' specifiers anymore, only 'll' for
|
|
+ quads and nothing for the rest. This is so that
|
|
+ magic writing is simpler.
|
|
+
|
|
+2014-04-01 15:25 Christos Zoulas <christos@zoulas.com>
|
|
+
|
|
+ * PR/341: Jan Kaluza, fix memory leak
|
|
+ * PR/342: Jan Kaluza, fix out of bounds read
|
|
+
|
|
+2014-03-28 15:25 Christos Zoulas <christos@zoulas.com>
|
|
+
|
|
+ * Fix issue with long formats not matching fmtcheck
|
|
+
|
|
2014-03-26 11:25 Christos Zoulas <christos@zoulas.com>
|
|
|
|
* release 5.18
|
|
|
|
2014-03-15 17:45 Christos Zoulas <christos@zoulas.com>
|
|
|
|
- * add fmtcheck(3) for those who don't have it
|
|
+ * add fmtcheck(3) for those who don't have it
|
|
|
|
2014-03-14 15:12 Christos Zoulas <christos@zoulas.com>
|
|
|
|
diff -urN file-5.18.orig/configure.ac file-master/configure.ac
|
|
--- file-5.18.orig/configure.ac 2014-03-26 19:26:58.000000000 +0400
|
|
+++ file-master/configure.ac 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -107,6 +107,8 @@
|
|
AC_TYPE_INT32_T
|
|
AC_TYPE_UINT64_T
|
|
AC_TYPE_INT64_T
|
|
+AC_TYPE_INTPTR_T
|
|
+AC_TYPE_UINTPTR_T
|
|
AC_FUNC_MMAP
|
|
AC_FUNC_FORK
|
|
AC_FUNC_MBRTOWC
|
|
diff -urN file-5.18.orig/COPYING file-master/COPYING
|
|
--- file-5.18.orig/COPYING 2008-02-05 22:08:11.000000000 +0300
|
|
+++ file-master/COPYING 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,4 +1,4 @@
|
|
-$File: COPYING,v 1.1 2008/02/05 19:08:11 christos Exp $
|
|
+$File: LEGAL.NOTICE,v 1.15 2006/05/03 18:48:33 christos Exp $
|
|
Copyright (c) Ian F. Darwin 1986, 1987, 1989, 1990, 1991, 1992, 1994, 1995.
|
|
Software written by Ian F. Darwin and others;
|
|
maintained 1994- Christos Zoulas.
|
|
diff -urN file-5.18.orig/magic/Magdir/alpha file-master/magic/Magdir/alpha
|
|
--- file-5.18.orig/magic/Magdir/alpha 1970-01-01 03:00:00.000000000 +0300
|
|
+++ file-master/magic/Magdir/alpha 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -0,0 +1,32 @@
|
|
+
|
|
+#------------------------------------------------------------------------------
|
|
+# $File$
|
|
+# alpha architecture description
|
|
+#
|
|
+
|
|
+0 leshort 0603 COFF format alpha
|
|
+>22 leshort&030000 !020000 executable
|
|
+>24 leshort 0410 pure
|
|
+>24 leshort 0413 paged
|
|
+>22 leshort&020000 !0 dynamically linked
|
|
+>16 lelong !0 not stripped
|
|
+>16 lelong 0 stripped
|
|
+>22 leshort&030000 020000 shared library
|
|
+>24 leshort 0407 object
|
|
+>27 byte x - version %d
|
|
+>26 byte x .%d
|
|
+>28 byte x -%d
|
|
+
|
|
+# Basic recognition of Digital UNIX core dumps - Mike Bremford <mike@opac.bl.uk>
|
|
+#
|
|
+# The actual magic number is just "Core", followed by a 2-byte version
|
|
+# number; however, treating any file that begins with "Core" as a Digital
|
|
+# UNIX core dump file may produce too many false hits, so we include one
|
|
+# byte of the version number as well; DU 5.0 appears only to be up to
|
|
+# version 2.
|
|
+#
|
|
+0 string Core\001 Alpha COFF format core dump (Digital UNIX)
|
|
+>24 string >\0 \b, from '%s'
|
|
+0 string Core\002 Alpha COFF format core dump (Digital UNIX)
|
|
+>24 string >\0 \b, from '%s'
|
|
+
|
|
diff -urN file-5.18.orig/magic/Magdir/animation file-master/magic/Magdir/animation
|
|
--- file-5.18.orig/magic/Magdir/animation 2014-03-14 22:47:29.000000000 +0400
|
|
+++ file-master/magic/Magdir/animation 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,6 +1,6 @@
|
|
|
|
#------------------------------------------------------------------------------
|
|
-# $File: animation,v 1.51 2014/03/14 18:47:29 christos Exp $
|
|
+# $File: animation,v 1.52 2014/04/28 12:04:50 christos Exp $
|
|
# animation: file(1) magic for animation/movie formats
|
|
#
|
|
# animation formats
|
|
@@ -621,7 +621,7 @@
|
|
# Live MPEG-4 audio streams (instead of RTP FlexMux)
|
|
0 beshort&0xFFE0 0x56E0 MPEG-4 LOAS
|
|
!:mime audio/x-mp4a-latm
|
|
-#>1 beshort&0x1FFF x \b, %u byte packet
|
|
+#>1 beshort&0x1FFF x \b, %hu byte packet
|
|
>3 byte&0xE0 0x40
|
|
>>4 byte&0x3C 0x04 \b, single stream
|
|
>>4 byte&0x3C 0x08 \b, 2 streams
|
|
@@ -719,16 +719,16 @@
|
|
!:mime video/x-mng
|
|
>4 belong !0x0d0a1a0a CORRUPTED,
|
|
>4 belong 0x0d0a1a0a
|
|
->>16 belong x %ld x
|
|
->>20 belong x %ld
|
|
+>>16 belong x %d x
|
|
+>>20 belong x %d
|
|
|
|
# JNG Video Format, <URL:http://www.libpng.org/pub/mng/spec/>
|
|
0 string \x8bJNG JNG video data,
|
|
!:mime video/x-jng
|
|
>4 belong !0x0d0a1a0a CORRUPTED,
|
|
>4 belong 0x0d0a1a0a
|
|
->>16 belong x %ld x
|
|
->>20 belong x %ld
|
|
+>>16 belong x %d x
|
|
+>>20 belong x %d
|
|
|
|
# Vivo video (Wolfram Kleff)
|
|
3 string \x0D\x0AVersion:Vivo Vivo video data
|
|
diff -urN file-5.18.orig/magic/Magdir/apple file-master/magic/Magdir/apple
|
|
--- file-5.18.orig/magic/Magdir/apple 2013-03-10 02:36:00.000000000 +0400
|
|
+++ file-master/magic/Magdir/apple 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,6 +1,6 @@
|
|
|
|
#------------------------------------------------------------------------------
|
|
-# $File: apple,v 1.27 2013/03/09 22:36:00 christos Exp $
|
|
+# $File: apple,v 1.28 2014/04/28 12:04:50 christos Exp $
|
|
# apple: file(1) magic for Apple file formats
|
|
#
|
|
0 search/1/t FiLeStArTfIlEsTaRt binscii (apple ][) text
|
|
@@ -204,15 +204,15 @@
|
|
# purposes in YellowStep/Cocoa, including some nib files.
|
|
# From: David Remahl <dremahl@apple.com>
|
|
2 string typedstream NeXT/Apple typedstream data, big endian
|
|
->0 byte x \b, version %hhd
|
|
+>0 byte x \b, version %d
|
|
>0 byte <5 \b
|
|
>>13 byte 0x81 \b
|
|
->>>14 ubeshort x \b, system %hd
|
|
+>>>14 ubeshort x \b, system %d
|
|
2 string streamtyped NeXT/Apple typedstream data, little endian
|
|
->0 byte x \b, version %hhd
|
|
+>0 byte x \b, version %d
|
|
>0 byte <5 \b
|
|
>>13 byte 0x81 \b
|
|
->>>14 uleshort x \b, system %hd
|
|
+>>>14 uleshort x \b, system %d
|
|
|
|
#------------------------------------------------------------------------------
|
|
# CAF: Apple CoreAudio File Format
|
|
diff -urN file-5.18.orig/magic/Magdir/archive file-master/magic/Magdir/archive
|
|
--- file-5.18.orig/magic/Magdir/archive 2014-03-14 22:47:29.000000000 +0400
|
|
+++ file-master/magic/Magdir/archive 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,5 +1,5 @@
|
|
#------------------------------------------------------------------------------
|
|
-# $File: archive,v 1.82 2014/03/14 18:47:29 christos Exp $
|
|
+# $File: archive,v 1.83 2014/04/28 12:04:50 christos Exp $
|
|
# archive: file(1) magic for archive formats (see also "msdos" for self-
|
|
# extracting compressed archives)
|
|
#
|
|
@@ -269,7 +269,7 @@
|
|
>9 string \0
|
|
>>0 string KWAJ
|
|
>>>7 string \321\003 MS Compress archive data
|
|
->>>>14 ulong >0 \b, original size: %ld bytes
|
|
+>>>>14 ulong >0 \b, original size: %d bytes
|
|
>>>>18 ubyte >0x65
|
|
>>>>>18 string x \b, was %.8s
|
|
>>>>>(10.b-4) string x \b.%.3s
|
|
@@ -498,7 +498,7 @@
|
|
# This is a really bad format. A file containing HAWAII will match this...
|
|
#0 string HA HA archive data,
|
|
#>2 leshort =1 1 file,
|
|
-#>2 leshort >1 %u files,
|
|
+#>2 leshort >1 %hu files,
|
|
#>4 byte&0x0f =0 first is type CPY
|
|
#>4 byte&0x0f =1 first is type ASC
|
|
#>4 byte&0x0f =2 first is type HSC
|
|
@@ -874,7 +874,7 @@
|
|
# From: Dirk Jagdmann <doj@cubic.org>
|
|
# xar archive format: http://code.google.com/p/xar/
|
|
0 string xar! xar archive
|
|
->6 beshort x - version %ld
|
|
+>6 beshort x - version %d
|
|
|
|
# From: "Nelson A. de Oliveira" <naoliv@gmail.com>
|
|
# .kgb
|
|
diff -urN file-5.18.orig/magic/Magdir/att3b file-master/magic/Magdir/att3b
|
|
--- file-5.18.orig/magic/Magdir/att3b 2009-09-19 20:28:08.000000000 +0400
|
|
+++ file-master/magic/Magdir/att3b 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -11,10 +11,10 @@
|
|
# The 3B20 conflicts with SCCS.
|
|
#0 beshort 0550 3b20 COFF executable
|
|
#>12 belong >0 not stripped
|
|
-#>22 beshort >0 - version %ld
|
|
+#>22 beshort >0 - version %d
|
|
#0 beshort 0551 3b20 COFF executable (TV)
|
|
#>12 belong >0 not stripped
|
|
-#>22 beshort >0 - version %ld
|
|
+#>22 beshort >0 - version %d
|
|
#
|
|
# WE32K
|
|
#
|
|
@@ -29,12 +29,12 @@
|
|
>20 beshort 0410 (pure)
|
|
>20 beshort 0413 (demand paged)
|
|
>20 beshort 0443 (target shared library)
|
|
->22 beshort >0 - version %ld
|
|
+>22 beshort >0 - version %d
|
|
0 beshort 0561 WE32000 COFF executable (TV)
|
|
>12 belong >0 not stripped
|
|
#>18 beshort &00020000 - 32100 required
|
|
#>18 beshort &00040000 and MAU hardware required
|
|
-#>22 beshort >0 - version %ld
|
|
+#>22 beshort >0 - version %d
|
|
#
|
|
# core file for 3b2
|
|
0 string \000\004\036\212\200 3b2 core file
|
|
diff -urN file-5.18.orig/magic/Magdir/audio file-master/magic/Magdir/audio
|
|
--- file-5.18.orig/magic/Magdir/audio 2013-12-02 17:32:26.000000000 +0400
|
|
+++ file-master/magic/Magdir/audio 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,6 +1,6 @@
|
|
|
|
#------------------------------------------------------------------------------
|
|
-# $File: audio,v 1.68 2013/12/02 13:32:26 christos Exp $
|
|
+# $File: audio,v 1.70 2014/04/30 21:41:02 christos Exp $
|
|
# audio: file(1) magic for sound formats (see also "iff")
|
|
#
|
|
# Jan Nicolai Langfeldt (janl@ifi.uio.no), Dan Quinlan (quinlan@yggdrasil.com),
|
|
@@ -104,7 +104,7 @@
|
|
|
|
# first entry is also the string "NTRK"
|
|
0 belong 0x4e54524b MultiTrack sound data
|
|
->4 belong x - version %ld
|
|
+>4 belong x - version %d
|
|
|
|
# Extended MOD format (*.emd) (Greg Roelofs, newt@uchicago.edu); NOT TESTED
|
|
# [based on posting 940824 by "Dirk/Elastik", husberg@lehtori.cc.tut.fi]
|
|
@@ -638,7 +638,7 @@
|
|
# From: Mike Melanson <mike@multimedia.cx>
|
|
0 string wvpk WavPack Lossless Audio
|
|
|
|
-# From Fábio R. Schmidlin <frs@pop.com.br>
|
|
+# From Fabio R. Schmidlin <frs@pop.com.br>
|
|
# VGM music file
|
|
0 string Vgm\
|
|
>9 ubyte >0 VGM Video Game Music dump v
|
|
diff -urN file-5.18.orig/magic/Magdir/bflt file-master/magic/Magdir/bflt
|
|
--- file-5.18.orig/magic/Magdir/bflt 2009-09-19 20:28:08.000000000 +0400
|
|
+++ file-master/magic/Magdir/bflt 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -6,7 +6,7 @@
|
|
# From Philippe De Muyter <phdm@macqel.be>
|
|
#
|
|
0 string bFLT BFLT executable
|
|
->4 belong x - version %ld
|
|
+>4 belong x - version %d
|
|
>4 belong 4
|
|
>>36 belong&0x1 0x1 ram
|
|
>>36 belong&0x2 0x2 gotpic
|
|
diff -urN file-5.18.orig/magic/Magdir/bsdi file-master/magic/Magdir/bsdi
|
|
--- file-5.18.orig/magic/Magdir/bsdi 2013-01-10 02:37:24.000000000 +0400
|
|
+++ file-master/magic/Magdir/bsdi 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -11,7 +11,7 @@
|
|
>32 byte 0x6a (uses shared libs)
|
|
|
|
# same as in SunOS 4.x, except for static shared libraries
|
|
-0 belong&077777777 0600413 sparc demand paged
|
|
+0 belong&077777777 0600413 SPARC demand paged
|
|
>0 byte &0x80
|
|
>>20 belong <4096 shared library
|
|
>>20 belong =4096 dynamically linked executable
|
|
@@ -20,13 +20,13 @@
|
|
>16 belong >0 not stripped
|
|
>36 belong 0xb4100001 (uses shared libs)
|
|
|
|
-0 belong&077777777 0600410 sparc pure
|
|
+0 belong&077777777 0600410 SPARC pure
|
|
>0 byte &0x80 dynamically linked executable
|
|
>0 byte ^0x80 executable
|
|
>16 belong >0 not stripped
|
|
>36 belong 0xb4100001 (uses shared libs)
|
|
|
|
-0 belong&077777777 0600407 sparc
|
|
+0 belong&077777777 0600407 SPARC
|
|
>0 byte &0x80 dynamically linked executable
|
|
>0 byte ^0x80 executable
|
|
>16 belong >0 not stripped
|
|
diff -urN file-5.18.orig/magic/Magdir/cafebabe file-master/magic/Magdir/cafebabe
|
|
--- file-5.18.orig/magic/Magdir/cafebabe 2014-03-14 22:47:29.000000000 +0400
|
|
+++ file-master/magic/Magdir/cafebabe 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -52,7 +52,7 @@
|
|
>4 belong 1 Mach-O universal binary with 1 architecture:
|
|
>>8 use mach-o \b
|
|
>4 belong >1
|
|
->>4 belong <20 Mach-O universal binary with %ld architectures:
|
|
+>>4 belong <20 Mach-O universal binary with %d architectures:
|
|
>>>8 use mach-o \b
|
|
>>>28 use mach-o \b
|
|
>>4 belong >2
|
|
diff -urN file-5.18.orig/magic/Magdir/clarion file-master/magic/Magdir/clarion
|
|
--- file-5.18.orig/magic/Magdir/clarion 2009-09-19 20:28:08.000000000 +0400
|
|
+++ file-master/magic/Magdir/clarion 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -15,7 +15,7 @@
|
|
>2 leshort &0x0010 \b, compressed
|
|
>2 leshort &0x0040 \b, read only
|
|
# number of records
|
|
->5 lelong x \b, %ld records
|
|
+>5 lelong x \b, %d records
|
|
|
|
# Memo files
|
|
0 leshort 0x334d Clarion Developer (v2 and above) memo data
|
|
diff -urN file-5.18.orig/magic/Magdir/clipper file-master/magic/Magdir/clipper
|
|
--- file-5.18.orig/magic/Magdir/clipper 2009-09-19 20:28:08.000000000 +0400
|
|
+++ file-master/magic/Magdir/clipper 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -35,7 +35,7 @@
|
|
>20 short 0413 (demand paged)
|
|
>20 short 0443 (target shared library)
|
|
>12 long >0 not stripped
|
|
->22 short >0 - version %ld
|
|
+>22 short >0 - version %d
|
|
0 short 0577 CLIPPER COFF executable
|
|
>18 short&074000 000000 C1 R1
|
|
>18 short&074000 004000 C2 R1
|
|
@@ -47,7 +47,7 @@
|
|
>20 short 0413 (paged)
|
|
>20 short 0443 (target shared library)
|
|
>12 long >0 not stripped
|
|
->22 short >0 - version %ld
|
|
+>22 short >0 - version %d
|
|
>48 long&01 01 alignment trap enabled
|
|
>52 byte 1 -Ctnc
|
|
>52 byte 2 -Ctsw
|
|
diff -urN file-5.18.orig/magic/Magdir/compress file-master/magic/Magdir/compress
|
|
--- file-5.18.orig/magic/Magdir/compress 2014-03-14 22:47:29.000000000 +0400
|
|
+++ file-master/magic/Magdir/compress 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,5 +1,5 @@
|
|
#------------------------------------------------------------------------------
|
|
-# $File: compress,v 1.54 2014/03/14 18:47:29 christos Exp $
|
|
+# $File: compress,v 1.57 2014/04/30 21:41:02 christos Exp $
|
|
# compress: file(1) magic for pure-compression formats (no archives)
|
|
#
|
|
# compress, gzip, pack, compact, huf, squeeze, crunch, freeze, yabba, etc.
|
|
@@ -210,9 +210,12 @@
|
|
!:mime application/x-lrzip
|
|
|
|
# http://fastcompression.blogspot.fi/2013/04/lz4-streaming-format-final.html
|
|
-0 lelong 0x184d2204 LZ4 compressed data
|
|
+0 lelong 0x184d2204 LZ4 compressed data (v1.4+)
|
|
!:mime application/x-lz4
|
|
-0 lelong 0x184c2102 LZ4 compressed data, legacy format
|
|
+# Added by osm0sis@xda-developers.com
|
|
+0 lelong 0x184c2103 LZ4 compressed data (v1.0-v1.3)
|
|
+!:mime application/x-lz4
|
|
+0 lelong 0x184c2102 LZ4 compressed data (v0.1-v0.9)
|
|
!:mime application/x-lz4
|
|
|
|
# AFX compressed files (Wolfram Kleff)
|
|
@@ -244,3 +247,7 @@
|
|
>0x4 lelong x \b, version %u
|
|
>0x8 lelong x \b, %u entries
|
|
|
|
+# Snappy framing format
|
|
+# http://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
|
|
diff -urN file-5.18.orig/magic/Magdir/database file-master/magic/Magdir/database
|
|
--- file-5.18.orig/magic/Magdir/database 2014-03-14 22:47:29.000000000 +0400
|
|
+++ file-master/magic/Magdir/database 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,6 +1,6 @@
|
|
|
|
#------------------------------------------------------------------------------
|
|
-# $File: database,v 1.37 2014/03/14 18:47:29 christos Exp $
|
|
+# $File: database,v 1.39 2014/04/28 12:04:50 christos Exp $
|
|
# database: file(1) magic for various databases
|
|
#
|
|
# extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
|
|
@@ -105,7 +105,7 @@
|
|
>>8 quad 0 64bit aligned
|
|
>>>16 bedouble 8.642135e+130 big-endian
|
|
>>>>24 long 0 64bit long (s390x)
|
|
->>>>24 long !0 32bit long (hppa/mips/ppc/s390/sparc)
|
|
+>>>>24 long !0 32bit long (hppa/mips/ppc/s390/SPARC)
|
|
>>>16 ledouble 8.642135e+130 little-endian
|
|
>>>>28 long 0 64bit long (alpha/amd64/ia64)
|
|
>>>>28 long !0 32bit long (armel/mipsel)
|
|
@@ -176,7 +176,7 @@
|
|
# database file
|
|
>>>>>>>>>>>>0 ubyte x \b DBF
|
|
>>>>>>>>>>>>4 lelong 0 \b, no records
|
|
->>>>>>>>>>>>4 lelong >0 \b, %ld record
|
|
+>>>>>>>>>>>>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
|
|
@@ -364,22 +364,22 @@
|
|
>>16 ubyte 0
|
|
>>>512 ubelong <0x00000003 FoxPro FPT
|
|
# Size of blocks for FoxPro
|
|
->>>>6 ubeshort x \b, blocks size %lu
|
|
+>>>>6 ubeshort x \b, blocks size %u
|
|
# Number of next available block for appending data for FoxPro
|
|
->>>>0 ubelong =0 \b, next free block index %lu
|
|
->>>>0 ubelong !0 \b, next free block index %lu
|
|
+>>>>0 ubelong =0 \b, next free block index %u
|
|
+>>>>0 ubelong !0 \b, next free block index %u
|
|
>>>512 default x dBase IV DBT
|
|
# DBF file name without extention
|
|
>>>>8 string >\0 \b of %-.8s.DBF
|
|
# size of blocks ; not reliable 0x2020204C
|
|
-#>>>>4 ulelong =0 \b, blocks size %lu
|
|
->>>>4 ulelong !0 \b, blocks size %lu
|
|
+#>>>>4 ulelong =0 \b, blocks size %u
|
|
+>>>>4 ulelong !0 \b, blocks size %u
|
|
# Block length found 0 , 512
|
|
#>>>>20 uleshort =0 \b, block length %u
|
|
>>>>20 uleshort !0 \b, block length %u
|
|
# Number of next available block for appending data
|
|
->>>>0 ulelong =0 \b, next free block index %lu
|
|
->>>>0 ulelong !0 \b, next free block index %lu
|
|
+>>>>0 ulelong =0 \b, next free block index %u
|
|
+>>>>0 ulelong !0 \b, next free block index %u
|
|
>>512 ubelong x
|
|
>>>512 ubelong =0xFFFF0800
|
|
>>>>520 string >\0 \b, 1st used item "%s"
|
|
diff -urN file-5.18.orig/magic/Magdir/dump file-master/magic/Magdir/dump
|
|
--- file-5.18.orig/magic/Magdir/dump 2012-11-01 08:26:40.000000000 +0400
|
|
+++ file-master/magic/Magdir/dump 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -8,7 +8,7 @@
|
|
0 name new-dump-be
|
|
>4 bedate x Previous dump %s,
|
|
>8 bedate x This dump %s,
|
|
->12 belong >0 Volume %ld,
|
|
+>12 belong >0 Volume %d,
|
|
>692 belong 0 Level zero, type:
|
|
>692 belong >0 Level %d, type:
|
|
>0 belong 1 tape header,
|
|
@@ -27,7 +27,7 @@
|
|
0 name old-dump-be
|
|
#>4 bedate x Previous dump %s,
|
|
#>8 bedate x This dump %s,
|
|
->12 belong >0 Volume %ld,
|
|
+>12 belong >0 Volume %d,
|
|
>692 belong 0 Level zero, type:
|
|
>692 belong >0 Level %d, type:
|
|
>0 belong 1 tape header,
|
|
@@ -46,7 +46,7 @@
|
|
0 name ufs2-dump-be
|
|
>896 beqdate x Previous dump %s,
|
|
>904 beqdate x This dump %s,
|
|
->12 belong >0 Volume %ld,
|
|
+>12 belong >0 Volume %d,
|
|
>692 belong 0 Level zero, type:
|
|
>692 belong >0 Level %d, type:
|
|
>0 belong 1 tape header,
|
|
@@ -84,7 +84,7 @@
|
|
18 leshort 60011 old-fs dump file (16-bit, assuming PDP-11 endianness),
|
|
>2 medate x Previous dump %s,
|
|
>6 medate x This dump %s,
|
|
->10 leshort >0 Volume %ld,
|
|
+>10 leshort >0 Volume %d,
|
|
>0 leshort 1 tape header.
|
|
>0 leshort 2 beginning of file record.
|
|
>0 leshort 3 map of inodes on tape.
|
|
diff -urN file-5.18.orig/magic/Magdir/efi file-master/magic/Magdir/efi
|
|
--- file-5.18.orig/magic/Magdir/efi 2009-09-19 20:28:09.000000000 +0400
|
|
+++ file-master/magic/Magdir/efi 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -12,4 +12,4 @@
|
|
>>&0 lelong 0x01000007 \b, x86_64
|
|
>>&20 lelong 7 \b, i386
|
|
>>&20 lelong 0x01000007 \b, x86_64
|
|
->4 lelong >2 Universal EFI binary with %ld architectures
|
|
+>4 lelong >2 Universal EFI binary with %d architectures
|
|
diff -urN file-5.18.orig/magic/Magdir/encore file-master/magic/Magdir/encore
|
|
--- file-5.18.orig/magic/Magdir/encore 2009-09-19 20:28:09.000000000 +0400
|
|
+++ file-master/magic/Magdir/encore 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -12,11 +12,11 @@
|
|
>20 short 0x10b demand-paged executable
|
|
>20 short 0x10f unsupported executable
|
|
>12 long >0 not stripped
|
|
->22 short >0 - version %ld
|
|
+>22 short >0 - version %d
|
|
>22 short 0 -
|
|
#>4 date x stamp %s
|
|
0 short 0x155 Encore unsupported executable
|
|
>12 long >0 not stripped
|
|
->22 short >0 - version %ld
|
|
+>22 short >0 - version %d
|
|
>22 short 0 -
|
|
#>4 date x stamp %s
|
|
diff -urN file-5.18.orig/magic/Magdir/filesystems file-master/magic/Magdir/filesystems
|
|
--- file-5.18.orig/magic/Magdir/filesystems 2014-03-01 07:04:06.000000000 +0400
|
|
+++ file-master/magic/Magdir/filesystems 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,5 +1,5 @@
|
|
#------------------------------------------------------------------------------
|
|
-# $File: filesystems,v 1.87 2014/03/01 03:04:06 christos Exp $
|
|
+# $File: filesystems,v 1.89 2014/04/30 21:41:02 christos Exp $
|
|
# filesystems: file(1) magic for different filesystems
|
|
#
|
|
0 name partid
|
|
@@ -204,8 +204,8 @@
|
|
>>0752 short >0 %d alt cyls,
|
|
>>0754 short >0 %d heads/partition,
|
|
>>0756 short >0 %d sectors/track,
|
|
->>0764 long >0 start cyl %ld,
|
|
->>0770 long x %ld blocks
|
|
+>>0764 long >0 start cyl %d,
|
|
+>>0770 long x %d blocks
|
|
# Is there a boot block written 1 sector in?
|
|
>512 belong&077777777 0600407 \b, boot block present
|
|
|
|
@@ -319,8 +319,8 @@
|
|
# assembler instructions: rep;movsb;retf;mov si,07be;mov cl,04
|
|
>>>24 ubequad 0xf3a4cbbebe07b104 9M
|
|
# "Invalid partition table" nn=0x10F for english version
|
|
-# "Ungültige Partitionstabelle" nn=0x10F for german version
|
|
-# "Table de partition erronée" nn=0x10F for french version
|
|
+# "Ung\201ltige Partitionstabelle" nn=0x10F for german version
|
|
+# "Table de partition erron\202e" nn=0x10F for french version
|
|
# "\216\257\245\340\240\346\250\256\255\255\240\357 \341\250\341\342\245\254\240 \255\245 \255\240\251\244\245\255\240" nn=0x10F for russian version
|
|
>>>>(0x3C.b+0x0FF) string Invalid\ partition\ table english
|
|
>>>>(0x3C.b+0x0FF) string Ung\201ltige\ Partitionstabelle german
|
|
@@ -330,13 +330,13 @@
|
|
>>>>(0x3C.b+0x0FF) string >\0 "%s"
|
|
# "Error loading operating system" nn=0x127 for english version
|
|
# "Fehler beim Laden des Betriebssystems" nn=0x12b for german version
|
|
-# "Erreur lors du chargement du système d'exploitation" nn=0x12a for french version
|
|
+# "Erreur lors du chargement du syst\212me d'exploitation" nn=0x12a for french version
|
|
# "\216\350\250\241\252\240 \257\340\250 \247\240\243\340\343\247\252\245 \256\257\245\340\240\346\250\256\255\255\256\251 \341\250\341\342\245\254\353" nn=0x12d for russian version
|
|
>>>>0xBD ubyte x at offset 0x1%x
|
|
>>>>(0xBD.b+0x100) string >\0 "%s"
|
|
# "Missing operating system" nn=0x146 for english version
|
|
# "Betriebssystem fehlt" nn=0x151 for german version
|
|
-# "Système d'exploitation manquant" nn=0x15e for french version
|
|
+# "Syst\212me d'exploitation manquant" nn=0x15e for french version
|
|
# "\216\257\245\340\240\346\250\256\255\255\240\357 \341\250\341\342\245\254\240 \255\245 \255\240\251\244\245\255\240" nn=0x156 for russian version
|
|
>>>>0xA9 ubyte x at offset 0x1%x
|
|
>>>>(0xA9.b+0x100) string >\0 "%s"
|
|
@@ -347,7 +347,7 @@
|
|
>>>>0x1B4 ubelong&0x00FFFFFF 0x002c4463 english
|
|
>>>>0x1B4 ubelong&0x00FFFFFF 0x002c486e german
|
|
# "Invalid partition table" xx=0x12C for english version
|
|
-# "Ungültige Partitionstabelle" xx=0x12C for german version
|
|
+# "Ung\201ltige Partitionstabelle" xx=0x12C for german version
|
|
>>>>0x1b5 ubyte >0 at offset 0x1%x
|
|
>>>>(0x1b5.b+0x100) string >\0 "%s"
|
|
# "Error loading operating system" yy=0x144 for english version
|
|
@@ -368,7 +368,7 @@
|
|
>>>>0x1B4 ubelong&0x00FFFFFF 0x00627a99 english
|
|
#>>>>0x1B4 ubelong&0x00FFFFFF ? german
|
|
# "Invalid partition table" xx=0x162 for english version
|
|
-# "Ungültige Partitionstabelle" xx=0x1?? for german version
|
|
+# "Ung\201ltige Partitionstabelle" xx=0x1?? for german version
|
|
>>>>0x1b5 ubyte >0 at offset 0x1%x
|
|
>>>>(0x1b5.b+0x100) string >\0 "%s"
|
|
# "Error loading operating system" yy=0x17a for english version
|
|
@@ -386,7 +386,7 @@
|
|
>>>>0x1B4 ubelong&0x00FFFFFF 0x00637b9a english
|
|
#>>>>0x1B4 ubelong&0x00FFFFFF ? german
|
|
# "Invalid partition table" xx=0x163 for english version
|
|
-# "Ungültige Partitionstabelle" xx=0x1?? for german version
|
|
+# "Ung\201ltige Partitionstabelle" xx=0x1?? for german version
|
|
>>>>0x1b5 ubyte >0 at offset 0x1%x
|
|
>>>>(0x1b5.b+0x100) string >\0 "%s"
|
|
# "Error loading operating system" yy=0x17b for english version
|
|
@@ -1330,7 +1330,7 @@
|
|
#>>>(0x1BC.s+11) ubyte x \b,cfg_def 0x%x
|
|
# for older versions
|
|
>>>(0x1BC.s+9) ubyte <2
|
|
-#>>>>(0x1BC.s+12) ubyte 18 \b,%u/18 seconds
|
|
+#>>>>(0x1BC.s+12) ubyte 18 \b,%hhu/18 seconds
|
|
>>>>(0x1BC.s+12) ubyte !18 \b,%u/18 seconds
|
|
# floppy A: or B:
|
|
>>>>(0x1BC.s+13) ubyte <2 \b,floppy 0x%x
|
|
@@ -1373,7 +1373,7 @@
|
|
>>>>0x207 ubyte x \b.%u
|
|
# module_size for 1.94
|
|
>>>>0x208 ulelong <0xffffff \b, installed partition %u
|
|
-#>>>>0x208 ulelong =0xffffff \b, %u (default)
|
|
+#>>>>0x208 ulelong =0xffffff \b, %lu (default)
|
|
>>>>0x208 ulelong >0xffffff \b, installed partition %u
|
|
# GRUB 0.5.95 unofficial
|
|
>>>>0x20C ulelong&0x2E300000 0x2E300000
|
|
@@ -1447,14 +1447,14 @@
|
|
>>>>>16 ubyte =1 \b, FAT %u
|
|
>>>>>16 ubyte >0
|
|
>>>>>17 uleshort >0 \b, root entries %u
|
|
-#>>>>>17 uleshort =0 \b, root entries %u=0 (usual Fat32)
|
|
+#>>>>>17 uleshort =0 \b, root entries %hu=0 (usual Fat32)
|
|
>>>>>19 uleshort >0 \b, sectors %u (volumes <=32 MB)
|
|
-#>>>>>19 uleshort =0 \b, sectors %u=0 (usual Fat32)
|
|
+#>>>>>19 uleshort =0 \b, sectors %hu=0 (usual Fat32)
|
|
>>>>>21 ubyte >0xF0 \b, Media descriptor 0x%x
|
|
#>>>>>21 ubyte =0xF0 \b, Media descriptor 0x%x (usual floppy)
|
|
>>>>>21 ubyte <0xF0 \b, Media descriptor 0x%x
|
|
>>>>>22 uleshort >0 \b, sectors/FAT %u
|
|
-#>>>>>22 uleshort =0 \b, sectors/FAT %u=0 (usual Fat32)
|
|
+#>>>>>22 uleshort =0 \b, sectors/FAT %hu=0 (usual Fat32)
|
|
>>>>>24 uleshort x \b, sectors/track %u
|
|
>>>>>26 ubyte >2 \b, heads %u
|
|
#>>>>>26 ubyte =2 \b, heads %u (usual floppy)
|
|
@@ -1496,7 +1496,7 @@
|
|
>>>>>>36 ulelong x \b, sectors/FAT %u
|
|
# http://technet.microsoft.com/en-us/library/cc977221.aspx
|
|
>>>>>>40 uleshort >0 \b, extension flags 0x%x
|
|
-#>>>>>>40 uleshort =0 \b, extension flags %u
|
|
+#>>>>>>40 uleshort =0 \b, extension flags %hu
|
|
>>>>>>42 uleshort >0 \b, fsVersion %u
|
|
#>>>>>>42 uleshort =0 \b, fsVersion %u (usual)
|
|
>>>>>>44 ulelong >2 \b, rootdir cluster %u
|
|
@@ -1555,13 +1555,13 @@
|
|
# Values 128 to 255 represent MFT record sizes of 2^(256-N) bytes.
|
|
>>>>>>>>>64 lelong <256
|
|
>>>>>>>>>>64 lelong <128 \b, clusters/RecordSegment %d
|
|
->>>>>>>>>>64 ubyte >127 \b, bytes/RecordSegment 2^(-1*%hhi)
|
|
+>>>>>>>>>>64 ubyte >127 \b, bytes/RecordSegment 2^(-1*%i)
|
|
# Values 0 to 127 represent index block sizes of 0 to 127 clusters.
|
|
# Values 128 to 255 represent index block sizes of 2^(256-N) byte
|
|
>>>>>>>>>68 ulelong <256
|
|
>>>>>>>>>>68 ulelong <128 \b, clusters/index block %d
|
|
#>>>>>>>>>>68 ulelong >127 \b, bytes/index block 2^(256-%d)
|
|
->>>>>>>>>>68 ubyte >127 \b, bytes/index block 2^(-1*%hhi)
|
|
+>>>>>>>>>>68 ubyte >127 \b, bytes/index block 2^(-1*%i)
|
|
>>>>>>>>>72 ulequad x \b, serial number 0%llx
|
|
>>>>>>>>>80 ulelong >0 \b, checksum 0x%x
|
|
#>>>>>>>>>80 ulelong =0 \b, checksum 0x%x=0 (usual)
|
|
@@ -1609,7 +1609,7 @@
|
|
>&-180 lelong x average file size %d,
|
|
>&-176 lelong x average number of files in dir %d,
|
|
>&-272 lequad x pending blocks to free %lld,
|
|
->&-264 lelong x pending inodes to free %ld,
|
|
+>&-264 lelong x pending inodes to free %d,
|
|
>&-664 lequad x system-wide uuid %0llx,
|
|
>&-1316 lelong x minimum percentage of free blocks %d,
|
|
>&-1248 lelong 0 TIME optimization
|
|
@@ -1629,7 +1629,7 @@
|
|
>&-180 lelong x average file size %d,
|
|
>&-176 lelong x average number of files in dir %d,
|
|
>&-272 lequad x pending blocks to free %lld,
|
|
->&-264 lelong x pending inodes to free %ld,
|
|
+>&-264 lelong x pending inodes to free %d,
|
|
>&-664 lequad x system-wide uuid %0llx,
|
|
>&-1316 lelong x minimum percentage of free blocks %d,
|
|
>&-1248 lelong 0 TIME optimization
|
|
@@ -1669,7 +1669,7 @@
|
|
>&-180 belong x average file size %d,
|
|
>&-176 belong x average number of files in dir %d,
|
|
>&-272 bequad x pending blocks to free %lld,
|
|
->&-264 belong x pending inodes to free %ld,
|
|
+>&-264 belong x pending inodes to free %d,
|
|
>&-664 bequad x system-wide uuid %0llx,
|
|
>&-1316 belong x minimum percentage of free blocks %d,
|
|
>&-1248 belong 0 TIME optimization
|
|
@@ -1689,7 +1689,7 @@
|
|
>&-180 belong x average file size %d,
|
|
>&-176 belong x average number of files in dir %d,
|
|
>&-272 bequad x pending blocks to free %lld,
|
|
->&-264 belong x pending inodes to free %ld,
|
|
+>&-264 belong x pending inodes to free %d,
|
|
>&-664 bequad x system-wide uuid %0llx,
|
|
>&-1316 belong x minimum percentage of free blocks %d,
|
|
>&-1248 belong 0 TIME optimization
|
|
@@ -1965,24 +1965,24 @@
|
|
|
|
# cramfs filesystem - russell@coker.com.au
|
|
0 lelong 0x28cd3d45 Linux Compressed ROM File System data, little endian
|
|
->4 lelong x size %lu
|
|
+>4 lelong x size %u
|
|
>8 lelong &1 version #2
|
|
>8 lelong &2 sorted_dirs
|
|
>8 lelong &4 hole_support
|
|
>32 lelong x CRC 0x%x,
|
|
->36 lelong x edition %lu,
|
|
->40 lelong x %lu blocks,
|
|
->44 lelong x %lu files
|
|
+>36 lelong x edition %u,
|
|
+>40 lelong x %u blocks,
|
|
+>44 lelong x %u files
|
|
|
|
0 belong 0x28cd3d45 Linux Compressed ROM File System data, big endian
|
|
->4 belong x size %lu
|
|
+>4 belong x size %u
|
|
>8 belong &1 version #2
|
|
>8 belong &2 sorted_dirs
|
|
>8 belong &4 hole_support
|
|
>32 belong x CRC 0x%x,
|
|
->36 belong x edition %lu,
|
|
->40 belong x %lu blocks,
|
|
->44 belong x %lu files
|
|
+>36 belong x edition %u,
|
|
+>40 belong x %u blocks,
|
|
+>44 belong x %u files
|
|
|
|
# reiserfs - russell@coker.com.au
|
|
0x10034 string ReIsErFs ReiserFS V3.5
|
|
@@ -2247,8 +2247,8 @@
|
|
>16 ulequad >0 \b fblock table at %lld,
|
|
>24 ulequad >0 \b inode table at %lld,
|
|
>32 ulequad >0 \b root at %lld,
|
|
->40 ulelong >0 \b fblock size = %ld,
|
|
->44 ulelong >0 \b block size = %ld,
|
|
+>40 ulelong >0 \b fblock size = %d,
|
|
+>44 ulelong >0 \b block size = %d,
|
|
>48 ulequad >0 \b bytes = %lld
|
|
|
|
# Type: xfs metadump image
|
|
diff -urN file-5.18.orig/magic/Magdir/flash file-master/magic/Magdir/flash
|
|
--- file-5.18.orig/magic/Magdir/flash 2014-03-06 20:07:24.000000000 +0400
|
|
+++ file-master/magic/Magdir/flash 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -9,17 +9,27 @@
|
|
# http://wwwimages.adobe.com/www.adobe.com/content/dam/Adobe/\
|
|
# en/devnet/swf/pdf/swf-file-format-spec.pdf page 27
|
|
#
|
|
-0 string FWS Macromedia Flash data,
|
|
->3 byte x version %d
|
|
+
|
|
+0 name swf-details
|
|
+>0 string F Macromedia Flash data
|
|
!:mime application/x-shockwave-flash
|
|
-0 string CWS Macromedia Flash data (compressed),
|
|
+>0 string C Macromedia Flash data (compressed)
|
|
!:mime application/x-shockwave-flash
|
|
->3 byte x version %d
|
|
-0 string ZWS Macromedia Flash data (lzma compressed),
|
|
+>0 string Z Macromedia Flash data (lzma compressed)
|
|
!:mime application/x-shockwave-flash
|
|
->3 byte x version %d
|
|
+>3 byte x \b, version %d
|
|
+
|
|
+1 string WS
|
|
+>4 lelong !0
|
|
+>>3 byte 255 Suspicious
|
|
+>>>0 use swf-details
|
|
+
|
|
+>>3 ubyte <32
|
|
+>>>3 ubyte !0
|
|
+>>>>0 use swf-details
|
|
+
|
|
# From: Cal Peake <cp@absolutedigital.net>
|
|
-0 string FLV Macromedia Flash Video
|
|
+0 string FLV\x01 Macromedia Flash Video
|
|
!:mime video/x-flv
|
|
|
|
#
|
|
diff -urN file-5.18.orig/magic/Magdir/fonts file-master/magic/Magdir/fonts
|
|
--- file-5.18.orig/magic/Magdir/fonts 2013-03-10 02:36:00.000000000 +0400
|
|
+++ file-master/magic/Magdir/fonts 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -96,5 +96,5 @@
|
|
0 string wOFF Web Open Font Format
|
|
>4 belong x \b, flavor %d
|
|
>8 belong x \b, length %d
|
|
->20 beshort x \b, version %hd
|
|
->22 beshort x \b.%hd
|
|
+>20 beshort x \b, version %d
|
|
+>22 beshort x \b.%d
|
|
diff -urN file-5.18.orig/magic/Magdir/games file-master/magic/Magdir/games
|
|
--- file-5.18.orig/magic/Magdir/games 2012-02-14 02:50:50.000000000 +0400
|
|
+++ file-master/magic/Magdir/games 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -6,14 +6,14 @@
|
|
# Fabio Bonelli <fabiobonelli@libero.it>
|
|
# Quake II - III data files
|
|
0 string IDP2 Quake II 3D Model file,
|
|
->20 long x %lu skin(s),
|
|
->8 long x (%lu x
|
|
->12 long x %lu),
|
|
->40 long x %lu frame(s),
|
|
->16 long x Frame size %lu bytes,
|
|
->24 long x %lu vertices/frame,
|
|
->28 long x %lu texture coordinates,
|
|
->32 long x %lu triangles/frame
|
|
+>20 long x %u skin(s),
|
|
+>8 long x (%u x
|
|
+>12 long x %u),
|
|
+>40 long x %u frame(s),
|
|
+>16 long x Frame size %u bytes,
|
|
+>24 long x %u vertices/frame,
|
|
+>28 long x %u texture coordinates,
|
|
+>32 long x %u triangles/frame
|
|
|
|
0 string IBSP Quake
|
|
>4 long 0x26 II Map file (BSP)
|
|
@@ -146,7 +146,7 @@
|
|
|
|
|
|
0 string MComprHD MAME CHD compressed hard disk image,
|
|
->12 belong x version %lu
|
|
+>12 belong x version %u
|
|
|
|
# doom - submitted by Jon Dowland
|
|
|
|
diff -urN file-5.18.orig/magic/Magdir/gimp file-master/magic/Magdir/gimp
|
|
--- file-5.18.orig/magic/Magdir/gimp 2013-12-21 18:29:45.000000000 +0400
|
|
+++ file-master/magic/Magdir/gimp 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -20,8 +20,8 @@
|
|
>9 string file version 0,
|
|
>9 string v version
|
|
>>10 string >\0 %s,
|
|
->14 belong x %lu x
|
|
->18 belong x %lu,
|
|
+>14 belong x %u x
|
|
+>18 belong x %u,
|
|
>22 belong 0 RGB Color
|
|
>22 belong 1 Greyscale
|
|
>22 belong 2 Indexed Color
|
|
diff -urN file-5.18.orig/magic/Magdir/gnome file-master/magic/Magdir/gnome
|
|
--- file-5.18.orig/magic/Magdir/gnome 2013-02-05 19:20:47.000000000 +0400
|
|
+++ file-master/magic/Magdir/gnome 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,6 +1,6 @@
|
|
|
|
#------------------------------------------------------------------------------
|
|
-# $File: gnome,v 1.3 2013/02/05 15:20:47 christos Exp $
|
|
+# $File: gnome,v 1.4 2014/04/28 12:04:50 christos Exp $
|
|
# GNOME related files
|
|
|
|
# Contributed by Josh Triplett
|
|
@@ -9,9 +9,9 @@
|
|
>&0 ubyte 0 \b, major version 0
|
|
>>&0 ubyte 0 \b, minor version 0
|
|
>>>&0 ubyte 0 \b, crypto type 0 (AES)
|
|
->>>&0 ubyte >0 \b, crypto type %hhu (unknown)
|
|
+>>>&0 ubyte >0 \b, crypto type %u (unknown)
|
|
>>>&1 ubyte 0 \b, hash type 0 (MD5)
|
|
->>>&1 ubyte >0 \b, hash type %hhu (unknown)
|
|
+>>>&1 ubyte >0 \b, hash type %u (unknown)
|
|
>>>&2 ubelong 0xFFFFFFFF \b, name NULL
|
|
>>>&2 ubelong !0xFFFFFFFF
|
|
>>>>&-4 ubelong >255 \b, name too long for file's pstring type
|
|
diff -urN file-5.18.orig/magic/Magdir/hp file-master/magic/Magdir/hp
|
|
--- file-5.18.orig/magic/Magdir/hp 2009-09-19 20:28:09.000000000 +0400
|
|
+++ file-master/magic/Magdir/hp 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -41,10 +41,10 @@
|
|
#### Old Apollo stuff
|
|
0 beshort 0627 Apollo m68k COFF executable
|
|
>18 beshort ^040000 not stripped
|
|
->22 beshort >0 - version %ld
|
|
+>22 beshort >0 - version %d
|
|
0 beshort 0624 apollo a88k COFF executable
|
|
>18 beshort ^040000 not stripped
|
|
->22 beshort >0 - version %ld
|
|
+>22 beshort >0 - version %d
|
|
0 long 01203604016 TML 0123 byte-order format
|
|
0 long 01702407010 TML 1032 byte-order format
|
|
0 long 01003405017 TML 2301 byte-order format
|
|
@@ -128,58 +128,58 @@
|
|
|
|
#### 500
|
|
0 long 0x02080106 HP s500 relocatable executable
|
|
->16 long >0 - version %ld
|
|
+>16 long >0 - version %d
|
|
|
|
0 long 0x02080107 HP s500 executable
|
|
->16 long >0 - version %ld
|
|
+>16 long >0 - version %d
|
|
|
|
0 long 0x02080108 HP s500 pure executable
|
|
->16 long >0 - version %ld
|
|
+>16 long >0 - version %d
|
|
|
|
#### 200
|
|
0 belong 0x020c0108 HP s200 pure executable
|
|
->4 beshort >0 - version %ld
|
|
+>4 beshort >0 - version %d
|
|
>8 belong &0x80000000 save fp regs
|
|
>8 belong &0x40000000 dynamically linked
|
|
>8 belong &0x20000000 debuggable
|
|
>36 belong >0 not stripped
|
|
|
|
0 belong 0x020c0107 HP s200 executable
|
|
->4 beshort >0 - version %ld
|
|
+>4 beshort >0 - version %d
|
|
>8 belong &0x80000000 save fp regs
|
|
>8 belong &0x40000000 dynamically linked
|
|
>8 belong &0x20000000 debuggable
|
|
>36 belong >0 not stripped
|
|
|
|
0 belong 0x020c010b HP s200 demand-load executable
|
|
->4 beshort >0 - version %ld
|
|
+>4 beshort >0 - version %d
|
|
>8 belong &0x80000000 save fp regs
|
|
>8 belong &0x40000000 dynamically linked
|
|
>8 belong &0x20000000 debuggable
|
|
>36 belong >0 not stripped
|
|
|
|
0 belong 0x020c0106 HP s200 relocatable executable
|
|
->4 beshort >0 - version %ld
|
|
+>4 beshort >0 - version %d
|
|
>6 beshort >0 - highwater %d
|
|
>8 belong &0x80000000 save fp regs
|
|
>8 belong &0x20000000 debuggable
|
|
>8 belong &0x10000000 PIC
|
|
|
|
0 belong 0x020a0108 HP s200 (2.x release) pure executable
|
|
->4 beshort >0 - version %ld
|
|
+>4 beshort >0 - version %d
|
|
>36 belong >0 not stripped
|
|
|
|
0 belong 0x020a0107 HP s200 (2.x release) executable
|
|
->4 beshort >0 - version %ld
|
|
+>4 beshort >0 - version %d
|
|
>36 belong >0 not stripped
|
|
|
|
0 belong 0x020c010e HP s200 shared library
|
|
->4 beshort >0 - version %ld
|
|
+>4 beshort >0 - version %d
|
|
>6 beshort >0 - highwater %d
|
|
>36 belong >0 not stripped
|
|
|
|
0 belong 0x020c010d HP s200 dynamic load library
|
|
->4 beshort >0 - version %ld
|
|
+>4 beshort >0 - version %d
|
|
>6 beshort >0 - highwater %d
|
|
>36 belong >0 not stripped
|
|
|
|
@@ -192,7 +192,7 @@
|
|
0 long 0x015821a6 HP core file
|
|
|
|
0 long 0x4da7eee8 HP-WINDOWS font
|
|
->8 byte >0 - version %ld
|
|
+>8 byte >0 - version %d
|
|
0 string Bitmapfile HP Bitmapfile
|
|
|
|
0 string IMGfile CIS compimg HP Bitmapfile
|
|
diff -urN file-5.18.orig/magic/Magdir/ibm370 file-master/magic/Magdir/ibm370
|
|
--- file-5.18.orig/magic/Magdir/ibm370 2009-09-19 20:28:09.000000000 +0400
|
|
+++ file-master/magic/Magdir/ibm370 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -36,13 +36,13 @@
|
|
>12 belong >0 not stripped
|
|
0 beshort 0531 SVR2 executable (Amdahl-UTS)
|
|
>12 belong >0 not stripped
|
|
->24 belong >0 - version %ld
|
|
+>24 belong >0 - version %d
|
|
0 beshort 0534 SVR2 pure executable (Amdahl-UTS)
|
|
>12 belong >0 not stripped
|
|
->24 belong >0 - version %ld
|
|
+>24 belong >0 - version %d
|
|
0 beshort 0530 SVR2 pure executable (USS/370)
|
|
>12 belong >0 not stripped
|
|
->24 belong >0 - version %ld
|
|
+>24 belong >0 - version %d
|
|
0 beshort 0535 SVR2 executable (USS/370)
|
|
>12 belong >0 not stripped
|
|
->24 belong >0 - version %ld
|
|
+>24 belong >0 - version %d
|
|
diff -urN file-5.18.orig/magic/Magdir/images file-master/magic/Magdir/images
|
|
--- file-5.18.orig/magic/Magdir/images 2013-12-11 18:14:20.000000000 +0400
|
|
+++ file-master/magic/Magdir/images 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,6 +1,6 @@
|
|
|
|
#------------------------------------------------------------------------------
|
|
-# $File: images,v 1.87 2013/12/11 14:14:20 christos Exp $
|
|
+# $File: images,v 1.90 2014/04/28 12:04:50 christos Exp $
|
|
# images: file(1) magic for image formats (see also "iff", and "c-lang" for
|
|
# XPM bitmaps)
|
|
#
|
|
@@ -18,17 +18,20 @@
|
|
# `xv' recognizes only a subset of the following (RGB with pixelsize = 24)
|
|
# `tgatoppm' recognizes a superset (Index may be anything)
|
|
1 belong&0xfff7ffff 0x01010000 Targa image data - Map
|
|
+!:strength + 2
|
|
>2 byte&8 8 - RLE
|
|
->12 leshort >0 %hd x
|
|
->14 leshort >0 %hd
|
|
+>12 leshort >0 %d x
|
|
+>14 leshort >0 %d
|
|
1 belong&0xfff7ffff 0x00020000 Targa image data - RGB
|
|
+!:strength + 2
|
|
>2 byte&8 8 - RLE
|
|
->12 leshort >0 %hd x
|
|
->14 leshort >0 %hd
|
|
+>12 leshort >0 %d x
|
|
+>14 leshort >0 %d
|
|
1 belong&0xfff7ffff 0x00030000 Targa image data - Mono
|
|
+!:strength + 2
|
|
>2 byte&8 8 - RLE
|
|
->12 leshort >0 %hd x
|
|
->14 leshort >0 %hd
|
|
+>12 leshort >0 %d x
|
|
+>14 leshort >0 %d
|
|
|
|
# PBMPLUS images
|
|
# The next byte following the magic is always whitespace.
|
|
@@ -128,8 +131,8 @@
|
|
#
|
|
0 string \x89PNG\x0d\x0a\x1a\x0a PNG image data
|
|
!:mime image/png
|
|
->16 belong x \b, %ld x
|
|
->20 belong x %ld,
|
|
+>16 belong x \b, %d x
|
|
+>20 belong x %d,
|
|
>24 byte x %d-bit
|
|
>25 byte 0 grayscale,
|
|
>25 byte 2 \b/color RGB,
|
|
@@ -164,8 +167,8 @@
|
|
!:apple 8BIMGIFf
|
|
>4 string 7a \b, version 8%s,
|
|
>4 string 9a \b, version 8%s,
|
|
->6 leshort >0 %hd x
|
|
->8 leshort >0 %hd
|
|
+>6 leshort >0 %d x
|
|
+>8 leshort >0 %d
|
|
#>10 byte &0x80 color mapped,
|
|
#>10 byte&0x07 =0x00 2 colors
|
|
#>10 byte&0x07 =0x01 4 colors
|
|
@@ -483,7 +486,7 @@
|
|
>>>>1 ubyte 3 ver. 2.8 image data, without palette
|
|
>>>>1 ubyte 4 for Windows image data
|
|
>>>>1 ubyte 5 ver. 3.0 image data
|
|
->>>>4 uleshort x bounding box [%hd,
|
|
+>>>>4 uleshort x bounding box [%d,
|
|
>>>>6 uleshort x %d] -
|
|
>>>>8 uleshort x [%d,
|
|
>>>>10 uleshort x %d],
|
|
@@ -618,7 +621,7 @@
|
|
# Author: Hans-Joachim Baader <hjb@pro-linux.de>
|
|
0 string PaRtImAgE-VoLuMe PartImage
|
|
>0x0020 string 0.6.1 file version %s
|
|
->>0x0060 lelong >-1 volume %ld
|
|
+>>0x0060 lelong >-1 volume %d
|
|
#>>0x0064 8 byte identifier
|
|
#>>0x007c reserved
|
|
>>0x0200 string >\0 type %s
|
|
@@ -641,8 +644,8 @@
|
|
# Kodak Cineon format for scanned negatives
|
|
# http://www.kodak.com/US/en/motion/support/dlad/
|
|
0 lelong 0xd75f2a80 Cineon image data
|
|
->200 belong >0 \b, %ld x
|
|
->204 belong >0 %ld
|
|
+>200 belong >0 \b, %d x
|
|
+>204 belong >0 %d
|
|
|
|
|
|
# Bio-Rad .PIC is an image format used by microscope control systems
|
|
@@ -654,10 +657,10 @@
|
|
14 leshort <2
|
|
>62 leshort <2
|
|
>>54 leshort 12345 Bio-Rad .PIC Image File
|
|
->>>0 leshort >0 %hd x
|
|
->>>2 leshort >0 %hd,
|
|
+>>>0 leshort >0 %d x
|
|
+>>>2 leshort >0 %d,
|
|
>>>4 leshort =1 1 image in file
|
|
->>>4 leshort >1 %hd images in file
|
|
+>>>4 leshort >1 %d images in file
|
|
|
|
# From Jan "Yenya" Kasprzak <kas@fi.muni.cz>
|
|
# The description of *.mrw format can be found at
|
|
@@ -823,7 +826,7 @@
|
|
0 string/t [BitmapInfo2] Polar Monitor Bitmap text
|
|
!:mime image/x-polar-monitor-bitmap
|
|
|
|
-# From: Rick Richardson <rick.richardson@comcast.net>
|
|
+# From: Rick Richardson <rickrich@gmail.com>
|
|
0 string GARMIN\ BITMAP\ 01 Garmin Bitmap file
|
|
|
|
# Type: Ulead Photo Explorer5 (.pe5)
|
|
diff -urN file-5.18.orig/magic/Magdir/intel file-master/magic/Magdir/intel
|
|
--- file-5.18.orig/magic/Magdir/intel 2013-02-06 18:18:52.000000000 +0400
|
|
+++ file-master/magic/Magdir/intel 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -16,24 +16,24 @@
|
|
#
|
|
0 leshort 0502 basic-16 executable
|
|
>12 lelong >0 not stripped
|
|
-#>22 leshort >0 - version %ld
|
|
+#>22 leshort >0 - version %d
|
|
0 leshort 0503 basic-16 executable (TV)
|
|
>12 lelong >0 not stripped
|
|
-#>22 leshort >0 - version %ld
|
|
+#>22 leshort >0 - version %d
|
|
0 leshort 0510 x86 executable
|
|
>12 lelong >0 not stripped
|
|
0 leshort 0511 x86 executable (TV)
|
|
>12 lelong >0 not stripped
|
|
0 leshort =0512 iAPX 286 executable small model (COFF)
|
|
>12 lelong >0 not stripped
|
|
-#>22 leshort >0 - version %ld
|
|
+#>22 leshort >0 - version %d
|
|
0 leshort =0522 iAPX 286 executable large model (COFF)
|
|
>12 lelong >0 not stripped
|
|
-#>22 leshort >0 - version %ld
|
|
+#>22 leshort >0 - version %d
|
|
# SGI labeled the next entry as "iAPX 386 executable" --Dan Quinlan
|
|
0 leshort =0514 80386 COFF executable
|
|
>12 lelong >0 not stripped
|
|
->22 leshort >0 - version %ld
|
|
+>22 leshort >0 - version %d
|
|
|
|
# rom: file(1) magic for BIOS ROM Extensions found in intel machines
|
|
# mapped into memory between 0xC0000 and 0xFFFFF
|
|
diff -urN file-5.18.orig/magic/Magdir/karma file-master/magic/Magdir/karma
|
|
--- file-5.18.orig/magic/Magdir/karma 2009-09-19 20:28:10.000000000 +0400
|
|
+++ file-master/magic/Magdir/karma 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -6,4 +6,4 @@
|
|
# From <rgooch@atnf.csiro.au>
|
|
|
|
0 string KarmaRHD Version Karma Data Structure Version
|
|
->16 belong x %lu
|
|
+>16 belong x %u
|
|
diff -urN file-5.18.orig/magic/Magdir/mach file-master/magic/Magdir/mach
|
|
--- file-5.18.orig/magic/Magdir/mach 2013-03-07 06:22:52.000000000 +0400
|
|
+++ file-master/magic/Magdir/mach 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,6 +1,6 @@
|
|
|
|
#------------------------------------------------------------
|
|
-# $File: mach,v 1.17 2013/03/07 02:22:52 christos Exp $
|
|
+# $File: mach,v 1.18 2014/03/29 15:40:34 christos Exp $
|
|
# Mach has two magic numbers, 0xcafebabe and 0xfeedface.
|
|
# Unfortunately the first, cafebabe, is shared with
|
|
# Java ByteCode, so they are both handled in the file "cafebabe".
|
|
@@ -31,7 +31,7 @@
|
|
>>>4 belong&0x00ffffff 10 vax8650
|
|
>>>4 belong&0x00ffffff 11 vax8800
|
|
>>>4 belong&0x00ffffff 12 uvaxIII
|
|
->>>4 belong&0x00ffffff >12 vax subarchitecture=%ld
|
|
+>>>4 belong&0x00ffffff >12 vax subarchitecture=%d
|
|
>>0 belong&0x00ffffff 2 romp
|
|
>>0 belong&0x00ffffff 3 architecture=3
|
|
>>0 belong&0x00ffffff 4 ns32032
|
|
@@ -51,40 +51,40 @@
|
|
>>>>4 belong&0x00fffff0 0x30 pentium_2_m3
|
|
>>>>4 belong&0x00fffff0 0x40 pentium_2_m0x40
|
|
>>>>4 belong&0x00fffff0 0x50 pentium_2_m5
|
|
->>>>4 belong&0x00fffff0 >0x50 pentium_2_m0x%lx
|
|
+>>>>4 belong&0x00fffff0 >0x50 pentium_2_m0x%x
|
|
>>>4 belong&0x0000000f 7 celeron
|
|
->>>>4 belong&0x00fffff0 0x00 \b_m0x%lx
|
|
->>>>4 belong&0x00fffff0 0x10 \b_m0x%lx
|
|
->>>>4 belong&0x00fffff0 0x20 \b_m0x%lx
|
|
->>>>4 belong&0x00fffff0 0x30 \b_m0x%lx
|
|
->>>>4 belong&0x00fffff0 0x40 \b_m0x%lx
|
|
->>>>4 belong&0x00fffff0 0x50 \b_m0x%lx
|
|
+>>>>4 belong&0x00fffff0 0x00 \b_m0x%x
|
|
+>>>>4 belong&0x00fffff0 0x10 \b_m0x%x
|
|
+>>>>4 belong&0x00fffff0 0x20 \b_m0x%x
|
|
+>>>>4 belong&0x00fffff0 0x30 \b_m0x%x
|
|
+>>>>4 belong&0x00fffff0 0x40 \b_m0x%x
|
|
+>>>>4 belong&0x00fffff0 0x50 \b_m0x%x
|
|
>>>>4 belong&0x00fffff0 0x60
|
|
>>>>4 belong&0x00fffff0 0x70 \b_mobile
|
|
->>>>4 belong&0x00fffff0 >0x70 \b_m0x%lx
|
|
+>>>>4 belong&0x00fffff0 >0x70 \b_m0x%x
|
|
>>>4 belong&0x0000000f 8 pentium_3
|
|
>>>>4 belong&0x00fffff0 0x00
|
|
>>>>4 belong&0x00fffff0 0x10 \b_m
|
|
>>>>4 belong&0x00fffff0 0x20 \b_xeon
|
|
->>>>4 belong&0x00fffff0 >0x20 \b_m0x%lx
|
|
+>>>>4 belong&0x00fffff0 >0x20 \b_m0x%x
|
|
>>>4 belong&0x0000000f 9 pentiumM
|
|
>>>>4 belong&0x00fffff0 0x00
|
|
->>>>4 belong&0x00fffff0 >0x00 \b_m0x%lx
|
|
+>>>>4 belong&0x00fffff0 >0x00 \b_m0x%x
|
|
>>>4 belong&0x0000000f 10 pentium_4
|
|
>>>>4 belong&0x00fffff0 0x00
|
|
>>>>4 belong&0x00fffff0 0x10 \b_m
|
|
->>>>4 belong&0x00fffff0 >0x10 \b_m0x%lx
|
|
+>>>>4 belong&0x00fffff0 >0x10 \b_m0x%x
|
|
>>>4 belong&0x0000000f 11 itanium
|
|
>>>>4 belong&0x00fffff0 0x00
|
|
>>>>4 belong&0x00fffff0 0x10 \b_2
|
|
->>>>4 belong&0x00fffff0 >0x10 \b_m0x%lx
|
|
+>>>>4 belong&0x00fffff0 >0x10 \b_m0x%x
|
|
>>>4 belong&0x0000000f 12 xeon
|
|
>>>>4 belong&0x00fffff0 0x00
|
|
>>>>4 belong&0x00fffff0 0x10 \b_mp
|
|
->>>>4 belong&0x00fffff0 >0x10 \b_m0x%lx
|
|
->>>4 belong&0x0000000f >12 ia32 family=%ld
|
|
+>>>>4 belong&0x00fffff0 >0x10 \b_m0x%x
|
|
+>>>4 belong&0x0000000f >12 ia32 family=%d
|
|
>>>>4 belong&0x00fffff0 0x00
|
|
->>>>4 belong&0x00fffff0 >0x00 model=%lx
|
|
+>>>>4 belong&0x00fffff0 >0x00 model=%x
|
|
>>0 belong&0x00ffffff 8 mips
|
|
>>>4 belong&0x00ffffff 1 R2300
|
|
>>>4 belong&0x00ffffff 2 R2600
|
|
@@ -93,35 +93,35 @@
|
|
>>>4 belong&0x00ffffff 5 R2000
|
|
>>>4 belong&0x00ffffff 6 R3000a
|
|
>>>4 belong&0x00ffffff 7 R3000
|
|
->>>4 belong&0x00ffffff >7 subarchitecture=%ld
|
|
+>>>4 belong&0x00ffffff >7 subarchitecture=%d
|
|
>>0 belong&0x00ffffff 9 ns32532
|
|
>>0 belong&0x00ffffff 10 mc98000
|
|
>>0 belong&0x00ffffff 11 hppa
|
|
>>>4 belong&0x00ffffff 0 7100
|
|
>>>4 belong&0x00ffffff 1 7100LC
|
|
->>>4 belong&0x00ffffff >1 subarchitecture=%ld
|
|
+>>>4 belong&0x00ffffff >1 subarchitecture=%d
|
|
>>0 belong&0x00ffffff 12 arm
|
|
>>>4 belong&0x00ffffff 0
|
|
->>>4 belong&0x00ffffff 1 subarchitecture=%ld
|
|
->>>4 belong&0x00ffffff 2 subarchitecture=%ld
|
|
->>>4 belong&0x00ffffff 3 subarchitecture=%ld
|
|
->>>4 belong&0x00ffffff 4 subarchitecture=%ld
|
|
+>>>4 belong&0x00ffffff 1 subarchitecture=%d
|
|
+>>>4 belong&0x00ffffff 2 subarchitecture=%d
|
|
+>>>4 belong&0x00ffffff 3 subarchitecture=%d
|
|
+>>>4 belong&0x00ffffff 4 subarchitecture=%d
|
|
>>>4 belong&0x00ffffff 5 \b_v4t
|
|
>>>4 belong&0x00ffffff 6 \b_v6
|
|
>>>4 belong&0x00ffffff 7 \b_v5tej
|
|
>>>4 belong&0x00ffffff 8 \b_xscale
|
|
>>>4 belong&0x00ffffff 9 \b_v7
|
|
>>>4 belong&0x00ffffff 10 \b_v7f
|
|
->>>4 belong&0x00ffffff 11 subarchitecture=%ld
|
|
+>>>4 belong&0x00ffffff 11 subarchitecture=%d
|
|
>>>4 belong&0x00ffffff 12 \b_v7k
|
|
->>>4 belong&0x00ffffff >12 subarchitecture=%ld
|
|
+>>>4 belong&0x00ffffff >12 subarchitecture=%d
|
|
# 13 m88k
|
|
>>0 belong&0x00ffffff 13
|
|
>>>4 belong&0x00ffffff 0 mc88000
|
|
>>>4 belong&0x00ffffff 1 mc88100
|
|
>>>4 belong&0x00ffffff 2 mc88110
|
|
->>>4 belong&0x00ffffff >2 mc88000 subarchitecture=%ld
|
|
->>0 belong&0x00ffffff 14 sparc
|
|
+>>>4 belong&0x00ffffff >2 mc88000 subarchitecture=%d
|
|
+>>0 belong&0x00ffffff 14 SPARC
|
|
>>0 belong&0x00ffffff 15 i860g
|
|
>>0 belong&0x00ffffff 16 alpha
|
|
>>0 belong&0x00ffffff 17 rs6000
|
|
@@ -139,36 +139,36 @@
|
|
>>>4 belong&0x00ffffff 10 \b_7400
|
|
>>>4 belong&0x00ffffff 11 \b_7450
|
|
>>>4 belong&0x00ffffff 100 \b_970
|
|
->>>4 belong&0x00ffffff >100 subarchitecture=%ld
|
|
->>0 belong&0x00ffffff >18 architecture=%ld
|
|
+>>>4 belong&0x00ffffff >100 subarchitecture=%d
|
|
+>>0 belong&0x00ffffff >18 architecture=%d
|
|
>0 belong&0x01000000 0x01000000
|
|
#
|
|
# 64-bit ABIs.
|
|
#
|
|
->>0 belong&0x00ffffff 0 64-bit architecture=%ld
|
|
->>0 belong&0x00ffffff 1 64-bit architecture=%ld
|
|
->>0 belong&0x00ffffff 2 64-bit architecture=%ld
|
|
->>0 belong&0x00ffffff 3 64-bit architecture=%ld
|
|
->>0 belong&0x00ffffff 4 64-bit architecture=%ld
|
|
->>0 belong&0x00ffffff 5 64-bit architecture=%ld
|
|
->>0 belong&0x00ffffff 6 64-bit architecture=%ld
|
|
+>>0 belong&0x00ffffff 0 64-bit architecture=%d
|
|
+>>0 belong&0x00ffffff 1 64-bit architecture=%d
|
|
+>>0 belong&0x00ffffff 2 64-bit architecture=%d
|
|
+>>0 belong&0x00ffffff 3 64-bit architecture=%d
|
|
+>>0 belong&0x00ffffff 4 64-bit architecture=%d
|
|
+>>0 belong&0x00ffffff 5 64-bit architecture=%d
|
|
+>>0 belong&0x00ffffff 6 64-bit architecture=%d
|
|
>>0 belong&0x00ffffff 7 x86_64
|
|
->>>4 belong&0x00ffffff 0 subarchitecture=%ld
|
|
->>>4 belong&0x00ffffff 1 subarchitecture=%ld
|
|
->>>4 belong&0x00ffffff 2 subarchitecture=%ld
|
|
+>>>4 belong&0x00ffffff 0 subarchitecture=%d
|
|
+>>>4 belong&0x00ffffff 1 subarchitecture=%d
|
|
+>>>4 belong&0x00ffffff 2 subarchitecture=%d
|
|
>>>4 belong&0x00ffffff 3
|
|
>>>4 belong&0x00ffffff 4 \b_arch1
|
|
->>>4 belong&0x00ffffff >4 subarchitecture=%ld
|
|
->>0 belong&0x00ffffff 8 64-bit architecture=%ld
|
|
->>0 belong&0x00ffffff 9 64-bit architecture=%ld
|
|
->>0 belong&0x00ffffff 10 64-bit architecture=%ld
|
|
->>0 belong&0x00ffffff 11 64-bit architecture=%ld
|
|
->>0 belong&0x00ffffff 12 64-bit architecture=%ld
|
|
->>0 belong&0x00ffffff 13 64-bit architecture=%ld
|
|
->>0 belong&0x00ffffff 14 64-bit architecture=%ld
|
|
->>0 belong&0x00ffffff 15 64-bit architecture=%ld
|
|
->>0 belong&0x00ffffff 16 64-bit architecture=%ld
|
|
->>0 belong&0x00ffffff 17 64-bit architecture=%ld
|
|
+>>>4 belong&0x00ffffff >4 subarchitecture=%d
|
|
+>>0 belong&0x00ffffff 8 64-bit architecture=%d
|
|
+>>0 belong&0x00ffffff 9 64-bit architecture=%d
|
|
+>>0 belong&0x00ffffff 10 64-bit architecture=%d
|
|
+>>0 belong&0x00ffffff 11 64-bit architecture=%d
|
|
+>>0 belong&0x00ffffff 12 64-bit architecture=%d
|
|
+>>0 belong&0x00ffffff 13 64-bit architecture=%d
|
|
+>>0 belong&0x00ffffff 14 64-bit architecture=%d
|
|
+>>0 belong&0x00ffffff 15 64-bit architecture=%d
|
|
+>>0 belong&0x00ffffff 16 64-bit architecture=%d
|
|
+>>0 belong&0x00ffffff 17 64-bit architecture=%d
|
|
>>0 belong&0x00ffffff 18 ppc64
|
|
>>>4 belong&0x00ffffff 0
|
|
>>>4 belong&0x00ffffff 1 \b_601
|
|
@@ -183,8 +183,8 @@
|
|
>>>4 belong&0x00ffffff 10 \b_7400
|
|
>>>4 belong&0x00ffffff 11 \b_7450
|
|
>>>4 belong&0x00ffffff 100 \b_970
|
|
->>>4 belong&0x00ffffff >100 subarchitecture=%ld
|
|
->>0 belong&0x00ffffff >18 64-bit architecture=%ld
|
|
+>>>4 belong&0x00ffffff >100 subarchitecture=%d
|
|
+>>0 belong&0x00ffffff >18 64-bit architecture=%d
|
|
|
|
|
|
0 name mach-o-be
|
|
@@ -202,7 +202,7 @@
|
|
>12 belong 10 dSYM companion file
|
|
>12 belong 11 kext bundle
|
|
>12 belong >11
|
|
->>12 belong x filetype=%ld
|
|
+>>12 belong x filetype=%d
|
|
|
|
#
|
|
0 lelong&0xfffffffe 0xfeedface Mach-O
|
|
diff -urN file-5.18.orig/magic/Magdir/mips file-master/magic/Magdir/mips
|
|
--- file-5.18.orig/magic/Magdir/mips 2013-01-12 07:09:51.000000000 +0400
|
|
+++ file-master/magic/Magdir/mips 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -10,8 +10,8 @@
|
|
>20 beshort 0413 (paged)
|
|
>8 belong >0 not stripped
|
|
>8 belong 0 stripped
|
|
->22 byte x - version %ld
|
|
->23 byte x \b.%ld
|
|
+>22 byte x - version %d
|
|
+>23 byte x \b.%d
|
|
#
|
|
0 beshort 0x0162 MIPSEL-BE ECOFF executable
|
|
>20 beshort 0407 (impure)
|
|
@@ -20,7 +20,7 @@
|
|
>8 belong >0 not stripped
|
|
>8 belong 0 stripped
|
|
>23 byte x - version %d
|
|
->22 byte x \b.%ld
|
|
+>22 byte x \b.%d
|
|
#
|
|
0 beshort 0x6001 MIPSEB-LE ECOFF executable
|
|
>20 beshort 03401 (impure)
|
|
@@ -29,7 +29,7 @@
|
|
>8 belong >0 not stripped
|
|
>8 belong 0 stripped
|
|
>23 byte x - version %d
|
|
->22 byte x \b.%ld
|
|
+>22 byte x \b.%d
|
|
#
|
|
0 beshort 0x6201 MIPSEL ECOFF executable
|
|
>20 beshort 03401 (impure)
|
|
@@ -37,8 +37,8 @@
|
|
>20 beshort 05401 (paged)
|
|
>8 belong >0 not stripped
|
|
>8 belong 0 stripped
|
|
->23 byte x - version %ld
|
|
->22 byte x \b.%ld
|
|
+>23 byte x - version %d
|
|
+>22 byte x \b.%d
|
|
#
|
|
# MIPS 2 additions
|
|
#
|
|
@@ -48,8 +48,8 @@
|
|
>20 beshort 0413 (paged)
|
|
>8 belong >0 not stripped
|
|
>8 belong 0 stripped
|
|
->22 byte x - version %ld
|
|
->23 byte x \b.%ld
|
|
+>22 byte x - version %d
|
|
+>23 byte x \b.%d
|
|
#
|
|
0 beshort 0x0166 MIPSEL-BE MIPS-II ECOFF executable
|
|
>20 beshort 0407 (impure)
|
|
@@ -57,8 +57,8 @@
|
|
>20 beshort 0413 (paged)
|
|
>8 belong >0 not stripped
|
|
>8 belong 0 stripped
|
|
->22 byte x - version %ld
|
|
->23 byte x \b.%ld
|
|
+>22 byte x - version %d
|
|
+>23 byte x \b.%d
|
|
#
|
|
0 beshort 0x6301 MIPSEB-LE MIPS-II ECOFF executable
|
|
>20 beshort 03401 (impure)
|
|
@@ -66,8 +66,8 @@
|
|
>20 beshort 05401 (paged)
|
|
>8 belong >0 not stripped
|
|
>8 belong 0 stripped
|
|
->23 byte x - version %ld
|
|
->22 byte x \b.%ld
|
|
+>23 byte x - version %d
|
|
+>22 byte x \b.%d
|
|
#
|
|
0 beshort 0x6601 MIPSEL MIPS-II ECOFF executable
|
|
>20 beshort 03401 (impure)
|
|
@@ -75,8 +75,8 @@
|
|
>20 beshort 05401 (paged)
|
|
>8 belong >0 not stripped
|
|
>8 belong 0 stripped
|
|
->23 byte x - version %ld
|
|
->22 byte x \b.%ld
|
|
+>23 byte x - version %d
|
|
+>22 byte x \b.%d
|
|
#
|
|
# MIPS 3 additions
|
|
#
|
|
@@ -86,8 +86,8 @@
|
|
>20 beshort 0413 (paged)
|
|
>8 belong >0 not stripped
|
|
>8 belong 0 stripped
|
|
->22 byte x - version %ld
|
|
->23 byte x \b.%ld
|
|
+>22 byte x - version %d
|
|
+>23 byte x \b.%d
|
|
#
|
|
0 beshort 0x0142 MIPSEL-BE MIPS-III ECOFF executable
|
|
>20 beshort 0407 (impure)
|
|
@@ -95,8 +95,8 @@
|
|
>20 beshort 0413 (paged)
|
|
>8 belong >0 not stripped
|
|
>8 belong 0 stripped
|
|
->22 byte x - version %ld
|
|
->23 byte x \b.%ld
|
|
+>22 byte x - version %d
|
|
+>23 byte x \b.%d
|
|
#
|
|
0 beshort 0x4001 MIPSEB-LE MIPS-III ECOFF executable
|
|
>20 beshort 03401 (impure)
|
|
@@ -104,8 +104,8 @@
|
|
>20 beshort 05401 (paged)
|
|
>8 belong >0 not stripped
|
|
>8 belong 0 stripped
|
|
->23 byte x - version %ld
|
|
->22 byte x \b.%ld
|
|
+>23 byte x - version %d
|
|
+>22 byte x \b.%d
|
|
#
|
|
0 beshort 0x4201 MIPSEL MIPS-III ECOFF executable
|
|
>20 beshort 03401 (impure)
|
|
@@ -113,8 +113,8 @@
|
|
>20 beshort 05401 (paged)
|
|
>8 belong >0 not stripped
|
|
>8 belong 0 stripped
|
|
->23 byte x - version %ld
|
|
->22 byte x \b.%ld
|
|
+>23 byte x - version %d
|
|
+>22 byte x \b.%d
|
|
#
|
|
0 beshort 0x180 MIPSEB Ucode
|
|
0 beshort 0x182 MIPSEL-BE Ucode
|
|
diff -urN file-5.18.orig/magic/Magdir/motorola file-master/magic/Magdir/motorola
|
|
--- file-5.18.orig/magic/Magdir/motorola 2009-09-19 20:28:11.000000000 +0400
|
|
+++ file-master/magic/Magdir/motorola 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -40,27 +40,27 @@
|
|
# not larger than 1 MB (which is a lot on ST).
|
|
# The additional 0x601b distinction I took from Doug Lee's magic.
|
|
0 belong&0xFFFFFFF0 0x601A0000 Atari ST M68K contiguous executable
|
|
->2 belong x (txt=%ld,
|
|
->6 belong x dat=%ld,
|
|
->10 belong x bss=%ld,
|
|
->14 belong x sym=%ld)
|
|
+>2 belong x (txt=%d,
|
|
+>6 belong x dat=%d,
|
|
+>10 belong x bss=%d,
|
|
+>14 belong x sym=%d)
|
|
0 belong&0xFFFFFFF0 0x601B0000 Atari ST M68K non-contig executable
|
|
->2 belong x (txt=%ld,
|
|
->6 belong x dat=%ld,
|
|
->10 belong x bss=%ld,
|
|
->14 belong x sym=%ld)
|
|
+>2 belong x (txt=%d,
|
|
+>6 belong x dat=%d,
|
|
+>10 belong x bss=%d,
|
|
+>14 belong x sym=%d)
|
|
|
|
# Atari ST/TT... program format (sent by Wolfram Kleff <kleff@cs.uni-bonn.de>)
|
|
0 beshort 0x601A Atari 68xxx executable,
|
|
->2 belong x text len %lu,
|
|
->6 belong x data len %lu,
|
|
->10 belong x BSS len %lu,
|
|
->14 belong x symboltab len %lu,
|
|
+>2 belong x text len %u,
|
|
+>6 belong x data len %u,
|
|
+>10 belong x BSS len %u,
|
|
+>14 belong x symboltab len %u,
|
|
>18 belong 0
|
|
>22 belong &0x01 fastload flag,
|
|
>22 belong &0x02 may be loaded to alternate RAM,
|
|
>22 belong &0x04 malloc may be from alternate RAM,
|
|
->22 belong x flags: 0x%lX,
|
|
+>22 belong x flags: 0x%X,
|
|
>26 beshort 0 no relocation tab
|
|
>26 beshort !0 + relocation tab
|
|
>30 string SFX [Self-Extracting LZH SFX archive]
|
|
@@ -68,4 +68,4 @@
|
|
>44 string ZIP! [Self-Extracting ZIP SFX archive]
|
|
|
|
0 beshort 0x0064 Atari 68xxx CPX file
|
|
->8 beshort x (version %04lx)
|
|
+>8 beshort x (version %04x)
|
|
diff -urN file-5.18.orig/magic/Magdir/msdos file-master/magic/Magdir/msdos
|
|
--- file-5.18.orig/magic/Magdir/msdos 2014-05-15 17:58:52.456110901 +0400
|
|
+++ file-master/magic/Magdir/msdos 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,6 +1,6 @@
|
|
|
|
#------------------------------------------------------------------------------
|
|
-# $File: msdos,v 1.92 2014/03/14 18:47:29 christos Exp $
|
|
+# $File: msdos,v 1.97 2014/05/07 21:25:41 christos Exp $
|
|
# msdos: file(1) magic for MS-DOS files
|
|
#
|
|
|
|
@@ -56,6 +56,7 @@
|
|
|
|
# Maybe it's a PE?
|
|
>>(0x3c.l) string PE\0\0 PE
|
|
+!:mime application/x-dosexec
|
|
>>>(0x3c.l+24) leshort 0x010b \b32 executable
|
|
>>>(0x3c.l+24) leshort 0x020b \b32+ executable
|
|
>>>(0x3c.l+24) leshort 0x0107 ROM image
|
|
@@ -134,8 +135,10 @@
|
|
# Hmm, not a PE but the relocation table is too high for a traditional DOS exe,
|
|
# must be one of the unusual subformats.
|
|
>>(0x3c.l) string !PE\0\0 MS-DOS executable
|
|
+!:mime application/x-dosexec
|
|
|
|
>>(0x3c.l) string NE \b, NE
|
|
+!:mime application/x-dosexec
|
|
>>>(0x3c.l+0x36) byte 1 for OS/2 1.x
|
|
>>>(0x3c.l+0x36) byte 2 for MS Windows 3.x
|
|
>>>(0x3c.l+0x36) byte 3 for MS-DOS
|
|
@@ -150,6 +153,7 @@
|
|
>>>(0x3c.l+0x70) search/0x80 WinZip(R)\ Self-Extractor \b, ZIP self-extracting archive (WinZip)
|
|
|
|
>>(0x3c.l) string LX\0\0 \b, LX
|
|
+!:mime application/x-dosexec
|
|
>>>(0x3c.l+0x0a) leshort <1 (unknown OS)
|
|
>>>(0x3c.l+0x0a) leshort 1 for OS/2
|
|
>>>(0x3c.l+0x0a) leshort 2 for MS Windows
|
|
@@ -168,8 +172,10 @@
|
|
|
|
# MS Windows system file, supposedly a collection of LE executables
|
|
>>(0x3c.l) string W3 \b, W3 for MS Windows
|
|
+!:mime application/x-dosexec
|
|
|
|
>>(0x3c.l) string LE\0\0 \b, LE executable
|
|
+!:mime application/x-dosexec
|
|
>>>(0x3c.l+0x0a) leshort 1
|
|
# some DOS extenders use LE files with OS/2 header
|
|
>>>>0x240 search/0x100 DOS/4G for MS-DOS, DOS4GW DOS extender
|
|
@@ -196,6 +202,7 @@
|
|
# and definitely not NE/LE/LX/PE
|
|
>>0x3c lelong >0x20000000
|
|
>>>(4.s*512) leshort !0x014c \b, MZ for MS-DOS
|
|
+!:mime application/x-dosexec
|
|
# header data too small for extended executable
|
|
>2 long !0
|
|
>>0x18 leshort <0x40
|
|
@@ -203,6 +210,7 @@
|
|
|
|
>>>>&(2.s-514) string !LE
|
|
>>>>>&-2 string !BW \b, MZ for MS-DOS
|
|
+!:mime application/x-dosexec
|
|
>>>>&(2.s-514) string LE \b, LE
|
|
>>>>>0x240 search/0x100 DOS/4G for MS-DOS, DOS4GW DOS extender
|
|
# educated guess since indirection is still not capable enough for complex offset
|
|
@@ -214,6 +222,7 @@
|
|
|
|
# This sequence skips to the first COFF segment, usually .text
|
|
>(4.s*512) leshort 0x014c \b, COFF
|
|
+!:mime application/x-dosexec
|
|
>>(8.s*16) string go32stub for MS-DOS, DJGPP go32 DOS extender
|
|
>>(8.s*16) string emx
|
|
>>>&1 string x for DOS, Win or OS/2, emx %s
|
|
@@ -590,7 +599,6 @@
|
|
>4 ubyte !0 \b, %d colors
|
|
|
|
0 belong 0x00000100
|
|
-
|
|
>9 byte 0
|
|
>>0 byte x MS Windows icon resource
|
|
!:mime image/x-icon
|
|
@@ -795,105 +803,6 @@
|
|
>40 string \ EMF Windows Enhanced Metafile (EMF) image data
|
|
>>44 ulelong x version 0x%x
|
|
|
|
-# From: Alex Beregszaszi <alex@fsn.hu>
|
|
-0 string/b COWD VMWare3
|
|
->4 byte 3 disk image
|
|
->>32 lelong x (%d/
|
|
->>36 lelong x \b%d/
|
|
->>40 lelong x \b%d)
|
|
->4 byte 2 undoable disk image
|
|
->>32 string >\0 (%s)
|
|
-
|
|
-0 string/b VMDK VMware4 disk image
|
|
-0 string/b KDMV VMware4 disk image
|
|
-
|
|
-#--------------------------------------------------------------------
|
|
-# Qemu Emulator Images
|
|
-# Lines written by Friedrich Schwittay (f.schwittay@yousable.de)
|
|
-# Updated by Adam Buchbinder (adam.buchbinder@gmail.com)
|
|
-# Made by reading sources, reading documentation, and doing trial and error
|
|
-# on existing QCOW files
|
|
-0 string/b QFI\xFB QEMU QCOW Image
|
|
-
|
|
-# Uncomment the following line to display Magic (only used for debugging
|
|
-# this magic number)
|
|
-#>0 string/b x , Magic: %s
|
|
-
|
|
-# There are currently 2 Versions: "1" and "2".
|
|
-# http://www.gnome.org/~markmc/qcow-image-format-version-1.html
|
|
->4 belong 1 (v1)
|
|
-
|
|
-# Using the existence of the Backing File Offset to determine whether
|
|
-# to read Backing File Information
|
|
->>12 belong >0 \b, has backing file (
|
|
-# Note that this isn't a null-terminated string; the length is actually
|
|
-# (16.L). Assuming a null-terminated string happens to work usually, but it
|
|
-# may spew junk until it reaches a \0 in some cases.
|
|
->>>(12.L) string >\0 \bpath %s
|
|
-
|
|
-# Modification time of the Backing File
|
|
-# Really useful if you want to know if your backing
|
|
-# file is still usable together with this image
|
|
->>>>20 bedate >0 \b, mtime %s)
|
|
->>>>20 default x \b)
|
|
-
|
|
-# Size is stored in bytes in a big-endian u64.
|
|
->>24 bequad x \b, %lld bytes
|
|
-
|
|
-# 1 for AES encryption, 0 for none.
|
|
->>36 belong 1 \b, AES-encrypted
|
|
-
|
|
-# http://www.gnome.org/~markmc/qcow-image-format.html
|
|
->4 belong 2 (v2)
|
|
-# Using the existence of the Backing File Offset to determine whether
|
|
-# to read Backing File Information
|
|
->>8 bequad >0 \b, has backing file
|
|
-# Note that this isn't a null-terminated string; the length is actually
|
|
-# (16.L). Assuming a null-terminated string happens to work usually, but it
|
|
-# may spew junk until it reaches a \0 in some cases. Also, since there's no
|
|
-# .Q modifier, we just use the bottom four bytes as an offset. Note that if
|
|
-# the file is over 4G, and the backing file path is stored after the first 4G,
|
|
-# the wrong filename will be printed. (This should be (8.Q), when that syntax
|
|
-# is introduced.)
|
|
->>>(12.L) string >\0 (path %s)
|
|
->>24 bequad x \b, %lld bytes
|
|
->>32 belong 1 \b, AES-encrypted
|
|
-
|
|
->4 belong 3 (v3)
|
|
-# Using the existence of the Backing File Offset to determine whether
|
|
-# to read Backing File Information
|
|
->>8 bequad >0 \b, has backing file
|
|
-# Note that this isn't a null-terminated string; the length is actually
|
|
-# (16.L). Assuming a null-terminated string happens to work usually, but it
|
|
-# may spew junk until it reaches a \0 in some cases. Also, since there's no
|
|
-# .Q modifier, we just use the bottom four bytes as an offset. Note that if
|
|
-# the file is over 4G, and the backing file path is stored after the first 4G,
|
|
-# the wrong filename will be printed. (This should be (8.Q), when that syntax
|
|
-# is introduced.)
|
|
->>>(12.L) string >\0 (path %s)
|
|
->>24 bequad x \b, %lld bytes
|
|
->>32 belong 1 \b, AES-encrypted
|
|
-
|
|
->4 default x (unknown version)
|
|
-
|
|
-0 string/b QEVM QEMU suspend to disk image
|
|
-
|
|
-# QEMU QED Image
|
|
-# http://wiki.qemu.org/Features/QED/Specification
|
|
-0 string/b QED\0 QEMU QED Image
|
|
-
|
|
-# VDI Image
|
|
-64 string/b \x7f\x10\xda\xbe VDI Image
|
|
->68 string/b \x01\x00\x01\x00 version 1.1
|
|
->0 string >\0 (%s)
|
|
->368 lequad x \b, %lld bytes
|
|
-
|
|
-0 string/b Bochs\ Virtual\ HD\ Image Bochs disk image,
|
|
->32 string x type %s,
|
|
->48 string x subtype %s
|
|
-
|
|
-0 lelong 0x02468ace Bochs Sparse disk image
|
|
-
|
|
# from http://filext.com by Derek M Jones <derek@knosof.co.uk>
|
|
# False positive with PPT (also currently this string is too long)
|
|
#0 string/b \xD0\xCF\x11\xE0\xA1\xB1\x1A\xE1\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x3E\x00\x03\x00\xFE\xFF\x09\x00\x06 Microsoft Installer
|
|
@@ -927,8 +836,8 @@
|
|
# URL: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp
|
|
# From: Morten Hustveit <morten@debian.org>
|
|
0 string/b DDS\040\174\000\000\000 Microsoft DirectDraw Surface (DDS),
|
|
->16 lelong >0 %hd x
|
|
->12 lelong >0 %hd,
|
|
+>16 lelong >0 %d x
|
|
+>12 lelong >0 %d,
|
|
>84 string x %.4s
|
|
|
|
# Type: Microsoft Document Imaging Format (.mdi)
|
|
diff -urN file-5.18.orig/magic/Magdir/ncr file-master/magic/Magdir/ncr
|
|
--- file-5.18.orig/magic/Magdir/ncr 2009-09-19 20:28:11.000000000 +0400
|
|
+++ file-master/magic/Magdir/ncr 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -11,27 +11,27 @@
|
|
>12 belong >0 not stripped
|
|
>20 beshort 0407 executable
|
|
>20 beshort 0410 pure executable
|
|
->22 beshort >0 - version %ld
|
|
+>22 beshort >0 - version %d
|
|
0 beshort 000615 Tower/XP rel 2 object
|
|
>12 belong >0 not stripped
|
|
>20 beshort 0407 executable
|
|
>20 beshort 0410 pure executable
|
|
->22 beshort >0 - version %ld
|
|
+>22 beshort >0 - version %d
|
|
0 beshort 000620 Tower/XP rel 3 object
|
|
>12 belong >0 not stripped
|
|
>20 beshort 0407 executable
|
|
>20 beshort 0410 pure executable
|
|
->22 beshort >0 - version %ld
|
|
+>22 beshort >0 - version %d
|
|
0 beshort 000625 Tower/XP rel 3 object
|
|
>12 belong >0 not stripped
|
|
>20 beshort 0407 executable
|
|
>20 beshort 0410 pure executable
|
|
->22 beshort >0 - version %ld
|
|
+>22 beshort >0 - version %d
|
|
0 beshort 000630 Tower32/600/400 68020 object
|
|
>12 belong >0 not stripped
|
|
>20 beshort 0407 executable
|
|
>20 beshort 0410 pure executable
|
|
->22 beshort >0 - version %ld
|
|
+>22 beshort >0 - version %d
|
|
0 beshort 000640 Tower32/800 68020
|
|
>18 beshort &020000 w/68881 object
|
|
>18 beshort &040000 compatible object
|
|
@@ -39,11 +39,11 @@
|
|
>20 beshort 0407 executable
|
|
>20 beshort 0413 pure executable
|
|
>12 belong >0 not stripped
|
|
->22 beshort >0 - version %ld
|
|
+>22 beshort >0 - version %d
|
|
0 beshort 000645 Tower32/800 68010
|
|
>18 beshort &040000 compatible object
|
|
>18 beshort &060000 object
|
|
>20 beshort 0407 executable
|
|
>20 beshort 0413 pure executable
|
|
>12 belong >0 not stripped
|
|
->22 beshort >0 - version %ld
|
|
+>22 beshort >0 - version %d
|
|
diff -urN file-5.18.orig/magic/Magdir/netbsd file-master/magic/Magdir/netbsd
|
|
--- file-5.18.orig/magic/Magdir/netbsd 2013-01-10 02:37:24.000000000 +0400
|
|
+++ file-master/magic/Magdir/netbsd 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -100,25 +100,25 @@
|
|
0 belong&0377777777 045200507 a.out NetBSD/powerpc core
|
|
>12 string >\0 from '%s'
|
|
|
|
-0 belong&0377777777 042400413 a.out NetBSD/sparc demand paged
|
|
+0 belong&0377777777 042400413 a.out NetBSD/SPARC demand paged
|
|
>0 byte &0x80
|
|
>>20 belong <8192 shared library
|
|
>>20 belong =8192 dynamically linked executable
|
|
>>20 belong >8192 dynamically linked executable
|
|
>0 byte ^0x80 executable
|
|
>16 belong >0 not stripped
|
|
-0 belong&0377777777 042400410 a.out NetBSD/sparc pure
|
|
+0 belong&0377777777 042400410 a.out NetBSD/SPARC pure
|
|
>0 byte &0x80 dynamically linked executable
|
|
>0 byte ^0x80 executable
|
|
>16 belong >0 not stripped
|
|
-0 belong&0377777777 042400407 a.out NetBSD/sparc
|
|
+0 belong&0377777777 042400407 a.out NetBSD/SPARC
|
|
>0 byte &0x80 dynamically linked executable
|
|
>0 byte ^0x80
|
|
>>0 byte &0x40 position independent
|
|
>>20 belong !0 executable
|
|
>>20 belong =0 object file
|
|
>16 belong >0 not stripped
|
|
-0 belong&0377777777 042400507 a.out NetBSD/sparc core
|
|
+0 belong&0377777777 042400507 a.out NetBSD/SPARC core
|
|
>12 string >\0 from '%s'
|
|
>32 belong !0 (signal %d)
|
|
|
|
@@ -254,7 +254,7 @@
|
|
>0 belong&0x03ff0000 0x00870000 \b, m68k BSD (8K pages)
|
|
>0 belong&0x03ff0000 0x00880000 \b, m68k BSD (4K pages)
|
|
>0 belong&0x03ff0000 0x00890000 \b, ns32532 BSD
|
|
->0 belong&0x03ff0000 0x008a0000 \b, sparc/32 BSD
|
|
+>0 belong&0x03ff0000 0x008a0000 \b, SPARC/32 BSD
|
|
>0 belong&0x03ff0000 0x008b0000 \b, pmax BSD
|
|
>0 belong&0x03ff0000 0x008c0000 \b, vax BSD (1K pages)
|
|
>0 belong&0x03ff0000 0x008d0000 \b, alpha BSD
|
|
@@ -268,7 +268,7 @@
|
|
>0 belong&0x03ff0000 0x00950000 \b, mips2 BSD
|
|
>0 belong&0x03ff0000 0x00960000 \b, parisc BSD
|
|
>0 belong&0x03ff0000 0x00970000 \b, sh5/64 BSD
|
|
->0 belong&0x03ff0000 0x00980000 \b, sparc/64 BSD
|
|
+>0 belong&0x03ff0000 0x00980000 \b, SPARC/64 BSD
|
|
>0 belong&0x03ff0000 0x00990000 \b, amd64 BSD
|
|
>0 belong&0x03ff0000 0x009a0000 \b, hp200 (68010) BSD
|
|
>0 belong&0x03ff0000 0x009b0000 \b, hp300 (68020+68881) BSD
|
|
diff -urN file-5.18.orig/magic/Magdir/palm file-master/magic/Magdir/palm
|
|
--- file-5.18.orig/magic/Magdir/palm 2013-12-31 23:18:02.000000000 +0400
|
|
+++ file-master/magic/Magdir/palm 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,6 +1,6 @@
|
|
|
|
#------------------------------------------------------------------------------
|
|
-# $File: palm,v 1.11 2013/12/31 19:18:02 christos Exp $
|
|
+# $File: palm,v 1.12 2014/03/28 19:11:40 christos Exp $
|
|
# palm: file(1) magic for PalmOS {.prc,.pdb}: applications, docfiles, and hacks
|
|
#
|
|
# Brian Lalor <blalor@hcirisc.cs.binghamton.edu>
|
|
@@ -141,8 +141,12 @@
|
|
>>(0x4E.L+1) byte x %02d)
|
|
|
|
# Palm OS .prc file types
|
|
-60 string libr Palm OS dynamic library data
|
|
->0 string >\0 "%s"
|
|
+60 string libr
|
|
+# flags, only bit 0 or bit 6
|
|
+# http://en.wikipedia.org/wiki/PRC_%28Palm_OS%29
|
|
+# http://web.mit.edu/tytso/www/pilot/prc-format.html
|
|
+>0x20 beshort&0xffbe 0
|
|
+>>0 string >\0 Palm OS dynamic library data "%s"
|
|
60 string ptch Palm OS operating system patch data
|
|
>0 string >\0 "%s"
|
|
|
|
diff -urN file-5.18.orig/magic/Magdir/pdp file-master/magic/Magdir/pdp
|
|
--- file-5.18.orig/magic/Magdir/pdp 2013-04-20 00:11:43.000000000 +0400
|
|
+++ file-master/magic/Magdir/pdp 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -10,7 +10,7 @@
|
|
#
|
|
0 leshort 0407 PDP-11 executable
|
|
>8 leshort >0 not stripped
|
|
->15 byte >0 - version %ld
|
|
+>15 byte >0 - version %d
|
|
|
|
# updated by Joerg Jenderek at Mar 2013
|
|
# GRR: line below too general as it catches also Windows precompiled setup information *.PNF
|
|
@@ -23,11 +23,11 @@
|
|
|
|
0 leshort 0410 PDP-11 pure executable
|
|
>8 leshort >0 not stripped
|
|
->15 byte >0 - version %ld
|
|
+>15 byte >0 - version %d
|
|
|
|
0 leshort 0411 PDP-11 separate I&D executable
|
|
>8 leshort >0 not stripped
|
|
->15 byte >0 - version %ld
|
|
+>15 byte >0 - version %d
|
|
|
|
0 leshort 0437 PDP-11 kernel overlay
|
|
|
|
diff -urN file-5.18.orig/magic/Magdir/perl file-master/magic/Magdir/perl
|
|
--- file-5.18.orig/magic/Magdir/perl 2013-12-09 03:33:18.000000000 +0400
|
|
+++ file-master/magic/Magdir/perl 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -57,3 +57,34 @@
|
|
>>4 byte =5 (major 2)
|
|
>>4 byte =4 (major 2)
|
|
>>5 byte >0 (minor %d)
|
|
+
|
|
+# This is Debian #742949 by Zefram <zefram@fysh.org>:
|
|
+# -----------------------------------------------------------
|
|
+# The Perl module Hash::SharedMem
|
|
+# <https://metacpan.org/release/Hash-SharedMem> defines a file format
|
|
+# for a key/value store. Details of the file format are in the "DESIGN"
|
|
+# file in the module distribution. Magic:
|
|
+0 bequad =0xa58afd185cbf5af7 Hash::SharedMem master file, big-endian
|
|
+>8 bequad <0x1000000
|
|
+>>15 byte >2 \b, line size 2^%d byte
|
|
+>>14 byte >2 \b, page size 2^%d byte
|
|
+>>13 byte &1
|
|
+>>>13 byte >1 \b, max fanout %d
|
|
+0 lequad =0xa58afd185cbf5af7 Hash::SharedMem master file, little-endian
|
|
+>8 lequad <0x1000000
|
|
+>>8 byte >2 \b, line size 2^%d byte
|
|
+>>9 byte >2 \b, page size 2^%d byte
|
|
+>>10 byte &1
|
|
+>>>10 byte >1 \b, max fanout %d
|
|
+0 bequad =0xc693dac5ed5e47c2 Hash::SharedMem data file, big-endian
|
|
+>8 bequad <0x1000000
|
|
+>>15 byte >2 \b, line size 2^%d byte
|
|
+>>14 byte >2 \b, page size 2^%d byte
|
|
+>>13 byte &1
|
|
+>>>13 byte >1 \b, max fanout %d
|
|
+0 lequad =0xc693dac5ed5e47c2 Hash::SharedMem data file, little-endian
|
|
+>8 lequad <0x1000000
|
|
+>>8 byte >2 \b, line size 2^%d byte
|
|
+>>9 byte >2 \b, page size 2^%d byte
|
|
+>>10 byte &1
|
|
+>>>10 byte >1 \b, max fanout %d
|
|
diff -urN file-5.18.orig/magic/Magdir/printer file-master/magic/Magdir/printer
|
|
--- file-5.18.orig/magic/Magdir/printer 2011-05-21 03:31:46.000000000 +0400
|
|
+++ file-master/magic/Magdir/printer 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -68,6 +68,22 @@
|
|
0 string \033%-12345X@PJL
|
|
>&0 search/10000 %! PJL encapsulated PostScript document text
|
|
|
|
+# Rick Richardson <rickrich@gmail.com>
|
|
+
|
|
+# For Fuji-Xerox Printers - HBPL stands for Host Based Printer Language
|
|
+# For Oki Data Printers - HIPERC
|
|
+# For Konica Minolta Printers - LAVAFLOW
|
|
+# For Samsung Printers - QPDL
|
|
+# For HP Printers - ZJS stands for Zenographics ZJStream
|
|
+0 string \033%-12345X@PJL HP Printer Job Language data
|
|
+>0 search/10000 @PJL\ ENTER\ LANGUAGE=HBPL - HBPL
|
|
+>0 search/10000 @PJL\ ENTER\ LANGUAGE=HIPERC - Oki Data HIPERC
|
|
+>0 search/10000 @PJL\ ENTER\ LANGUAGE=LAVAFLOW - Konica Minolta LAVAFLOW
|
|
+>0 search/10000 @PJL\ ENTER\ LANGUAGE=QPDL - Samsung QPDL
|
|
+>0 search/10000 @PJL\ ENTER\ LANGUAGE\ =\ QPDL - Samsung QPDL
|
|
+>0 search/10000 @PJL\ ENTER\ LANGUAGE=ZJS - HP ZJS
|
|
+
|
|
+
|
|
# HP Printer Control Language, Daniel Quinlan (quinlan@yggdrasil.com)
|
|
0 string \033E\033 HP PCL printer data
|
|
>3 string \&l0A - default page size
|
|
@@ -108,7 +124,7 @@
|
|
|
|
#------------------------------------------------------------------------------
|
|
# zenographics: file(1) magic for Zenographics ZjStream printer data
|
|
-# Rick Richardson rickr@mn.rr.com
|
|
+# Rick Richardson <rickrich@gmail.com>
|
|
0 string JZJZ
|
|
>0x12 string ZZ Zenographics ZjStream printer data (big-endian)
|
|
0 string ZJZJ
|
|
@@ -117,7 +133,7 @@
|
|
|
|
#------------------------------------------------------------------------------
|
|
# Oak Technologies printer stream
|
|
-# Rick Richardson <rickr@mn.rr.com>
|
|
+# Rick Richardson <rickrich@gmail.com>
|
|
0 string OAK
|
|
>0x07 byte 0
|
|
>0x0b byte 0 Oak Technologies printer stream
|
|
diff -urN file-5.18.orig/magic/Magdir/python file-master/magic/Magdir/python
|
|
--- file-5.18.orig/magic/Magdir/python 2014-02-15 05:30:52.000000000 +0400
|
|
+++ file-master/magic/Magdir/python 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -63,5 +63,5 @@
|
|
|
|
# def name(args, args):
|
|
0 regex \^(\ |\\t){0,50}def\ {1,50}[a-zA-Z]{1,100}
|
|
->&0 regex \ {0,50}\\(([a-zA-Z]|,|\ ){1,500}\\):$ Python script text executable
|
|
+>&0 regex \ {0,50}\\(([a-zA-Z]|,|\ ){1,255}\\):$ Python script text executable
|
|
!:mime text/x-python
|
|
diff -urN file-5.18.orig/magic/Magdir/riff file-master/magic/Magdir/riff
|
|
--- file-5.18.orig/magic/Magdir/riff 2014-03-06 22:55:09.000000000 +0400
|
|
+++ file-master/magic/Magdir/riff 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -88,8 +88,8 @@
|
|
!:mime video/x-msvideo
|
|
>>12 string LIST
|
|
>>>20 string hdrlavih
|
|
->>>>&36 lelong x \b, %lu x
|
|
->>>>&40 lelong x %lu,
|
|
+>>>>&36 lelong x \b, %u x
|
|
+>>>>&40 lelong x %u,
|
|
>>>>&4 lelong >1000000 <1 fps,
|
|
>>>>&4 lelong 1000000 1.00 fps,
|
|
>>>>&4 lelong 500000 2.00 fps,
|
|
diff -urN file-5.18.orig/magic/Magdir/sequent file-master/magic/Magdir/sequent
|
|
--- file-5.18.orig/magic/Magdir/sequent 2009-09-19 20:28:12.000000000 +0400
|
|
+++ file-master/magic/Magdir/sequent 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -7,29 +7,29 @@
|
|
# For Sequent's multiprocessor systems (incomplete).
|
|
0 lelong 0x00ea BALANCE NS32000 .o
|
|
>16 lelong >0 not stripped
|
|
->124 lelong >0 version %ld
|
|
+>124 lelong >0 version %d
|
|
0 lelong 0x10ea BALANCE NS32000 executable (0 @ 0)
|
|
>16 lelong >0 not stripped
|
|
->124 lelong >0 version %ld
|
|
+>124 lelong >0 version %d
|
|
0 lelong 0x20ea BALANCE NS32000 executable (invalid @ 0)
|
|
>16 lelong >0 not stripped
|
|
->124 lelong >0 version %ld
|
|
+>124 lelong >0 version %d
|
|
0 lelong 0x30ea BALANCE NS32000 standalone executable
|
|
>16 lelong >0 not stripped
|
|
->124 lelong >0 version %ld
|
|
+>124 lelong >0 version %d
|
|
#
|
|
# Symmetry information added by Jason Merrill <jason@jarthur.claremont.edu>.
|
|
# Symmetry magic nums will not be reached if DOS COM comes before them;
|
|
# byte 0xeb is matched before these get a chance.
|
|
0 leshort 0x12eb SYMMETRY i386 .o
|
|
>16 lelong >0 not stripped
|
|
->124 lelong >0 version %ld
|
|
+>124 lelong >0 version %d
|
|
0 leshort 0x22eb SYMMETRY i386 executable (0 @ 0)
|
|
>16 lelong >0 not stripped
|
|
->124 lelong >0 version %ld
|
|
+>124 lelong >0 version %d
|
|
0 leshort 0x32eb SYMMETRY i386 executable (invalid @ 0)
|
|
>16 lelong >0 not stripped
|
|
->124 lelong >0 version %ld
|
|
+>124 lelong >0 version %d
|
|
0 leshort 0x42eb SYMMETRY i386 standalone executable
|
|
>16 lelong >0 not stripped
|
|
->124 lelong >0 version %ld
|
|
+>124 lelong >0 version %d
|
|
diff -urN file-5.18.orig/magic/Magdir/sereal file-master/magic/Magdir/sereal
|
|
--- file-5.18.orig/magic/Magdir/sereal 1970-01-01 03:00:00.000000000 +0300
|
|
+++ file-master/magic/Magdir/sereal 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -0,0 +1,24 @@
|
|
+#------------------------------------------------------------------------------
|
|
+# $File$
|
|
+# sereal: file(1) magic the Sereal binary serialization format
|
|
+#
|
|
+# From: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
|
|
+#
|
|
+# See the specification of the format at
|
|
+# https://github.com/Sereal/Sereal/blob/master/sereal_spec.pod#document-header-format
|
|
+#
|
|
+# I'd have liked to do the byte&0xF0 matching against 0, 1, 2 ... by
|
|
+# doing (byte&0xF0)>>4 here, but unfortunately that's not
|
|
+# supported. So when we print out a message about an unknown format
|
|
+# we'll print out e.g. 0x30 instead of the more human-readable
|
|
+# 0x30>>4.
|
|
+#
|
|
+# See https://github.com/Sereal/Sereal/commit/35372ae01d in the
|
|
+# Sereal.git repository for test Sereal data.
|
|
+0 string \=srl Sereal data
|
|
+!:mime application/sereal
|
|
+>4 byte&0x0F x (version %d,
|
|
+>4 byte&0xF0 0x00 uncompressed)
|
|
+>4 byte&0xF0 0x10 compressed with non-incremental Snappy)
|
|
+>4 byte&0xF0 0x20 compressed with incremental Snappy)
|
|
+>4 byte&0xF0 >0x20 unknown subformat, flag: %d>>4)
|
|
diff -urN file-5.18.orig/magic/Magdir/sgi file-master/magic/Magdir/sgi
|
|
--- file-5.18.orig/magic/Magdir/sgi 2014-03-10 04:53:38.000000000 +0400
|
|
+++ file-master/magic/Magdir/sgi 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -17,16 +17,16 @@
|
|
|
|
0 beshort 0x0506 IRIS Showcase file
|
|
>2 byte 0x49 -
|
|
->3 byte x - version %ld
|
|
+>3 byte x - version %d
|
|
0 beshort 0x0226 IRIS Showcase template
|
|
>2 byte 0x63 -
|
|
->3 byte x - version %ld
|
|
+>3 byte x - version %d
|
|
0 belong 0x5343464d IRIS Showcase file
|
|
->4 byte x - version %ld
|
|
+>4 byte x - version %d
|
|
0 belong 0x5443464d IRIS Showcase template
|
|
->4 byte x - version %ld
|
|
+>4 byte x - version %d
|
|
0 belong 0xdeadbabe IRIX Parallel Arena
|
|
->8 belong >0 - version %ld
|
|
+>8 belong >0 - version %d
|
|
|
|
# core files
|
|
#
|
|
@@ -49,7 +49,7 @@
|
|
# Trusted IRIX info
|
|
0 string SGIAUDIT SGI Audit file
|
|
>8 byte x - version %d
|
|
->9 byte x \b.%ld
|
|
+>9 byte x \b.%d
|
|
#
|
|
0 string WNGZWZSC Wingz compiled script
|
|
0 string WNGZWZSS Wingz spreadsheet
|
|
@@ -82,11 +82,11 @@
|
|
#>20 lelong -2 temporal index
|
|
#>20 lelong -1 metadata
|
|
#>20 lelong 0 log volume #0
|
|
-#>20 lelong >0 log volume #%ld
|
|
+#>20 lelong >0 log volume #%d
|
|
>20 belong -2 temporal index
|
|
>20 belong -1 metadata
|
|
>20 belong 0 log volume #0
|
|
->20 belong >0 log volume #%ld
|
|
+>20 belong >0 log volume #%d
|
|
>24 string >\0 host: %s
|
|
0 string PCPFolio PCP
|
|
>9 string Version: Archive Folio
|
|
diff -urN file-5.18.orig/magic/Magdir/sharc file-master/magic/Magdir/sharc
|
|
--- file-5.18.orig/magic/Magdir/sharc 2009-09-19 20:28:12.000000000 +0400
|
|
+++ file-master/magic/Magdir/sharc 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -19,5 +19,5 @@
|
|
0 string .system SHARC architecture file
|
|
|
|
0 leshort 0x521C SHARC COFF binary
|
|
->2 leshort >1 , %hd sections
|
|
+>2 leshort >1 , %d sections
|
|
>>12 lelong >0 , not stripped
|
|
diff -urN file-5.18.orig/magic/Magdir/sql file-master/magic/Magdir/sql
|
|
--- file-5.18.orig/magic/Magdir/sql 2013-08-27 08:02:33.000000000 +0400
|
|
+++ file-master/magic/Magdir/sql 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,6 +1,6 @@
|
|
|
|
#------------------------------------------------------------------------------
|
|
-# $File: sql,v 1.13 2013/08/27 04:02:33 christos Exp $
|
|
+# $File: sql,v 1.14 2014/04/28 12:04:50 christos Exp $
|
|
# sql: file(1) magic for SQL files
|
|
#
|
|
# From: "Marty Leisner" <mleisner@eng.mc.xerox.com>
|
|
@@ -69,7 +69,7 @@
|
|
# SQLite Write-Ahead Log from SQLite version >= 3.7.0
|
|
# http://www.sqlite.org/fileformat.html#walformat
|
|
0 belong&0xfffffffe 0x377f0682 SQLite Write-Ahead Log,
|
|
->4 belong x version %ld
|
|
+>4 belong x version %d
|
|
|
|
# SQLite Rollback Journal
|
|
# http://www.sqlite.org/fileformat.html#rollbackjournal
|
|
diff -urN file-5.18.orig/magic/Magdir/sun file-master/magic/Magdir/sun
|
|
--- file-5.18.orig/magic/Magdir/sun 2013-01-10 02:37:24.000000000 +0400
|
|
+++ file-master/magic/Magdir/sun 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,6 +1,6 @@
|
|
|
|
#------------------------------------------------------------------------------
|
|
-# $File: sun,v 1.25 2013/01/09 22:37:24 christos Exp $
|
|
+# $File: sun,v 1.26 2014/03/29 15:40:34 christos Exp $
|
|
# sun: file(1) magic for Sun machines
|
|
#
|
|
# Values for big-endian Sun (MC680x0, SPARC) binaries on pre-5.x
|
|
@@ -9,7 +9,7 @@
|
|
# are in aout, as they're indistinguishable from other big-endian
|
|
# 32-bit a.out files.
|
|
#
|
|
-0 belong&077777777 0600413 a.out SunOS sparc demand paged
|
|
+0 belong&077777777 0600413 a.out SunOS SPARC demand paged
|
|
>0 byte &0x80
|
|
>>20 belong <4096 shared library
|
|
>>20 belong =4096 dynamically linked executable
|
|
@@ -17,12 +17,12 @@
|
|
>0 byte ^0x80 executable
|
|
>16 belong >0 not stripped
|
|
|
|
-0 belong&077777777 0600410 a.out SunOS sparc pure
|
|
+0 belong&077777777 0600410 a.out SunOS SPARC pure
|
|
>0 byte &0x80 dynamically linked executable
|
|
>0 byte ^0x80 executable
|
|
>16 belong >0 not stripped
|
|
|
|
-0 belong&077777777 0600407 a.out SunOS sparc
|
|
+0 belong&077777777 0600407 a.out SunOS SPARC
|
|
>0 byte &0x80 dynamically linked executable
|
|
>0 byte ^0x80 executable
|
|
>16 belong >0 not stripped
|
|
@@ -97,7 +97,7 @@
|
|
# which is the IANA registry of Snoop datalink types)
|
|
#
|
|
0 string snoop Snoop capture file
|
|
->8 belong >0 - version %ld
|
|
+>8 belong >0 - version %d
|
|
>12 belong 0 (IEEE 802.3)
|
|
>12 belong 1 (IEEE 802.4)
|
|
>12 belong 2 (IEEE 802.5)
|
|
@@ -108,24 +108,24 @@
|
|
>12 belong 7 (IBM channel-to-channel adapter)
|
|
>12 belong 8 (FDDI)
|
|
>12 belong 9 (Other)
|
|
->12 belong 10 (type %ld)
|
|
->12 belong 11 (type %ld)
|
|
->12 belong 12 (type %ld)
|
|
->12 belong 13 (type %ld)
|
|
->12 belong 14 (type %ld)
|
|
->12 belong 15 (type %ld)
|
|
+>12 belong 10 (type %d)
|
|
+>12 belong 11 (type %d)
|
|
+>12 belong 12 (type %d)
|
|
+>12 belong 13 (type %d)
|
|
+>12 belong 14 (type %d)
|
|
+>12 belong 15 (type %d)
|
|
>12 belong 16 (Fibre Channel)
|
|
>12 belong 17 (ATM)
|
|
>12 belong 18 (ATM Classical IP)
|
|
->12 belong 19 (type %ld)
|
|
->12 belong 20 (type %ld)
|
|
->12 belong 21 (type %ld)
|
|
->12 belong 22 (type %ld)
|
|
->12 belong 23 (type %ld)
|
|
->12 belong 24 (type %ld)
|
|
->12 belong 25 (type %ld)
|
|
+>12 belong 19 (type %d)
|
|
+>12 belong 20 (type %d)
|
|
+>12 belong 21 (type %d)
|
|
+>12 belong 22 (type %d)
|
|
+>12 belong 23 (type %d)
|
|
+>12 belong 24 (type %d)
|
|
+>12 belong 25 (type %d)
|
|
>12 belong 26 (IP over Infiniband)
|
|
->12 belong >26 (type %ld)
|
|
+>12 belong >26 (type %d)
|
|
|
|
#---------------------------------------------------------------------------
|
|
# The following entries have been tested by Duncan Laurie <duncan@sun.com> (a
|
|
diff -urN file-5.18.orig/magic/Magdir/ti-8x file-master/magic/Magdir/ti-8x
|
|
--- file-5.18.orig/magic/Magdir/ti-8x 2009-09-19 20:28:12.000000000 +0400
|
|
+++ file-master/magic/Magdir/ti-8x 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -222,7 +222,7 @@
|
|
>49 byte 0x24 type: application,
|
|
>49 byte 0x25 type: certificate,
|
|
>49 byte 0x3e type: license,
|
|
->74 lelong >0 size: %ld bytes
|
|
+>74 lelong >0 size: %d bytes
|
|
|
|
# VTi & TiEmu skins (TI Graphing Calculators).
|
|
# From: Romain Lievin (roms@lpg.ticalc.org).
|
|
diff -urN file-5.18.orig/magic/Magdir/varied.out file-master/magic/Magdir/varied.out
|
|
--- file-5.18.orig/magic/Magdir/varied.out 2010-07-02 04:06:27.000000000 +0400
|
|
+++ file-master/magic/Magdir/varied.out 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -26,7 +26,7 @@
|
|
>7 string >\0 version '%s'
|
|
# gnu gmon magic From: Eugen Dedu <dedu@ese-metz.fr>
|
|
0 string gmon GNU prof performance data
|
|
->4 long x - version %ld
|
|
+>4 long x - version %d
|
|
# From: Dave Pearson <davep@davep.org>
|
|
# Harbour <URL:http://harbour-project.org/> HRB files.
|
|
0 string \xc0HRB Harbour HRB file
|
|
diff -urN file-5.18.orig/magic/Magdir/vax file-master/magic/Magdir/vax
|
|
--- file-5.18.orig/magic/Magdir/vax 2013-01-10 02:37:24.000000000 +0400
|
|
+++ file-master/magic/Magdir/vax 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -21,7 +21,7 @@
|
|
#
|
|
0 leshort 0570 VAX COFF executable
|
|
>12 lelong >0 not stripped
|
|
->22 leshort >0 - version %ld
|
|
+>22 leshort >0 - version %d
|
|
0 leshort 0575 VAX COFF pure executable
|
|
>12 lelong >0 not stripped
|
|
->22 leshort >0 - version %ld
|
|
+>22 leshort >0 - version %d
|
|
diff -urN file-5.18.orig/magic/Magdir/virtual file-master/magic/Magdir/virtual
|
|
--- file-5.18.orig/magic/Magdir/virtual 2014-03-03 18:19:46.000000000 +0400
|
|
+++ file-master/magic/Magdir/virtual 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,6 +1,6 @@
|
|
|
|
#------------------------------------------------------------------------------
|
|
-# $File: virtual,v 1.3 2014/03/03 14:19:46 christos Exp $
|
|
+# $File: virtual,v 1.5 2014/04/30 21:41:02 christos Exp $
|
|
# From: James Nobis <quel@quelrod.net>
|
|
# Microsoft hard disk images for:
|
|
# Virtual Server
|
|
@@ -9,13 +9,6 @@
|
|
# .vhd
|
|
0 string conectix Microsoft Disk Image, Virtual Server or Virtual PC
|
|
|
|
-# Sun xVM VirtualBox Disk Image
|
|
-# From: Richard W.M. Jones <rich@annexia.org>
|
|
-# VirtualBox Disk Image
|
|
-0x40 ulelong 0xbeda107f VirtualBox Disk Image
|
|
->0x44 uleshort >0 \b, major %u
|
|
->0x46 uleshort >0 \b, minor %u
|
|
-
|
|
# libvirt
|
|
# From: Philipp Hahn <hahn@univention.de>
|
|
0 string LibvirtQemudSave Libvirt QEMU Suspend Image
|
|
@@ -25,3 +18,106 @@
|
|
>0x1c lelong 1 \b, compressed
|
|
|
|
0 string LibvirtQemudPart Libvirt QEMU partial Suspend Image
|
|
+# From: Alex Beregszaszi <alex@fsn.hu>
|
|
+0 string/b COWD VMWare3
|
|
+>4 byte 3 disk image
|
|
+>>32 lelong x (%d/
|
|
+>>36 lelong x \b%d/
|
|
+>>40 lelong x \b%d)
|
|
+>4 byte 2 undoable disk image
|
|
+>>32 string >\0 (%s)
|
|
+
|
|
+0 string/b VMDK VMware4 disk image
|
|
+0 string/b KDMV VMware4 disk image
|
|
+
|
|
+#--------------------------------------------------------------------
|
|
+# Qemu Emulator Images
|
|
+# Lines written by Friedrich Schwittay (f.schwittay@yousable.de)
|
|
+# Updated by Adam Buchbinder (adam.buchbinder@gmail.com)
|
|
+# Made by reading sources, reading documentation, and doing trial and error
|
|
+# on existing QCOW files
|
|
+0 string/b QFI\xFB QEMU QCOW Image
|
|
+
|
|
+# Uncomment the following line to display Magic (only used for debugging
|
|
+# this magic number)
|
|
+#>0 string/b x , Magic: %s
|
|
+
|
|
+# There are currently 2 Versions: "1" and "2".
|
|
+# http://www.gnome.org/~markmc/qcow-image-format-version-1.html
|
|
+>4 belong 1 (v1)
|
|
+
|
|
+# Using the existence of the Backing File Offset to determine whether
|
|
+# to read Backing File Information
|
|
+>>12 belong >0 \b, has backing file (
|
|
+# Note that this isn't a null-terminated string; the length is actually
|
|
+# (16.L). Assuming a null-terminated string happens to work usually, but it
|
|
+# may spew junk until it reaches a \0 in some cases.
|
|
+>>>(12.L) string >\0 \bpath %s
|
|
+
|
|
+# Modification time of the Backing File
|
|
+# Really useful if you want to know if your backing
|
|
+# file is still usable together with this image
|
|
+>>>>20 bedate >0 \b, mtime %s)
|
|
+>>>>20 default x \b)
|
|
+
|
|
+# Size is stored in bytes in a big-endian u64.
|
|
+>>24 bequad x \b, %lld bytes
|
|
+
|
|
+# 1 for AES encryption, 0 for none.
|
|
+>>36 belong 1 \b, AES-encrypted
|
|
+
|
|
+# http://www.gnome.org/~markmc/qcow-image-format.html
|
|
+>4 belong 2 (v2)
|
|
+# Using the existence of the Backing File Offset to determine whether
|
|
+# to read Backing File Information
|
|
+>>8 bequad >0 \b, has backing file
|
|
+# Note that this isn't a null-terminated string; the length is actually
|
|
+# (16.L). Assuming a null-terminated string happens to work usually, but it
|
|
+# may spew junk until it reaches a \0 in some cases. Also, since there's no
|
|
+# .Q modifier, we just use the bottom four bytes as an offset. Note that if
|
|
+# the file is over 4G, and the backing file path is stored after the first 4G,
|
|
+# the wrong filename will be printed. (This should be (8.Q), when that syntax
|
|
+# is introduced.)
|
|
+>>>(12.L) string >\0 (path %s)
|
|
+>>24 bequad x \b, %lld bytes
|
|
+>>32 belong 1 \b, AES-encrypted
|
|
+
|
|
+>4 belong 3 (v3)
|
|
+# Using the existence of the Backing File Offset to determine whether
|
|
+# to read Backing File Information
|
|
+>>8 bequad >0 \b, has backing file
|
|
+# Note that this isn't a null-terminated string; the length is actually
|
|
+# (16.L). Assuming a null-terminated string happens to work usually, but it
|
|
+# may spew junk until it reaches a \0 in some cases. Also, since there's no
|
|
+# .Q modifier, we just use the bottom four bytes as an offset. Note that if
|
|
+# the file is over 4G, and the backing file path is stored after the first 4G,
|
|
+# the wrong filename will be printed. (This should be (8.Q), when that syntax
|
|
+# is introduced.)
|
|
+>>>(12.L) string >\0 (path %s)
|
|
+>>24 bequad x \b, %lld bytes
|
|
+>>32 belong 1 \b, AES-encrypted
|
|
+
|
|
+>4 default x (unknown version)
|
|
+
|
|
+0 string/b QEVM QEMU suspend to disk image
|
|
+
|
|
+# QEMU QED Image
|
|
+# http://wiki.qemu.org/Features/QED/Specification
|
|
+0 string/b QED\0 QEMU QED Image
|
|
+
|
|
+# VDI Image
|
|
+# Sun xVM VirtualBox Disk Image
|
|
+# From: Richard W.M. Jones <rich@annexia.org>
|
|
+# VirtualBox Disk Image
|
|
+0x40 ulelong 0xbeda107f VirtualBox Disk Image
|
|
+>0x44 uleshort >0 \b, major %u
|
|
+>0x46 uleshort >0 \b, minor %u
|
|
+>0 string >\0 (%s)
|
|
+>368 lequad x \b, %lld bytes
|
|
+
|
|
+0 string/b Bochs\ Virtual\ HD\ Image Bochs disk image,
|
|
+>32 string x type %s,
|
|
+>48 string x subtype %s
|
|
+
|
|
+0 lelong 0x02468ace Bochs Sparse disk image
|
|
+
|
|
diff -urN file-5.18.orig/magic/Magdir/vorbis file-master/magic/Magdir/vorbis
|
|
--- file-5.18.orig/magic/Magdir/vorbis 2009-09-19 20:28:13.000000000 +0400
|
|
+++ file-master/magic/Magdir/vorbis 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,6 +1,6 @@
|
|
|
|
#------------------------------------------------------------------------------
|
|
-# $File: vorbis,v 1.16 2009/09/19 16:28:13 christos Exp $
|
|
+# $File: vorbis,v 1.17 2014/04/28 12:04:50 christos Exp $
|
|
# vorbis: file(1) magic for Ogg/Vorbis files
|
|
#
|
|
# From Felix von Leitner <leitner@fefe.de>
|
|
@@ -56,13 +56,13 @@
|
|
>>>37 string/c xvid (XviD)
|
|
# --- First vorbis packet - general header ---
|
|
>>28 string \x01vorbis \b, Vorbis audio,
|
|
->>>35 lelong !0 UNKNOWN VERSION %lu,
|
|
+>>>35 lelong !0 UNKNOWN VERSION %u,
|
|
##>>>35 lelong 0 version 0,
|
|
>>>35 lelong 0
|
|
>>>>39 ubyte 1 mono,
|
|
>>>>39 ubyte 2 stereo,
|
|
>>>>39 ubyte >2 %u channels,
|
|
->>>>40 lelong x %lu Hz
|
|
+>>>>40 lelong x %u Hz
|
|
# Minimal, nominal and maximal bitrates specified when encoding
|
|
>>>>48 string <\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff \b,
|
|
# The above tests if at least one of these is specified:
|
|
@@ -72,13 +72,13 @@
|
|
# Vorbis 1.0 uses 0 instead of -1.
|
|
>>>>>>52 lelong !0
|
|
>>>>>>>52 lelong !-1000
|
|
->>>>>>>>52 lelong x <%lu
|
|
+>>>>>>>>52 lelong x <%u
|
|
>>>>>48 lelong !-1
|
|
->>>>>>48 lelong x ~%lu
|
|
+>>>>>>48 lelong x ~%u
|
|
>>>>>44 lelong !-1
|
|
>>>>>>44 lelong !-1000
|
|
>>>>>>>44 lelong !0
|
|
->>>>>>>>44 lelong x >%lu
|
|
+>>>>>>>>44 lelong x >%u
|
|
>>>>>48 string <\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff bps
|
|
# -- Second vorbis header packet - the comments
|
|
# A kludge to read the vendor string. It's a counted string, not a
|
|
diff -urN file-5.18.orig/magic/Magdir/windows file-master/magic/Magdir/windows
|
|
--- file-5.18.orig/magic/Magdir/windows 2013-04-20 00:12:29.000000000 +0400
|
|
+++ file-master/magic/Magdir/windows 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,6 +1,6 @@
|
|
|
|
#------------------------------------------------------------------------------
|
|
-# $File: windows,v 1.6 2013/04/19 20:12:29 christos Exp $
|
|
+# $File: windows,v 1.7 2014/04/28 12:04:50 christos Exp $
|
|
# windows: file(1) magic for Microsoft Windows
|
|
#
|
|
# This file is mainly reserved for files where programs
|
|
@@ -36,7 +36,7 @@
|
|
>>0xf88 lelong 1 \b, full dump
|
|
>>0xf88 lelong 2 \b, kernel dump
|
|
>>0xf88 lelong 3 \b, small dump
|
|
->>0x068 lelong x \b, %ld pages
|
|
+>>0x068 lelong x \b, %d pages
|
|
>4 string DU64 MS Windows 64bit crash dump
|
|
>>0xf98 lelong 1 \b, full dump
|
|
>>0xf98 lelong 2 \b, kernel dump
|
|
diff -urN file-5.18.orig/magic/Magdir/xilinx file-master/magic/Magdir/xilinx
|
|
--- file-5.18.orig/magic/Magdir/xilinx 2013-11-20 03:15:13.000000000 +0400
|
|
+++ file-master/magic/Magdir/xilinx 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -33,7 +33,7 @@
|
|
# Then 'e'
|
|
>>>>>>>>>>>&1 string e
|
|
# And length of data
|
|
->>>>>>>>>>>>&0 belong x - data length 0x%lx
|
|
+>>>>>>>>>>>>&0 belong x - data length 0x%x
|
|
|
|
# Raw bitstream files
|
|
0 long 0xffffffff
|
|
diff -urN file-5.18.orig/magic/Magdir/xwindows file-master/magic/Magdir/xwindows
|
|
--- file-5.18.orig/magic/Magdir/xwindows 2013-02-08 21:25:57.000000000 +0400
|
|
+++ file-master/magic/Magdir/xwindows 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -18,10 +18,10 @@
|
|
|
|
# Jaleo XFS files
|
|
0 long 395726 Jaleo XFS file
|
|
->4 long x - version %ld
|
|
->8 long x - [%ld -
|
|
->20 long x \b%ldx
|
|
->24 long x \b%ldx
|
|
+>4 long x - version %d
|
|
+>8 long x - [%d -
|
|
+>20 long x \b%dx
|
|
+>24 long x \b%dx
|
|
>28 long 1008 \bYUV422]
|
|
>28 long 1000 \bRGB24]
|
|
|
|
@@ -31,5 +31,5 @@
|
|
# http://cgit.freedesktop.org/xorg/lib/libXcursor/tree/include/X11/Xcursor/Xcursor.h
|
|
0 string Xcur Xcursor data
|
|
!:mime image/x-xcursor
|
|
->10 leshort x version %hd
|
|
->>8 leshort x \b.%hd
|
|
+>10 leshort x version %d
|
|
+>>8 leshort x \b.%d
|
|
diff -urN file-5.18.orig/magic/Magdir/zfs file-master/magic/Magdir/zfs
|
|
--- file-5.18.orig/magic/Magdir/zfs 2012-01-27 05:41:00.000000000 +0400
|
|
+++ file-master/magic/Magdir/zfs 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -37,14 +37,14 @@
|
|
|
|
# Big-endian values
|
|
8 string \000\000\000\002\365\272\313\254 ZFS shapshot (big-endian machine),
|
|
->20 belong x version %lu,
|
|
+>20 belong x version %u,
|
|
>32 belong 0 type: NONE,
|
|
>32 belong 1 type: META,
|
|
>32 belong 2 type: ZFS,
|
|
>32 belong 3 type: ZVOL,
|
|
>32 belong 4 type: OTHER,
|
|
>32 belong 5 type: ANY,
|
|
->32 belong >5 type: UNKNOWN (%lu),
|
|
+>32 belong >5 type: UNKNOWN (%u),
|
|
>40 byte x destination GUID: %02X
|
|
>41 byte x %02X
|
|
>42 byte x %02X
|
|
@@ -67,14 +67,14 @@
|
|
|
|
# Little-endian values
|
|
8 string \254\313\272\365\002\000\000\000 ZFS shapshot (little-endian machine),
|
|
->16 lelong x version %lu,
|
|
+>16 lelong x version %u,
|
|
>32 lelong 0 type: NONE,
|
|
>32 lelong 1 type: META,
|
|
>32 lelong 2 type: ZFS,
|
|
>32 lelong 3 type: ZVOL,
|
|
>32 lelong 4 type: OTHER,
|
|
>32 lelong 5 type: ANY,
|
|
->32 lelong >5 type: UNKNOWN (%lu),
|
|
+>32 lelong >5 type: UNKNOWN (%u),
|
|
>47 byte x destination GUID: %02X
|
|
>46 byte x %02X
|
|
>45 byte x %02X
|
|
diff -urN file-5.18.orig/magic/Makefile.am file-master/magic/Makefile.am
|
|
--- file-5.18.orig/magic/Makefile.am 2014-03-07 21:25:17.000000000 +0400
|
|
+++ file-master/magic/Makefile.am 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -208,6 +208,7 @@
|
|
$(MAGIC_FRAGMENT_DIR)/selinux \
|
|
$(MAGIC_FRAGMENT_DIR)/sendmail \
|
|
$(MAGIC_FRAGMENT_DIR)/sequent \
|
|
+$(MAGIC_FRAGMENT_DIR)/sereal \
|
|
$(MAGIC_FRAGMENT_DIR)/sgi \
|
|
$(MAGIC_FRAGMENT_DIR)/sgml \
|
|
$(MAGIC_FRAGMENT_DIR)/sharc \
|
|
diff -urN file-5.18.orig/src/apprentice.c file-master/src/apprentice.c
|
|
--- file-5.18.orig/src/apprentice.c 2014-03-14 22:48:11.000000000 +0400
|
|
+++ file-master/src/apprentice.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -32,7 +32,7 @@
|
|
#include "file.h"
|
|
|
|
#ifndef lint
|
|
-FILE_RCSID("@(#)$File: apprentice.c,v 1.202 2014/03/14 18:48:11 christos Exp $")
|
|
+FILE_RCSID("@(#)$File: apprentice.c,v 1.209 2014/05/13 16:42:17 christos Exp $")
|
|
#endif /* lint */
|
|
|
|
#include "magic.h"
|
|
@@ -517,14 +517,18 @@
|
|
{
|
|
if (map == NULL)
|
|
return;
|
|
- if (map->p == NULL)
|
|
- return;
|
|
+ if (map->p != NULL) {
|
|
#ifdef QUICK
|
|
- if (map->len)
|
|
- (void)munmap(map->p, map->len);
|
|
- else
|
|
+ if (map->len)
|
|
+ (void)munmap(map->p, map->len);
|
|
+ else
|
|
#endif
|
|
free(map->p);
|
|
+ } else {
|
|
+ uint32_t j;
|
|
+ for (j = 0; j < MAGIC_SETS; j++)
|
|
+ free(map->magic[j]);
|
|
+ }
|
|
free(map);
|
|
}
|
|
|
|
@@ -779,7 +783,6 @@
|
|
break;
|
|
|
|
default:
|
|
- val = 0;
|
|
(void)fprintf(stderr, "Bad type %d\n", m->type);
|
|
abort();
|
|
}
|
|
@@ -1290,11 +1293,7 @@
|
|
magic_entry_free(mset[j].me, mset[j].count);
|
|
|
|
if (errs) {
|
|
- for (j = 0; j < MAGIC_SETS; j++) {
|
|
- if (map->magic[j])
|
|
- free(map->magic[j]);
|
|
- }
|
|
- free(map);
|
|
+ apprentice_unmap(map);
|
|
return NULL;
|
|
}
|
|
return map;
|
|
@@ -1749,7 +1748,7 @@
|
|
*/
|
|
m->type = get_standard_integer_type(l, &l);
|
|
}
|
|
- // It's unsigned.
|
|
+ /* It's unsigned. */
|
|
if (m->type != FILE_INVALID)
|
|
m->flag |= UNSIGNED;
|
|
} else {
|
|
@@ -2133,17 +2132,41 @@
|
|
private int
|
|
check_format_type(const char *ptr, int type)
|
|
{
|
|
- int quad = 0;
|
|
+ int quad = 0, h;
|
|
if (*ptr == '\0') {
|
|
/* Missing format string; bad */
|
|
return -1;
|
|
}
|
|
|
|
- switch (type) {
|
|
+ switch (file_formats[type]) {
|
|
case FILE_FMT_QUAD:
|
|
quad = 1;
|
|
/*FALLTHROUGH*/
|
|
case FILE_FMT_NUM:
|
|
+ if (quad == 0) {
|
|
+ switch (type) {
|
|
+ case FILE_BYTE:
|
|
+ h = 2;
|
|
+ break;
|
|
+ case FILE_SHORT:
|
|
+ case FILE_BESHORT:
|
|
+ case FILE_LESHORT:
|
|
+ h = 1;
|
|
+ break;
|
|
+ case FILE_LONG:
|
|
+ case FILE_BELONG:
|
|
+ case FILE_LELONG:
|
|
+ case FILE_MELONG:
|
|
+ case FILE_LEID3:
|
|
+ case FILE_BEID3:
|
|
+ case FILE_INDIRECT:
|
|
+ h = 0;
|
|
+ break;
|
|
+ default:
|
|
+ abort();
|
|
+ }
|
|
+ } else
|
|
+ h = 0;
|
|
if (*ptr == '-')
|
|
ptr++;
|
|
if (*ptr == '.')
|
|
@@ -2160,6 +2183,8 @@
|
|
}
|
|
|
|
switch (*ptr++) {
|
|
+#ifdef STRICT_FORMAT /* "long" formats are int formats for us */
|
|
+ /* so don't accept the 'l' modifier */
|
|
case 'l':
|
|
switch (*ptr++) {
|
|
case 'i':
|
|
@@ -2168,14 +2193,22 @@
|
|
case 'o':
|
|
case 'x':
|
|
case 'X':
|
|
- return 0;
|
|
+ return h != 0 ? -1 : 0;
|
|
default:
|
|
return -1;
|
|
}
|
|
|
|
+ /*
|
|
+ * Don't accept h and hh modifiers. They make writing
|
|
+ * magic entries more complicated, for very little benefit
|
|
+ */
|
|
case 'h':
|
|
+ if (h-- <= 0)
|
|
+ return -1;
|
|
switch (*ptr++) {
|
|
case 'h':
|
|
+ if (h-- <= 0)
|
|
+ return -1;
|
|
switch (*ptr++) {
|
|
case 'i':
|
|
case 'd':
|
|
@@ -2187,21 +2220,30 @@
|
|
default:
|
|
return -1;
|
|
}
|
|
+ case 'i':
|
|
case 'd':
|
|
- return 0;
|
|
+ case 'u':
|
|
+ case 'o':
|
|
+ case 'x':
|
|
+ case 'X':
|
|
+ return h != 0 ? -1 : 0;
|
|
default:
|
|
return -1;
|
|
}
|
|
-
|
|
- case 'i':
|
|
+#endif
|
|
case 'c':
|
|
+ return h != 2 ? -1 : 0;
|
|
+ case 'i':
|
|
case 'd':
|
|
case 'u':
|
|
case 'o':
|
|
case 'x':
|
|
case 'X':
|
|
+#ifdef STRICT_FORMAT
|
|
+ return h != 0 ? -1 : 0;
|
|
+#else
|
|
return 0;
|
|
-
|
|
+#endif
|
|
default:
|
|
return -1;
|
|
}
|
|
@@ -2288,7 +2330,7 @@
|
|
}
|
|
|
|
ptr++;
|
|
- if (check_format_type(ptr, file_formats[m->type]) == -1) {
|
|
+ if (check_format_type(ptr, m->type) == -1) {
|
|
/*
|
|
* TODO: this error message is unhelpful if the format
|
|
* string is not one character long
|
|
@@ -2335,6 +2377,16 @@
|
|
m->value.s);
|
|
return -1;
|
|
}
|
|
+ if (m->type == FILE_REGEX) {
|
|
+ file_regex_t rx;
|
|
+ int rc = file_regcomp(&rx, m->value.s, REG_EXTENDED);
|
|
+ if (rc) {
|
|
+ if (ms->flags & MAGIC_CHECK)
|
|
+ file_regerror(&rx, rc, ms);
|
|
+ }
|
|
+ file_regfree(&rx);
|
|
+ return rc ? -1 : 0;
|
|
+ }
|
|
return 0;
|
|
case FILE_FLOAT:
|
|
case FILE_BEFLOAT:
|
|
@@ -2715,7 +2767,8 @@
|
|
}
|
|
entries = (uint32_t)(st.st_size / sizeof(struct magic));
|
|
if ((off_t)(entries * sizeof(struct magic)) != st.st_size) {
|
|
- file_error(ms, 0, "Size of `%s' %llu is not a multiple of %zu",
|
|
+ file_error(ms, 0, "Size of `%s' %" INT64_T_FORMAT "u is not "
|
|
+ "a multiple of %" SIZE_T_FORMAT "u",
|
|
dbname, (unsigned long long)st.st_size,
|
|
sizeof(struct magic));
|
|
goto error;
|
|
@@ -2750,10 +2803,6 @@
|
|
return NULL;
|
|
}
|
|
|
|
-private const uint32_t ar[] = {
|
|
- MAGICNO, VERSIONNO
|
|
-};
|
|
-
|
|
/*
|
|
* handle an mmaped file.
|
|
*/
|
|
@@ -2767,6 +2816,10 @@
|
|
char *dbname;
|
|
int rv = -1;
|
|
uint32_t i;
|
|
+ union {
|
|
+ struct magic m;
|
|
+ uint32_t h[2 + MAGIC_SETS];
|
|
+ } hdr;
|
|
|
|
dbname = mkdbname(ms, fn, 1);
|
|
|
|
@@ -2778,24 +2831,16 @@
|
|
file_error(ms, errno, "cannot open `%s'", dbname);
|
|
goto out;
|
|
}
|
|
+ memset(&hdr, 0, sizeof(hdr));
|
|
+ hdr.h[0] = MAGICNO;
|
|
+ hdr.h[1] = VERSIONNO;
|
|
+ memcpy(hdr.h + 2, map->nmagic, nm);
|
|
|
|
- if (write(fd, ar, sizeof(ar)) != (ssize_t)sizeof(ar)) {
|
|
- file_error(ms, errno, "error writing `%s'", dbname);
|
|
- goto out;
|
|
- }
|
|
-
|
|
- if (write(fd, map->nmagic, nm) != (ssize_t)nm) {
|
|
+ if (write(fd, &hdr, sizeof(hdr)) != (ssize_t)sizeof(hdr)) {
|
|
file_error(ms, errno, "error writing `%s'", dbname);
|
|
goto out;
|
|
}
|
|
|
|
- assert(nm + sizeof(ar) < m);
|
|
-
|
|
- if (lseek(fd, (off_t)m, SEEK_SET) != (off_t)m) {
|
|
- file_error(ms, errno, "error seeking `%s'", dbname);
|
|
- goto out;
|
|
- }
|
|
-
|
|
for (i = 0; i < MAGIC_SETS; i++) {
|
|
len = m * map->nmagic[i];
|
|
if (write(fd, map->magic[i], len) != (ssize_t)len) {
|
|
diff -urN file-5.18.orig/src/asctime_r.c file-master/src/asctime_r.c
|
|
--- file-5.18.orig/src/asctime_r.c 2012-06-21 02:18:33.000000000 +0400
|
|
+++ file-master/src/asctime_r.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,8 +1,8 @@
|
|
-/* $File: asctime_r.c,v 1.1 2012/05/15 17:14:36 christos Exp $ */
|
|
+/* $File$ */
|
|
|
|
#include "file.h"
|
|
#ifndef lint
|
|
-FILE_RCSID("@(#)$File: asctime_r.c,v 1.1 2012/05/15 17:14:36 christos Exp $")
|
|
+FILE_RCSID("@(#)$File: ascmagic.c,v 1.84 2011/12/08 12:38:24 rrt Exp $")
|
|
#endif /* lint */
|
|
#include <time.h>
|
|
#include <string.h>
|
|
diff -urN file-5.18.orig/src/asprintf.c file-master/src/asprintf.c
|
|
--- file-5.18.orig/src/asprintf.c 2012-06-21 02:18:33.000000000 +0400
|
|
+++ file-master/src/asprintf.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -29,7 +29,7 @@
|
|
#include "file.h"
|
|
|
|
#ifndef lint
|
|
-FILE_RCSID("@(#)$File: asprintf.c,v 1.4 2010/07/21 16:47:17 christos Exp $")
|
|
+FILE_RCSID("@(#)$File: asprintf.c,v 1.3 2009/02/03 20:27:51 christos Exp $")
|
|
#endif
|
|
|
|
int asprintf(char **ptr, const char *fmt, ...)
|
|
diff -urN file-5.18.orig/src/BNF file-master/src/BNF
|
|
--- file-5.18.orig/src/BNF 1970-01-01 03:00:00.000000000 +0300
|
|
+++ file-master/src/BNF 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -0,0 +1,151 @@
|
|
+This is a first attempt to document the grammar used by magic(5), with
|
|
+hopes of eventually incorporating something like this into the manpage.
|
|
+
|
|
+Note: Currently, the parser varies slightly from this, but only in
|
|
+very minor ways, e.g., the strflags maybe separated by '/' characters
|
|
+and at most one strcount is allowed; likewise for regflags.
|
|
+
|
|
+------------------------------------------------------------------------
|
|
+magic = 1*query
|
|
+
|
|
+query = line *( 1*level line )
|
|
+
|
|
+level = ">" ;; Increment the level by 1.
|
|
+ ;; The first line of a query is at level 0.
|
|
+
|
|
+line = offset HWS type HWS test HWS message EOL
|
|
+
|
|
+------------------------------------------------------------------------
|
|
+offset = absoffset | reloffset | indoffset
|
|
+ ;; The offset in the file at which to apply
|
|
+ ;; the <test>.
|
|
+
|
|
+absoffset = NUMBER ;; An absolute offset from the start of the file.
|
|
+
|
|
+reloffset = "&" NUMBER ;; The offset relative to the last match offset
|
|
+ ;; at one level up.
|
|
+ ;; Not allowed at level == 0.
|
|
+
|
|
+indoffset = indoff | relindoff
|
|
+
|
|
+indoff = "(" offset1 [ "." size ] [ op disp ] ")"
|
|
+ ;; Read the file at <offset1> of width <size>.
|
|
+ ;; If size is not specified, assume a long.
|
|
+ ;; If <op> is given, then preform that
|
|
+ ;; operation on the result and the <disp>.
|
|
+
|
|
+offset1 = absoffset | reloffset
|
|
+
|
|
+size = byte | leshort | beshort | lelong | belong | melong
|
|
+
|
|
+byte = "B" | "b" | "C" | "c" ;; A one-byte value.
|
|
+leshort = "s" | "h" ;; A two-byte little-endian value.
|
|
+beshort = "S" | "H" ;; A two-byte big-endian value.
|
|
+lelong = "l" ;; A four-byte little-endian value.
|
|
+belong = "L" ;; A four-byte big-endian value.
|
|
+melong = "m" ;; A four-byte middle-endian value.
|
|
+
|
|
+op = [ invert ] ( "+" | "-" | "*" | "/" | "%" | "&" | "|" | "^" )
|
|
+
|
|
+invert = "~" ;; Flip the bits on result of the <op>.
|
|
+
|
|
+disp = NUMBER | memvalue
|
|
+
|
|
+memvalue = "(" NUMBER ")"
|
|
+ ;; NUMBER is interpreted as an absolute or
|
|
+ ;; relative offset matching that of <offset1>.
|
|
+ ;; Read the file at the resulting offset with
|
|
+ ;; the same size as <offset1>
|
|
+
|
|
+relindoff = "&" indoff ;; add <indoff> to the last match offset at
|
|
+ ;; one level up.
|
|
+
|
|
+------------------------------------------------------------------------
|
|
+type = [ unsigned ] ( numeric | strtype | default )
|
|
+
|
|
+unsigned = "u" ;; The value is unsigned.
|
|
+ ;; This affects the sign extension of numeric
|
|
+ ;; types and the '<' and '>' compares. It is
|
|
+ ;; intended for numeric types, but allowed on
|
|
+ ;; all types.
|
|
+
|
|
+numeric = ( numtype | datatype ) [ nummask ]
|
|
+
|
|
+numtype = byte | short | long | quad
|
|
+
|
|
+byte = "byte"
|
|
+short = "short" | "beshort" | "leshort"
|
|
+long = "long" | "lelong" | "belong" | "melong"
|
|
+quad = "quad" | "lequad" | "bequad"
|
|
+
|
|
+datetype = udate32 | ldate32 | udate64 | ldate64
|
|
+
|
|
+udate32 = "date" | "bedate" | "ledate" | "medate" ;; UTC dates
|
|
+ldate32 = "ldate" | "beldate" | "leldate" | "meldate" ;; local dates
|
|
+udate64 = "qdate" | "leqdate" | "beqdate" ;; UTC dates
|
|
+ldate64 = "qldate" | "leqldate" | "beqldate" ;; local dates
|
|
+
|
|
+nummask = op NUMBER
|
|
+
|
|
+strtype = regex | search | string8 | string16
|
|
+
|
|
+regex = "regex" [ "/" 1*regflag ]
|
|
+
|
|
+regflag = "c" | "s" | linecnt
|
|
+
|
|
+linecnt = NUMBER ;; The number of lines to search. If this
|
|
+ ;; is missing or zero, the rest of the
|
|
+ ;; file is searched.
|
|
+
|
|
+search = "string" [ "/" 1*srchflag ]
|
|
+
|
|
+srchflag = strflag | srchcnt
|
|
+
|
|
+srchcnt = NUMBER ;; The number of search tries. If this
|
|
+ ;; is missing or zero, the rest of the
|
|
+ ;; file is searched.
|
|
+
|
|
+string8 = ( "string" | "pstring" ) [ "/" 1*strflag ]
|
|
+
|
|
+strflag = "b" | "B" | "c" | "C"
|
|
+
|
|
+string16 = "bestring16" | "lestring16"
|
|
+
|
|
+default = "default" ;; This is intended to be used with the
|
|
+ ;; <truetest> ("x" below). It is matched if
|
|
+ ;; there has been no previous match at its
|
|
+ ;; level or none since the last default at
|
|
+ ;; that level. It is useful for implementing
|
|
+ ;; switch-like and if/else constructions.
|
|
+
|
|
+------------------------------------------------------------------------
|
|
+test = numtest | strtest | truetest
|
|
+ ;; Test to preform on <type> read from file.
|
|
+
|
|
+numtest = [ compare ] NUMBER ;; If compare is missing, "=" is assumed.
|
|
+
|
|
+strtest = [ compare ] STRING ;; If compare is missing, "=" is assumed.
|
|
+ ;; Note: If the STRING begins with a <compare>
|
|
+ ;; character, the <compare> field cannot be
|
|
+ ;; omitted.
|
|
+
|
|
+compare = "=" | "!" | "<" | ">" | "&" | "^"
|
|
+
|
|
+truetest = "x" ;; This always returns true.
|
|
+ ;; To test for the string "x" use "=x".
|
|
+
|
|
+------------------------------------------------------------------------
|
|
+message = [ nospflag ] ( STRING | FMT_STRING )
|
|
+ ;; Message to print if test result is true.
|
|
+
|
|
+nospflag = %x08 | "\\b" ;; Do not insert a space before the message.
|
|
+ ;; By default, messages are separated by a " ".
|
|
+
|
|
+------------------------------------------------------------------------
|
|
+HWS = <horizontal white space>
|
|
+EOL = <end of line marker>
|
|
+NUMBER = <C-style unsigned number>
|
|
+STRING = <C-style string without delimiting quotes>
|
|
+FMTSTR = <printf format string with exactly one % construct>
|
|
+
|
|
+------------------------------------------------------------------------
|
|
diff -urN file-5.18.orig/src/cdf.c file-master/src/cdf.c
|
|
--- file-5.18.orig/src/cdf.c 2014-02-28 03:26:17.000000000 +0400
|
|
+++ file-master/src/cdf.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -35,7 +35,7 @@
|
|
#include "file.h"
|
|
|
|
#ifndef lint
|
|
-FILE_RCSID("@(#)$File: cdf.c,v 1.55 2014/02/27 23:26:17 christos Exp $")
|
|
+FILE_RCSID("@(#)$File: cdf.c,v 1.58 2014/05/13 16:41:06 christos Exp $")
|
|
#endif
|
|
|
|
#include <assert.h>
|
|
@@ -352,10 +352,10 @@
|
|
size_t ss = CDF_SHORT_SEC_SIZE(h);
|
|
size_t pos = CDF_SHORT_SEC_POS(h, id);
|
|
assert(ss == len);
|
|
- if (pos > CDF_SEC_SIZE(h) * sst->sst_len) {
|
|
+ if (pos + len > CDF_SEC_SIZE(h) * sst->sst_len) {
|
|
DPRINTF(("Out of bounds read %" SIZE_T_FORMAT "u > %"
|
|
SIZE_T_FORMAT "u\n",
|
|
- pos, CDF_SEC_SIZE(h) * sst->sst_len));
|
|
+ pos + len, CDF_SEC_SIZE(h) * sst->sst_len));
|
|
return -1;
|
|
}
|
|
(void)memcpy(((char *)buf) + offs,
|
|
@@ -472,6 +472,11 @@
|
|
}
|
|
sid = CDF_TOLE4((uint32_t)sat->sat_tab[sid]);
|
|
}
|
|
+ if (i == 0) {
|
|
+ DPRINTF((" none, sid: %d\n", sid));
|
|
+ return (size_t)-1;
|
|
+
|
|
+ }
|
|
DPRINTF(("\n"));
|
|
return i;
|
|
}
|
|
@@ -719,18 +724,27 @@
|
|
const cdf_sat_t *sat, const cdf_sat_t *ssat, const cdf_stream_t *sst,
|
|
const cdf_dir_t *dir, cdf_stream_t *scn)
|
|
{
|
|
+ return cdf_read_user_stream(info, h, sat, ssat, sst, dir,
|
|
+ "\05SummaryInformation", scn);
|
|
+}
|
|
+
|
|
+int
|
|
+cdf_read_user_stream(const cdf_info_t *info, const cdf_header_t *h,
|
|
+ const cdf_sat_t *sat, const cdf_sat_t *ssat, const cdf_stream_t *sst,
|
|
+ const cdf_dir_t *dir, const char *name, cdf_stream_t *scn)
|
|
+{
|
|
size_t i;
|
|
const cdf_directory_t *d;
|
|
- static const char name[] = "\05SummaryInformation";
|
|
+ size_t name_len = strlen(name) + 1;
|
|
|
|
for (i = dir->dir_len; i > 0; i--)
|
|
if (dir->dir_tab[i - 1].d_type == CDF_DIR_TYPE_USER_STREAM &&
|
|
- cdf_namecmp(name, dir->dir_tab[i - 1].d_name, sizeof(name))
|
|
+ cdf_namecmp(name, dir->dir_tab[i - 1].d_name, name_len)
|
|
== 0)
|
|
break;
|
|
|
|
if (i == 0) {
|
|
- DPRINTF(("Cannot find summary information section\n"));
|
|
+ DPRINTF(("Cannot find user stream `%s'\n", name));
|
|
errno = ESRCH;
|
|
return -1;
|
|
}
|
|
@@ -932,7 +946,7 @@
|
|
cdf_unpack_summary_info(const cdf_stream_t *sst, const cdf_header_t *h,
|
|
cdf_summary_info_header_t *ssi, cdf_property_info_t **info, size_t *count)
|
|
{
|
|
- size_t i, maxcount;
|
|
+ size_t maxcount;
|
|
const cdf_summary_info_header_t *si =
|
|
CAST(const cdf_summary_info_header_t *, sst->sst_tab);
|
|
const cdf_section_declaration_t *sd =
|
|
@@ -947,21 +961,13 @@
|
|
ssi->si_os = CDF_TOLE2(si->si_os);
|
|
ssi->si_class = si->si_class;
|
|
cdf_swap_class(&ssi->si_class);
|
|
- ssi->si_count = CDF_TOLE2(si->si_count);
|
|
+ ssi->si_count = CDF_TOLE4(si->si_count);
|
|
*count = 0;
|
|
maxcount = 0;
|
|
*info = NULL;
|
|
- for (i = 0; i < CDF_TOLE4(si->si_count); i++) {
|
|
- if (i >= CDF_LOOP_LIMIT) {
|
|
- DPRINTF(("Unpack summary info loop limit"));
|
|
- errno = EFTYPE;
|
|
- return -1;
|
|
- }
|
|
- if (cdf_read_property_info(sst, h, CDF_TOLE4(sd->sd_offset),
|
|
- info, count, &maxcount) == -1) {
|
|
- return -1;
|
|
- }
|
|
- }
|
|
+ if (cdf_read_property_info(sst, h, CDF_TOLE4(sd->sd_offset), info,
|
|
+ count, &maxcount) == -1)
|
|
+ return -1;
|
|
return 0;
|
|
}
|
|
|
|
diff -urN file-5.18.orig/src/cdf.h file-master/src/cdf.h
|
|
--- file-5.18.orig/src/cdf.h 2014-02-28 02:38:15.000000000 +0400
|
|
+++ file-master/src/cdf.h 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -298,6 +298,9 @@
|
|
const cdf_directory_t **);
|
|
int cdf_read_property_info(const cdf_stream_t *, const cdf_header_t *, uint32_t,
|
|
cdf_property_info_t **, size_t *, size_t *);
|
|
+int cdf_read_user_stream(const cdf_info_t *, const cdf_header_t *,
|
|
+ const cdf_sat_t *, const cdf_sat_t *, const cdf_stream_t *,
|
|
+ const cdf_dir_t *, const char *, cdf_stream_t *);
|
|
int cdf_read_summary_info(const cdf_info_t *, const cdf_header_t *,
|
|
const cdf_sat_t *, const cdf_sat_t *, const cdf_stream_t *,
|
|
const cdf_dir_t *, cdf_stream_t *);
|
|
diff -urN file-5.18.orig/src/cdf.mk file-master/src/cdf.mk
|
|
--- file-5.18.orig/src/cdf.mk 1970-01-01 03:00:00.000000000 +0300
|
|
+++ file-master/src/cdf.mk 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -0,0 +1,3 @@
|
|
+CFLAGS+=-DTEST -DCDF_DEBUG -g -DHAVE_CONFIG_H -I..
|
|
+cdf: cdf.o cdf_time.o
|
|
+ ${CC} ${CFLAGS} -o $@ $>
|
|
diff -urN file-5.18.orig/src/cdf_time.c file-master/src/cdf_time.c
|
|
--- file-5.18.orig/src/cdf_time.c 2014-02-26 00:52:02.000000000 +0400
|
|
+++ file-master/src/cdf_time.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -27,7 +27,7 @@
|
|
#include "file.h"
|
|
|
|
#ifndef lint
|
|
-FILE_RCSID("@(#)$File: cdf_time.c,v 1.13 2014/02/25 20:52:02 christos Exp $")
|
|
+FILE_RCSID("@(#)$File: cdf_time.c,v 1.14 2014/04/17 12:44:01 christos Exp $")
|
|
#endif
|
|
|
|
#include <time.h>
|
|
@@ -117,7 +117,7 @@
|
|
tm.tm_hour = (int)(t % 24);
|
|
t /= 24;
|
|
|
|
- // XXX: Approx
|
|
+ /* XXX: Approx */
|
|
tm.tm_year = (int)(CDF_BASE_YEAR + (t / 365));
|
|
|
|
rdays = cdf_getdays(tm.tm_year);
|
|
@@ -171,7 +171,8 @@
|
|
char *ptr = ctime_r(sec, buf);
|
|
if (ptr != NULL)
|
|
return buf;
|
|
- (void)snprintf(buf, 26, "*Bad* 0x%16.16llx\n", (long long)*sec);
|
|
+ (void)snprintf(buf, 26, "*Bad* 0x%16.16" INT64_T_FORMAT "x\n",
|
|
+ (long long)*sec);
|
|
return buf;
|
|
}
|
|
|
|
diff -urN file-5.18.orig/src/compress.c file-master/src/compress.c
|
|
--- file-5.18.orig/src/compress.c 2014-01-05 19:55:21.000000000 +0400
|
|
+++ file-master/src/compress.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -35,7 +35,7 @@
|
|
#include "file.h"
|
|
|
|
#ifndef lint
|
|
-FILE_RCSID("@(#)$File: compress.c,v 1.73 2014/01/05 15:55:21 christos Exp $")
|
|
+FILE_RCSID("@(#)$File: compress.c,v 1.72 2013/11/18 17:54:58 christos Exp $")
|
|
#endif
|
|
|
|
#include "magic.h"
|
|
diff -urN file-5.18.orig/src/ctime_r.c file-master/src/ctime_r.c
|
|
--- file-5.18.orig/src/ctime_r.c 2012-06-21 02:18:33.000000000 +0400
|
|
+++ file-master/src/ctime_r.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,8 +1,8 @@
|
|
-/* $File: ctime_r.c,v 1.1 2012/05/15 17:14:36 christos Exp $ */
|
|
+/* $File$ */
|
|
|
|
#include "file.h"
|
|
#ifndef lint
|
|
-FILE_RCSID("@(#)$File: ctime_r.c,v 1.1 2012/05/15 17:14:36 christos Exp $")
|
|
+FILE_RCSID("@(#)$File: ascmagic.c,v 1.84 2011/12/08 12:38:24 rrt Exp $")
|
|
#endif /* lint */
|
|
#include <time.h>
|
|
#include <string.h>
|
|
diff -urN file-5.18.orig/src/encoding.c file-master/src/encoding.c
|
|
--- file-5.18.orig/src/encoding.c 2013-11-20 00:45:50.000000000 +0400
|
|
+++ file-master/src/encoding.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -35,7 +35,7 @@
|
|
#include "file.h"
|
|
|
|
#ifndef lint
|
|
-FILE_RCSID("@(#)$File: encoding.c,v 1.9 2013/11/19 20:45:50 christos Exp $")
|
|
+FILE_RCSID("@(#)$File: encoding.c,v 1.8 2013/09/17 15:51:22 christos Exp $")
|
|
#endif /* lint */
|
|
|
|
#include "magic.h"
|
|
diff -urN file-5.18.orig/src/file.c file-master/src/file.c
|
|
--- file-5.18.orig/src/file.c 2014-02-11 19:41:04.000000000 +0400
|
|
+++ file-master/src/file.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -32,7 +32,7 @@
|
|
#include "file.h"
|
|
|
|
#ifndef lint
|
|
-FILE_RCSID("@(#)$File: file.c,v 1.153 2014/02/11 15:41:04 christos Exp $")
|
|
+FILE_RCSID("@(#)$File: file.c,v 1.152 2013/06/26 14:46:54 christos Exp $")
|
|
#endif /* lint */
|
|
|
|
#include "magic.h"
|
|
diff -urN file-5.18.orig/src/file.h file-master/src/file.h
|
|
--- file-5.18.orig/src/file.h 2014-03-16 06:53:25.000000000 +0400
|
|
+++ file-master/src/file.h 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -27,7 +27,7 @@
|
|
*/
|
|
/*
|
|
* file.h - definitions for file(1) program
|
|
- * @(#)$File: file.h,v 1.149 2014/03/15 21:47:40 christos Exp $
|
|
+ * @(#)$File: file.h,v 1.150 2014/05/05 20:53:10 christos Exp $
|
|
*/
|
|
|
|
#ifndef __file_h__
|
|
@@ -83,7 +83,7 @@
|
|
|
|
#define private static
|
|
|
|
-#if HAVE_VISIBILITY
|
|
+#if HAVE_VISIBILITY && !defined(WIN32)
|
|
#define public __attribute__ ((__visibility__("default")))
|
|
#ifndef protected
|
|
#define protected __attribute__ ((__visibility__("hidden")))
|
|
@@ -468,6 +468,18 @@
|
|
size_t);
|
|
#endif /* __EMX__ */
|
|
|
|
+typedef struct {
|
|
+ const char *pat;
|
|
+ char *old_lc_ctype;
|
|
+ int rc;
|
|
+ regex_t rx;
|
|
+} file_regex_t;
|
|
+
|
|
+protected int file_regcomp(file_regex_t *, const char *, int);
|
|
+protected int file_regexec(file_regex_t *, const char *, size_t, regmatch_t *,
|
|
+ int);
|
|
+protected void file_regfree(file_regex_t *);
|
|
+protected void file_regerror(file_regex_t *, int, struct magic_set *);
|
|
|
|
#ifndef COMPILE_ONLY
|
|
extern const char *file_names[];
|
|
diff -urN file-5.18.orig/src/fsmagic.c file-master/src/fsmagic.c
|
|
--- file-5.18.orig/src/fsmagic.c 2013-12-01 23:22:13.000000000 +0400
|
|
+++ file-master/src/fsmagic.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -32,7 +32,7 @@
|
|
#include "file.h"
|
|
|
|
#ifndef lint
|
|
-FILE_RCSID("@(#)$File: fsmagic.c,v 1.71 2013/12/01 18:01:07 christos Exp $")
|
|
+FILE_RCSID("@(#)$File: fsmagic.c,v 1.72 2014/04/17 12:47:11 christos Exp $")
|
|
#endif /* lint */
|
|
|
|
#include "magic.h"
|
|
@@ -53,7 +53,11 @@
|
|
#ifdef major /* Might be defined in sys/types.h. */
|
|
# define HAVE_MAJOR
|
|
#endif
|
|
-
|
|
+#ifdef WIN32
|
|
+# define WIN32_LEAN_AND_MEAN
|
|
+# include <windows.h>
|
|
+#endif
|
|
+
|
|
#ifndef HAVE_MAJOR
|
|
# define major(dev) (((dev) >> 8) & 0xff)
|
|
# define minor(dev) ((dev) & 0xff)
|
|
@@ -123,6 +127,35 @@
|
|
#endif
|
|
ret = stat(fn, sb); /* don't merge into if; see "ret =" above */
|
|
|
|
+#ifdef WIN32
|
|
+ {
|
|
+ HANDLE hFile = CreateFile(fn, 0, FILE_SHARE_DELETE |
|
|
+ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0,
|
|
+ NULL);
|
|
+ if (hFile != INVALID_HANDLE_VALUE) {
|
|
+ /*
|
|
+ * Stat failed, but we can still open it - assume it's
|
|
+ * a block device, if nothing else.
|
|
+ */
|
|
+ if (ret) {
|
|
+ sb->st_mode = S_IFBLK;
|
|
+ ret = 0;
|
|
+ }
|
|
+ switch (GetFileType(hFile)) {
|
|
+ case FILE_TYPE_CHAR:
|
|
+ sb->st_mode |= S_IFCHR;
|
|
+ sb->st_mode &= ~S_IFREG;
|
|
+ break;
|
|
+ case FILE_TYPE_PIPE:
|
|
+ sb->st_mode |= S_IFIFO;
|
|
+ sb->st_mode &= ~S_IFREG;
|
|
+ break;
|
|
+ }
|
|
+ CloseHandle(hFile);
|
|
+ }
|
|
+ }
|
|
+#endif
|
|
+
|
|
if (ret) {
|
|
if (ms->flags & MAGIC_ERROR) {
|
|
file_error(ms, errno, "cannot stat `%s'", fn);
|
|
@@ -176,7 +209,7 @@
|
|
if (handle_mime(ms, mime, "chardevice") == -1)
|
|
return -1;
|
|
} else {
|
|
-#ifdef HAVE_STAT_ST_RDEV
|
|
+#ifdef HAVE_STRUCT_STAT_ST_RDEV
|
|
# ifdef dv_unit
|
|
if (file_printf(ms, "%scharacter special (%d/%d/%d)",
|
|
COMMA, major(sb->st_rdev), dv_unit(sb->st_rdev),
|
|
@@ -210,7 +243,7 @@
|
|
if (handle_mime(ms, mime, "blockdevice") == -1)
|
|
return -1;
|
|
} else {
|
|
-#ifdef HAVE_STAT_ST_RDEV
|
|
+#ifdef HAVE_STRUCT_STAT_ST_RDEV
|
|
# ifdef dv_unit
|
|
if (file_printf(ms, "%sblock special (%d/%d/%d)",
|
|
COMMA, major(sb->st_rdev), dv_unit(sb->st_rdev),
|
|
diff -urN file-5.18.orig/src/funcs.c file-master/src/funcs.c
|
|
--- file-5.18.orig/src/funcs.c 2014-03-14 23:02:37.000000000 +0400
|
|
+++ file-master/src/funcs.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -27,7 +27,7 @@
|
|
#include "file.h"
|
|
|
|
#ifndef lint
|
|
-FILE_RCSID("@(#)$File: funcs.c,v 1.70 2014/03/14 19:02:37 christos Exp $")
|
|
+FILE_RCSID("@(#)$File: funcs.c,v 1.71 2014/05/05 20:53:10 christos Exp $")
|
|
#endif /* lint */
|
|
|
|
#include "magic.h"
|
|
@@ -280,7 +280,9 @@
|
|
if (file_printf(ms, "%s", code_mime) == -1)
|
|
rv = -1;
|
|
}
|
|
+#if HAVE_FORK
|
|
done_encoding:
|
|
+#endif
|
|
free(u8buf);
|
|
if (rv)
|
|
return rv;
|
|
@@ -427,35 +429,65 @@
|
|
protected int
|
|
file_replace(struct magic_set *ms, const char *pat, const char *rep)
|
|
{
|
|
- regex_t rx;
|
|
+ file_regex_t rx;
|
|
int rc, rv = -1;
|
|
- char *old_lc_ctype;
|
|
|
|
- old_lc_ctype = setlocale(LC_CTYPE, NULL);
|
|
- assert(old_lc_ctype != NULL);
|
|
- old_lc_ctype = strdup(old_lc_ctype);
|
|
- assert(old_lc_ctype != NULL);
|
|
- (void)setlocale(LC_CTYPE, "C");
|
|
- rc = regcomp(&rx, pat, REG_EXTENDED);
|
|
+ rc = file_regcomp(&rx, pat, REG_EXTENDED);
|
|
if (rc) {
|
|
- char errmsg[512];
|
|
- (void)regerror(rc, &rx, errmsg, sizeof(errmsg));
|
|
- file_magerror(ms, "regex error %d, (%s)", rc, errmsg);
|
|
+ file_regerror(&rx, rc, ms);
|
|
} else {
|
|
regmatch_t rm;
|
|
int nm = 0;
|
|
- while (regexec(&rx, ms->o.buf, 1, &rm, 0) == 0) {
|
|
+ while (file_regexec(&rx, ms->o.buf, 1, &rm, 0) == 0) {
|
|
ms->o.buf[rm.rm_so] = '\0';
|
|
if (file_printf(ms, "%s%s", rep,
|
|
rm.rm_eo != 0 ? ms->o.buf + rm.rm_eo : "") == -1)
|
|
goto out;
|
|
nm++;
|
|
}
|
|
- regfree(&rx);
|
|
rv = nm;
|
|
}
|
|
out:
|
|
- (void)setlocale(LC_CTYPE, old_lc_ctype);
|
|
- free(old_lc_ctype);
|
|
+ file_regfree(&rx);
|
|
return rv;
|
|
}
|
|
+
|
|
+protected int
|
|
+file_regcomp(file_regex_t *rx, const char *pat, int flags)
|
|
+{
|
|
+ rx->old_lc_ctype = setlocale(LC_CTYPE, NULL);
|
|
+ assert(rx->old_lc_ctype != NULL);
|
|
+ rx->old_lc_ctype = strdup(rx->old_lc_ctype);
|
|
+ assert(rx->old_lc_ctype != NULL);
|
|
+ rx->pat = pat;
|
|
+
|
|
+ (void)setlocale(LC_CTYPE, "C");
|
|
+ return rx->rc = regcomp(&rx->rx, pat, flags);
|
|
+}
|
|
+
|
|
+protected int
|
|
+file_regexec(file_regex_t *rx, const char *str, size_t nmatch,
|
|
+ regmatch_t* pmatch, int eflags)
|
|
+{
|
|
+ assert(rx->rc == 0);
|
|
+ return regexec(&rx->rx, str, nmatch, pmatch, eflags);
|
|
+}
|
|
+
|
|
+protected void
|
|
+file_regfree(file_regex_t *rx)
|
|
+{
|
|
+ if (rx->rc == 0)
|
|
+ regfree(&rx->rx);
|
|
+ (void)setlocale(LC_CTYPE, rx->old_lc_ctype);
|
|
+ free(rx->old_lc_ctype);
|
|
+}
|
|
+
|
|
+protected void
|
|
+file_regerror(file_regex_t *rx, int rc, struct magic_set *ms)
|
|
+{
|
|
+ char errmsg[512];
|
|
+
|
|
+ (void)regerror(rc, &rx->rx, errmsg, sizeof(errmsg));
|
|
+ file_magerror(ms, "regex error %d for `%s', (%s)", rc, rx->pat,
|
|
+ errmsg);
|
|
+}
|
|
diff -urN file-5.18.orig/src/getopt_long.c file-master/src/getopt_long.c
|
|
--- file-5.18.orig/src/getopt_long.c 2012-06-21 02:18:33.000000000 +0400
|
|
+++ file-master/src/getopt_long.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -32,7 +32,7 @@
|
|
#include "file.h"
|
|
|
|
#ifndef lint
|
|
-FILE_RCSID("@(#)$File: getopt_long.c,v 1.6 2009/02/13 18:48:05 christos Exp $")
|
|
+FILE_RCSID("@(#)$File: getopt_long.c,v 1.5 2009/02/03 20:27:51 christos Exp $")
|
|
#endif /* lint */
|
|
|
|
#include <assert.h>
|
|
diff -urN file-5.18.orig/src/is_tar.c file-master/src/is_tar.c
|
|
--- file-5.18.orig/src/is_tar.c 2012-06-21 02:18:33.000000000 +0400
|
|
+++ file-master/src/is_tar.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -40,7 +40,7 @@
|
|
#include "file.h"
|
|
|
|
#ifndef lint
|
|
-FILE_RCSID("@(#)$File: is_tar.c,v 1.37 2010/11/30 14:58:53 rrt Exp $")
|
|
+FILE_RCSID("@(#)$File: is_tar.c,v 1.36 2009/02/03 20:27:51 christos Exp $")
|
|
#endif
|
|
|
|
#include "magic.h"
|
|
diff -urN file-5.18.orig/src/magic.c file-master/src/magic.c
|
|
--- file-5.18.orig/src/magic.c 2013-12-01 23:22:13.000000000 +0400
|
|
+++ file-master/src/magic.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -33,7 +33,7 @@
|
|
#include "file.h"
|
|
|
|
#ifndef lint
|
|
-FILE_RCSID("@(#)$File: magic.c,v 1.81 2013/11/29 15:42:51 christos Exp $")
|
|
+FILE_RCSID("@(#)$File: magic.c,v 1.83 2014/05/13 16:44:24 christos Exp $")
|
|
#endif /* lint */
|
|
|
|
#include "magic.h"
|
|
@@ -126,8 +126,9 @@
|
|
free(hmagicpath);
|
|
return MAGIC;
|
|
#else
|
|
- char *hmagicp = hmagicpath;
|
|
+ char *hmagicp;
|
|
char *tmppath = NULL;
|
|
+ hmagicpath = NULL;
|
|
|
|
#define APPENDPATH() \
|
|
do { \
|
|
@@ -220,13 +221,15 @@
|
|
private int
|
|
unreadable_info(struct magic_set *ms, mode_t md, const char *file)
|
|
{
|
|
- /* We cannot open it, but we were able to stat it. */
|
|
- if (access(file, W_OK) == 0)
|
|
- if (file_printf(ms, "writable, ") == -1)
|
|
- return -1;
|
|
- if (access(file, X_OK) == 0)
|
|
- if (file_printf(ms, "executable, ") == -1)
|
|
- return -1;
|
|
+ if (file) {
|
|
+ /* We cannot open it, but we were able to stat it. */
|
|
+ if (access(file, W_OK) == 0)
|
|
+ if (file_printf(ms, "writable, ") == -1)
|
|
+ return -1;
|
|
+ if (access(file, X_OK) == 0)
|
|
+ if (file_printf(ms, "executable, ") == -1)
|
|
+ return -1;
|
|
+ }
|
|
if (S_ISREG(md))
|
|
if (file_printf(ms, "regular file, ") == -1)
|
|
return -1;
|
|
@@ -345,6 +348,9 @@
|
|
int ispipe = 0;
|
|
off_t pos = (off_t)-1;
|
|
|
|
+ if (file_reset(ms) == -1)
|
|
+ goto out;
|
|
+
|
|
/*
|
|
* one extra for terminating '\0', and
|
|
* some overlapping space for matches near EOF
|
|
@@ -353,9 +359,6 @@
|
|
if ((buf = CAST(unsigned char *, malloc(HOWMANY + SLOP))) == NULL)
|
|
return NULL;
|
|
|
|
- if (file_reset(ms) == -1)
|
|
- goto done;
|
|
-
|
|
switch (file_fsmagic(ms, inname, &sb)) {
|
|
case -1: /* error */
|
|
goto done;
|
|
@@ -366,6 +369,12 @@
|
|
goto done;
|
|
}
|
|
|
|
+#ifdef WIN32
|
|
+ /* Place stdin in binary mode, so EOF (Ctrl+Z) doesn't stop early. */
|
|
+ if (fd == STDIN_FILENO)
|
|
+ _setmode(STDIN_FILENO, O_BINARY);
|
|
+#endif
|
|
+
|
|
if (inname == NULL) {
|
|
if (fstat(fd, &sb) == 0 && S_ISFIFO(sb.st_mode))
|
|
ispipe = 1;
|
|
@@ -384,6 +393,18 @@
|
|
|
|
errno = 0;
|
|
if ((fd = open(inname, flags)) < 0) {
|
|
+#ifdef WIN32
|
|
+ /*
|
|
+ * Can't stat, can't open. It may have been opened in
|
|
+ * fsmagic, so if the user doesn't have read permission,
|
|
+ * allow it to say so; otherwise an error was probably
|
|
+ * displayed in fsmagic.
|
|
+ */
|
|
+ if (!okstat && errno == EACCES) {
|
|
+ sb.st_mode = S_IFBLK;
|
|
+ okstat = 1;
|
|
+ }
|
|
+#endif
|
|
if (okstat &&
|
|
unreadable_info(ms, sb.st_mode, inname) == -1)
|
|
goto done;
|
|
@@ -419,8 +440,18 @@
|
|
}
|
|
|
|
} else {
|
|
- if ((nbytes = read(fd, (char *)buf, HOWMANY)) == -1) {
|
|
- file_error(ms, errno, "cannot read `%s'", inname);
|
|
+ /* Windows refuses to read from a big console buffer. */
|
|
+ size_t howmany =
|
|
+#if defined(WIN32) && HOWMANY > 8 * 1024
|
|
+ _isatty(fd) ? 8 * 1024 :
|
|
+#endif
|
|
+ HOWMANY;
|
|
+ if ((nbytes = read(fd, (char *)buf, howmany)) == -1) {
|
|
+ if (inname == NULL && fd != STDIN_FILENO)
|
|
+ file_error(ms, errno, "cannot read fd %d", fd);
|
|
+ else
|
|
+ file_error(ms, errno, "cannot read `%s'",
|
|
+ inname == NULL ? "/dev/stdin" : inname);
|
|
goto done;
|
|
}
|
|
}
|
|
@@ -434,6 +465,7 @@
|
|
if (pos != (off_t)-1)
|
|
(void)lseek(fd, pos, SEEK_SET);
|
|
close_and_restore(ms, inname, fd, &sb);
|
|
+out:
|
|
return rv == 0 ? file_getbuffer(ms) : NULL;
|
|
}
|
|
|
|
diff -urN file-5.18.orig/src/Makefile.std file-master/src/Makefile.std
|
|
--- file-5.18.orig/src/Makefile.std 1970-01-01 03:00:00.000000000 +0300
|
|
+++ file-master/src/Makefile.std 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -0,0 +1,167 @@
|
|
+# Makefile for file(1) cmd.
|
|
+# Copyright (c) Ian F. Darwin 86/09/01 - see LEGAL.NOTICE.
|
|
+# @(#)$Id: Makefile.std,v 1.18 2011/12/30 16:51:19 christos Exp $
|
|
+#
|
|
+# This software is not subject to any license of the American Telephone
|
|
+# and Telegraph Company or of the Regents of the University of California.
|
|
+#
|
|
+# Permission is granted to anyone to use this software for any purpose on
|
|
+# any computer system, and to alter it and redistribute it freely, subject
|
|
+# to the following restrictions:
|
|
+#
|
|
+# 1. The author is not responsible for the consequences of use of this
|
|
+# software, no matter how awful, even if they arise from flaws in it.
|
|
+#
|
|
+# 2. The origin of this software must not be misrepresented, either by
|
|
+# explicit claim or by omission. Since few users ever read sources,
|
|
+# credits must appear in the documentation.
|
|
+#
|
|
+# 3. Altered versions must be plainly marked as such, and must not be
|
|
+# misrepresented as being the original software. Since few users
|
|
+# ever read sources, credits must appear in the documentation.
|
|
+#
|
|
+# 4. This notice may not be removed or altered.
|
|
+#
|
|
+VERSION = 3.41
|
|
+SHELL = /bin/sh
|
|
+#MAGIC = /etc/magic
|
|
+MAGIC = /usr/local/etc/magic
|
|
+DEFS = -DMAGIC='"$(MAGIC)"' -DBUILTIN_ELF # -Dvoid=int
|
|
+CC = cc
|
|
+COPTS = -O -g # newer compilers allow both; else drop -O
|
|
+# For truly antique environments, use this for (dummy) include files:
|
|
+COPTS = -O # -Ilocalinc
|
|
+CFLAGS = $(COPTS) $(DEFS)
|
|
+LDFLAGS = $(COPTS) # -Bstatic # older gdb couldn't handle shared libs
|
|
+SHAR = bundle
|
|
+OFILE = /usr/bin/file # old or distributed version, for comparison
|
|
+# Where new binary lives; typically /usr/local (BSD), /usr/lbin (USG).
|
|
+BINDIR = /usr/local/bin
|
|
+# For installing our man pages;
|
|
+# MANCxxx is manual section for Commands, MANFxxx is section for file formats.
|
|
+# MANxDIR is directory names; MANxEXT is the filename extention. Usual values:
|
|
+# Variable V7 4BSD Sys V
|
|
+# MANCDIR /usr/man/man1 /usr/man/man1 /usr/man/u_man/man1
|
|
+# MANFDIR /usr/man/man5 /usr/man/man5 /usr/man/u_man/man4
|
|
+# MANCEXT 1 1 1
|
|
+# MANFEXT 5 5 4
|
|
+# --- possible alternative for 4BSD ---
|
|
+# MANCDIR /usr/local/man/man1
|
|
+# MANCEXT 1
|
|
+# or
|
|
+# MANCDIR /usr/man/manl
|
|
+# MANCEXT l
|
|
+# --- possible alternative for USG ---
|
|
+# MANCDIR /usr/man/local/man1
|
|
+# MANCEXT 1
|
|
+
|
|
+MANCDIR = /usr/local/man/man1
|
|
+MANCEXT = 1
|
|
+MANFDIR = /usr/local/man/man4
|
|
+MANFEXT = 4
|
|
+
|
|
+# There are no system-dependant configuration options (except maybe CFLAGS).
|
|
+# Uncomment any of these that is missing from your "standard" library.
|
|
+LOCALSRCS = # localsrc/getopt.c localsrc/strtol.c \
|
|
+# localsrc/strtok.c localsrc/strchr.c
|
|
+LOCALOBJS = # localsrc/getopt.o localsrc/strtol.o \
|
|
+# localsrc/strtok.o localsrc/strchr.o
|
|
+# These are not compiled in unless you use -Ilocalinc, but
|
|
+# are not commented out as "make dist" &c use them.
|
|
+LOCALINC = # localinc/*.h localinc/sys/*.h
|
|
+
|
|
+SRCS = file.c apprentice.c fsmagic.c softmagic.c ascmagic.c \
|
|
+ compress.c is_tar.c readelf.c \
|
|
+ print.c $(LOCALSRCS) $(LOCALINC)
|
|
+OBJS = file.o apprentice.o fsmagic.o softmagic.o ascmagic.o \
|
|
+ compress.o is_tar.o readelf.o \
|
|
+ print.o $(LOCALOBJS)
|
|
+HDRS = file.h readelf.h tar.h
|
|
+
|
|
+AUTOSRC=configure configure.in install-sh config.h.in Makefile.in
|
|
+ALLSRC = LEGAL.NOTICE README MAINT PORTING $(SRCS) $(HDRS) \
|
|
+ Makefile.std file.man magic.man magic2mime $(AUTOSRC) \
|
|
+ Localstuff Header
|
|
+ALLMAGIC = Magdir/[a-z]*
|
|
+
|
|
+all: file magic file.${MANCEXT} magic.${MANFEXT}
|
|
+
|
|
+TESTFILES = * tst/*
|
|
+try: all $(OFILE)
|
|
+ cd tst; $(MAKE)
|
|
+ time $(OFILE) $(TESTFILES) >/tmp/t1 # can't use ./magic
|
|
+ time ./file -m ./magic $(TESTFILES) >/tmp/t2
|
|
+ -diff -b /tmp/t[12]
|
|
+ what ./file >lastnocore
|
|
+
|
|
+file: $(OBJS)
|
|
+ $(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@
|
|
+lint: $(SRCS)
|
|
+ lint -ha $(DEFS) $(SRCS) | tee $@
|
|
+magic: Localstuff Header Magdir
|
|
+ cat Header Localstuff Magdir/[a-z] > $@
|
|
+
|
|
+ascmagic.o: names.h
|
|
+
|
|
+compress.o apprentice.o ascmagic.o file.o fsmagic.o print.o softmagic.o: file.h
|
|
+
|
|
+install: file magic
|
|
+ cp file $(BINDIR)/file
|
|
+ cp magic $(MAGIC)
|
|
+
|
|
+install.man: file.${MANCEXT} magic.${MANFEXT}
|
|
+ cp file.${MANCEXT} $(MANCDIR)/file.$(MANCEXT)
|
|
+ cp magic.${MANFEXT} $(MANFDIR)/magic.$(MANFEXT)
|
|
+
|
|
+clean:
|
|
+ rm -f *.o core file magic lint dist.* MANIFEST \
|
|
+ magic.${MANFEXT} file.${MANCEXT} \
|
|
+ config.h config.status config.cache config.log
|
|
+clobber:
|
|
+ cd tst; $(MAKE) clean
|
|
+
|
|
+
|
|
+magic.${MANFEXT} : Makefile magic.man
|
|
+ @rm -f $@
|
|
+ sed -e s@__CSECTION__@${MANCEXT}@g \
|
|
+ -e s@__FSECTION__@${MANFEXT}@g \
|
|
+ -e s@__VERSION__@${VERSION}@g \
|
|
+ -e s@__MAGIC__@${MAGIC}@g magic.man > $@
|
|
+
|
|
+file.${MANCEXT} : Makefile file.man
|
|
+ @rm -f $@
|
|
+ sed -e s@__CSECTION__@${MANCEXT}@g \
|
|
+ -e s@__FSECTION__@${MANFEXT}@g \
|
|
+ -e s@__VERSION__@${VERSION}@g \
|
|
+ -e s@__MAGIC__@${MAGIC}@g file.man > $@
|
|
+
|
|
+send: dist
|
|
+ ftp ftp.cs
|
|
+
|
|
+dist: dist.src dist.magic
|
|
+ @echo Now check this patchlevel!
|
|
+ ident patchlevel.h
|
|
+
|
|
+dist.src: $(ALLSRC) MANIFEST
|
|
+# Some versions of shar can't handle a single file from
|
|
+# a subdirectory, so we manually insert mkdir as needed.
|
|
+# The point is to exclude all the generable targets in tst.
|
|
+ (echo mkdir localinc localinc/sys localsrc tst; \
|
|
+ $(SHAR) $(ALLSRC) MANIFEST) > $@
|
|
+
|
|
+rcsdiff: $(ALLSRC)
|
|
+ rcsdiff -q RCS/*
|
|
+
|
|
+MANIFEST: $(ALLSRC)
|
|
+ ident $(ALLSRC) > MANIFEST
|
|
+dist.magic: Magdir
|
|
+# As above, but to exclude Magdir/RCS from being shipped.
|
|
+ (echo mkdir Magdir; $(SHAR) $(ALLMAGIC)) >$@
|
|
+
|
|
+tar: $(ALLSRC) $(ALLMAGIC)
|
|
+ -rm -fr file-${VERSION}
|
|
+ -mkdir file-${VERSION} file-${VERSION}/Magdir
|
|
+ ln $(ALLSRC) file-${VERSION}
|
|
+ ln ${ALLMAGIC} file-${VERSION}/Magdir
|
|
+ tar cvf file-${VERSION}.tar file-${VERSION}
|
|
+ -rm -fr file-${VERSION}
|
|
diff -urN file-5.18.orig/src/patchlevel.h file-master/src/patchlevel.h
|
|
--- file-5.18.orig/src/patchlevel.h 1970-01-01 03:00:00.000000000 +0300
|
|
+++ file-master/src/patchlevel.h 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -0,0 +1,361 @@
|
|
+#define FILE_VERSION_MAJOR 5
|
|
+#define patchlevel 6
|
|
+
|
|
+/*
|
|
+ * Patchlevel file for Ian Darwin's MAGIC command.
|
|
+ * $File: patchlevel.h,v 1.76 2011/01/17 16:40:41 christos Exp $
|
|
+ *
|
|
+ * $Log: patchlevel.h,v $
|
|
+ * Revision 1.77 2011/04/15 22:07:27 christos
|
|
+ * fix the patchlevel.
|
|
+ *
|
|
+ * Revision 1.76 2011/01/17 16:40:41 christos
|
|
+ * welcome to 5_05
|
|
+ *
|
|
+ * Revision 1.75 2010/01/22 21:08:13 christos
|
|
+ * welcome to 5.04
|
|
+ *
|
|
+ * Revision 1.74 2009/05/06 20:32:48 christos
|
|
+ * welcome to 5.03
|
|
+ *
|
|
+ * Revision 1.73 2009/05/04 15:15:13 christos
|
|
+ * 5.02...
|
|
+ *
|
|
+ * Revision 1.72 2009/04/30 21:20:15 christos
|
|
+ * 5.01 we are almost here.
|
|
+ *
|
|
+ * Revision 1.71 2009/01/21 19:09:42 christos
|
|
+ * file 5.0
|
|
+ *
|
|
+ * Revision 1.70 2008/08/30 10:01:01 christos
|
|
+ * file 4.26
|
|
+ *
|
|
+ * Revision 1.69 2008/07/02 15:27:05 christos
|
|
+ * welcome to 4.25
|
|
+ *
|
|
+ * Revision 1.68 2008/03/22 21:39:43 christos
|
|
+ * file 4.24
|
|
+ *
|
|
+ * Revision 1.67 2007/12/28 20:08:40 christos
|
|
+ * welcome to 4.23.
|
|
+ *
|
|
+ * Revision 1.66 2007/12/27 16:38:24 christos
|
|
+ * welcome to 4.22
|
|
+ *
|
|
+ * Revision 1.65 2007/05/24 17:22:27 christos
|
|
+ * Welcome to 4.21
|
|
+ *
|
|
+ * Revision 1.64 2007/03/01 22:14:55 christos
|
|
+ * welcome to 4.20
|
|
+ *
|
|
+ * Revision 1.63 2007/01/12 17:38:28 christos
|
|
+ * Use File id.
|
|
+ *
|
|
+ * Revision 1.62 2006/12/11 21:49:58 christos
|
|
+ * time for 4.19
|
|
+ *
|
|
+ * Revision 1.61 2006/10/31 21:18:09 christos
|
|
+ * bump
|
|
+ *
|
|
+ * Revision 1.60 2006/03/02 22:15:12 christos
|
|
+ * welcome to 4.17
|
|
+ *
|
|
+ * Revision 1.59 2005/10/17 17:15:21 christos
|
|
+ * welcome to 4.16
|
|
+ *
|
|
+ * Revision 1.58 2005/08/18 15:52:56 christos
|
|
+ * welcome to 4.15
|
|
+ *
|
|
+ * Revision 1.57 2005/06/25 15:52:14 christos
|
|
+ * Welcome to 4.14
|
|
+ *
|
|
+ * Revision 1.56 2005/02/09 19:25:13 christos
|
|
+ * Welcome to 4.13
|
|
+ *
|
|
+ * Revision 1.55 2004/11/24 18:57:47 christos
|
|
+ * Re-do the autoconf stuff once more; passes make dist now.
|
|
+ *
|
|
+ * Revision 1.54 2004/11/21 05:52:05 christos
|
|
+ * ready for 4.11
|
|
+ *
|
|
+ * Revision 1.53 2004/07/24 20:40:46 christos
|
|
+ * welcome to 4.10
|
|
+ *
|
|
+ * Revision 1.52 2004/04/07 00:32:25 christos
|
|
+ * welcome to 4.09
|
|
+ *
|
|
+ * Revision 1.51 2004/03/22 21:17:11 christos
|
|
+ * welcome to 4.08.
|
|
+ *
|
|
+ * Revision 1.50 2003/12/23 17:34:04 christos
|
|
+ * 4.07
|
|
+ *
|
|
+ * Revision 1.49 2003/10/15 02:08:27 christos
|
|
+ * welcome to 4.06
|
|
+ *
|
|
+ * Revision 1.48 2003/09/12 19:41:14 christos
|
|
+ * this is 4.04
|
|
+ *
|
|
+ * Revision 1.47 2003/05/23 21:38:21 christos
|
|
+ * welcome to 4.03
|
|
+ *
|
|
+ * Revision 1.46 2003/04/02 18:57:43 christos
|
|
+ * prepare for 4.02
|
|
+ *
|
|
+ * Revision 1.45 2003/03/26 15:37:25 christos
|
|
+ * - Pass lint
|
|
+ * - make NULL in magic_file mean stdin
|
|
+ * - Fix "-" argument to file to pass NULL to magic_file
|
|
+ * - avoid pointer casts by using memcpy
|
|
+ * - rename magic_buf -> magic_buffer
|
|
+ * - keep only the first error
|
|
+ * - manual page: new sentence, new line
|
|
+ * - fix typo in api function (magic_buf -> magic_buffer)
|
|
+ *
|
|
+ * Revision 1.44 2003/03/23 22:23:31 christos
|
|
+ * finish librarification.
|
|
+ *
|
|
+ * Revision 1.43 2003/03/23 21:16:26 christos
|
|
+ * update copyrights.
|
|
+ *
|
|
+ * Revision 1.42 2003/03/23 04:06:05 christos
|
|
+ * Library re-organization
|
|
+ *
|
|
+ * Revision 1.41 2003/02/27 20:53:45 christos
|
|
+ * - fix memory allocation problem (Jeff Johnson)
|
|
+ * - fix stack overflow corruption (David Endler)
|
|
+ * - fixes from NetBSD source (Antti Kantee)
|
|
+ * - magic fixes
|
|
+ *
|
|
+ * Revision 1.40 2003/02/08 18:33:53 christos
|
|
+ * - detect inttypes.h too (Dave Love <d.love@dl.ac.uk>)
|
|
+ * - eliminate unsigned char warnings (Petter Reinholdtsen <pere@hungry.com>)
|
|
+ * - better elf PT_NOTE handling (Nalin Dahyabhai <nalin@redhat.com>)
|
|
+ * - add options to format the output differently
|
|
+ * - much more magic.
|
|
+ *
|
|
+ * Revision 1.39 2002/07/03 18:57:52 christos
|
|
+ * - ansify/c99ize
|
|
+ * - more magic
|
|
+ * - better COMPILE_ONLY support.
|
|
+ * - new magic files.
|
|
+ * - fix solaris compilation problems.
|
|
+ *
|
|
+ * Revision 1.38 2002/05/16 18:45:56 christos
|
|
+ * - pt_note elf additions from NetBSD
|
|
+ * - EMX os specific changes (Alexander Mai)
|
|
+ * - stdint.h detection, acconfig.h fixes (Maciej W. Rozycki, Franz Korntner)
|
|
+ * - regex file additions (Kim Cromie)
|
|
+ * - getopt_long support and misc cleanups (Michael Piefel)
|
|
+ * - many magic fixes and additions
|
|
+ *
|
|
+ * Revision 1.37 2001/09/03 14:44:22 christos
|
|
+ * daylight/tm_isdst detection
|
|
+ * magic fixes
|
|
+ * don't eat the whole file if it has only nulls
|
|
+ *
|
|
+ * Revision 1.36 2001/07/22 21:04:15 christos
|
|
+ * - magic fixes
|
|
+ * - add new operators, pascal strings, UTC date printing, $HOME/.magic
|
|
+ * [from "Tom N Harris" <telliamed@mac.com>]
|
|
+ *
|
|
+ * Revision 1.35 2001/04/24 14:40:25 christos
|
|
+ * - rename magic file sgi to mips and fix it
|
|
+ * - add support for building magic.mgc
|
|
+ * - portability fixes for mmap()
|
|
+ * - try gzip before uncompress, because uncompress sometimes hangs
|
|
+ * - be more conservative about pipe reads and writes
|
|
+ * - many magic fixes
|
|
+ *
|
|
+ * Revision 1.34 2001/03/12 05:05:57 christos
|
|
+ * - new compiled magic format
|
|
+ * - lots of magic additions
|
|
+ *
|
|
+ * Revision 1.33 2000/11/13 00:30:50 christos
|
|
+ * - wordperfect magic fix: freebsd pr 9388
|
|
+ * - more msdos fixes from freebsd pr's 20131 and 20812
|
|
+ * - sas and spss magic [Bruce Foster]
|
|
+ * - mkinstalldirs [John Fremlin]
|
|
+ * - sgi opengl fixes [Michael Pruett]
|
|
+ * - netbsd magic fixes [Ignatios Souvatzis]
|
|
+ * - audio additions [Michael Pruett]
|
|
+ * - fix problem with non ansi RCSID [Andreas Ley]
|
|
+ * - oggs magic [Felix von Leitner]
|
|
+ * - gmon magic [Eugen Dedu]
|
|
+ * - TNEF magic [Joomy]
|
|
+ * - netpbm magic and misc other image stuff [Bryan Henderson]
|
|
+ *
|
|
+ * Revision 1.32 2000/08/05 18:24:18 christos
|
|
+ * Correct indianness detection in elf (Charles Hannum)
|
|
+ * FreeBSD elf core support (Guy Harris)
|
|
+ * Use gzip in systems that don't have uncompress (Anthon van der Neut)
|
|
+ * Internationalization/EBCDIC support (Eric Fisher)
|
|
+ * Many many magic changes
|
|
+ *
|
|
+ * Revision 1.31 2000/05/14 17:58:36 christos
|
|
+ * - new magic for claris files
|
|
+ * - new magic for mathematica and maple files
|
|
+ * - new magic for msvc files
|
|
+ * - new -k flag to keep going matching all possible entries
|
|
+ * - add the word executable on #! magic files, and fix the usage of
|
|
+ * the word script
|
|
+ * - lots of other magic fixes
|
|
+ * - fix typo test -> text
|
|
+ *
|
|
+ * Revision 1.30 2000/04/11 02:41:17 christos
|
|
+ * - add support for mime output (-i)
|
|
+ * - make sure we free memory in case realloc fails
|
|
+ * - magic fixes
|
|
+ *
|
|
+ * Revision 1.29 1999/11/28 20:02:29 christos
|
|
+ * new string/[Bcb] magic from anthon, and adjustments to the magic files to
|
|
+ * use it.
|
|
+ *
|
|
+ * Revision 1.28 1999/10/31 22:11:48 christos
|
|
+ * - add "char" type for compatibility with HP/UX
|
|
+ * - recognize HP/UX syntax &=n etc.
|
|
+ * - include errno.h for CYGWIN
|
|
+ * - conditionalize the S_IS* macros
|
|
+ * - revert the SHT_DYNSYM test that broke the linux stripped binaries test
|
|
+ * - lots of Magdir changes
|
|
+ *
|
|
+ * Revision 1.27 1999/02/14 17:21:41 christos
|
|
+ * Automake support and misc cleanups from Rainer Orth
|
|
+ * Enable reading character and block special files from Dale R. Worley
|
|
+ *
|
|
+ * Revision 1.26 1998/09/12 13:19:39 christos
|
|
+ * - add support for bi-endian indirect offsets (Richard Verhoeven)
|
|
+ * - add recognition for bcpl (Joseph Myers)
|
|
+ * - remove non magic files from Magdir to avoid difficulties building
|
|
+ * on os2 where files are case independent
|
|
+ * - magic fixes.
|
|
+ *
|
|
+ * Revision 1.25 1998/06/27 14:04:04 christos
|
|
+ * OLF patch Guy Harris
|
|
+ * Recognize java/html (debian linux)
|
|
+ * Const poisoning (debian linux)
|
|
+ * More magic!
|
|
+ *
|
|
+ * Revision 1.24 1998/02/15 23:20:38 christos
|
|
+ * Autoconf patch: Felix von Leitner <leitner@math.fu-berlin.de>
|
|
+ * More magic fixes
|
|
+ * Elf64 fixes
|
|
+ *
|
|
+ * Revision 1.23 1997/11/05 16:03:37 christos
|
|
+ * - correct elf prps offset for SunOS-2.5.1 [guy@netapp.com]
|
|
+ * - handle 64 bit time_t's correctly [ewt@redhat.com]
|
|
+ * - new mime style magic [clarosse@netvista.net]
|
|
+ * - new TI calculator magic [rmcguire@freenet.columbus.oh.us]
|
|
+ * - new figlet fonts [obrien@freebsd.org]
|
|
+ * - new cisco magic, and elf fixes [jhawk@bbnplanet.com]
|
|
+ * - -b flag addition, and x86 filesystem magic [vax@linkhead.paranoia.com]
|
|
+ * - s/Mpeg/MPEG, header and elf typo fixes [guy@netapp.com]
|
|
+ * - Windows/NT registry files, audio code [guy@netapp.com]
|
|
+ * - libGrx graphics lib fonts [guy@netapp.com]
|
|
+ * - PNG fixes [guy@netapp.com]
|
|
+ * - more m$ document magic [guy@netapp.com]
|
|
+ * - PPD files [guy@netapp.com]
|
|
+ * - archive magic cleanup [guy@netapp.com]
|
|
+ * - linux kernel magic cleanup [guy@netapp.com]
|
|
+ * - lecter magic [guy@netapp.com]
|
|
+ * - vgetty magic [guy@netapp.com]
|
|
+ * - sniffer additions [guy@netapp.com]
|
|
+ *
|
|
+ * Revision 1.22 1997/01/15 17:23:24 christos
|
|
+ * - add support for elf core files: find the program name under SVR4 [Ken Pizzini]
|
|
+ * - print strings only up to the first carriage return [various]
|
|
+ * - freebsd international ascii support [J Wunsch]
|
|
+ * - magic fixes and additions [Guy Harris]
|
|
+ * - 64 bit fixes [Larry Schwimmer]
|
|
+ * - support for both utime and utimes, but don't restore file access times
|
|
+ * by default [various]
|
|
+ * - \xXX only takes 2 hex digits, not 3.
|
|
+ * - re-implement support for core files [Guy Harris]
|
|
+ *
|
|
+ * Revision 1.21 1996/10/05 18:15:29 christos
|
|
+ * Segregate elf stuff and conditionally enable it with -DBUILTIN_ELF
|
|
+ * More magic fixes
|
|
+ *
|
|
+ * Revision 1.20 1996/06/22 22:15:52 christos
|
|
+ * - support relative offsets of the form >&
|
|
+ * - fix bug with truncating magic strings that contain \n
|
|
+ * - file -f - did not read from stdin as documented
|
|
+ * - support elf file parsing using our own elf support.
|
|
+ * - as always magdir fixes and additions.
|
|
+ *
|
|
+ * Revision 1.19 1995/10/27 23:14:46 christos
|
|
+ * Ability to parse colon separated list of magic files
|
|
+ * New LEGAL.NOTICE
|
|
+ * Various magic file changes
|
|
+ *
|
|
+ * Revision 1.18 1995/05/20 22:09:21 christos
|
|
+ * Passed incorrect argument to eatsize().
|
|
+ * Use %ld and %lx where appropriate.
|
|
+ * Remove unused variables
|
|
+ * ELF support for both big and little endian
|
|
+ * Fixes for small files again.
|
|
+ *
|
|
+ * Revision 1.17 1995/04/28 17:29:13 christos
|
|
+ * - Incorrect nroff detection fix from der Mouse
|
|
+ * - Lost and incorrect magic entries.
|
|
+ * - Added ELF stripped binary detection [in C; ugh]
|
|
+ * - Look for $MAGIC to find the magic file.
|
|
+ * - Eat trailing size specifications from numbers i.e. ignore 10L
|
|
+ * - More fixes for very short files
|
|
+ *
|
|
+ * Revision 1.16 1995/03/25 22:06:45 christos
|
|
+ * - use strtoul() where it exists.
|
|
+ * - fix sign-extend bug
|
|
+ * - try to detect tar archives before nroff files, otherwise
|
|
+ * tar files where the first file starts with a . will not work
|
|
+ *
|
|
+ * Revision 1.15 1995/01/21 21:03:35 christos
|
|
+ * Added CSECTION for the file man page
|
|
+ * Added version flag -v
|
|
+ * Fixed bug with -f input flag (from iorio@violet.berkeley.edu)
|
|
+ * Lots of magic fixes and reorganization...
|
|
+ *
|
|
+ * Revision 1.14 1994/05/03 17:58:23 christos
|
|
+ * changes from mycroft@gnu.ai.mit.edu (Charles Hannum) for unsigned
|
|
+ *
|
|
+ * Revision 1.13 1994/01/21 01:27:01 christos
|
|
+ * Fixed null termination bug from Don Seeley at BSDI in ascmagic.c
|
|
+ *
|
|
+ * Revision 1.12 1993/10/27 20:59:05 christos
|
|
+ * Changed -z flag to understand gzip format too.
|
|
+ * Moved builtin compression detection to a table, and move
|
|
+ * the compress magic entry out of the source.
|
|
+ * Made printing of numbers unsigned, and added the mask to it.
|
|
+ * Changed the buffer size to 8k, because gzip will refuse to
|
|
+ * unzip just a few bytes.
|
|
+ *
|
|
+ * Revision 1.11 1993/09/24 18:49:06 christos
|
|
+ * Fixed small bug in softmagic.c introduced by
|
|
+ * copying the data to be examined out of the input
|
|
+ * buffer. Changed the Makefile to use sed to create
|
|
+ * the correct man pages.
|
|
+ *
|
|
+ * Revision 1.10 1993/09/23 21:56:23 christos
|
|
+ * Passed purify. Fixed indirections. Fixed byte order printing.
|
|
+ * Fixed segmentation faults caused by referencing past the end
|
|
+ * of the magic buffer. Fixed bus errors caused by referencing
|
|
+ * unaligned shorts or longs.
|
|
+ *
|
|
+ * Revision 1.9 1993/03/24 14:23:40 ian
|
|
+ * Batch of minor changes from several contributors.
|
|
+ *
|
|
+ * Revision 1.8 93/02/19 15:01:26 ian
|
|
+ * Numerous changes from Guy Harris too numerous to mention but including
|
|
+ * byte-order independance, fixing "old-style masking", etc. etc. A bugfix
|
|
+ * for broken symlinks from martin@@d255s004.zfe.siemens.de.
|
|
+ *
|
|
+ * Revision 1.7 93/01/05 14:57:27 ian
|
|
+ * Couple of nits picked by Christos (again, thanks).
|
|
+ *
|
|
+ * Revision 1.6 93/01/05 13:51:09 ian
|
|
+ * Lotsa work on the Magic directory.
|
|
+ *
|
|
+ * Revision 1.5 92/09/14 14:54:51 ian
|
|
+ * Fix a tiny null-pointer bug in previous fix for tar archive + uncompress.
|
|
+ *
|
|
+ */
|
|
diff -urN file-5.18.orig/src/pread.c file-master/src/pread.c
|
|
--- file-5.18.orig/src/pread.c 2013-04-02 20:23:07.000000000 +0400
|
|
+++ file-master/src/pread.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1,6 +1,6 @@
|
|
#include "file.h"
|
|
#ifndef lint
|
|
-FILE_RCSID("@(#)$File: pread.c,v 1.2 2013/04/02 16:23:07 christos Exp $")
|
|
+FILE_RCSID("@(#)$File: pread.c,v 1.1 2013/02/18 15:40:59 christos Exp $")
|
|
#endif /* lint */
|
|
#include <fcntl.h>
|
|
#include <unistd.h>
|
|
diff -urN file-5.18.orig/src/print.c file-master/src/print.c
|
|
--- file-5.18.orig/src/print.c 2013-02-26 22:25:00.000000000 +0400
|
|
+++ file-master/src/print.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -32,7 +32,7 @@
|
|
#include "file.h"
|
|
|
|
#ifndef lint
|
|
-FILE_RCSID("@(#)$File: print.c,v 1.76 2013/02/26 18:25:00 christos Exp $")
|
|
+FILE_RCSID("@(#)$File: print.c,v 1.75 2012/10/30 23:11:51 christos Exp $")
|
|
#endif /* lint */
|
|
|
|
#include <string.h>
|
|
diff -urN file-5.18.orig/src/readcdf.c file-master/src/readcdf.c
|
|
--- file-5.18.orig/src/readcdf.c 2014-03-26 19:28:34.000000000 +0400
|
|
+++ file-master/src/readcdf.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -26,7 +26,7 @@
|
|
#include "file.h"
|
|
|
|
#ifndef lint
|
|
-FILE_RCSID("@(#)$File: readcdf.c,v 1.40 2014/03/06 15:23:33 christos Exp $")
|
|
+FILE_RCSID("@(#)$File: readcdf.c,v 1.43 2014/05/07 21:26:06 christos Exp $")
|
|
#endif
|
|
|
|
#include <assert.h>
|
|
@@ -75,14 +75,20 @@
|
|
const char *mime;
|
|
} clsid2mime[] = {
|
|
{
|
|
- { 0x00000000000c1084LLU, 0x46000000000000c0LLU },
|
|
+ { 0x00000000000c1084LLU, 0x46000000000000c0LLU },
|
|
"x-msi",
|
|
- }
|
|
+ },
|
|
+ { { 0, 0 },
|
|
+ NULL,
|
|
+ },
|
|
}, clsid2desc[] = {
|
|
{
|
|
- { 0x00000000000c1084LLU, 0x46000000000000c0LLU },
|
|
+ { 0x00000000000c1084LLU, 0x46000000000000c0LLU },
|
|
"MSI Installer",
|
|
},
|
|
+ { { 0, 0 },
|
|
+ NULL,
|
|
+ },
|
|
};
|
|
|
|
private const char *
|
|
@@ -120,7 +126,7 @@
|
|
|
|
private int
|
|
cdf_file_property_info(struct magic_set *ms, const cdf_property_info_t *info,
|
|
- size_t count, const uint64_t clsid[2])
|
|
+ size_t count, const cdf_directory_t *root_storage)
|
|
{
|
|
size_t i;
|
|
cdf_timestamp_t tp;
|
|
@@ -130,8 +136,9 @@
|
|
const char *s;
|
|
int len;
|
|
|
|
- if (!NOTMIME(ms))
|
|
- str = cdf_clsid_to_mime(clsid, clsid2mime);
|
|
+ if (!NOTMIME(ms) && root_storage)
|
|
+ str = cdf_clsid_to_mime(root_storage->d_storage_uuid,
|
|
+ clsid2mime);
|
|
|
|
for (i = 0; i < count; i++) {
|
|
cdf_print_property_name(buf, sizeof(buf), info[i].pi_id);
|
|
@@ -173,12 +180,11 @@
|
|
if (info[i].pi_type == CDF_LENGTH32_WSTRING)
|
|
k++;
|
|
s = info[i].pi_str.s_buf;
|
|
- for (j = 0; j < sizeof(vbuf) && len--;
|
|
- j++, s += k) {
|
|
+ for (j = 0; j < sizeof(vbuf) && len--; s += k) {
|
|
if (*s == '\0')
|
|
break;
|
|
if (isprint((unsigned char)*s))
|
|
- vbuf[j] = *s;
|
|
+ vbuf[j++] = *s;
|
|
}
|
|
if (j == sizeof(vbuf))
|
|
--j;
|
|
@@ -236,7 +242,7 @@
|
|
|
|
private int
|
|
cdf_file_summary_info(struct magic_set *ms, const cdf_header_t *h,
|
|
- const cdf_stream_t *sst, const uint64_t clsid[2])
|
|
+ const cdf_stream_t *sst, const cdf_directory_t *root_storage)
|
|
{
|
|
cdf_summary_info_header_t si;
|
|
cdf_property_info_t *info;
|
|
@@ -276,13 +282,16 @@
|
|
return -2;
|
|
break;
|
|
}
|
|
- str = cdf_clsid_to_mime(clsid, clsid2desc);
|
|
- if (str)
|
|
- if (file_printf(ms, ", %s", str) == -1)
|
|
- return -2;
|
|
- }
|
|
+ if (root_storage) {
|
|
+ str = cdf_clsid_to_mime(root_storage->d_storage_uuid,
|
|
+ clsid2desc);
|
|
+ if (str)
|
|
+ if (file_printf(ms, ", %s", str) == -1)
|
|
+ return -2;
|
|
+ }
|
|
+ }
|
|
|
|
- m = cdf_file_property_info(ms, info, count, clsid);
|
|
+ m = cdf_file_property_info(ms, info, count, root_storage);
|
|
free(info);
|
|
|
|
return m == -1 ? -2 : m;
|
|
@@ -368,6 +377,30 @@
|
|
}
|
|
#endif
|
|
|
|
+ if ((i = cdf_read_user_stream(&info, &h, &sat, &ssat, &sst, &dir,
|
|
+ "FileHeader", &scn)) != -1) {
|
|
+#define HWP5_SIGNATURE "HWP Document File"
|
|
+ if (scn.sst_dirlen >= sizeof(HWP5_SIGNATURE) - 1
|
|
+ && memcmp(scn.sst_tab, HWP5_SIGNATURE,
|
|
+ sizeof(HWP5_SIGNATURE) - 1) == 0) {
|
|
+ if (NOTMIME(ms)) {
|
|
+ if (file_printf(ms,
|
|
+ "Hangul (Korean) Word Processor File 5.x") == -1)
|
|
+ return -1;
|
|
+ } else {
|
|
+ if (file_printf(ms, "application/x-hwp") == -1)
|
|
+ return -1;
|
|
+ }
|
|
+ i = 1;
|
|
+ goto out5;
|
|
+ } else {
|
|
+ free(scn.sst_tab);
|
|
+ scn.sst_tab = NULL;
|
|
+ scn.sst_len = 0;
|
|
+ scn.sst_dirlen = 0;
|
|
+ }
|
|
+ }
|
|
+
|
|
if ((i = cdf_read_summary_info(&info, &h, &sat, &ssat, &sst, &dir,
|
|
&scn)) == -1) {
|
|
if (errno == ESRCH) {
|
|
@@ -381,9 +414,8 @@
|
|
#ifdef CDF_DEBUG
|
|
cdf_dump_summary_info(&h, &scn);
|
|
#endif
|
|
- if ((i = cdf_file_summary_info(ms, &h, &scn,
|
|
- root_storage->d_storage_uuid)) < 0)
|
|
- expn = "Can't expand summary_info";
|
|
+ if ((i = cdf_file_summary_info(ms, &h, &scn, root_storage)) < 0)
|
|
+ expn = "Can't expand summary_info";
|
|
|
|
if (i == 0) {
|
|
const char *str = NULL;
|
|
@@ -412,6 +444,7 @@
|
|
i = 1;
|
|
}
|
|
}
|
|
+out5:
|
|
free(scn.sst_tab);
|
|
out4:
|
|
free(sst.sst_tab);
|
|
diff -urN file-5.18.orig/src/readelf.c file-master/src/readelf.c
|
|
--- file-5.18.orig/src/readelf.c 2014-03-26 19:28:22.000000000 +0400
|
|
+++ file-master/src/readelf.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -1005,6 +1005,36 @@
|
|
file_badread(ms);
|
|
return -1;
|
|
}
|
|
+ if (cbuf[0] == 'A') {
|
|
+#ifdef notyet
|
|
+ char *p = cbuf + 1;
|
|
+ uint32_t len, tag;
|
|
+ memcpy(&len, p, sizeof(len));
|
|
+ p += 4;
|
|
+ len = getu32(swap, len);
|
|
+ if (memcmp("gnu", p, 3) != 0) {
|
|
+ if (file_printf(ms,
|
|
+ ", unknown capability %.3s", p)
|
|
+ == -1)
|
|
+ return -1;
|
|
+ break;
|
|
+ }
|
|
+ p += strlen(p) + 1;
|
|
+ tag = *p++;
|
|
+ memcpy(&len, p, sizeof(len));
|
|
+ p += 4;
|
|
+ len = getu32(swap, len);
|
|
+ if (tag != 1) {
|
|
+ if (file_printf(ms, ", unknown gnu"
|
|
+ " capability tag %d", tag)
|
|
+ == -1)
|
|
+ return -1;
|
|
+ break;
|
|
+ }
|
|
+ // gnu attributes
|
|
+#endif
|
|
+ break;
|
|
+ }
|
|
(void)memcpy(xcap_addr, cbuf, xcap_sizeof);
|
|
switch (xcap_tag) {
|
|
case CA_SUNW_NULL:
|
|
diff -urN file-5.18.orig/src/softmagic.c file-master/src/softmagic.c
|
|
--- file-5.18.orig/src/softmagic.c 2014-03-16 06:53:25.000000000 +0400
|
|
+++ file-master/src/softmagic.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -32,11 +32,10 @@
|
|
#include "file.h"
|
|
|
|
#ifndef lint
|
|
-FILE_RCSID("@(#)$File: softmagic.c,v 1.180 2014/03/15 21:47:40 christos Exp $")
|
|
+FILE_RCSID("@(#)$File: softmagic.c,v 1.187 2014/05/13 16:42:17 christos Exp $")
|
|
#endif /* lint */
|
|
|
|
#include "magic.h"
|
|
-#define F(a, b) fmtcheck((a), (b))
|
|
#include <assert.h>
|
|
#include <string.h>
|
|
#include <ctype.h>
|
|
@@ -88,6 +87,25 @@
|
|
return 0;
|
|
}
|
|
|
|
+#define FILE_FMTDEBUG
|
|
+#ifdef FILE_FMTDEBUG
|
|
+#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
|
|
+
|
|
+private const char * __attribute__((__format_arg__(3)))
|
|
+file_fmtcheck(struct magic_set *ms, const struct magic *m, const char *def,
|
|
+ const char *file, size_t line)
|
|
+{
|
|
+ const char *ptr = fmtcheck(m->desc, def);
|
|
+ if (ptr == def)
|
|
+ file_magerror(ms,
|
|
+ "%s, %zu: format `%s' does not match with `%s'",
|
|
+ file, line, m->desc, def);
|
|
+ return ptr;
|
|
+}
|
|
+#else
|
|
+#define F(a, b, c) fmtcheck((b)->desc, (c))
|
|
+#endif
|
|
+
|
|
/*
|
|
* Go through the whole list, stopping if you find a match. Process all
|
|
* the continuations of that match before returning.
|
|
@@ -217,8 +235,8 @@
|
|
if (file_check_mem(ms, ++cont_level) == -1)
|
|
return -1;
|
|
|
|
- while (magic[magindex+1].cont_level != 0 &&
|
|
- ++magindex < nmagic) {
|
|
+ while (++magindex < nmagic &&
|
|
+ magic[magindex].cont_level != 0) {
|
|
m = &magic[magindex];
|
|
ms->line = m->lineno; /* for messages */
|
|
|
|
@@ -346,30 +364,20 @@
|
|
private int
|
|
check_fmt(struct magic_set *ms, struct magic *m)
|
|
{
|
|
- regex_t rx;
|
|
+ file_regex_t rx;
|
|
int rc, rv = -1;
|
|
- char *old_lc_ctype;
|
|
|
|
if (strchr(m->desc, '%') == NULL)
|
|
return 0;
|
|
|
|
- old_lc_ctype = setlocale(LC_CTYPE, NULL);
|
|
- assert(old_lc_ctype != NULL);
|
|
- old_lc_ctype = strdup(old_lc_ctype);
|
|
- assert(old_lc_ctype != NULL);
|
|
- (void)setlocale(LC_CTYPE, "C");
|
|
- rc = regcomp(&rx, "%[-0-9\\.]*s", REG_EXTENDED|REG_NOSUB);
|
|
+ rc = file_regcomp(&rx, "%[-0-9\\.]*s", REG_EXTENDED|REG_NOSUB);
|
|
if (rc) {
|
|
- char errmsg[512];
|
|
- (void)regerror(rc, &rx, errmsg, sizeof(errmsg));
|
|
- file_magerror(ms, "regex error %d, (%s)", rc, errmsg);
|
|
+ file_regerror(&rx, rc, ms);
|
|
} else {
|
|
- rc = regexec(&rx, m->desc, 0, 0, 0);
|
|
- regfree(&rx);
|
|
+ rc = file_regexec(&rx, m->desc, 0, 0, 0);
|
|
rv = !rc;
|
|
}
|
|
- (void)setlocale(LC_CTYPE, old_lc_ctype);
|
|
- free(old_lc_ctype);
|
|
+ file_regfree(&rx);
|
|
return rv;
|
|
}
|
|
|
|
@@ -409,13 +417,13 @@
|
|
case -1:
|
|
return -1;
|
|
case 1:
|
|
- (void)snprintf(buf, sizeof(buf), "%c",
|
|
+ (void)snprintf(buf, sizeof(buf), "%d",
|
|
(unsigned char)v);
|
|
- if (file_printf(ms, F(m->desc, "%s"), buf) == -1)
|
|
+ if (file_printf(ms, F(ms, m, "%s"), buf) == -1)
|
|
return -1;
|
|
break;
|
|
default:
|
|
- if (file_printf(ms, F(m->desc, "%c"),
|
|
+ if (file_printf(ms, F(ms, m, "%d"),
|
|
(unsigned char) v) == -1)
|
|
return -1;
|
|
break;
|
|
@@ -431,13 +439,13 @@
|
|
case -1:
|
|
return -1;
|
|
case 1:
|
|
- (void)snprintf(buf, sizeof(buf), "%hu",
|
|
+ (void)snprintf(buf, sizeof(buf), "%u",
|
|
(unsigned short)v);
|
|
- if (file_printf(ms, F(m->desc, "%s"), buf) == -1)
|
|
+ if (file_printf(ms, F(ms, m, "%s"), buf) == -1)
|
|
return -1;
|
|
break;
|
|
default:
|
|
- if (file_printf(ms, F(m->desc, "%hu"),
|
|
+ if (file_printf(ms, F(ms, m, "%u"),
|
|
(unsigned short) v) == -1)
|
|
return -1;
|
|
break;
|
|
@@ -454,13 +462,12 @@
|
|
case -1:
|
|
return -1;
|
|
case 1:
|
|
- (void)snprintf(buf, sizeof(buf), "%u", (uint32_t)v);
|
|
- if (file_printf(ms, F(m->desc, "%s"), buf) == -1)
|
|
+ (void)snprintf(buf, sizeof(buf), "%u", (uint32_t) v);
|
|
+ if (file_printf(ms, F(ms, m, "%s"), buf) == -1)
|
|
return -1;
|
|
break;
|
|
default:
|
|
- if (file_printf(ms, F(m->desc, "%u"),
|
|
- (uint32_t) v) == -1)
|
|
+ if (file_printf(ms, F(ms, m, "%u"), (uint32_t) v) == -1)
|
|
return -1;
|
|
break;
|
|
}
|
|
@@ -475,13 +482,13 @@
|
|
case -1:
|
|
return -1;
|
|
case 1:
|
|
- (void)snprintf(buf, sizeof(buf), "%llu",
|
|
+ (void)snprintf(buf, sizeof(buf), "%" INT64_T_FORMAT "u",
|
|
(unsigned long long)v);
|
|
- if (file_printf(ms, F(m->desc, "%s"), buf) == -1)
|
|
+ if (file_printf(ms, F(ms, m, "%s"), buf) == -1)
|
|
return -1;
|
|
break;
|
|
default:
|
|
- if (file_printf(ms, F(m->desc, "%llu"),
|
|
+ if (file_printf(ms, F(ms, m, "%" INT64_T_FORMAT "u"),
|
|
(unsigned long long) v) == -1)
|
|
return -1;
|
|
break;
|
|
@@ -494,7 +501,7 @@
|
|
case FILE_BESTRING16:
|
|
case FILE_LESTRING16:
|
|
if (m->reln == '=' || m->reln == '!') {
|
|
- if (file_printf(ms, F(m->desc, "%s"), m->value.s) == -1)
|
|
+ if (file_printf(ms, F(ms, m, "%s"), m->value.s) == -1)
|
|
return -1;
|
|
t = ms->offset + m->vallen;
|
|
}
|
|
@@ -520,7 +527,7 @@
|
|
*++last = '\0';
|
|
}
|
|
|
|
- if (file_printf(ms, F(m->desc, "%s"), str) == -1)
|
|
+ if (file_printf(ms, F(ms, m, "%s"), str) == -1)
|
|
return -1;
|
|
|
|
if (m->type == FILE_PSTRING)
|
|
@@ -532,7 +539,7 @@
|
|
case FILE_BEDATE:
|
|
case FILE_LEDATE:
|
|
case FILE_MEDATE:
|
|
- if (file_printf(ms, F(m->desc, "%s"),
|
|
+ if (file_printf(ms, F(ms, m, "%s"),
|
|
file_fmttime(p->l, FILE_T_LOCAL, tbuf)) == -1)
|
|
return -1;
|
|
t = ms->offset + sizeof(uint32_t);
|
|
@@ -542,7 +549,7 @@
|
|
case FILE_BELDATE:
|
|
case FILE_LELDATE:
|
|
case FILE_MELDATE:
|
|
- if (file_printf(ms, F(m->desc, "%s"),
|
|
+ if (file_printf(ms, F(ms, m, "%s"),
|
|
file_fmttime(p->l, 0, tbuf)) == -1)
|
|
return -1;
|
|
t = ms->offset + sizeof(uint32_t);
|
|
@@ -551,7 +558,7 @@
|
|
case FILE_QDATE:
|
|
case FILE_BEQDATE:
|
|
case FILE_LEQDATE:
|
|
- if (file_printf(ms, F(m->desc, "%s"),
|
|
+ if (file_printf(ms, F(ms, m, "%s"),
|
|
file_fmttime(p->q, FILE_T_LOCAL, tbuf)) == -1)
|
|
return -1;
|
|
t = ms->offset + sizeof(uint64_t);
|
|
@@ -560,7 +567,7 @@
|
|
case FILE_QLDATE:
|
|
case FILE_BEQLDATE:
|
|
case FILE_LEQLDATE:
|
|
- if (file_printf(ms, F(m->desc, "%s"),
|
|
+ if (file_printf(ms, F(ms, m, "%s"),
|
|
file_fmttime(p->q, 0, tbuf)) == -1)
|
|
return -1;
|
|
t = ms->offset + sizeof(uint64_t);
|
|
@@ -569,7 +576,7 @@
|
|
case FILE_QWDATE:
|
|
case FILE_BEQWDATE:
|
|
case FILE_LEQWDATE:
|
|
- if (file_printf(ms, F(m->desc, "%s"),
|
|
+ if (file_printf(ms, F(ms, m, "%s"),
|
|
file_fmttime(p->q, FILE_T_WINDOWS, tbuf)) == -1)
|
|
return -1;
|
|
t = ms->offset + sizeof(uint64_t);
|
|
@@ -584,11 +591,11 @@
|
|
return -1;
|
|
case 1:
|
|
(void)snprintf(buf, sizeof(buf), "%g", vf);
|
|
- if (file_printf(ms, F(m->desc, "%s"), buf) == -1)
|
|
+ if (file_printf(ms, F(ms, m, "%s"), buf) == -1)
|
|
return -1;
|
|
break;
|
|
default:
|
|
- if (file_printf(ms, F(m->desc, "%g"), vf) == -1)
|
|
+ if (file_printf(ms, F(ms, m, "%g"), vf) == -1)
|
|
return -1;
|
|
break;
|
|
}
|
|
@@ -604,11 +611,11 @@
|
|
return -1;
|
|
case 1:
|
|
(void)snprintf(buf, sizeof(buf), "%g", vd);
|
|
- if (file_printf(ms, F(m->desc, "%s"), buf) == -1)
|
|
+ if (file_printf(ms, F(ms, m, "%s"), buf) == -1)
|
|
return -1;
|
|
break;
|
|
default:
|
|
- if (file_printf(ms, F(m->desc, "%g"), vd) == -1)
|
|
+ if (file_printf(ms, F(ms, m, "%g"), vd) == -1)
|
|
return -1;
|
|
break;
|
|
}
|
|
@@ -624,7 +631,7 @@
|
|
file_oomem(ms, ms->search.rm_len);
|
|
return -1;
|
|
}
|
|
- rval = file_printf(ms, F(m->desc, "%s"), cp);
|
|
+ rval = file_printf(ms, F(ms, m, "%s"), cp);
|
|
free(cp);
|
|
|
|
if (rval == -1)
|
|
@@ -638,7 +645,7 @@
|
|
}
|
|
|
|
case FILE_SEARCH:
|
|
- if (file_printf(ms, F(m->desc, "%s"), m->value.s) == -1)
|
|
+ if (file_printf(ms, F(ms, m, "%s"), m->value.s) == -1)
|
|
return -1;
|
|
if ((m->str_flags & REGEX_OFFSET_START))
|
|
t = ms->search.offset;
|
|
@@ -1160,6 +1167,7 @@
|
|
{
|
|
uint32_t soffset, offset = ms->offset;
|
|
uint32_t count = m->str_range;
|
|
+ uint32_t lhs;
|
|
int rv, oneed_separator, in_type;
|
|
char *sbuf, *rbuf;
|
|
union VALUETYPE *p = &ms->ms_value;
|
|
@@ -1262,104 +1270,72 @@
|
|
case FILE_BESHORT:
|
|
if (OFFSET_OOB(nbytes, offset, 2))
|
|
return 0;
|
|
+ lhs = (p->hs[0] << 8) | p->hs[1];
|
|
if (off) {
|
|
switch (m->in_op & FILE_OPS_MASK) {
|
|
case FILE_OPAND:
|
|
- offset = (short)((p->hs[0]<<8)|
|
|
- (p->hs[1])) &
|
|
- off;
|
|
+ offset = lhs & off;
|
|
break;
|
|
case FILE_OPOR:
|
|
- offset = (short)((p->hs[0]<<8)|
|
|
- (p->hs[1])) |
|
|
- off;
|
|
+ offset = lhs | off;
|
|
break;
|
|
case FILE_OPXOR:
|
|
- offset = (short)((p->hs[0]<<8)|
|
|
- (p->hs[1])) ^
|
|
- off;
|
|
+ offset = lhs ^ off;
|
|
break;
|
|
case FILE_OPADD:
|
|
- offset = (short)((p->hs[0]<<8)|
|
|
- (p->hs[1])) +
|
|
- off;
|
|
+ offset = lhs + off;
|
|
break;
|
|
case FILE_OPMINUS:
|
|
- offset = (short)((p->hs[0]<<8)|
|
|
- (p->hs[1])) -
|
|
- off;
|
|
+ offset = lhs - off;
|
|
break;
|
|
case FILE_OPMULTIPLY:
|
|
- offset = (short)((p->hs[0]<<8)|
|
|
- (p->hs[1])) *
|
|
- off;
|
|
+ offset = lhs * off;
|
|
break;
|
|
case FILE_OPDIVIDE:
|
|
- offset = (short)((p->hs[0]<<8)|
|
|
- (p->hs[1])) /
|
|
- off;
|
|
+ offset = lhs / off;
|
|
break;
|
|
case FILE_OPMODULO:
|
|
- offset = (short)((p->hs[0]<<8)|
|
|
- (p->hs[1])) %
|
|
- off;
|
|
+ offset = lhs % off;
|
|
break;
|
|
}
|
|
} else
|
|
- offset = (short)((p->hs[0]<<8)|
|
|
- (p->hs[1]));
|
|
+ offset = lhs;
|
|
if (m->in_op & FILE_OPINVERSE)
|
|
offset = ~offset;
|
|
break;
|
|
case FILE_LESHORT:
|
|
if (OFFSET_OOB(nbytes, offset, 2))
|
|
return 0;
|
|
+ lhs = (p->hs[1] << 8) | p->hs[0];
|
|
if (off) {
|
|
switch (m->in_op & FILE_OPS_MASK) {
|
|
case FILE_OPAND:
|
|
- offset = (short)((p->hs[1]<<8)|
|
|
- (p->hs[0])) &
|
|
- off;
|
|
+ offset = lhs & off;
|
|
break;
|
|
case FILE_OPOR:
|
|
- offset = (short)((p->hs[1]<<8)|
|
|
- (p->hs[0])) |
|
|
- off;
|
|
+ offset = lhs | off;
|
|
break;
|
|
case FILE_OPXOR:
|
|
- offset = (short)((p->hs[1]<<8)|
|
|
- (p->hs[0])) ^
|
|
- off;
|
|
+ offset = lhs ^ off;
|
|
break;
|
|
case FILE_OPADD:
|
|
- offset = (short)((p->hs[1]<<8)|
|
|
- (p->hs[0])) +
|
|
- off;
|
|
+ offset = lhs + off;
|
|
break;
|
|
case FILE_OPMINUS:
|
|
- offset = (short)((p->hs[1]<<8)|
|
|
- (p->hs[0])) -
|
|
- off;
|
|
+ offset = lhs - off;
|
|
break;
|
|
case FILE_OPMULTIPLY:
|
|
- offset = (short)((p->hs[1]<<8)|
|
|
- (p->hs[0])) *
|
|
- off;
|
|
+ offset = lhs * off;
|
|
break;
|
|
case FILE_OPDIVIDE:
|
|
- offset = (short)((p->hs[1]<<8)|
|
|
- (p->hs[0])) /
|
|
- off;
|
|
+ offset = lhs / off;
|
|
break;
|
|
case FILE_OPMODULO:
|
|
- offset = (short)((p->hs[1]<<8)|
|
|
- (p->hs[0])) %
|
|
- off;
|
|
+ offset = lhs % off;
|
|
break;
|
|
}
|
|
} else
|
|
- offset = (short)((p->hs[1]<<8)|
|
|
- (p->hs[0]));
|
|
+ offset = lhs;
|
|
if (m->in_op & FILE_OPINVERSE)
|
|
offset = ~offset;
|
|
break;
|
|
@@ -1403,70 +1379,37 @@
|
|
case FILE_BEID3:
|
|
if (OFFSET_OOB(nbytes, offset, 4))
|
|
return 0;
|
|
+ lhs = (p->hl[0] << 24) | (p->hl[1] << 16) |
|
|
+ (p->hl[2] << 8) | p->hl[3];
|
|
if (off) {
|
|
switch (m->in_op & FILE_OPS_MASK) {
|
|
case FILE_OPAND:
|
|
- offset = (int32_t)((p->hl[0]<<24)|
|
|
- (p->hl[1]<<16)|
|
|
- (p->hl[2]<<8)|
|
|
- (p->hl[3])) &
|
|
- off;
|
|
+ offset = lhs & off;
|
|
break;
|
|
case FILE_OPOR:
|
|
- offset = (int32_t)((p->hl[0]<<24)|
|
|
- (p->hl[1]<<16)|
|
|
- (p->hl[2]<<8)|
|
|
- (p->hl[3])) |
|
|
- off;
|
|
+ offset = lhs | off;
|
|
break;
|
|
case FILE_OPXOR:
|
|
- offset = (int32_t)((p->hl[0]<<24)|
|
|
- (p->hl[1]<<16)|
|
|
- (p->hl[2]<<8)|
|
|
- (p->hl[3])) ^
|
|
- off;
|
|
+ offset = lhs ^ off;
|
|
break;
|
|
case FILE_OPADD:
|
|
- offset = (int32_t)((p->hl[0]<<24)|
|
|
- (p->hl[1]<<16)|
|
|
- (p->hl[2]<<8)|
|
|
- (p->hl[3])) +
|
|
- off;
|
|
+ offset = lhs + off;
|
|
break;
|
|
case FILE_OPMINUS:
|
|
- offset = (int32_t)((p->hl[0]<<24)|
|
|
- (p->hl[1]<<16)|
|
|
- (p->hl[2]<<8)|
|
|
- (p->hl[3])) -
|
|
- off;
|
|
+ offset = lhs - off;
|
|
break;
|
|
case FILE_OPMULTIPLY:
|
|
- offset = (int32_t)((p->hl[0]<<24)|
|
|
- (p->hl[1]<<16)|
|
|
- (p->hl[2]<<8)|
|
|
- (p->hl[3])) *
|
|
- off;
|
|
+ offset = lhs * off;
|
|
break;
|
|
case FILE_OPDIVIDE:
|
|
- offset = (int32_t)((p->hl[0]<<24)|
|
|
- (p->hl[1]<<16)|
|
|
- (p->hl[2]<<8)|
|
|
- (p->hl[3])) /
|
|
- off;
|
|
+ offset = lhs / off;
|
|
break;
|
|
case FILE_OPMODULO:
|
|
- offset = (int32_t)((p->hl[0]<<24)|
|
|
- (p->hl[1]<<16)|
|
|
- (p->hl[2]<<8)|
|
|
- (p->hl[3])) %
|
|
- off;
|
|
+ offset = lhs % off;
|
|
break;
|
|
}
|
|
} else
|
|
- offset = (int32_t)((p->hl[0]<<24)|
|
|
- (p->hl[1]<<16)|
|
|
- (p->hl[2]<<8)|
|
|
- (p->hl[3]));
|
|
+ offset = lhs;
|
|
if (m->in_op & FILE_OPINVERSE)
|
|
offset = ~offset;
|
|
break;
|
|
@@ -1474,140 +1417,74 @@
|
|
case FILE_LEID3:
|
|
if (OFFSET_OOB(nbytes, offset, 4))
|
|
return 0;
|
|
+ lhs = (p->hl[3] << 24) | (p->hl[2] << 16) |
|
|
+ (p->hl[1] << 8) | p->hl[0];
|
|
if (off) {
|
|
switch (m->in_op & FILE_OPS_MASK) {
|
|
case FILE_OPAND:
|
|
- offset = (int32_t)((p->hl[3]<<24)|
|
|
- (p->hl[2]<<16)|
|
|
- (p->hl[1]<<8)|
|
|
- (p->hl[0])) &
|
|
- off;
|
|
+ offset = lhs & off;
|
|
break;
|
|
case FILE_OPOR:
|
|
- offset = (int32_t)((p->hl[3]<<24)|
|
|
- (p->hl[2]<<16)|
|
|
- (p->hl[1]<<8)|
|
|
- (p->hl[0])) |
|
|
- off;
|
|
+ offset = lhs | off;
|
|
break;
|
|
case FILE_OPXOR:
|
|
- offset = (int32_t)((p->hl[3]<<24)|
|
|
- (p->hl[2]<<16)|
|
|
- (p->hl[1]<<8)|
|
|
- (p->hl[0])) ^
|
|
- off;
|
|
+ offset = lhs ^ off;
|
|
break;
|
|
case FILE_OPADD:
|
|
- offset = (int32_t)((p->hl[3]<<24)|
|
|
- (p->hl[2]<<16)|
|
|
- (p->hl[1]<<8)|
|
|
- (p->hl[0])) +
|
|
- off;
|
|
+ offset = lhs + off;
|
|
break;
|
|
case FILE_OPMINUS:
|
|
- offset = (int32_t)((p->hl[3]<<24)|
|
|
- (p->hl[2]<<16)|
|
|
- (p->hl[1]<<8)|
|
|
- (p->hl[0])) -
|
|
- off;
|
|
+ offset = lhs - off;
|
|
break;
|
|
case FILE_OPMULTIPLY:
|
|
- offset = (int32_t)((p->hl[3]<<24)|
|
|
- (p->hl[2]<<16)|
|
|
- (p->hl[1]<<8)|
|
|
- (p->hl[0])) *
|
|
- off;
|
|
+ offset = lhs * off;
|
|
break;
|
|
case FILE_OPDIVIDE:
|
|
- offset = (int32_t)((p->hl[3]<<24)|
|
|
- (p->hl[2]<<16)|
|
|
- (p->hl[1]<<8)|
|
|
- (p->hl[0])) /
|
|
- off;
|
|
+ offset = lhs / off;
|
|
break;
|
|
case FILE_OPMODULO:
|
|
- offset = (int32_t)((p->hl[3]<<24)|
|
|
- (p->hl[2]<<16)|
|
|
- (p->hl[1]<<8)|
|
|
- (p->hl[0])) %
|
|
- off;
|
|
+ offset = lhs % off;
|
|
break;
|
|
}
|
|
} else
|
|
- offset = (int32_t)((p->hl[3]<<24)|
|
|
- (p->hl[2]<<16)|
|
|
- (p->hl[1]<<8)|
|
|
- (p->hl[0]));
|
|
+ offset = lhs;
|
|
if (m->in_op & FILE_OPINVERSE)
|
|
offset = ~offset;
|
|
break;
|
|
case FILE_MELONG:
|
|
if (OFFSET_OOB(nbytes, offset, 4))
|
|
return 0;
|
|
+ lhs = (p->hl[1] << 24) | (p->hl[0] << 16) |
|
|
+ (p->hl[3] << 8) | p->hl[2];
|
|
if (off) {
|
|
switch (m->in_op & FILE_OPS_MASK) {
|
|
case FILE_OPAND:
|
|
- offset = (int32_t)((p->hl[1]<<24)|
|
|
- (p->hl[0]<<16)|
|
|
- (p->hl[3]<<8)|
|
|
- (p->hl[2])) &
|
|
- off;
|
|
+ offset = lhs & off;
|
|
break;
|
|
case FILE_OPOR:
|
|
- offset = (int32_t)((p->hl[1]<<24)|
|
|
- (p->hl[0]<<16)|
|
|
- (p->hl[3]<<8)|
|
|
- (p->hl[2])) |
|
|
- off;
|
|
+ offset = lhs | off;
|
|
break;
|
|
case FILE_OPXOR:
|
|
- offset = (int32_t)((p->hl[1]<<24)|
|
|
- (p->hl[0]<<16)|
|
|
- (p->hl[3]<<8)|
|
|
- (p->hl[2])) ^
|
|
- off;
|
|
+ offset = lhs ^ off;
|
|
break;
|
|
case FILE_OPADD:
|
|
- offset = (int32_t)((p->hl[1]<<24)|
|
|
- (p->hl[0]<<16)|
|
|
- (p->hl[3]<<8)|
|
|
- (p->hl[2])) +
|
|
- off;
|
|
+ offset = lhs + off;
|
|
break;
|
|
case FILE_OPMINUS:
|
|
- offset = (int32_t)((p->hl[1]<<24)|
|
|
- (p->hl[0]<<16)|
|
|
- (p->hl[3]<<8)|
|
|
- (p->hl[2])) -
|
|
- off;
|
|
+ offset = lhs - off;
|
|
break;
|
|
case FILE_OPMULTIPLY:
|
|
- offset = (int32_t)((p->hl[1]<<24)|
|
|
- (p->hl[0]<<16)|
|
|
- (p->hl[3]<<8)|
|
|
- (p->hl[2])) *
|
|
- off;
|
|
+ offset = lhs * off;
|
|
break;
|
|
case FILE_OPDIVIDE:
|
|
- offset = (int32_t)((p->hl[1]<<24)|
|
|
- (p->hl[0]<<16)|
|
|
- (p->hl[3]<<8)|
|
|
- (p->hl[2])) /
|
|
- off;
|
|
+ offset = lhs / off;
|
|
break;
|
|
case FILE_OPMODULO:
|
|
- offset = (int32_t)((p->hl[1]<<24)|
|
|
- (p->hl[0]<<16)|
|
|
- (p->hl[3]<<8)|
|
|
- (p->hl[2])) %
|
|
- off;
|
|
+ offset = lhs % off;
|
|
break;
|
|
}
|
|
} else
|
|
- offset = (int32_t)((p->hl[1]<<24)|
|
|
- (p->hl[0]<<16)|
|
|
- (p->hl[3]<<8)|
|
|
- (p->hl[2]));
|
|
+ offset = lhs;
|
|
if (m->in_op & FILE_OPINVERSE)
|
|
offset = ~offset;
|
|
break;
|
|
@@ -1756,7 +1633,7 @@
|
|
ms->offset = soffset;
|
|
if (rv == 1) {
|
|
if ((ms->flags & (MAGIC_MIME|MAGIC_APPLE)) == 0 &&
|
|
- file_printf(ms, F(m->desc, "%u"), offset) == -1) {
|
|
+ file_printf(ms, F(ms, m, "%u"), offset) == -1) {
|
|
free(rbuf);
|
|
return -1;
|
|
}
|
|
@@ -1889,7 +1766,6 @@
|
|
double dl, dv;
|
|
int matched;
|
|
union VALUETYPE *p = &ms->ms_value;
|
|
- char *old_lc_ctype;
|
|
|
|
switch (m->type) {
|
|
case FILE_BYTE:
|
|
@@ -1959,7 +1835,6 @@
|
|
break;
|
|
|
|
default:
|
|
- matched = 0;
|
|
file_magerror(ms, "cannot happen with float: invalid relation `%c'",
|
|
m->reln);
|
|
return -1;
|
|
@@ -1993,7 +1868,6 @@
|
|
break;
|
|
|
|
default:
|
|
- matched = 0;
|
|
file_magerror(ms, "cannot happen with double: invalid relation `%c'", m->reln);
|
|
return -1;
|
|
}
|
|
@@ -2042,28 +1916,19 @@
|
|
}
|
|
case FILE_REGEX: {
|
|
int rc;
|
|
- regex_t rx;
|
|
- char errmsg[512];
|
|
+ file_regex_t rx;
|
|
|
|
if (ms->search.s == NULL)
|
|
return 0;
|
|
|
|
- old_lc_ctype = setlocale(LC_CTYPE, NULL);
|
|
- assert(old_lc_ctype != NULL);
|
|
- old_lc_ctype = strdup(old_lc_ctype);
|
|
- assert(old_lc_ctype != NULL);
|
|
- (void)setlocale(LC_CTYPE, "C");
|
|
l = 0;
|
|
- rc = regcomp(&rx, m->value.s,
|
|
+ rc = file_regcomp(&rx, m->value.s,
|
|
REG_EXTENDED|REG_NEWLINE|
|
|
((m->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0));
|
|
if (rc) {
|
|
- (void)regerror(rc, &rx, errmsg, sizeof(errmsg));
|
|
- file_magerror(ms, "regex error %d, (%s)",
|
|
- rc, errmsg);
|
|
+ file_regerror(&rx, rc, ms);
|
|
v = (uint64_t)-1;
|
|
- }
|
|
- else {
|
|
+ } else {
|
|
regmatch_t pmatch[1];
|
|
#ifndef REG_STARTEND
|
|
#define REG_STARTEND 0
|
|
@@ -2074,7 +1939,7 @@
|
|
pmatch[0].rm_so = 0;
|
|
pmatch[0].rm_eo = ms->search.s_len;
|
|
#endif
|
|
- rc = regexec(&rx, (const char *)ms->search.s,
|
|
+ rc = file_regexec(&rx, (const char *)ms->search.s,
|
|
1, pmatch, REG_STARTEND);
|
|
#if REG_STARTEND == 0
|
|
((char *)(intptr_t)ms->search.s)[l] = c;
|
|
@@ -2093,16 +1958,12 @@
|
|
break;
|
|
|
|
default:
|
|
- (void)regerror(rc, &rx, errmsg, sizeof(errmsg));
|
|
- file_magerror(ms, "regexec error %d, (%s)",
|
|
- rc, errmsg);
|
|
+ file_regerror(&rx, rc, ms);
|
|
v = (uint64_t)-1;
|
|
break;
|
|
}
|
|
- regfree(&rx);
|
|
}
|
|
- (void)setlocale(LC_CTYPE, old_lc_ctype);
|
|
- free(old_lc_ctype);
|
|
+ file_regfree(&rx);
|
|
if (v == (uint64_t)-1)
|
|
return -1;
|
|
break;
|
|
@@ -2199,7 +2060,6 @@
|
|
break;
|
|
|
|
default:
|
|
- matched = 0;
|
|
file_magerror(ms, "cannot happen: invalid relation `%c'",
|
|
m->reln);
|
|
return -1;
|
|
diff -urN file-5.18.orig/src/strcasestr.c file-master/src/strcasestr.c
|
|
--- file-5.18.orig/src/strcasestr.c 2013-12-05 20:57:50.000000000 +0400
|
|
+++ file-master/src/strcasestr.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -37,6 +37,8 @@
|
|
__RCSID("$NetBSD: strncasecmp.c,v 1.2 2007/06/04 18:19:27 christos Exp $");
|
|
#endif /* LIBC_SCCS and not lint */
|
|
|
|
+#include "file.h"
|
|
+
|
|
#include <assert.h>
|
|
#include <ctype.h>
|
|
#include <string.h>
|
|
diff -urN file-5.18.orig/src/tar.h file-master/src/tar.h
|
|
--- file-5.18.orig/src/tar.h 2012-06-21 02:19:55.000000000 +0400
|
|
+++ file-master/src/tar.h 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -32,7 +32,7 @@
|
|
*
|
|
* Created 25 August 1985 by John Gilmore, ihnp4!hoptoad!gnu.
|
|
*
|
|
- * $File: tar.h,v 1.13 2010/11/30 14:58:53 rrt Exp $ # checkin only
|
|
+ * $File: tar.h,v 1.12 2008/02/07 00:58:52 christos Exp $ # checkin only
|
|
*/
|
|
|
|
/*
|
|
diff -urN file-5.18.orig/src/teststrchr.c file-master/src/teststrchr.c
|
|
--- file-5.18.orig/src/teststrchr.c 1970-01-01 03:00:00.000000000 +0300
|
|
+++ file-master/src/teststrchr.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -0,0 +1,20 @@
|
|
+#ifdef TEST
|
|
+#include <stdio.h>
|
|
+#include <err.h>
|
|
+#include <string.h>
|
|
+int
|
|
+main(void)
|
|
+{
|
|
+ char *strchr();
|
|
+
|
|
+ if (strchr(1, "abc", 'c') == NULL)
|
|
+ errx(1, "error 1");
|
|
+ if (strchr("abc", 'd') != NULL)
|
|
+ errx(1, "error 2");
|
|
+ if (strchr("abc", 'a') == NULL)
|
|
+ errx(1, "error 3");
|
|
+ if (strchr("abc", 'c') == NULL)
|
|
+ errx(1, "error 4");
|
|
+ return 0;
|
|
+}
|
|
+#endif
|
|
diff -urN file-5.18.orig/src/vasprintf.c file-master/src/vasprintf.c
|
|
--- file-5.18.orig/src/vasprintf.c 2012-08-09 20:40:04.000000000 +0400
|
|
+++ file-master/src/vasprintf.c 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -108,7 +108,7 @@
|
|
#include "file.h"
|
|
|
|
#ifndef lint
|
|
-FILE_RCSID("@(#)$File: vasprintf.c,v 1.10 2012/08/09 16:40:04 christos Exp $")
|
|
+FILE_RCSID("@(#)$File: vasprintf.c,v 1.11 2014/04/17 12:45:50 christos Exp $")
|
|
#endif /* lint */
|
|
|
|
#include <assert.h>
|
|
@@ -559,7 +559,7 @@
|
|
*/
|
|
static int core(xprintf_struct *s)
|
|
{
|
|
- size_t len, save_len;
|
|
+ size_t save_len;
|
|
char *dummy_base;
|
|
|
|
/* basic checks */
|
|
@@ -584,8 +584,7 @@
|
|
for (;;) {
|
|
/* up to end of source string */
|
|
if (*(s->src_string) == 0) {
|
|
- *(s->dest_string) = 0; /* final 0 */
|
|
- len = s->real_len + 1;
|
|
+ *(s->dest_string) = '\0'; /* final NUL */
|
|
break;
|
|
}
|
|
|
|
@@ -594,15 +593,13 @@
|
|
|
|
/* up to end of dest string */
|
|
if (s->real_len >= s->maxlen) {
|
|
- (s->buffer_base)[s->maxlen] = 0; /* final 0 */
|
|
- len = s->maxlen + 1;
|
|
+ (s->buffer_base)[s->maxlen] = '\0'; /* final NUL */
|
|
break;
|
|
}
|
|
}
|
|
|
|
/* for (v)asnprintf */
|
|
dummy_base = s->buffer_base;
|
|
- save_len = 0; /* just to avoid a compiler warning */
|
|
|
|
dummy_base = s->buffer_base + s->real_len;
|
|
save_len = s->real_len;
|
|
@@ -639,7 +636,7 @@
|
|
#ifdef __va_copy
|
|
__va_copy (s.vargs, vargs);
|
|
#else
|
|
- memcpy (&s.vargs, vargs, sizeof (va_list));
|
|
+ memcpy (&s.vargs, &vargs, sizeof (s.va_args));
|
|
#endif /* __va_copy */
|
|
#endif /* va_copy */
|
|
s.maxlen = (size_t)INT_MAX;
|
|
diff -urN file-5.18.orig/tests/CVE-2014-1943.result file-master/tests/CVE-2014-1943.result
|
|
--- file-5.18.orig/tests/CVE-2014-1943.result 1970-01-01 03:00:00.000000000 +0300
|
|
+++ file-master/tests/CVE-2014-1943.result 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -0,0 +1 @@
|
|
+ASCII text, with no line terminators
|
|
\ No newline at end of file
|
|
Binary files file-5.18.orig/tests/CVE-2014-1943.testfile and file-master/tests/CVE-2014-1943.testfile differ
|
|
diff -urN file-5.18.orig/visibility.m4 file-master/visibility.m4
|
|
--- file-5.18.orig/visibility.m4 1970-01-01 03:00:00.000000000 +0300
|
|
+++ file-master/visibility.m4 2014-05-15 05:24:58.000000000 +0400
|
|
@@ -0,0 +1,77 @@
|
|
+# visibility.m4 serial 4 (gettext-0.18.2)
|
|
+dnl Copyright (C) 2005, 2008, 2010-2012 Free Software Foundation, Inc.
|
|
+dnl This file is free software; the Free Software Foundation
|
|
+dnl gives unlimited permission to copy and/or distribute it,
|
|
+dnl with or without modifications, as long as this notice is preserved.
|
|
+
|
|
+dnl From Bruno Haible.
|
|
+
|
|
+dnl Tests whether the compiler supports the command-line option
|
|
+dnl -fvisibility=hidden and the function and variable attributes
|
|
+dnl __attribute__((__visibility__("hidden"))) and
|
|
+dnl __attribute__((__visibility__("default"))).
|
|
+dnl Does *not* test for __visibility__("protected") - which has tricky
|
|
+dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
|
|
+dnl MacOS X.
|
|
+dnl Does *not* test for __visibility__("internal") - which has processor
|
|
+dnl dependent semantics.
|
|
+dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
|
|
+dnl "really only recommended for legacy code".
|
|
+dnl Set the variable CFLAG_VISIBILITY.
|
|
+dnl Defines and sets the variable HAVE_VISIBILITY.
|
|
+
|
|
+AC_DEFUN([gl_VISIBILITY],
|
|
+[
|
|
+ AC_REQUIRE([AC_PROG_CC])
|
|
+ CFLAG_VISIBILITY=
|
|
+ HAVE_VISIBILITY=0
|
|
+ if test -n "$GCC"; then
|
|
+ dnl First, check whether -Werror can be added to the command line, or
|
|
+ dnl whether it leads to an error because of some other option that the
|
|
+ dnl user has put into $CC $CFLAGS $CPPFLAGS.
|
|
+ AC_MSG_CHECKING([whether the -Werror option is usable])
|
|
+ AC_CACHE_VAL([gl_cv_cc_vis_werror], [
|
|
+ gl_save_CFLAGS="$CFLAGS"
|
|
+ CFLAGS="$CFLAGS -Werror"
|
|
+ AC_COMPILE_IFELSE(
|
|
+ [AC_LANG_PROGRAM([[]], [[]])],
|
|
+ [gl_cv_cc_vis_werror=yes],
|
|
+ [gl_cv_cc_vis_werror=no])
|
|
+ CFLAGS="$gl_save_CFLAGS"])
|
|
+ AC_MSG_RESULT([$gl_cv_cc_vis_werror])
|
|
+ dnl Now check whether visibility declarations are supported.
|
|
+ AC_MSG_CHECKING([for simple visibility declarations])
|
|
+ AC_CACHE_VAL([gl_cv_cc_visibility], [
|
|
+ gl_save_CFLAGS="$CFLAGS"
|
|
+ CFLAGS="$CFLAGS -fvisibility=hidden"
|
|
+ dnl We use the option -Werror and a function dummyfunc, because on some
|
|
+ dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
|
|
+ dnl "visibility attribute not supported in this configuration; ignored"
|
|
+ dnl at the first function definition in every compilation unit, and we
|
|
+ dnl don't want to use the option in this case.
|
|
+ if test $gl_cv_cc_vis_werror = yes; then
|
|
+ CFLAGS="$CFLAGS -Werror"
|
|
+ fi
|
|
+ AC_COMPILE_IFELSE(
|
|
+ [AC_LANG_PROGRAM(
|
|
+ [[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
|
|
+ extern __attribute__((__visibility__("default"))) int exportedvar;
|
|
+ extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
|
|
+ extern __attribute__((__visibility__("default"))) int exportedfunc (void);
|
|
+ void dummyfunc (void) {}
|
|
+ ]],
|
|
+ [[]])],
|
|
+ [gl_cv_cc_visibility=yes],
|
|
+ [gl_cv_cc_visibility=no])
|
|
+ CFLAGS="$gl_save_CFLAGS"])
|
|
+ AC_MSG_RESULT([$gl_cv_cc_visibility])
|
|
+ if test $gl_cv_cc_visibility = yes; then
|
|
+ CFLAG_VISIBILITY="-fvisibility=hidden"
|
|
+ HAVE_VISIBILITY=1
|
|
+ fi
|
|
+ fi
|
|
+ AC_SUBST([CFLAG_VISIBILITY])
|
|
+ AC_SUBST([HAVE_VISIBILITY])
|
|
+ AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
|
|
+ [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
|
|
+])
|