[File] [PATCH] Recognize ZIP archives with extra data prepended

Christos Zoulas christos at zoulas.com
Sun Oct 2 12:34:09 UTC 2022


Added, thanks!

christos

> On Oct 2, 2022, at 7:42 AM, Michał Górny <mgorny at gentoo.org> wrote:
> 
> The ZIP format allows prepending arbitrary data to the ZIP file
> (e.g. a SFX stub).  The archiver then recognizes the archive by looking
> up the central directory at the end of ZIP archive.  Teach file(1)
> to recognize it as well through the presence of end-of-central-directory
> record.
> ---
> magic/Magdir/archive | 8 ++++++++
> 1 file changed, 8 insertions(+)
> 
> diff --git a/magic/Magdir/archive b/magic/Magdir/archive
> index 16778356..ca883887 100644
> --- a/magic/Magdir/archive
> +++ b/magic/Magdir/archive
> @@ -1789,6 +1789,14 @@
> !:mime	application/zip
> !:ext zip/cbz
> 
> +# Recognize ZIP archives with prepended data by end-of-central-directory record
> +# https://en.wikipedia.org/wiki/ZIP_(file_format)#End_of_central_directory_record_(EOCD)
> +# by Michał Górny <mgorny at gentoo.org>
> +-2	uleshort	0
> +>&-22	string	PK\005\006	Zip archive, with extra data prepended
> +!:mime	application/zip
> +!:ext zip/cbz
> +
> # ACE archive (from http://www.wotsit.org/download.asp?f=ace)
> # by Stefan `Sec` Zehl <sec at 42.org>
> 7	string		**ACE**		ACE archive data
> --
> 2.37.3
> 
> --
> File mailing list
> File at astron.com
> https://mailman.astron.com/mailman/listinfo/file

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 235 bytes
Desc: Message signed with OpenPGP
URL: <https://mailman.astron.com/pipermail/file/attachments/20221002/5479fcd3/attachment.asc>


More information about the File mailing list