From: Christos Zoulas Date: Tue, 26 Oct 2010 14:08:47 +0000 (+0000) Subject: fixes from cchittleborough+comp.file@cluemail.com ("Christopher Chittleborough") X-Git-Tag: FILE5_05~39 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e373b16dab52ee37c7468e0a6db42ebd5ca60f2e;p=file fixes from cchittleborough+comp.file@cluemail.com ("Christopher Chittleborough") --- diff --git a/magic/Magdir/archive b/magic/Magdir/archive index a41c327d..f9b0520a 100644 --- a/magic/Magdir/archive +++ b/magic/Magdir/archive @@ -1,5 +1,5 @@ #------------------------------------------------------------------------------ -# $File: archive,v 1.59 2010/10/25 22:48:38 christos Exp $ +# $File: archive,v 1.60 2010/10/26 14:08:47 christos Exp $ # archive: file(1) magic for archive formats (see also "msdos" for self- # extracting compressed archives) # @@ -275,7 +275,7 @@ # Splint 0 string \x93\xb9\x06 Splint archive data # InstallShield -0 string \x13\x5d\x65\x8c InstallShield Z archive Data +0 string \x13\x5d\x65\x8c InstallShield Z archive Data # Gather 1 string GTH Gather archive data # BOA @@ -496,7 +496,7 @@ 0 string HPAK HPACK archive data # JAM Archive volume format, by Dmitry.Kohmanyuk@UA.net -0 string \351,\001JAM\ JAM archive, +0 string \351,\001JAM\ JAM archive, >7 string >\0 version %.4s >0x26 byte =0x27 - >>0x2b string >\0 label %.11s, @@ -568,13 +568,17 @@ # Zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu) 0 string PK\003\004 -# Specialised zip formats ->30 string mimetype +# Specialised zip formats which start with a member named 'mimetype' +# (stored uncompressed, with no 'extra field') containing the file's MIME type. +# Check for have 8-byte name, 0-byte extra field, name "mimetype", and +# contents starting with "application/": +>26 string \x8\0\0\0mimetypeapplication/ -# OpenOffice.org / KOffice / StarOffice documents -# From: Abel Cheung +# KOffice / OpenOffice & StarOffice / OpenDocument formats +# From: Abel Cheung -# KOffice (1.2 or above) formats +# KOffice (1.2 or above) formats +# (mimetype contains "application/vnd.kde.") >>50 string vnd.kde. KOffice (>=1.2) >>>58 string karbon Karbon document >>>58 string kchart KChart document @@ -585,8 +589,8 @@ >>>58 string kspread KSpread document >>>58 string kword KWord document -# OpenOffice formats (for OpenOffice 1.x / StarOffice 6/7) -# mimetype contains 'application/vnd.sun.xml.' +# OpenOffice formats (for OpenOffice 1.x / StarOffice 6/7) +# (mimetype contains "application/vnd.sun.xml.") >>50 string vnd.sun.xml. OpenOffice.org 1.x >>>62 string writer Writer >>>>68 byte !0x2e document @@ -604,9 +608,9 @@ >>>62 string math Math document >>>62 string base Database file -# OpenDocument formats (for OpenOffice 2.x / StarOffice >= 8) -# http://lists.oasis-open.org/archives/office/200505/msg00006.html -# mimetype contains 'application/vnd.oasis.opendocument.' +# OpenDocument formats (for OpenOffice 2.x / StarOffice >= 8) +# http://lists.oasis-open.org/archives/office/200505/msg00006.html +# (mimetype contains "application/vnd.oasis.opendocument.") >>50 string vnd.oasis.opendocument. OpenDocument >>>73 string text >>>>77 byte !0x2d Text @@ -650,48 +654,40 @@ >>>>78 string -template Template !:mime application/vnd.oasis.opendocument.image-template -# OEBPS Container Format (OCF) 1.0 ->>50 string epub+zip OEBPS Container Format (OCF) 1.0 (EPUB) +# EPUB (OEBPS) books using OCF (OEBPS Container Format) +# From: Adam Buchbinder +# http://www.idpf.org/ocf/ocf1.0/download/ocf10.htm, section 4. +# (mimetype contains "application/epub+zip") +>>50 string epub+zip EPUB ebook data !:mime application/epub+zip -# Generic zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu) -# N.B. Must come after specialised formats -# Next line simply matches anything, including "mimetype" as used above ->30 byte x ->>4 byte 0x00 Zip archive data -!:mime application/zip ->>4 byte 0x09 Zip archive data, at least v0.9 to extract -!:mime application/zip ->>4 byte 0x0a Zip archive data, at least v1.0 to extract +# Catch other ZIP-with-mimetype formats +# In a ZIP file, the bytes immediately after a member's contents are +# always "PK". The 2 regex rules here print the "mimetype" member's +# contents up to the first 'P'. Luckily, most MIME types don't contain +# any capital 'P's. This is a kludge. +# (mimetype contains "application/") +>>50 string !epub+zip +>>>50 string !vnd.oasis.opendocument. +>>>>50 string !vnd.sun.xml. +>>>>>50 string !vnd.kde. +>>>>>>38 regex [!-OQ-~]+ Zip data (MIME type "%s"?) !:mime application/zip ->>4 byte 0x0b Zip archive data, at least v1.1 to extract +# (mimetype contents other than "application/*") +>26 string \x8\0\0\0mimetype +>>38 string !application/ +>>>38 regex [!-OQ-~]+ Zip data (MIME type "%s"?) !:mime application/zip ->>0x161 string WINZIP Zip archive data, WinZIP self-extracting -!:mime application/zip ->>4 byte 0x14 Zip archive data, at least v2.0 to extract -!:mime application/zip - -# EPUB (OEBPS) books using OCF (Open Container Format) -# From: Adam Buchbinder -# URL: http://www.idpf.org/ocf/ocf1.0/download/ocf10.htm, section 4. ->>38 string application/epub+zip EPUB ebook -!:mime application/epub+zip - -# EPUB documents (.epub eBooks) are also zip archives starting with a -# 'mimetype' member, which contains 'application/epub+zip'. ->>50 string epub+zip epub eBook data -!:mime application/epub+zip - -# Catch other ZIP-with-mimetype formats ->>50 string !epub+zip ->>>50 string !vnd.oasis.opendocument. ->>>>50 string !vnd.sun.xml. ->>>>>50 string !vnd.kde. ->>>>>>38 regex [!-OQ-~]+ Zip data (mimetype "%s"?) ->26 string \x8\0\0\0mimetype ->>38 string !application/ ->>>38 regex [!-OQ-~]+ Zip data (mimetype "%s"?) +# Generic zip archives (Greg Roelofs, c/o zip-bugs@wkuvx1.wku.edu) +# Next line excludes specialized formats: +>26 string !\x8\0\0\0mimetype Zip archive data +!:mime application/zip +>>4 byte 0x09 \b, at least v0.9 to extract +>>4 byte 0x0a \b, at least v1.0 to extract +>>4 byte 0x0b \b, at least v1.1 to extract +>>0x161 string WINZIP \b, WinZIP self-extracting +>>4 byte 0x14 \b, at least v2.0 to extract # Zoo archiver 20 lelong 0xfdc4a7dc Zoo archive data @@ -739,7 +735,7 @@ # GTKtalog catalogs # by David Necas (Yeti) -4 string gtktalog\ GTKtalog catalog data, +4 string gtktalog\ GTKtalog catalog data, >13 string 3 version 3 >>14 beshort 0x677a (gzipped) >>14 beshort !0x677a (not gzipped) @@ -756,12 +752,12 @@ !:mime application/x-bittorrent # Atari MSA archive - Teemu Hukkanen -0 beshort 0x0e0f Atari MSA archive data ->2 beshort x \b, %d sectors per track ->4 beshort 0 \b, 1 sided ->4 beshort 1 \b, 2 sided ->6 beshort x \b, starting track: %d ->8 beshort x \b, ending track: %d +0 beshort 0x0e0f Atari MSA archive data +>2 beshort x \b, %d sectors per track +>4 beshort 0 \b, 1 sided +>4 beshort 1 \b, 2 sided +>6 beshort x \b, starting track: %d +>8 beshort x \b, ending track: %d # Alternate ZIP string (amc@arwen.cs.berkeley.edu) 0 string PK00PK\003\004 Zip archive data @@ -805,8 +801,8 @@ >>0x2A string >\0 : %s # DR-DOS 7.03 Packed File *.??_ -0 string Packed\ File\ Personal NetWare Packed File ->12 string x \b, was "%.12s" +0 string Packed\ File\ Personal NetWare Packed File +>12 string x \b, was "%.12s" # EET archive # From: Tilman Sauerbeck