aboutsummaryrefslogtreecommitdiff
path: root/magic
diff options
context:
space:
mode:
Diffstat (limited to 'magic')
-rw-r--r--magic/Magdir/animation3
-rw-r--r--magic/Magdir/archive315
-rw-r--r--magic/Magdir/aria38
-rw-r--r--magic/Magdir/asf4
-rw-r--r--magic/Magdir/bytecode4
-rw-r--r--magic/Magdir/c64141
-rw-r--r--magic/Magdir/cad4
-rw-r--r--magic/Magdir/ccf14
-rw-r--r--magic/Magdir/commands32
-rw-r--r--magic/Magdir/console103
-rw-r--r--magic/Magdir/ctf2
-rw-r--r--magic/Magdir/database18
-rw-r--r--magic/Magdir/dataone28
-rw-r--r--magic/Magdir/dsf25
-rw-r--r--magic/Magdir/filesystems165
-rw-r--r--magic/Magdir/fonts67
-rw-r--r--magic/Magdir/freebsd22
-rw-r--r--magic/Magdir/games34
-rw-r--r--magic/Magdir/geo10
-rw-r--r--magic/Magdir/iff3
-rw-r--r--magic/Magdir/images2933
-rw-r--r--magic/Magdir/intel204
-rw-r--r--magic/Magdir/javascript14
-rw-r--r--magic/Magdir/linux6
-rw-r--r--magic/Magdir/make29
-rw-r--r--magic/Magdir/mathematica33
-rw-r--r--magic/Magdir/mcrypt16
-rw-r--r--magic/Magdir/msdos38
-rw-r--r--magic/Magdir/msooxml9
-rw-r--r--magic/Magdir/msvc161
-rw-r--r--magic/Magdir/nifty202
-rw-r--r--magic/Magdir/ole2compounddocs101
-rw-r--r--magic/Magdir/oric16
-rw-r--r--magic/Magdir/os24
-rw-r--r--magic/Magdir/palm3
-rw-r--r--magic/Magdir/pci_ids116
-rw-r--r--magic/Magdir/python47
-rw-r--r--magic/Magdir/riff66
-rw-r--r--magic/Magdir/rpi25
-rw-r--r--magic/Magdir/sgml47
-rw-r--r--magic/Magdir/sniffer51
-rw-r--r--magic/Magdir/statistics4
-rw-r--r--magic/Magdir/sysex147
-rw-r--r--magic/Magdir/uuencode18
-rw-r--r--magic/Magdir/virtual8
-rw-r--r--magic/Magdir/windows182
-rw-r--r--magic/Magdir/wordprocessors64
-rw-r--r--magic/Magdir/xwindows6
-rw-r--r--magic/Magdir/zip30
-rw-r--r--magic/Makefile.am8
-rw-r--r--magic/Makefile.in8
51 files changed, 4231 insertions, 1397 deletions
diff --git a/magic/Magdir/animation b/magic/Magdir/animation
index d59497d8005a..28a0f2d217aa 100644
--- a/magic/Magdir/animation
+++ b/magic/Magdir/animation
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: animation,v 1.87 2021/08/24 09:25:11 christos Exp $
+# $File: animation,v 1.88 2022/05/14 22:06:04 christos Exp $
# animation: file(1) magic for animation/movie formats
#
# animation formats
@@ -940,6 +940,7 @@
# DIF digital video file format <mpruett@sgi.com>
0 belong&0xffffff00 0x1f070000 DIF
+!:mime video/x-dv
>4 byte &0x01 (DVCPRO) movie file
>4 byte ^0x01 (DV) movie file
>3 byte &0x80 (PAL)
diff --git a/magic/Magdir/archive b/magic/Magdir/archive
index d4fd3c920d36..fb535ac0ff26 100644
--- a/magic/Magdir/archive
+++ b/magic/Magdir/archive
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
-# $File: archive,v 1.151 2021/08/16 10:19:56 christos Exp $
+# $File: archive,v 1.162 2022/05/27 21:27:59 christos Exp $
# archive: file(1) magic for archive formats (see also "msdos" for self-
# extracting compressed archives)
#
@@ -150,7 +150,7 @@
# Incremental snapshot gnu-tar format from:
# https://www.gnu.org/software/tar/manual/html_node/Snapshot-Files.html
0 string GNU\ tar- GNU tar incremental snapshot data
->&0 regex [0-9]\.[0-9]+-[0-9]+ version %s
+>&0 regex [0-9]\\.[0-9]+-[0-9]+ version %s
# cpio archives
#
@@ -518,46 +518,65 @@
#>-3 ubyte x \b, last 3 bytes 0x%2.2x
#>-2 ubeshort x \b%4.4x
# From: Joerg Jenderek
-# URL: https://wiki.68kmla.org/DiskCopy_4.2_format_specification
+# URL: https://en.wikipedia.org/wiki/Disk_Copy
# reference: http://nulib.com/library/FTN.e00005.htm
0x52 ubeshort 0x0100
# test for disk image size equal or above 400k
>0x40 ubelong >409599
# test also for disk image size equal or below 1440k to skip
# windows7en.mbr UNICODE.DAT
->>0x40 ubelong <1474561
-# To skip Flags$StringJoiner.class with size 00106A61h test also for only 4 disk image sizes
-# 00064000 for 400k GCR disks
-# 000c8000 for 800k GCR disks
-# 000b4000 for 720k MFM disks
-# 00168000 for 1440k MFM disks
->>>0x40 ubelong&0xffE03fFF 0
->>>>0 use dc42-floppy
+#>>0x40 ubelong <1474561
+# test now for "low" disk image size equal or below 64 MiB to skip
+# windows7en.mbr (B441BBAAh) UNICODE.DAT (0400AF05h)
+>>0x40 ubelong <0x04000001
+# To skip Flags$StringJoiner.class with size 00106A61h test also for valid disk image sizes
+# 00064000 for 400k GCR disks dc42-400k-gcr.trid.xml
+# 000c8000 for 800k GCR disks dc42-800k-gcr.trid.xml
+# 000b4000 for 720k MFM disks dc42-720k-mfm.trid.xml
+# 00168000 for 1440k MFM disks dc42-1440k-mfm.trid.xml
+# https://lisaem.sunder.net/LisaProjectDocs.txt
+# 00500000 05M available
+# 00A00000 10M available
+# 01800000 24M possible
+# 02000000 32M uncertain
+# 04000000 64M uncertain
+>>>0x40 ubelong&0xf8003fFF 0
+# skip samples with invalid disk name length like:
+# 181 (biosmd80.rom) 202 (Flags$StringJoiner.class) 90 (UNICODE.DAT)
+>>>>0x0 ubyte <64
+>>>>>0 use dc42-floppy
# display information of Apple DiskCopy 4.2 floppy image
0 name dc42-floppy
-# image pascal name padded with NULs like Microsoft Mail
+# disk name length; maximal 63
+#>0 ubyte x DISK NAME LENGTH %u
+# ASCII image pascal (maximal 63 bytes) name padded with NULs like:
+# "Microsoft Mail" "Disquette 2" "IIe Installer Disk"
+# "-lisaem.sunder.net hd-" (dc42-lisaem.trid.xml) "-not a Macintosh disk" (dc42-nonmac.trid.xml)
>00 pstring/B x Apple DiskCopy 4.2 image %s
#!:mime application/octet-stream
!:mime application/x-dc42-floppy-image
!:apple dCpydImg
-!:ext image/dc42
-# data size in bytes like 409600
+# probably also img like: "Utilitaires 2.img" "Installation 7.img"
+!:ext image/dc42/img
+# data size in bytes like: 409600 737280 819200 1474560
>0x40 ubelong x \b, %u bytes
# for debugging purpose size in hexadecimal
#>0x40 ubelong x (%#8.8x)
-# tag size in bytes
+# tag size in bytes like: 0 (often) 2580h (PUID fmt/625) 4B00h (Microsoft Mail.image)
>0x44 ubelong >0 \b, %#x tag size
# data checksum
#>0x48 ubelong x \b, %#x checksum
# tag checksum
#>0x4c ubelong x \b, %#x tag checksum
-# disk encoding
+# disk encoding like: 0 1 2 3 (PUID: fmt/625)
>0x50 ubyte 0 \b, GCR CLV ssdd (400k)
>0x50 ubyte 1 \b, GCR CLV dsdd (800k)
>0x50 ubyte 2 \b, MFM CAV dsdd (720k)
>0x50 ubyte 3 \b, MFM CAV dshd (1440k)
>0x50 ubyte >3 \b, %#x encoding
-# format byte
+# format byte like: 12h (Lisa 400K) 24h (400K Macintosh) 96h (800K Apple II disk)
+# 2 (Mac 400k "Disquette Installation 13.image")
+# 22h (double-sided MFM or Mac 800k "Disco 12.image" "IIe Installer Disk.image")
>0x51 ubyte x \b, %#x format
#>0x54 ubequad x \b, data %#16.16llx
# ESP, could this conflict with Easy Software Products' (e.g.ESP ghostscript) documentation?
@@ -670,7 +689,15 @@
# 2 bytes: length of data + mentioned bytes
#
# SZDD variant Haruhiko Okumura's LZSS or 7z type MsLZ
+# URL: http://fileformats.archiveteam.org/wiki/MS-DOS_installation_compression
+# Reference: http://www.cabextract.org.uk/libmspack/doc/szdd_kwaj_format.html
+# http://mark0.net/download/triddefs_xml.7z/defs/s/szdd.trid.xml
+# Note: called "Microsoft SZDD compressed (Haruhiko Okumura's LZSS)" by TrID
+# verfied by 7-Zip `7z l -tMsLZ -slt *.??_` as MsLZ
+# `deark -l -m lzss_oku -d2 setup-1-41.bin` as "LZSS.C by Haruhiko Okumura"
>0 string SZDD MS Compress archive data, SZDD variant
+# 2nd part of signature
+#>>4 ubelong 0x88F02733 \b, SIGNATURE OK
!:mime application/x-ms-compress-szdd
!:ext ??_
# The character missing from the end of the filename (0=unknown)
@@ -679,6 +706,24 @@
# Compression mode: "A" (0x41) found but sometimes "B" in Windows 3.1 builds 026 and 034e
>>8 string !A \b, %-.1s method
>>10 ulelong >0 \b, original size: %u bytes
+# Summary: InstallShield archive with SZDD compressed
+# URL: https://community.flexera.com/t5/InstallShield-Knowledge-Base/InstallShield-Redistributable-Files/ta-p/5647
+# From: Joerg Jenderek
+1 search/48/bs SZDD\x88\xF0\x27\x33 InstallShield archive
+#!:mime application/octet-stream
+!:mime application/x-installshield-compress-szdd
+!:ext ibt
+# name of compressed archive member like: setup.dl_ _setup7int.dl_ _setup2k.dl_ _igdi.dl_ cabinet.dl_
+>0 string x %s
+# name of uncompressed archive member like: setup.dll _Setup.dll IGdi.dll CABINET.DLL
+>>&1 string x (%s)
+# probably version like: 9.0.0.333 9.1.0.429 11.50.0.42618
+>>>&1 string x \b, version %s
+# SZDD member length like: 168048 169333 181842
+>>>>&1 string x \b, %s bytes
+# MS Compress archive data
+#>&0 string SZDD \b, SIGNATURE FOUND
+>&0 indirect x
# QBasic SZDD variant
3 string \x88\xf0\x27
>0 string SZ\x20 MS Compress archive data, QBasic variant
@@ -686,6 +731,17 @@
!:ext ??$
>>8 ulelong >0 \b, original size: %u bytes
+# Summary: CAZIP compressed file
+# From: Joerg Jenderek
+# URL: http://fileformats.archiveteam.org/wiki/CAZIP
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/c/caz.trid.xml
+# Note: Format is distinct from CAZIPXP compressed
+0 string \x0D\x0A\x1ACAZIP CAZIP compressed file
+#!:mime application/octet-stream
+!:mime application/x-compress-cazip
+# like: BLINKER.WR_ CLIPDEFS._ CAOSETUP.EX_ CLIPPER.EX_ FILEIO.C_
+!:ext ??_/?_/_
+
# Summary: FTCOMP compressed archive
# From: Joerg Jenderek
# URL: http://fileformats.archiveteam.org/wiki/FTCOMP
@@ -772,13 +828,43 @@
0 string NSK NaShrink archive data
# SAPCAR
0 string #\ CAR\ archive\ header SAPCAR archive data
-0 string CAR\ 2.00RG SAPCAR archive data
+0 string CAR\ 2.00 SAPCAR archive data
+0 string CAR\ 2.01 SAPCAR archive data
+#!:mime application/octet-stream
+!:mime application/vnd.sar
+!:ext sar
# Disintegrator
0 string DST Disintegrator archive data
# ASD
0 string ASD ASD archive data
# InstallShield CAB
-0 string ISc( InstallShield CAB
+# Update: Joerg Jenderek at Nov 2021
+# URL: https://en.wikipedia.org/wiki/InstallShield
+# Reference: https://github.com/twogood/unshield/blob/master/lib/cabfile.h
+# Note: Not compatible with Microsoft CAB files
+# http://mark0.net/download/triddefs_xml.7z/defs/a/ark-cab-ishield.trid.xml
+# CAB_SIGNATURE 0x28635349
+0 string ISc( InstallShield
+#!:mime application/octet-stream
+!:mime application/x-installshield
+# http://mark0.net/download/triddefs_xml.7z/defs/a/ark-cab-ishield-hdr.trid.xml
+>16 ulelong !0 setup header
+# like: _SYS1.HDR _USER1.HDR data1.hdr
+!:ext hdr
+>16 ulelong =0 CAB
+# like: _SYS1.CAB _USER1.CAB DATA1.CAB data2.cab
+!:ext cab
+# https://github.com/twogood/unshield/blob/master/lib/helper.c
+# version like: 0x1005201 0x100600c 0x1007000 0x1009500
+# 0x2000578 0x20005dc 0x2000640 0x40007d0 0x4000834
+>4 ulelong x \b, version %#x
+# volume_info like: 0
+>8 ulelong !0 \b, volume_info %#x
+# cab_descriptor_offset like: 0x200
+>12 ulelong !0x200 \b, offset %#x
+#>0x200 ubequad x \b, at 0x200 %#16.16llx
+# cab_descriptor_size like: 0 (*.cab) BD5 C8B DA5 E2A E36 116C 251D 4DA9 56F0 5CC2 6E4B 777D 779E 1F7C2
+>16 ulelong !0 \b, descriptor size %#x
# TOP4
0 string T4\x1a TOP4 archive data
# BatComp left out: sig looks like COM executable
@@ -925,30 +1011,143 @@
>3 byte&0xf0 0x30
>>3 byte x (v%c)
# JAR archiver (.j), this is the successor to ARJ, not Java's JAR (which is essentially ZIP)
+# Update: Joerg Jenderek
+# URL: http://fileformats.archiveteam.org/wiki/JAR_(ARJ_Software)
+# reference: http://mark0.net/download/triddefs_xml.7z/defs/a/ark-jar.trid.xml
+# https://www.sac.sk/download/pack/jar102x.exe/TECHNOTE.DOC
+# Note: called "JAR compressed archive" by TrID
0xe string \x1aJar\x1b JAR (ARJ Software, Inc.) archive data
+#!:mime application/octet-stream
+!:mime application/x-compress-j
+>0 ulelong x \b, CRC32 %#x
+# standard suffix is ".j"; for multi volumes following order j01 j02 ... j99 100 ... 990
+!:ext j/j01/j02
+# URL: http://fileformats.archiveteam.org/wiki/JARCS
+# reference: http://mark0.net/download/triddefs_xml.7z/defs/a/ark-jarcs.trid.xml
+# Note: called "JARCS compressed archive" by TrID
0 string JARCS JAR (ARJ Software, Inc.) archive data
+#!:mime application/octet-stream
+!:mime application/x-compress-jar
+!:ext jar
# ARJ archiver (jason@jarthur.Claremont.EDU)
-0 leshort 0xea60 ARJ archive data
+# URL: http://fileformats.archiveteam.org/wiki/ARJ
+# reference: http://mark0.net/download/triddefs_xml.7z/defs/a/ark-arj.trid.xml
+# https://github.com/FarGroup/FarManager/
+# blob/master/plugins/multiarc/arc.doc/arj.txt
+# Note: called "ARJ compressed archive" by TrID and
+# "ARJ File Format" by DROID via PUID fmt/610
+# verified by `7z l -tarj PHRACK1.ARJ` and
+# `arj.exe l TEST-hk9.ARJ`
+0 leshort 0xea60
+# skip DROID fmt-610-signature-id-946.arj by check for valid file type of main header
+>0xA ubyte 2
+>>0 use arj-archive
+0 name arj-archive
+>0 leshort x ARJ archive
!:mime application/x-arj
->5 byte x \b, v%d,
->8 byte &0x04 multi-volume,
->8 byte &0x10 slash-switched,
->8 byte &0x20 backup,
->34 string x original name: %s,
->7 byte 0 os: MS-DOS
->7 byte 1 os: PRIMOS
->7 byte 2 os: Unix
->7 byte 3 os: Amiga
->7 byte 4 os: Macintosh
->7 byte 5 os: OS/2
->7 byte 6 os: Apple ][ GS
->7 byte 7 os: Atari ST
->7 byte 8 os: NeXT
->7 byte 9 os: VAX/VMS
->3 byte >0 %d]
+# look for terminating 0-character of filename
+>0x26 search/1024 \0
+# file name extension is normally .arj but not for parts of multi volume
+#>>&-5 string x extension %.4s
+>>&-5 string/c .arj data
+!:ext arj
+>>&-5 default x
+# for multi volume first name is archive.arj then following parts archive.a01 archive.a02 ...
+>>>8 byte &0x04 data
+!:ext a01/a02
+# for SFX first name is archive.exe then following parts archive.e01 archive.e02 ...
+>>>8 byte ^0x04 data, SFX multi-volume
+!:ext e01/e02
+# basic header size like: 0x002b 0x002c 0x04e0 0x04e3 0x04e7
+#>2 uleshort x basic header size %#4.4x
+# next fragment content like: 0x0a200a003a8fc713 0x524a000010bb3471 0x524a0000c73c70f9
+#>(2.s) ubequad x NEXT FRAGMENT CONTENT %#16.16llx
+# first_hdr_size; seems to be same as basic header size
+#>2 uleshort x 1st header size %#x
+# archiver version number like: 3 4 6 11 102
+>5 byte x \b, v%d
+# minimum archiver version to extract like: 1
+>6 ubyte !1 \b, minimum %u to extract
+# FOR DEBUGGING
+#>8 byte x \b, FLAGS %#x
+# GARBLED_FLAG1; garble with password; g switch
+>8 byte &0x01 \b, password-protected
+# encryption version: 0~old 1~old 2~new 3~reserved 4~40 bit key GOST
+>>0x20 ubyte x (v%u)
+#>8 byte &0x02 \b, secured
+# ANSIPAGE_FLAG; indicates ANSI codepage used by ARJ32; hy switch
+>8 byte &0x02 \b, ANSI codepage
+# VOLUME_FLAG indicates presence of succeeding volume; but apparently not for SFX
+>8 byte &0x04 \b, multi-volume
+#>8 byte &0x08 \b, file-offset
+# ARJPROT_FLAG; build with data protection record; hk switch
+>8 byte &0x08 \b, recoverable
+# arj protection factor; maximal 10; switch hky -> factor=y+1
+>>0x22 byte x (factor %u)
+>8 byte &0x10 \b, slash-switched
+# BACKUP_FLAG; obsolete
+>8 byte &0x20 \b, backup
+# SECURED_FLAG;
+>8 byte &0x40 \b, secured,
+# ALTNAME_FLAG; indicates dual-name archive
+>8 byte &0x80 \b, dual-name
+# security version; 0~old 2~current
+>9 ubyte !0
+>>9 ubyte !2 \b, security version %u
+# file type; 2 in main header; 0~binary 1~7-bitText 2~comment 3~directory 4~VolumeLabel 5=ChapterLabel
+>0xA ubyte !2 \b, file type %u
+# date+time when original archive was created in MS-DOS format via ./msdos
+>0xC ulelong x \b, created
+>0xC use dos-date
+# or date and time by new internal function
+#>0xE lemsdosdate x %s
+#>0xC lemsdostime x %s
+# FOR DEBUGGING
+#>0x12 uleshort x RAW DATE %#4.4x
+#>0x10 uleshort x RAW TIME %#4.4x
+# date+time when archive was last modified; sometimes nil or
+# maybe wrong like in HP4DRVR.ARJ
+#>0x10 ulelong >0 \b, modified
+#>>0x10 use dos-date
+# or date and time by new internal function
+#>>0x12 lemsdosdate x %s
+#>>0x10 lemsdostime x %s
+# archive size (currently used only for secured archives); MAYBE?
+#>0x14 ulelong !0 \b, file size %u
+# security envelope file position; MAYBE?
+#>0x18 ulelong !0 \b, at %#x security envelope
+# filespec position in filename; WHAT IS THAT?
+#>0x1C uleshort >0 \b, filespec position %#x
+# length in bytes of security envelope data like: 2CAh 301h 364h 471h
+>0x1E uleshort !0 \b, security envelope length %#x
+# last chapter like: 0 1
+>0x21 ubyte !0 \b, last chapter %u
+# filename (null-terminated string); sometimes at 0x26 when 4 bytes for extra data
+>34 byte x \b, original name:
+# with extras data
+>34 byte <0x0B
+>>38 string x %s
+# without extras data
+>34 byte >0x0A
+>>34 string x %s
+# host OS: 0~MSDOS ... 11~WIN32
+>7 byte 0 \b, os: MS-DOS
+>7 byte 1 \b, os: PRIMOS
+>7 byte 2 \b, os: Unix
+>7 byte 3 \b, os: Amiga
+>7 byte 4 \b, os: Macintosh
+>7 byte 5 \b, os: OS/2
+>7 byte 6 \b, os: Apple ][ GS
+>7 byte 7 \b, os: Atari ST
+>7 byte 8 \b, os: NeXT
+>7 byte 9 \b, os: VAX/VMS
+>7 byte 10 \b, os: WIN95
+>7 byte 11 \b, os: WIN32
# [JW] idarc says this is also possible
2 leshort 0xea60 ARJ archive data
+#2 leshort 0xea60
+#>2 use arj-archive
# HA archiver (Greg Roelofs, newt@uchicago.edu)
# This is a really bad format. A file containing HAWAII will match this...
@@ -1276,6 +1475,18 @@
!:mime application/vnd.sun.xml.base
!:ext sdb
+# URL: https://wiki.openoffice.org/wiki/Documentation/DevGuide/Extensions/File_Format
+# From: Joerg Jenderek
+# Note: only few OXT samples are detected here by mimetype member
+# is used by OpenOffice and LibreOffice and probably also NeoOffice
+# verified by `unzip -Zv *.oxt` or `7z l -slt *.oxt`
+>>50 string vnd.openofficeorg. OpenOffice
+>>>68 string extension \b/LibreOffice Extension
+# http://extension.nirsoft.net/oxt
+!:mime application/vnd.openofficeorg.extension
+# like: Gallery-Puzzle.2.1.0.1.oxt
+!:ext oxt
+
# OpenDocument formats (for OpenOffice 2.x / StarOffice >= 8)
# URL: http://fileformats.archiveteam.org/wiki/OpenDocument
# https://lists.oasis-open.org/archives/office/200505/msg00006.html
@@ -1522,12 +1733,30 @@
!:mime application/x-bittorrent
# Atari MSA archive - Teemu Hukkanen <tjhukkan@iki.fi>
-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
+# URL: http://fileformats.archiveteam.org/wiki/MSA_(Magic_Shadow_Archiver)
+# Reference: http://info-coach.fr/atari/documents/_mydoc/FD_Image_File_Format.pdf
+# http://mark0.net/download/triddefs_xml.7z/defs/m/msa.trid.xml
+# Update: Joerg Jenderek
+# Note: called by TrID "Atari MSA Disk Image" and verified by
+# command like `deark -l -m msa -d2 PDATS578.msa` as " Atari ST floppy disk image"
+# GRR: line below is too general as it matches setup.skin
+0 beshort 0x0e0f
+# skip foo setup.skin with unrealistic high number 52255 of sides by check for valid "low" value
+>4 ubeshort <2 Atari MSA archive data
+#!:mime application/octet-stream
+!:mime application/x-atari-msa
+!:ext msa
+# sectors per track like: 9 10
+>>2 beshort x \b, %d sectors per track
+# sides (0 or 1; add 1 to this to get correct number of sides)
+>>4 beshort 0 \b, 1 sided
+>>4 beshort 1 \b, 2 sided
+# starting track like: 0
+>>6 beshort x \b, starting track: %d
+# ending track like: 39 79 80 81
+>>8 beshort x \b, ending track: %d
+# tracks content
+#>>10 ubequad x \b, track content %#16.16llx
# Alternate ZIP string (amc@arwen.cs.berkeley.edu)
0 string PK00PK\003\004 Zip archive data
@@ -1537,6 +1766,8 @@
# ACE archive (from http://www.wotsit.org/download.asp?f=ace)
# by Stefan `Sec` Zehl <sec@42.org>
7 string **ACE** ACE archive data
+!:mime application/x-ace-compressed
+!:ext ace
>15 byte >0 version %d
>16 byte =0x00 \b, from MS-DOS
>16 byte =0x01 \b, from OS/2
diff --git a/magic/Magdir/aria b/magic/Magdir/aria
new file mode 100644
index 000000000000..c3a6bf57e464
--- /dev/null
+++ b/magic/Magdir/aria
@@ -0,0 +1,38 @@
+
+#------------------------------------------------------------------------------
+# URL: https://de.wikipedia.org/wiki/Aria_(Software)
+# Reference: https://github.com/aria2/aria2/blob/master/doc/manual-src/en/technical-notes.rst
+# From: Joerg Jenderek
+# Note: only version 1 suited
+# check for valid version one
+0 beshort 0x0001
+# skip most uncompressed DEGAS med-res bitmap *.PI2 and GEM bitmap (v1) *.IMG
+# by test for valid infoHashCheck extension
+>2 ubelong&0xffFFffFE 0x00000000
+# skip DEGAS med-res bitmap DIAGRAM1.PI2 by test for valid length of download
+>>(6.L+14) ubequad >0
+>>>0 use aria
+0 name aria
+# version; (0x0000) or (0x0001); for 0 all multi-byte are in host byte order. For 1 big endian
+>0 beshort x aria2 control file, version %u
+#!:mime application/octet-stream
+!:mime application/x-aria
+!:ext aria2
+# EXTension; if EXT[3]&1 == 1 checks whether saved InfoHash and current downloading the same; infoHashCheck extension
+>2 ubelong !0 \b, infoHashCheck %#x
+# info hash length like: 0 14h
+>6 ubelong !0 \b, %#x bytes info hash
+# info hash; BitTorrent InfoHash
+>>10 ubequad x %#16.16llx...
+# piece length; the length of the piece like: 400h 100000h
+>(6.L+10) ubelong x \b, piece length 0x%x
+# total length; the total length of the download
+>(6.L+14) ubequad x \b, total length %llu
+#>(6.L+14) ubequad x \b, total length %#llx
+# upload length; the uploaded length of download like: 0 400h
+>(6.L+22) ubequad !0 \b, upload length %#llx
+# bitfield length; the length of bitfield like: 4 6 Ah 10h 13h 167h
+>(6.L+30) ubelong x \b, %#x bytes bitfield
+# bitfield; bitfield which represents current download progress
+>(6.L+34) ubequad !0 %#llx...
+
diff --git a/magic/Magdir/asf b/magic/Magdir/asf
index faae6a8aa9cf..9f274ede2ff8 100644
--- a/magic/Magdir/asf
+++ b/magic/Magdir/asf
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: asf,v 1.2 2021/04/26 15:56:00 christos Exp $
+# $File: asf,v 1.3 2022/04/25 17:33:13 christos Exp $
# asf: file(1) magic for Microsoft Advanced Systems Format (ASF) files
# http://www.staroceans.org/e-book/ASF_Specification.pdf
@@ -88,7 +88,7 @@
>0 guid 26F18B5D-4584-47EC-9F5F-0E651F0452C9 ASF_Compatibility_Object
>0 guid 43058533-6981-49E6-9B74-AD12CB86D58C ASF_Advanced_Content_Encryption_Object
>0 guid 59DACFC0-59E6-11D0-A3AC-00A0C90348F6 ASF_Command_Media
->0 guid B61BE100-5B4E-11CF-A8FD-00805F5C44 ASF_JFIF_Media
+>0 guid B61BE100-5B4E-11CF-A8FD-00805F5C442B ASF_JFIF_Media
>0 guid 35907DE0-E415-11CF-A917-00805F5C442B ASF_Degradable_JPEG_Media
>0 guid 91BD222C-F21C-497A-8B6D-5AA86BFC0185 ASF_File_Transfer_Media
>0 guid 3AFB65E2-47EF-40F2-AC2C-70A90D71D343 ASF_Binary_Media
diff --git a/magic/Magdir/bytecode b/magic/Magdir/bytecode
index 501cd9d4415f..94fb8b38cb03 100644
--- a/magic/Magdir/bytecode
+++ b/magic/Magdir/bytecode
@@ -1,6 +1,6 @@
#------------------------------------------------------------
-# $File: bytecode,v 1.2 2021/06/30 11:57:32 christos Exp $
+# $File: bytecode,v 1.3 2022/03/24 15:48:58 christos Exp $
# magic for various bytecodes
# From: Mikhail Gusarov <dottedmag@dottedmag.net>
@@ -27,4 +27,4 @@
>8 string BE \b, big endian
>11 string 4 \b, 32bit
>11 string 8 \b, 64bit
->13 regex .\.. \b, bytecode v%s
+>13 regex .\\.. \b, bytecode v%s
diff --git a/magic/Magdir/c64 b/magic/Magdir/c64
index 52a4e22d99e9..9a635aedc978 100644
--- a/magic/Magdir/c64
+++ b/magic/Magdir/c64
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: c64,v 1.9 2021/04/26 15:56:00 christos Exp $
+# $File: c64,v 1.12 2022/05/14 20:03:39 christos Exp $
# c64: file(1) magic for various commodore 64 related files
#
# From: Dirk Jagdmann <doj@cubic.org>
@@ -8,9 +8,146 @@
0x16500 belong 0x12014100 D64 Image
0x16500 belong 0x12014180 D71 Image
0x61800 belong 0x28034400 D81 Image
-0 string C64\40CARTRIDGE CCS C64 Emultar Cartridge Image
0 belong 0x43154164 X64 Image
+# C64 (and other CBM) cartridges
+# Extended by David Korth <gerbilsoft@gerbilsoft.com>
+# Reference: https://vice-emu.sourceforge.io/vice_17.html#SEC391
+
+0 string C64\40CARTRIDGE Commodore 64 cartridge
+>0x20 ubyte 0 \b,
+>0x20 ubyte !0
+>>0x20 string/T x \b: "%.32s",
+>0x16 beshort 0
+>>0x18 beshort 0x0000 16 KB game
+>>0x18 beshort 0x0001 8 KB game
+>>0x18 beshort 0x0100 UltiMax mode
+>>0x18 beshort 0x0101 RAM/disabled
+>0x16 beshort 1 Action Replay
+>0x16 beshort 2 KCS Power Cartridge
+>0x16 beshort 3 Final Cartridge III
+>0x16 beshort 4 Simons' BASIC
+>0x16 beshort 5 Ocean type 1
+>0x16 beshort 6 Expert Cartridge
+>0x16 beshort 7 Fun Play, Power Play
+>0x16 beshort 8 Super Games
+>0x16 beshort 9 Atomic Power
+>0x16 beshort 10 Epyx Fastload
+>0x16 beshort 11 Westermann Learning
+>0x16 beshort 12 Rex Utility
+>0x16 beshort 13 Final Cartridge I
+>0x16 beshort 14 Magic Formel
+>0x16 beshort 15 C64 Game System, System 3
+>0x16 beshort 16 Warp Speed
+>0x16 beshort 17 Dinamic
+>0x16 beshort 18 Zaxxon / Super Zaxxon (Sega)
+>0x16 beshort 19 Magic Desk, Domark, HES Australia
+>0x16 beshort 20 Super Snapshot V5
+>0x16 beshort 21 Comal-80
+>0x16 beshort 22 Structured BASIC
+>0x16 beshort 23 Ross
+>0x16 beshort 24 Dela EP64
+>0x16 beshort 25 Dela EP7x8
+>0x16 beshort 26 Dela EP256
+>0x16 beshort 27 Rex EP256
+>0x16 beshort 28 Mikro Assembler
+>0x16 beshort 29 Final Cartridge Plus
+>0x16 beshort 30 Action Replay 4
+>0x16 beshort 31 Stardos
+>0x16 beshort 32 EasyFlash
+>0x16 beshort 33 EasyFlash Xbank
+>0x16 beshort 34 Capture
+>0x16 beshort 35 Action Replay 3
+>0x16 beshort 36
+>>0x1A ubyte 1 Nordic Replay
+>>0x1A ubyte !1 Retro Replay
+>0x16 beshort 37 MMC64
+>0x16 beshort 38 MMC Replay
+>0x16 beshort 39 IDE64
+>0x16 beshort 40 Super Snapshot V4
+>0x16 beshort 41 IEEE-488
+>0x16 beshort 42 Game Killer
+>0x16 beshort 43 Prophet64
+>0x16 beshort 44 EXOS
+>0x16 beshort 45 Freeze Frame
+>0x16 beshort 46 Freeze Machine
+>0x16 beshort 47 Snapshot64
+>0x16 beshort 48 Super Explode V5.0
+>0x16 beshort 49 Magic Voice
+>0x16 beshort 50 Action Replay 2
+>0x16 beshort 51 MACH 5
+>0x16 beshort 52 Diashow-Maker
+>0x16 beshort 53 Pagefox
+>0x16 beshort 54 Kingsoft
+>0x16 beshort 55 Silverrock 128K Cartridge
+>0x16 beshort 56 Formel 64
+>0x16 beshort 57
+>>0x1A ubyte 1 Hucky
+>>0x1A ubyte !1 RGCD
+>0x16 beshort 58 RR-Net MK3
+>0x16 beshort 59 EasyCalc
+>0x16 beshort 60 GMod2
+>0x16 beshort 61 MAX Basic
+>0x16 beshort 62 GMod3
+>0x16 beshort 63 ZIPP-CODE 48
+>0x16 beshort 64 Blackbox V8
+>0x16 beshort 65 Blackbox V3
+>0x16 beshort 66 Blackbox V4
+>0x16 beshort 67 REX RAM-Floppy
+>0x16 beshort 68 BIS-Plus
+>0x16 beshort 69 SD-BOX
+>0x16 beshort 70 MultiMAX
+>0x16 beshort 71 Blackbox V9
+>0x16 beshort 72 Lt. Kernal Host Adaptor
+>0x16 beshort 73 RAMLink
+>0x16 beshort 74 H.E.R.O.
+>0x16 beshort 75 IEEE Flash! 64
+>0x16 beshort 76 Turtle Graphics II
+>0x16 beshort 77 Freeze Frame MK2
+
+0 string C128\40CARTRIDGE Commodore 128 cartridge
+>0x20 ubyte 0 \b,
+>0x20 ubyte !0
+>>0x20 string/T x \b: "%.32s",
+>0x16 beshort 0 generic cartridge
+>0x16 beshort 1 Warpspeed128
+>>0x1A ubyte 1 \b, REU support
+>>0x1A ubyte 2 \b, REU support, with I/O and ROM banking
+
+0 string CBM2\40CARTRIDGE Commodore CBM-II cartridge
+>0x20 ubyte !0
+>>0x20 string/T x \b: "%.32s"
+
+0 string VIC20\40CARTRIDGE Commodore VIC-20 cartridge
+>0x20 ubyte 0 \b,
+>0x20 ubyte !0
+>>0x20 string/T x \b: "%.32s",
+>0x16 beshort 0 generic cartridge
+>0x16 beshort 1 Mega-Cart
+>0x16 beshort 2 Behr Bonz
+>0x16 beshort 3 Vic Flash Plugin
+>0x16 beshort 4 UltiMem
+>0x16 beshort 5 Final Expansion
+
+0 string PLUS4\40CARTRIDGE Commodore 16/Plus4 cartridge
+>0x20 ubyte !0
+>>0x20 string/T x \b: "%.32s"
+
+
+# DreamLoad archives see:
+# https://www.lemon64.com/forum/viewtopic.php?t=37415\
+# &sid=494dc2ca91289e05dadf80a7f8a968fe (at the bottom).
+# https://www.c64-wiki.com/wiki/DreamLoad.
+# Example HVSC Commodore 64 music collection:
+# https://kohina.duckdns.org/HVSC/C64Music/10_Years_HVSC.dfi
+
+0 byte 0
+>1 string DREAMLOAD\40FILE\40ARCHIVE
+>>0x17 byte 0 DFI Image
+>>>0x1a leshort x version: %d.
+>>>0x18 leshort x \b%d
+>>>0x1c lelong x tracks: %d
+
0 string GCR-1541 GCR Image
>8 byte x version: %i
>9 byte x tracks: %i
diff --git a/magic/Magdir/cad b/magic/Magdir/cad
index 530f72f31e95..46a35497c2f2 100644
--- a/magic/Magdir/cad
+++ b/magic/Magdir/cad
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: cad,v 1.28 2021/04/26 15:56:00 christos Exp $
+# $File: cad,v 1.29 2021/12/06 19:33:27 christos Exp $
# autocad: file(1) magic for cad files
#
@@ -287,6 +287,8 @@
>6 leshort 0x2
>>8 lelong 0xa
>>>16 leshort 0x3d3d 3D Studio model
+# Beat sgi MMV
+!:strength +20
!:mime image/x-3ds
!:ext 3ds
diff --git a/magic/Magdir/ccf b/magic/Magdir/ccf
new file mode 100644
index 000000000000..1d5ba19e00e2
--- /dev/null
+++ b/magic/Magdir/ccf
@@ -0,0 +1,14 @@
+
+#------------------------------------------------------------------------------
+# $File: ccf,v 1.1 2022/02/15 12:57:45 christos Exp $
+# file(1) magic(5) data for Phillips remote controls
+
+# Exchange format for Philips Pronto universal infrared remote controls
+# A CCF file describes a learned/customized remote control,
+# i.e. it contains button UI and infrared pulse code definitions
+# (Georg Sauthoff)
+# http://files.remotecentral.com/download/45/pan-air-csakr.zip.html
+# https://github.com/gsauthof/pronto-ccf/blob/
+
+8 string @\xa5Z@_CCF
+>32 string CCF\x00 Philips Pronto IR remote control CCF
diff --git a/magic/Magdir/commands b/magic/Magdir/commands
index 705a72861ac0..a257eb2b7a13 100644
--- a/magic/Magdir/commands
+++ b/magic/Magdir/commands
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: commands,v 1.66 2021/07/03 13:50:29 christos Exp $
+# $File: commands,v 1.69 2022/04/20 21:14:23 christos Exp $
# commands: file(1) magic for various shells and interpreters
#
#0 string/w : shell archive or script for antique kernel text
@@ -35,7 +35,7 @@
!:mime text/x-shellscript
0 string/fwt #!\ /usr/local/bin/zsh Paul Falstad's zsh script text executable
!:mime text/x-shellscript
-0 search/1 #!/usr/bin/env\ zsh Paul Falstad's zsh script text executable
+0 string/fwt #!\ /usr/bin/env\ zsh Paul Falstad's zsh script text executable
!:mime text/x-shellscript
0 string/fwt #!\ /bin/ash Neil Brown's ash script text executable
@@ -98,7 +98,7 @@
!:mime text/x-shellscript
0 string/wt #!\ a
->&-1 string x %s script text executable
+>&-1 string/T x %s script text executable
0 search/1/fwt #!\ /usr/bin/tclsh Tcl/Tk script text executable
!:mime text/x-tcl
@@ -153,6 +153,32 @@
0 string Zend\x00 PHP script Zend Optimizer data
+# From: Anatol Belski <ab@php.net>
+0 string OPCACHE
+>7 ubyte 0 PHP opcache filecache data
+
+0 search/64 --TEST--
+>16 search/64 --FILE--
+>24 search/8192 --EXPECT PHP core test
+!:ext phpt
+
+# https://www.php.net/manual/en/phar.fileformat.signature.php
+-4 string GBMB PHP phar archive
+>-8 ubyte 0x1 with MD5 signature
+!:ext phar
+>-8 ubyte 0x2 with SHA1 signature
+!:ext phar
+>-8 ubyte 0x3 with SHA256 signature
+!:ext phar
+>-8 ubyte 0x4 with SHA512 signature
+!:ext phar
+>-8 ubyte 0x10 with OpenSSL signature
+!:ext phar
+>-8 ubyte 0x11 with OpenSSL SHA256 signature
+!:ext phar
+>-8 ubyte 0x12 with OpenSSL SHA512 signature
+!:ext phar
+
0 string/t $! DCL command file
# Type: Pdmenu
diff --git a/magic/Magdir/console b/magic/Magdir/console
index d31932d5834c..367aeec36004 100644
--- a/magic/Magdir/console
+++ b/magic/Magdir/console
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: console,v 1.63 2021/04/26 15:56:00 christos Exp $
+# $File: console,v 1.68 2022/05/14 20:04:43 christos Exp $
# Console game magic
# Toby Deshane <hac@shoelace.digivill.net>
@@ -78,8 +78,8 @@
>23 byte !1 FMC-
>23 byte 1 FSC-
>16 string x \b%.3s
->15 byte x \b, mfr %02X
->20 byte x (Rev.%02u)
+>15 ubyte x \b, mfr %02X
+>20 ubyte x (Rev.%02u)
# Headered version.
0 string FDS\x1A
@@ -228,21 +228,56 @@
>0x10 use sega-mega-drive-header
>0 byte x \b, 2352-byte sectors
-# Sega Mega Drive, 32X, Pico, and Mega CD Boot ROM images.
+# Sega Mega Drive: Identify the system ID.
0x100 string SEGA
->0x3C0 bequad 0x4D41525320434845 Sega 32X ROM image
+>0x3C0 string MARS\ CHECK\ MODE Sega 32X ROM image
!:mime application/x-genesis-32x-rom
>>0 use sega-mega-drive-header
->0x3C0 bequad !0x4D41525320434845
->>0x105 belong 0x5049434F Sega Pico ROM image
+>0x104 string \ PICO Sega Pico ROM image
!:mime application/x-sega-pico-rom
->>>0 use sega-mega-drive-header
->>0x105 belong !0x5049434F
->>>0x180 beshort 0x4252 Sega Mega CD Boot ROM image
+>>0 use sega-mega-drive-header
+>0x104 string TOYS\ PICO Sega Pico ROM image
+!:mime application/x-sega-pico-rom
+>>0 use sega-mega-drive-header
+>0x104 string \ TOYS\ PICO Sega Pico ROM image
+!:mime application/x-sega-pico-rom
+>>0 use sega-mega-drive-header
+>0x104 string \ IAC Sega Pico ROM image
+!:mime application/x-sega-pico-rom
+>>0 use sega-mega-drive-header
+>0x104 string \ TERA68K Sega Teradrive (68K) ROM image
+!:mime application/x-sega-teradrive-rom
+>>0 use sega-mega-drive-header
+>0x104 string \ TERA286 Sega Teradrive (286) ROM image
+!:mime application/x-sega-teradrive-rom
+>>0 use sega-mega-drive-header
+>0x180 string BR Sega Mega CD Boot ROM image
!:mime application/x-genesis-rom
->>>0x180 beshort !0x4252 Sega Mega Drive / Genesis ROM image
+>>0 use sega-mega-drive-header
+>0x104 default x Sega Mega Drive / Genesis ROM image
!:mime application/x-genesis-rom
->>>0 use sega-mega-drive-header
+>>0 use sega-mega-drive-header
+
+# Sega Mega Drive: Some ROMs have "SEGA" at 0x101, not 0x100.
+0x100 string \ SEGA Sega Mega Drive / Genesis ROM image
+>0 use sega-mega-drive-header
+
+# Sega Pico ROMs that don't start with "SEGA".
+0x100 string SAMSUNG\ PICO Samsung Pico ROM image
+!:mime application/x-sega-pico-rom
+>0 use sega-mega-drive-header
+0x100 string IMA\ IKUNOUJYUKU Samsung Pico ROM image
+!:mime application/x-sega-pico-rom
+>0 use sega-mega-drive-header
+0x100 string IMA IKUNOJYUKU Samsung Pico ROM image
+!:mime application/x-sega-pico-rom
+>0 use sega-mega-drive-header
+
+# Sega Picture Magic (modified 32X)
+0x100 string Picture\ Magic
+>0x3C0 string PICTURE MAGIC-01 Sega 32X ROM image
+!:mime application/x-genesis-32x-rom
+>>0 use sega-mega-drive-header
#------------------------------------------------------------------------------
# genesis: file(1) magic for the Super MegaDrive ROM dump format
@@ -474,12 +509,13 @@
# - https://neogpc.googlecode.com/svn-history/r10/trunk/src/core/neogpc.cpp
# - https://www.devrs.com/ngp/files/ngpctech.txt
#
-0x0A string BY\ SNK\ CORPORATION Neo Geo Pocket
+0x0A string BY\ SNK\ CORPORATION Neo Geo Pocket
!:mime application/x-neo-geo-pocket-rom
->0x23 byte 0x10 Color
->0 byte x ROM image
->0x24 string >\0 \b: "%.12s"
->0x1F byte 0xFF (debug mode enabled)
+>0x23 byte 0x10 Color
+>0 byte x ROM image
+>0x24 string >\0 \b: "%.12s"
+>0x21 uleshort x \b, NEOP%04X
+>0x1F ubyte 0xFF (debug mode enabled)
#------------------------------------------------------------------------------
# msx: file(1) magic for MSX game cartridge dumps
@@ -639,17 +675,21 @@
>>0 use xbox-360-package
# Atari Lynx cartridge dump (EXE/BLL header)
-# From: "Stefan A. Haubenthal" <polluks@web.de>
-
+# From: "Stefan A. Haubenthal" <polluks@sdf.lonestar.org>
+# Reference:
+# https://raw.githubusercontent.com/cc65/cc65/master/libsrc/lynx/exehdr.s
# Double-check that the image type matches too, 0x8008 conflicts with
# 8 character OMF-86 object file headers.
0 beshort 0x8008
>6 string BS93 Lynx homebrew cartridge
!:mime application/x-atari-lynx-rom
>>2 beshort x \b, RAM start $%04x
->6 string LYNX Lynx cartridge
+0 string LYNX Lynx cartridge
!:mime application/x-atari-lynx-rom
->>2 beshort x \b, RAM start $%04x
+>4 leshort/4 >0 \b, bank 0 %dk
+>6 leshort/4 >0 \b, bank 1 %dk
+>10 string >\0 \b, "%.32s"
+>42 string >\0 \b, "%.16s"
# Opera file system that is used on the 3DO console
# From: Serge van den Boom <svdb@stack.nl>
@@ -898,6 +938,16 @@
!:mime application/x-gamecube-rom
>>>>0x8000 use nintendo-gcn-disc-common
+# Type: Nintendo GameCube/Wii disc image (RVZ format)
+0 string RVZ\001 Nintendo
+>0x48 belong 1 GameCube
+!:mime application/x-gamecube-rom
+>0x48 belong 2 Wii
+!:mime application/x-wii-rom
+>0x48 default x GameCube/Wii
+>0x48 belong x disc image (RVZ format):
+>>0x58 use nintendo-gcn-disc-common
+
#------------------------------------------------------------------------------
# Nintendo 3DS file formats.
#
@@ -1126,14 +1176,3 @@
>>0x34 ubyte 1 [FastROM]
>>0x35 ubyte 1 [SRAM]
>>0x35 ubyte 3 [Special]
-
-# Type: Nintendo GameCube/Wii disc image (RVZ format)
-0 string RVZ\001 Nintendo
->0x48 belong 1 GameCube
-!:mime application/x-gamecube-rom
->0x48 belong 2 Wii
-!:mime application/x-wii-rom
->0x48 default x GameCube/Wii
->0x48 belong x disc image (RVZ format):
->>0x58 use nintendo-gcn-disc-common
-
diff --git a/magic/Magdir/ctf b/magic/Magdir/ctf
index ebea8f316961..d91684d18c40 100644
--- a/magic/Magdir/ctf
+++ b/magic/Magdir/ctf
@@ -20,4 +20,4 @@
# CTF metadata (plain text)
0 string /*\x20CTF\x20 Common Trace Format (CTF) plain text metadata
!:strength + 5 # this is to make sure we beat C
->&0 regex [0-9]+\.[0-9]+ \b, v%s
+>&0 regex [0-9]+\\.[0-9]+ \b, v%s
diff --git a/magic/Magdir/database b/magic/Magdir/database
index 7f93f8e2da96..ee4b1cb98f9d 100644
--- a/magic/Magdir/database
+++ b/magic/Magdir/database
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: database,v 1.63 2021/10/04 00:44:30 christos Exp $
+# $File: database,v 1.66 2022/02/26 17:42:21 christos Exp $
# database: file(1) magic for various databases
#
# extracted from header/code files by Graeme Wilford (eep2gw@ee.surrey.ac.uk)
@@ -151,6 +151,7 @@
# https://www.clicketyclick.dk/databases/xbase/format/dbf.html
# inspect VVYYMMDD , where 1<= MM <= 12 and 1<= DD <= 31
0 ubelong&0x0000FFFF <0x00000C20
+!:strength +10
# skip Infocom game Z-machine
>2 ubyte >0
# skip Androids *.xml
@@ -399,7 +400,9 @@
>>>>>>>>>>4 ushort 0
# check for valid FoxPro field type
>>>>>>>>>>>512 ubelong <3
->>>>>>>>>>>>0 use foxpro-memo-print
+# skip LXMDCLN4.OUT LXMDCLN6.OUT LXMDALG6.OUT with invalid blocksize 170=AAh
+>>>>>>>>>>>>6 ubeshort&0x002f 0
+>>>>>>>>>>>>>0 use foxpro-memo-print
# dBASE III DBT , garbage
# skip WORD1XW.DOC with improbably high free block index
>>>>>>>>>0 ulelong <0x400000
@@ -415,9 +418,11 @@
>>>>>>>>>>0 ulelong <0x400000
# skip AI070GEP.EPS by printable 1st character of 1st memo item
>>>>>>>>>>>512 ubyte >037
+# skip some Microsoft Visual C, OMF library like: BZ2.LIB WATTCPWL.LIB ZLIB.LIB
+>>>>>>>>>>>>512 ubyte <0200
# skip gluon-ffhat-1.0-tp-link-tl-wr1043n-nd-v2-sysupgrade.bin by printable 2nd character
->>>>>>>>>>>>513 ubyte >037
->>>>>>>>>>>>>0 use dbase3-memo-print
+>>>>>>>>>>>>>513 ubyte >037
+>>>>>>>>>>>>>>0 use dbase3-memo-print
# dBASE IV DBT with positive block size
>>>>>>>20 uleshort >0
# dBASE IV DBT with valid block length like 512, 1024
@@ -440,7 +445,10 @@
#>20 uleshort =0 \b, block length %u
>20 uleshort !0 \b, block length %u
# dBase III memo field terminated by \032\032
+# like: "WHAT IS XBASE" test.dbt "Borges, Malte" biblio.dbt "First memo\032\032" T2.DBT
>512 string >\0 \b, 1st item "%s"
+# For DEBUGGING
+#>512 ubelong x \b, 1ST item %#8.8x
# https://www.clicketyclick.dk/databases/xbase/format/dbt.html
# Print the information of dBase IV DBT memo file
0 name dbase4-memo-print
@@ -486,7 +494,7 @@
>0 belong x FoxPro FPT
!:mime application/x-fpt
!:ext fpt
-# Size of blocks for FoxPro ( 64,256 )
+# Size of blocks for FoxPro ( 64,256 ); probably a multiple of two
>6 ubeshort x \b, blocks size %u
# next available block
#>0 belong =0 \b, next free block index %u
diff --git a/magic/Magdir/dataone b/magic/Magdir/dataone
index 8ef3f798163f..566633eff22c 100644
--- a/magic/Magdir/dataone
+++ b/magic/Magdir/dataone
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: dataone,v 1.2 2019/04/19 00:42:27 christos Exp $
+# $File: dataone,v 1.3 2022/04/18 21:38:10 christos Exp $
#
# DataONE- files from Dave Vieglais <dave.vieglais@gmail.com> &
# Pratik Shrivastava <pratikshrivastava23@gmail.com>
@@ -9,39 +9,39 @@
#------------------------------------------------------------------------------
# EML (Ecological Metadata Language Format)
-0 string <?xml
->&0 regex (eml)-[0-9].[0-9].[0-9]+ eml://ecoinformatics.org/%s
+0 string \<?xml\ version=
+>&0 regex/1024 eml-[0-9]\\.[0-9]\\.[0-9]+ eml://ecoinformatics.org/%s
# onedcx (DataONE Dublin Core Extended v1.0)
->&0 regex (onedcx/v)[0-9].[0-9]+ https://ns.dataone.org/metadata/schema/onedcx/v1.0
+>&0 regex/1024 onedcx/v[0-9]\\.[0-9]+ https://ns.dataone.org/metadata/schema/onedcx/v1.0
# FGDC-STD-001-1998 (Content Standard for Digital Geospatial Metadata,
# version 001-1998)
->&0 regex fgdc FGDC-STD-001-1998
+>&0 search/1024 fgdc FGDC-STD-001-1998
# Mercury (Oak Ridge National Lab Mercury Metadata version 1.0)
->&0 regex (mercury/terms/v)[0-9].[0-9] https://purl.org/ornl/schema/mercury/terms/v1.0
+>&0 regex/1024 mercury/terms/v[0-9]\\.[0-9] https://purl.org/ornl/schema/mercury/terms/v1.0
# ISOTC211 (Geographic MetaData (GMD) Extensible Markup Language)
->&0 regex isotc211
->>&0 regex eng;USA https://www.isotc211.org/2005/gmd
+>&0 search/1024 isotc211
+>>&0 search/1024 eng;USA https://www.isotc211.org/2005/gmd
# ISOTC211 (NOAA Variant Geographic MetaData (GMD) Extensible Markup Language)
->>&0 regex gov.noaa.nodc:[0-9]+ https://www.isotc211.org/2005/gmd-noaa
+>>&0 regex/1024 gov\\.noaa\\.nodc:[0-9]+ https://www.isotc211.org/2005/gmd-noaa
# ISOTC211 PANGAEA Variant Geographic MetaData (GMD) Extensible Markup Language
->>&0 regex pangaea.dataset[0-9][0-9][0-9][0-9][0-9][0-9]+ https://www.isotc211.org/2005/gmd-pangaea
+>>&0 regex/1024 pangaea\\.dataset[0-9][0-9][0-9][0-9][0-9][0-9]+ https://www.isotc211.org/2005/gmd-pangaea
!:mime text/xml
# Object Reuse and Exchange Vocabulary
-0 string <?xml
->&0 regex rdf
->>&0 regex openarchives https://www.openarchives.org/ore/terms
+0 string \<?xml\ version=
+>&0 search/1024 rdf
+>>&0 search/1024 openarchives https://www.openarchives.org/ore/terms
!:mime application/rdf+xml
# Dryad Metadata Application Profile Version 3.1
0 string <DryadData
->&0 regex (dryad-bibo/v)[0-9].[0-9] https://datadryad.org/profile/v3.1
+>&0 regex/1024 dryad-bibo/v[0-9]\\.[0-9] https://datadryad.org/profile/v3.1
!:mime text/xml
diff --git a/magic/Magdir/dsf b/magic/Magdir/dsf
new file mode 100644
index 000000000000..e6c4b6e3e059
--- /dev/null
+++ b/magic/Magdir/dsf
@@ -0,0 +1,25 @@
+
+#------------------------------------------------------------
+# $File: dsf,v 1.1 2022/01/08 16:29:18 christos Exp $
+# dsf: file(1) magic for DSD Stream File
+# URL: https://en.wikipedia.org/wiki/Direct_Stream_Digital
+# Reference: https://dsd-guide.com/sites/default/files/white-papers/DSFFileFormatSpec_E.pdf
+0 string DSD\x20 DSD Stream File,
+>0x30 leshort 1 mono,
+>0x30 leshort 2 stereo,
+>0x30 leshort 3 three-channel,
+>0x30 leshort 4 quad-channel,
+>0x30 leshort 5 3.1 4-channel,
+>0x30 leshort 6 five-channel,
+>0x30 leshort 7 5.1 surround,
+>0x30 default x
+>>0x30 leshort x unknown channel format (%d),
+>0x38 lelong 2822400 simple-rate,
+>0x38 lelong 5644800 double-rate,
+>0x38 default x
+>>0x38 lelong x %d Hz,
+>0x3c leshort 1 1 bit,
+>0x3c leshort 8 8 bit,
+>0x3c default x
+>>0x3c leshort x %d bit,
+>0x40 lelong x %d samples
diff --git a/magic/Magdir/filesystems b/magic/Magdir/filesystems
index 283f9c4ac9b6..dee053b0a812 100644
--- a/magic/Magdir/filesystems
+++ b/magic/Magdir/filesystems
@@ -1,5 +1,5 @@
#------------------------------------------------------------------------------
-# $File: filesystems,v 1.145 2021/09/07 18:57:50 christos Exp $
+# $File: filesystems,v 1.149 2022/05/21 22:50:28 christos Exp $
# filesystems: file(1) magic for different filesystems
#
0 name partid
@@ -2317,6 +2317,8 @@
>0x10070 lequad x \b%lld bytes used,
>0x10088 lequad x %lld devices
+0 string btrfs-stream BTRFS stream file
+
# dvdisaster's .ecc
# From: "Nelson A. de Oliveira" <naoliv@gmail.com>
0 string *dvdisaster* dvdisaster error correction file
@@ -2399,12 +2401,167 @@
0 string ACT\020Apricot\020disk\020image\032\004 floppy image data (ApriDisk)
-0 beshort 0xAA58 floppy image data (IBM SaveDskF, old)
-0 beshort 0xAA59 floppy image data (IBM SaveDskF)
-0 beshort 0xAA5A floppy image data (IBM SaveDskF, compressed)
+# URL: http://fileformats.archiveteam.org/wiki/LoadDskF/SaveDskF
+# Update: Joerg Jenderek
+# Note: called "IBM SKF disk image" by TrID
+# verfied by 7-Zip `7z l -tFAT -slt *.dsk` and
+# `deark -l -m loaddskf 06200D19.DSK`
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/d/dsk-skf-old.trid.xml
+0 beshort 0xAA58
+>0 use SaveDskF
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/d/dsk-skf.trid.xml
+0 beshort 0xAA59
+>0 use SaveDskF
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/d/dsk-skf-comp.trid.xml
+0 beshort 0xAA5A
+# skip foo by additional check for unused upper byte of media type in SaveDskF header
+#>3 ubyte =0
+# skip bar by additional check for valid "low" number of heads in SaveDskF header
+#>>26 uleshort <3
+# skip foo by additional check for unused double word field in SaveDskF header
+#>>>30 long =0
+#>>>>0 use SaveDskF
+>0 use SaveDskF
+# display information about IBM SaveDskF floppy disk images
+0 name SaveDskF
+# SaveDskF magic
+>0 beshort x floppy image data (IBM SaveDskF
+#!:mime application/octet-stream
+!:mime application/x-ibm-dsk
+!:ext dsk
+# also suffix with digit (1dk .2dk ...); NO example FOUND!
+#!:ext dsk/1dk/2dk
+>1 ubyte =0x58 \b, old)
+>1 ubyte =0x59 \b)
+>1 ubyte =0x5A \b, compressed)
+# media type; the first byte of the FAT like: 0xF0 (usual floppy) 0xF9 0xFE
+# https://en.wikipedia.org/wiki/Design_of_the_FAT_file_system
+>2 ubyte !0xF0 \b, Media descriptor %#x
+# upper byte of media type is not used; so this seems to be nil
+>3 ubyte !0 \b, upper byte of media type %#x
+# sector size in bytes as in the BIOS parameter block like: 512 ; SAVEDSKF.EXE with other sizes produce garbage images
+>4 uleshort !512 \b, Bytes/sector %u
+# cluster mask; number of sectors per cluster, minus 1
+>6 uleshort+1 >1 \b, sectors/cluster %u
+#>6 uleshort+1 x \b, sectors/cluster %u
+# cluster shift; log2(cluster size / sector size) like: 0~1=ClusterSize/SectorSize
+>7 ubyte >0 \b, cluster shift %u
+#>7 ubyte x \b, cluster shift %u
+# reserved sectors; as in the BIOS parameter block like: 1 256 (2M256R-K.DSK)
+>8 uleshort >1 \b, reserved sectors %u
+#>8 uleshort x \b, reserved sectors %u
+# FAT copies; as in the BIOS parameter block like: 2 (usual) 1 (2-NK.DSK)
+>10 ubyte !2 \b, FAT
+# plural s
+>>10 ubyte >1 \bs
+>>10 ubyte x %u
+# root directory entries; as in the BIOS parameter block like: 224 (usual) 64 (H1-NK.DSK) 4096 (2-NK.DSK)
+>11 uleshort !224 \b, root entries %u
+# sector number of first cluster (count sectors used by boot sector, FATs and root directory) like: 7 10 29 33 288
+>13 uleshort !33 \b, 1st cluster at sector %u
+# number of clusters in image; empty clusters at the end are not saved and counted like: 2372 2848
+>15 uleshort x \b, %u clusters
+# sectors/FAT; as in the BIOS parameter block like: 1 (H1-NK.DSK) 7 9
+>17 ubyte !9 \b, sectors/FAT %u
+# sector number of root directory (ie, count of sectors used by boot sector and FATs) like: 3 (H1-NK.DSK) 9 10 15 19 274 (2M256R-K.DSK)
+>18 uleshort !19 \b, root directory at sector %u
+# checksum; sum of all bytes in the file
+>20 ulelong x \b, checksum %#8.8x
+# cylinders; number of cylinders like: 40 80
+>24 uleshort !80 \b, %u cylinders
+#>24 uleshort x \b, %u cylinders
+# heads; number of heads as in the BIOS parameter block like: 1 (H1-NK.DSK) 2
+>26 uleshort !2 \b, heads %u
+#>26 uleshort x \b, heads %u
+# sectors/track; number of sectors per track as in the BIOS parameter block like: 8 15 18 36
+>28 uleshort !18 \b, sectors/track %u
+#>28 uleshort x \b, sectors/track %u
+# unused double word field seems to be always like: 0
+>30 ulelong !0 \b, at 0x1E %#x
+# number of sectors in images like: 1017 2786 2880
+>34 uleshort x \b, sectors %u
+# if string is "printable" it can be a real comment
+>(36.s) ubyte !0x00
+# if 1st sector is far enough away (> 0x29) then there is space for comment part
+>>38 uleshort >41
+# offset to comment string like: 28h=40
+>>>36 uleshort x \b, at %#x
+# comment string terminated with \r\n\0
+>>>(36.s) string x "%s"
+# offset to the first sector like: 0 (If this is 0, assume it is 0x200) 29h=41 (DISPLAY3.DSK) 31h 43h 45h 46h 48h 50h 200h=512
+>38 uleshort !0 \b, 1st sector at %#x
+# FOR DEBUGGING!
+#>(38.s) ubelong x SECTOR CONTENT %x
+# not compressed floppy image implies readable DOS boot sector inside image
+>>1 ubyte !0x5A
+# when not compressed it is readable as DOS boot sector via ./filesystems
+#>>>(38.s) indirect x \b; contains
+>38 uleshort =0 \b, 1st sector at 0x200 (0)
+# maybe standard DOS boot sector; NO example FOUND HERE!
+#>>0x200 indirect x \b; contains
0 string \074CPM_Disk\076 disk image data (YAZE)
+# From: Joerg Jenderek
+# URL: https://en.wikipedia.org/wiki/Central_Point_Software#cite_note-6
+# Reference: https://www.robcraig.com/download/transcopy-5-x-file-format
+# https://www.robcraig.com/download/transcopy-file-format-by-gene-thompson
+# http://mark0.net/download/triddefs_xml.7z/defs/t/tc-transcopy.trid.xml
+# TransCopy signature
+0 beshort 0x5AA5
+# skip Intel serial flash ROM with invalid 0 disk sides handled by ./intel
+>0x103 ubyte !0
+# skip Intel serial flash ROM with unlikely "high" start cylinder 100 handled by ./intel
+#>>0x101 ubyte <100 VALID_START_CYLINDER
+# skip Intel serial flash ROM with unlikely description handled by ./intel
+#>>>2 beshort !0xF00f VALID_DESCRIPTION
+# skip Intel serial flash ROM with invalid disk types 89h 88h handled by ./intel
+#>>>>0x100 byte !0x89 VALID_DISK_TYPE
+>>0 use tc-floppy
+# display information of Central Point Software (CPS) Option Board TransCopy floppy image
+0 name tc-floppy
+>0 beshort x TransCopy disk image
+#!:mime application/octet-stream
+!:mime application/x-floppy-image-tc
+# like: disk04.tc VOCALC2.TC WIZ5_A.tc WIZ2_720.IMG
+!:ext tc/img
+# 1st description (optional 0-terminated maximal 32) like:
+# "Project Workbench 2.20" "Visi On Calc" "Wizardry V Disk 1 of 3"
+>2 string >\0 %.32s
+# 2nd desc. (optional 0-terminated maximal 32) like:
+# "(1988)." "Advanced - Utility" 'Program Disk 2"
+>0x22 string >\0 "%.32s"
+# Looks like ascii (like MESSAGES) formatted with attribute bytes (190)?
+# not needed for disk copy
+#>>0x42 string x '%.190s'
+#>>0x88 lestring16 x "%.8s"
+# disktype: 2~MFM High Density 3~MFM Double Density 4~Apple II GCR 5~FM Single Density
+# 6~Commodore GCR 7~MFM Double Density 8~Commodore Amiga Ch~Atari FM FFh~Unknown
+>0x100 ubyte !0xFF \b, disk type %u
+# StartingCylinder like: 0
+>0x101 ubyte x \b, cylinder
+>0x101 ubyte !0 start=%u
+# EndingCylinder like: 40 (often) 41 79
+>0x102 ubyte x end=%u
+# NumberOfSides like: 2
+>0x103 ubyte !2 \b, %u sides
+# TrackIncrement like: 1
+>0x104 ubyte !1 \b, track increment %u
+# TrackPosTbl Track skew
+#>0x105 ubequad x \b, Track skew %#16.16llx
+# TrackOffsTbl
+#>0x305 ubequad x \b, TrackOffsTbl %#16.16llx
+# TrackLngthTbl
+#>0x505 ubequad x \b, TrackLngthTbl %#16.16llx
+# TrackTypeTable
+#>0x705 ubequad x \b, TrackTypeTable %#16.16llx
+# Address mark timing
+#>0x905 ubequad x \b, Address mark timing %#16.16llx
+# Track fragment
+#>0x2905 ubequad !0 \b, Track fragment %#16.16llx
+# Track data
+#>0x4000 ubequad !0 \b, Track data %#16.16llx
+
# ReFS
# Richard W.M. Jones <rjones@redhat.com>
0 string \0\0\0ReFS\0 ReFS filesystem image
diff --git a/magic/Magdir/fonts b/magic/Magdir/fonts
index c53822271e05..de3e5354c785 100644
--- a/magic/Magdir/fonts
+++ b/magic/Magdir/fonts
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: fonts,v 1.46 2021/04/26 15:56:00 christos Exp $
+# $File: fonts,v 1.50 2022/03/21 21:28:13 christos Exp $
# fonts: file(1) magic for font data
#
0 search/1 FONT ASCII vfont text
@@ -8,13 +8,56 @@
0 short 017001 byte-swapped Berkeley vfont data
# PostScript fonts (must precede "printer" entries), quinlan@yggdrasil.com
+# Modified by: Joerg Jenderek
+# URL: https://en.wikipedia.org/wiki/PostScript_fonts
+# http://fileformats.archiveteam.org/wiki/Adobe_Type_1
+# Reference: http://mark0.net/download/triddefs_xml.7z
+# defs/p/pfb.trid.xml
+# Note: PFB stands for Printer Font Binary
0 string %!PS-AdobeFont-1. PostScript Type 1 font text
+#!:mime font/x-postscript-pfb
+#!:ext pfb
>20 string >\0 (%s)
-6 string %!PS-AdobeFont-1. PostScript Type 1 font program data
->26 string >\0 (%s)
+# http://www.nationalarchives.gov.uk/pronom/fmt/525
+6 string %!PS-AdobeFont-1.
+# skip DROID fmt-525-signature-id-816.pfb by checking for content after header
+>24 ubyte x PostScript Type 1 font program data
+#!:mime application/octet-stream
+!:mime font/x-postscript-pfb
+!:ext pfb
+# often followed by colon (3Ah) and space (20h) and font name like: DarkGardenMK LetterGothic
+>>24 ubyte =0x3A
+>>>26 string >\0 (%s)
+# some times instead of colon %%CreationDate: and "font name" later
+>>24 ubyte !0x3A
+# font name directive followed by def like: c0633bt_.pfb
+>>>25 search/1247 /FontName\040/
+# show font name in parentheses like: Frankfurt Lithos CharterBT-BoldItalic Courier10PitchBT-Bold
+>>>>&0 regex [A-Za-z0-9-]+ (%s)
+# http://cd.textfiles.com/maxfonts/ATM/M/MIRROR__.PFB
+6 string %PS-AdobeFont-1. PostScript Type 1 font program data
+!:mime font/x-postscript-pfb
+!:ext pfb
+# font name like: Times-Mirror
+>25 string >\0 (%s)
0 string %!FontType1 PostScript Type 1 font program data
+#!:mime font/x-postscript-pfb
+#!:ext pfb
6 string %!FontType1 PostScript Type 1 font program data
+#!:mime application/octet-stream
+!:mime font/x-postscript-pfb
+!:ext pfb
+# font name like: CaslonOpenFace FetteFraktur Kaufmann Linotext MesozoicGothic Old-Town
+>23 string >\0 (%s)
+# http://cd.textfiles.com/maxfonts/ATM/P/PLAYBI.PFB
+230 string %!FontType1 PostScript Type 1 font program data
+!:mime font/x-postscript-pfb
+!:ext pfb
+# font name like: Playbill
+>247 string >\0 (%s)
0 string %!PS-Adobe-3.0\ Resource-Font PostScript Type 1 font text
+#!:mime font/x-postscript-pfb
+#!:ext pfb
# Summary: PostScript Type 1 Printer Font Metrics
# URL: https://en.wikipedia.org/wiki/PostScript_fonts
@@ -67,15 +110,23 @@
>>>90 ubyte 65 script proportional
# X11 font files in SNF (Server Natural Format) format
-# updated by Joerg Jenderek at Feb 2013
+# updated by Joerg Jenderek at Feb 2013 and Nov 2021
# http://computer-programming-forum.com/51-perl/8f22fb96d2e34bab.htm
-0 belong 00000004 X11 SNF font data, MSB first
-#>104 belong 00000004 X11 SNF font data, MSB first
+# URL: http://fileformats.archiveteam.org/wiki/SNF
+# Reference: https://cgit.freedesktop.org/xorg/lib/libXfont/tree/src/bitmap/snfstr.h
+0 belong 00000004
+# version2 same as version1 in struct _snfFontInfo
+>104 belong 00000004 X11 SNF font data, MSB first
+# GRR: line above is too general as it catches also DEGAS low-res bitmap like:
+# http://cd.textfiles.com/geminiatari/FILES/GRAPHICS/ANIMAT/SPID_PAT/BIGSPID.PI1
!:mime application/x-font-sfn
-# GRR: line below too general as it catches also Xbase index file t3-CHAR.NDX
+!:ext snf
+# GRR: line below is too general as it catches also Xbase index file t3-CHAR.NDX
0 lelong 00000004
>104 lelong 00000004 X11 SNF font data, LSB first
!:mime application/x-font-sfn
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/s/snf-x11-lsb.trid.xml
+!:ext snf
# X11 Bitmap Distribution Format, from Daniel Quinlan (quinlan@yggdrasil.com)
0 search/1 STARTFONT\ X11 BDF font text
@@ -384,11 +435,13 @@
# https://www.w3.org/TR/WOFF/
0 string wOFF Web Open Font Format
+!:mime font/woff
>0 use woff
>20 beshort x \b, version %d
>22 beshort x \b.%d
# https://www.w3.org/TR/WOFF2/
0 string wOF2 Web Open Font Format (Version 2)
+!:mime font/woff2
>0 use woff
#>20 belong x \b, totalCompressedSize %d
>24 beshort x \b, version %d
diff --git a/magic/Magdir/freebsd b/magic/Magdir/freebsd
index a01ac4a28575..66aff6caf2ac 100644
--- a/magic/Magdir/freebsd
+++ b/magic/Magdir/freebsd
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: freebsd,v 1.7 2009/09/19 16:28:09 christos Exp $
+# $File: freebsd,v 1.9 2022/01/19 12:44:13 christos Exp $
# freebsd: file(1) magic for FreeBSD objects
#
# All new-style FreeBSD magic numbers are in host byte order (i.e.,
@@ -142,3 +142,23 @@
>9 byte 2 %d bytes in header,
>>10 byte x %d chars wide by
>>11 byte x %d chars high
+
+#
+# FreeBSD kernel minidumps
+#
+0 string minidump\040FreeBSD/ FreeBSD kernel minidump
+# powerpc uses 32-byte magic, followed by 32-byte mmu kind, then version
+>17 string powerpc
+>>17 string >\0 for %s,
+>>>32 string >\0 %s,
+>>>>64 byte 0 big endian,
+>>>>>64 belong x version %d
+>>>>64 default x little endian,
+>>>>>64 lelong x version %d
+# all other architectures use 24-byte magic, followed by version
+>17 default x
+>>17 string >\0 for %s,
+>>>24 byte 0 big endian,
+>>>>24 belong x version %d
+>>>24 default x little endian,
+>>>>24 lelong x version %d
diff --git a/magic/Magdir/games b/magic/Magdir/games
index 65af681bad00..b5d4664c8891 100644
--- a/magic/Magdir/games
+++ b/magic/Magdir/games
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: games,v 1.24 2021/04/26 15:56:00 christos Exp $
+# $File: games,v 1.25 2022/05/31 18:40:20 christos Exp $
# games: file(1) for games
# Fabio Bonelli <fabiobonelli@libero.it>
@@ -496,25 +496,17 @@
>4 ulelong x version %d, used in GTA IV,
>>8 ulelong x %d items
-0 uleshort 0x5250 RAGE Package Format (RPF),
->2 uleshort 0x4630 version 0, used in Rockstar Table Tennis,
->>4 ulelong x %d bytes,
->>>8 ulelong x %d entries
->2 uleshort 0x4632 version 2, used in GTA IV,
->>4 ulelong x %d bytes,
->>>8 ulelong x %d entries
->2 uleshort 0x4633 version 3, used in GTA IV Audio & Midnight Club: LA,
->>4 ulelong x %d bytes,
->>>8 ulelong x %d entries
->2 uleshort 0x4634 version 4, used in Max Payne 3,
->>4 ulelong x %d bytes,
->>>8 ulelong x %d entries
->2 uleshort 0x4636 version 6, used in RDR,
->>4 ulelong x %d bytes,
->>>8 ulelong x %d entries
->2 uleshort 0x4637 version 7, used in GTA V,
->>4 ulelong x %d bytes,
->>>8 ulelong x %d entries
->2 uleshort 0x4638 version 8, used in RDR 2,
+# RPF[0-8]
+0 ulelong&0xfffffff0 =0x52504630
+>0 ulelong&0xf <9 RAGE Package Format (RPF), version %d, used in
+>>0 ulelong&0xf =0 Rockstar Table Tennis,
+>>0 ulelong&0xf =1 *unknown*
+>>0 ulelong&0xf =2 GTA IV,
+>>0 ulelong&0xf =3 GTA IV Audio & Midnight Club: LA,
+>>0 ulelong&0xf =4 Max Payne 3,
+>>0 ulelong&0xf =5 *unknown*
+>>0 ulelong&0xf =6 RDR,
+>>0 ulelong&0xf =7 GTA V,
+>>0 ulelong&0xf =8 RDR 2,
>>4 ulelong x %d bytes,
>>>8 ulelong x %d entries
diff --git a/magic/Magdir/geo b/magic/Magdir/geo
index d72e514a2338..dda5f738311d 100644
--- a/magic/Magdir/geo
+++ b/magic/Magdir/geo
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: geo,v 1.7 2019/04/19 00:42:27 christos Exp $
+# $File: geo,v 1.8 2022/03/24 15:48:58 christos Exp $
# Geo- files from Kurt Schwehr <schwehr@ccom.unh.edu>
######################################################################
@@ -28,8 +28,8 @@
# Knudsen subbottom chirp profiler - Binary File Format: B9
# KEB D409-03167 V1.75 Huffman
0 string KEB\ Knudsen seismic KEL binary (KEB) -
->4 regex [-A-Z0-9]* Software: %s
->>&1 regex V[0-9]*\.[0-9]* version %s
+>4 regex [-A-Z0-9]+ Software: %s
+>>&1 regex V[0-9]+\\.[0-9]+ version %s
######################################################################
#
@@ -40,7 +40,7 @@
# Caris LIDAR format for LADS comes as two parts... ascii location file and binary waveform data
0 string HCA LADS Caris Ascii Format (CAF) bathymetric lidar
->4 regex [0-9]*\.[0-9]* version %s
+>4 regex [0-9]+\\.[0-9]+ version %s
0 string HCB LADS Caris Binary Format (CBF) bathymetric lidar waveform data
>3 byte x version %d .
@@ -69,7 +69,7 @@
# mb121 https://www.saic.com/maritime/gsf/
8 string GSF-v SAIC generic sensor format (GSF) sonar data,
->&0 regex [0-9]*\.[0-9]* version %s
+>&0 regex [0-9]+\\.[0-9]+ version %s
# MGD77 - https://www.ngdc.noaa.gov/mgg/dat/geodas/docs/mgd77.htm
# mb161
diff --git a/magic/Magdir/iff b/magic/Magdir/iff
index 8da0350dbfac..258d16a4e1e3 100644
--- a/magic/Magdir/iff
+++ b/magic/Magdir/iff
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: iff,v 1.17 2021/02/23 01:07:32 christos Exp $
+# $File: iff,v 1.18 2022/03/21 19:57:18 christos Exp $
# iff: file(1) magic for Interchange File Format (see also "audio" & "images")
#
# Daniel Quinlan (quinlan@yggdrasil.com) -- IFF was designed by Electronic
@@ -45,6 +45,7 @@
>8 string ACBM \b, ACBM continuous image
>8 string FAXX \b, FAXX fax image
>8 string STFX \b, ST-Fax image
+>8 string IMAGIHDR \b, CD-i image
# other formats
>8 string FTXT \b, FTXT formatted text
>8 string CTLG \b, CTLG message catalog
diff --git a/magic/Magdir/images b/magic/Magdir/images
index 6ce087255570..95004d1d9f47 100644
--- a/magic/Magdir/images
+++ b/magic/Magdir/images
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: images,v 1.205 2021/10/18 13:56:29 christos Exp $
+# $File: images,v 1.223 2022/05/14 20:05:09 christos Exp $
# images: file(1) magic for image formats (see also "iff", and "c-lang" for
# XPM bitmaps)
#
@@ -123,46 +123,46 @@
# date
>>>>&365 ubequad&0xffffFFFFffff0000 !0
# Day
->>>>>&-6 uleshort x %d
+>>>>>&-6 uleshort x %d
# Month
->>>>>&-8 uleshort x \b-%d
+>>>>>&-8 uleshort x \b-%d
# Year
->>>>>&-4 uleshort x \b-%d
+>>>>>&-4 uleshort x \b-%d
# time
>>>>&371 ubequad&0xffffFFFFffff0000 !0
# hour
->>>>>&-8 uleshort x %d
+>>>>>&-8 uleshort x %d
# minutes
->>>>>&-6 uleshort x \b:%.2d
+>>>>>&-6 uleshort x \b:%.2d
# second
->>>>>&-4 uleshort x \b:%.2d
+>>>>>&-4 uleshort x \b:%.2d
# JobName[41]
->>>>&377 string >\0 - job "%-.40s"
+>>>>&377 string >\0 - job "%-.40s"
# JobHour Jobminute Jobsecond
>>>>&418 ubequad&0xffffFFFFffff0000 !0
->>>>>&-8 uleshort x %d
->>>>>&-6 uleshort x \b:%.2d
->>>>>&-4 uleshort x \b:%.2d
+>>>>>&-8 uleshort x %d
+>>>>>&-6 uleshort x \b:%.2d
+>>>>>&-4 uleshort x \b:%.2d
# SoftwareId[41]
->>>>&424 string >\0 - %-.40s
+>>>>&424 string >\0 - %-.40s
# SoftwareVersionNumber
->>>>&424 ubyte >0
->>>>>&40 uleshort/100 x %d
->>>>>&40 uleshort%100 x \b.%d
+>>>>&424 ubyte >0
+>>>>>&40 uleshort/100 x %d
+>>>>>&40 uleshort%100 x \b.%d
# VersionLetter
->>>>>&42 ubyte >0x20 \b%c
+>>>>>&42 ubyte >0x20 \b%c
# KeyColor
->>>>&468 ulelong >0 - keycolor %#8.8x
+>>>>&468 ulelong >0 - keycolor %#8.8x
# Denominator of Pixel ratio. 0~no pixel aspect
->>>>&474 uleshort >0
+>>>>&474 uleshort >0
# Numerator
->>>>>&-4 uleshort >0 - aspect %d
->>>>>&-2 uleshort x \b/%d
+>>>>>&-4 uleshort >0 - aspect %d
+>>>>>&-2 uleshort x \b/%d
# Denominator of Gamma ratio. 0~no Gamma value
->>>>&478 uleshort >0
+>>>>&478 uleshort >0
# Numerator
->>>>>&-4 uleshort >0 - gamma %d
->>>>>&-2 uleshort x \b/%d
+>>>>>&-4 uleshort >0 - gamma %d
+>>>>>&-2 uleshort x \b/%d
# ColorOffset
#>>>>&480 ulelong x - col offset %#8.8x
# StampOffset
@@ -179,7 +179,7 @@
# adding 65 to strength so that Netpbm images comes before "x86 boot sector" or
# "DOS/MBR boot sector" identified by ./filesystems
0 name netpbm
->3 regex/s =[0-9]{1,50}\ [0-9]{1,50} Netpbm image data
+>3 regex/s =[0-9]{1,50}[\040\t\f\r\n]+[0-9]{1,50} Netpbm image data
>>&0 regex =[0-9]{1,50} \b, size = %s x
>>>&0 regex =[0-9]{1,50} \b %s
@@ -260,11 +260,11 @@
>4 string \013 MGI Type 11
>4 string \021 MGI Type 17
0 string .MDA MicroDesign data
->21 byte 48 version 2
->21 byte 51 version 3
+>21 ubyte 48 version 2
+>21 ubyte 51 version 3
0 string .MDP MicroDesign page data
->21 byte 48 version 2
->21 byte 51 version 3
+>21 ubyte 48 version 2
+>21 ubyte 51 version 3
# NIFF (Navy Interchange File Format, a modification of TIFF) images
# [GRR: this *must* go before TIFF]
@@ -277,8 +277,8 @@
# URL: https://www.sno.phy.queensu.ca/~phil/exiftool/canon_raw.html
0 string II\x1a\0\0\0HEAPCCDR Canon CIFF raw image data
!:mime image/x-canon-crw
->16 leshort x \b, version %d.
->14 leshort x \b%d
+>16 uleshort x \b, version %d.
+>14 uleshort x \b%d
# Canon RAW version 2 (CR2) files are a kind of TIFF with an extra magic
# number. Put this above the TIFF test to make sure we detect them.
@@ -288,8 +288,8 @@
0 string II\x2a\0\x10\0\0\0CR Canon CR2 raw image data
!:mime image/x-canon-cr2
!:strength +80
->10 byte x \b, version %d.
->11 byte x \b%d
+>10 ubyte x \b, version %d.
+>11 ubyte x \b%d
# Fujifilm RAF RAW image files with embedded JPEG data and compressed
# or uncompressed CFA RAW data. Byte order: Big Endian.
@@ -320,148 +320,148 @@
>(4.l) use tiff_ifd
0 name tiff_ifd
->0 leshort x \b, direntries=%d
+>0 uleshort x \b, direntries=%d
>2 use tiff_entry
0 name tiff_entry
# NewSubFileType
->0 leshort 0xfe
+>0 uleshort 0xfe
>>12 use tiff_entry
->0 leshort 0x100
->>4 lelong 1
+>0 uleshort 0x100
+>>4 ulelong 1
>>>12 use tiff_entry
->>>8 leshort x \b, width=%d
->0 leshort 0x101
->>4 lelong 1
->>>8 leshort x \b, height=%d
+>>>8 uleshort x \b, width=%d
+>0 uleshort 0x101
+>>4 ulelong 1
+>>>8 uleshort x \b, height=%d
>>>12 use tiff_entry
->0 leshort 0x102
->>8 leshort x \b, bps=%d
+>0 uleshort 0x102
+>>8 uleshort x \b, bps=%d
>>12 use tiff_entry
->0 leshort 0x103
->>4 lelong 1 \b, compression=
->>>8 leshort 1 \bnone
->>>8 leshort 2 \bhuffman
->>>8 leshort 3 \bbi-level group 3
->>>8 leshort 4 \bbi-level group 4
->>>8 leshort 5 \bLZW
->>>8 leshort 6 \bJPEG (old)
->>>8 leshort 7 \bJPEG
->>>8 leshort 8 \bdeflate
->>>8 leshort 9 \bJBIG, ITU-T T.85
->>>8 leshort 0xa \bJBIG, ITU-T T.43
->>>8 leshort 0x7ffe \bNeXT RLE 2-bit
->>>8 leshort 0x8005 \bPackBits (Macintosh RLE)
->>>8 leshort 0x8029 \bThunderscan RLE
->>>8 leshort 0x807f \bRasterPadding (CT or MP)
->>>8 leshort 0x8080 \bRLE (Line Work)
->>>8 leshort 0x8081 \bRLE (High-Res Cont-Tone)
->>>8 leshort 0x8082 \bRLE (Binary Line Work)
->>>8 leshort 0x80b2 \bDeflate (PKZIP)
->>>8 leshort 0x80b3 \bKodak DCS
->>>8 leshort 0x8765 \bJBIG
->>>8 leshort 0x8798 \bJPEG2000
->>>8 leshort 0x8799 \bNikon NEF Compressed
+>0 uleshort 0x103
+>>4 ulelong 1 \b, compression=
+>>>8 uleshort 1 \bnone
+>>>8 uleshort 2 \bhuffman
+>>>8 uleshort 3 \bbi-level group 3
+>>>8 uleshort 4 \bbi-level group 4
+>>>8 uleshort 5 \bLZW
+>>>8 uleshort 6 \bJPEG (old)
+>>>8 uleshort 7 \bJPEG
+>>>8 uleshort 8 \bdeflate
+>>>8 uleshort 9 \bJBIG, ITU-T T.85
+>>>8 uleshort 0xa \bJBIG, ITU-T T.43
+>>>8 uleshort 0x7ffe \bNeXT RLE 2-bit
+>>>8 uleshort 0x8005 \bPackBits (Macintosh RLE)
+>>>8 uleshort 0x8029 \bThunderscan RLE
+>>>8 uleshort 0x807f \bRasterPadding (CT or MP)
+>>>8 uleshort 0x8080 \bRLE (Line Work)
+>>>8 uleshort 0x8081 \bRLE (High-Res Cont-Tone)
+>>>8 uleshort 0x8082 \bRLE (Binary Line Work)
+>>>8 uleshort 0x80b2 \bDeflate (PKZIP)
+>>>8 uleshort 0x80b3 \bKodak DCS
+>>>8 uleshort 0x8765 \bJBIG
+>>>8 uleshort 0x8798 \bJPEG2000
+>>>8 uleshort 0x8799 \bNikon NEF Compressed
>>>8 default x
->>>>8 leshort x \b(unknown %#x)
+>>>>8 uleshort x \b(unknown %#x)
>>>12 use tiff_entry
->0 leshort 0x106 \b, PhotometricIntepretation=
+>0 uleshort 0x106 \b, PhotometricIntepretation=
>>8 clear x
->>8 leshort 0 \bWhiteIsZero
->>8 leshort 1 \bBlackIsZero
->>8 leshort 2 \bRGB
->>8 leshort 3 \bRGB Palette
->>8 leshort 4 \bTransparency Mask
->>8 leshort 5 \bCMYK
->>8 leshort 6 \bYCbCr
->>8 leshort 8 \bCIELab
+>>8 uleshort 0 \bWhiteIsZero
+>>8 uleshort 1 \bBlackIsZero
+>>8 uleshort 2 \bRGB
+>>8 uleshort 3 \bRGB Palette
+>>8 uleshort 4 \bTransparency Mask
+>>8 uleshort 5 \bCMYK
+>>8 uleshort 6 \bYCbCr
+>>8 uleshort 8 \bCIELab
>>8 default x
->>>8 leshort x \b(unknown=%#x)
+>>>8 uleshort x \b(unknown=%#x)
>>12 use tiff_entry
# FillOrder
->0 leshort 0x10a
->>4 lelong 1
+>0 uleshort 0x10a
+>>4 ulelong 1
>>>12 use tiff_entry
# DocumentName
->0 leshort 0x10d
+>0 uleshort 0x10d
>>(8.l) string x \b, name=%s
>>>12 use tiff_entry
# ImageDescription
->0 leshort 0x10e
+>0 uleshort 0x10e
>>(8.l) string x \b, description=%s
>>>12 use tiff_entry
# Make
->0 leshort 0x10f
+>0 uleshort 0x10f
>>(8.l) string x \b, manufacturer=%s
>>>12 use tiff_entry
# Model
->0 leshort 0x110
+>0 uleshort 0x110
>>(8.l) string x \b, model=%s
>>>12 use tiff_entry
# StripOffsets
->0 leshort 0x111
+>0 uleshort 0x111
>>12 use tiff_entry
# Orientation
->0 leshort 0x112 \b, orientation=
->>8 leshort 1 \bupper-left
->>8 leshort 3 \blower-right
->>8 leshort 6 \bupper-right
->>8 leshort 8 \blower-left
->>8 leshort 9 \bundefined
+>0 uleshort 0x112 \b, orientation=
+>>8 uleshort 1 \bupper-left
+>>8 uleshort 3 \blower-right
+>>8 uleshort 6 \bupper-right
+>>8 uleshort 8 \blower-left
+>>8 uleshort 9 \bundefined
>>8 default x
->>>8 leshort x \b[*%d*]
+>>>8 uleshort x \b[*%d*]
>>12 use tiff_entry
# XResolution
->0 leshort 0x11a
->>8 lelong x \b, xresolution=%d
+>0 uleshort 0x11a
+>>8 ulelong x \b, xresolution=%d
>>12 use tiff_entry
# YResolution
->0 leshort 0x11b
->>8 lelong x \b, yresolution=%d
+>0 uleshort 0x11b
+>>8 ulelong x \b, yresolution=%d
>>12 use tiff_entry
# ResolutionUnit
->0 leshort 0x128
->>8 leshort x \b, resolutionunit=%d
+>0 uleshort 0x128
+>>8 uleshort x \b, resolutionunit=%d
>>12 use tiff_entry
# Software
->0 leshort 0x131
+>0 uleshort 0x131
>>(8.l) string x \b, software=%s
>>12 use tiff_entry
# Datetime
->0 leshort 0x132
+>0 uleshort 0x132
>>(8.l) string x \b, datetime=%s
>>12 use tiff_entry
# HostComputer
->0 leshort 0x13c
+>0 uleshort 0x13c
>>(8.l) string x \b, hostcomputer=%s
>>12 use tiff_entry
# WhitePoint
->0 leshort 0x13e
+>0 uleshort 0x13e
>>12 use tiff_entry
# PrimaryChromaticities
->0 leshort 0x13f
+>0 uleshort 0x13f
>>12 use tiff_entry
# YCbCrCoefficients
->0 leshort 0x211
+>0 uleshort 0x211
>>12 use tiff_entry
# YCbCrPositioning
->0 leshort 0x213
+>0 uleshort 0x213
>>12 use tiff_entry
# ReferenceBlackWhite
->0 leshort 0x214
+>0 uleshort 0x214
>>12 use tiff_entry
# Copyright
->0 leshort 0x8298
+>0 uleshort 0x8298
>>(8.l) string x \b, copyright=%s
>>12 use tiff_entry
# ExifOffset
->0 leshort 0x8769
+>0 uleshort 0x8769
>>12 use tiff_entry
# GPS IFD
->0 leshort 0x8825 \b, GPS-Data
+>0 uleshort 0x8825 \b, GPS-Data
>>12 use tiff_entry
-#>0 leshort x \b, unknown=%#x
+#>0 uleshort x \b, unknown=%#x
#>>12 use tiff_entry
0 string MM\x00\x2b Big TIFF image data, big-endian
@@ -478,17 +478,17 @@
# IHDR parser
0 name png-ihdr
->0 belong x \b, %d x
->4 belong x %d,
->8 byte x %d-bit
->9 byte 0 grayscale,
->9 byte 2 \b/color RGB,
->9 byte 3 colormap,
->9 byte 4 gray+alpha,
->9 byte 6 \b/color RGBA,
-#>10 byte 0 deflate/32K,
->12 byte 0 non-interlaced
->12 byte 1 interlaced
+>0 ubelong x \b, %d x
+>4 ubelong x %d,
+>8 ubyte x %d-bit
+>9 ubyte 0 grayscale,
+>9 ubyte 2 \b/color RGB,
+>9 ubyte 3 colormap,
+>9 ubyte 4 gray+alpha,
+>9 ubyte 6 \b/color RGBA,
+#>10 ubyte 0 deflate/32K,
+>12 ubyte 0 non-interlaced
+>12 ubyte 1 interlaced
# Standard PNG image.
0 string \x89PNG\x0d\x0a\x1a\x0a\x00\x00\x00\x0DIHDR PNG image data
@@ -532,24 +532,24 @@
!:ext gif
>4 string 7a \b, version 8%s,
>4 string 9a \b, version 8%s,
->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
-#>10 byte&0x07 =0x02 8 colors
-#>10 byte&0x07 =0x03 16 colors
-#>10 byte&0x07 =0x04 32 colors
-#>10 byte&0x07 =0x05 64 colors
-#>10 byte&0x07 =0x06 128 colors
-#>10 byte&0x07 =0x07 256 colors
+>6 uleshort >0 %d x
+>8 uleshort >0 %d
+#>10 ubyte &0x80 color mapped,
+#>10 ubyte&0x07 =0x00 2 colors
+#>10 ubyte&0x07 =0x01 4 colors
+#>10 ubyte&0x07 =0x02 8 colors
+#>10 ubyte&0x07 =0x03 16 colors
+#>10 ubyte&0x07 =0x04 32 colors
+#>10 ubyte&0x07 =0x05 64 colors
+#>10 ubyte&0x07 =0x06 128 colors
+#>10 ubyte&0x07 =0x07 256 colors
# ITC (CMU WM) raster files. It is essentially a byte-reversed Sun raster,
# 1 plane, no encoding.
0 string \361\0\100\273 CMU window manager raster image data
->4 lelong >0 %d x
->8 lelong >0 %d,
->12 lelong >0 %d-bit
+>4 ulelong >0 %d x
+>8 ulelong >0 %d,
+>12 ulelong >0 %d-bit
# Magick Image File Format
# URL: https://imagemagick.org/script/miff.php
@@ -596,8 +596,49 @@
>4 long 3 \b, rectangular 32-bit (24-bit with matte)
# FIG (Facility for Interactive Generation of figures), an object-based format
-0 search/1 #FIG FIG image text
+# URL: http://fileformats.archiveteam.org/wiki/Fig
+# https://en.wikipedia.org/wiki/Xfig
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/f/fig.trid.xml
+# https://web.archive.org/web/20070920204655/http://epb.lbl.gov/xfig/fig-format.html
+# Update: Joerg Jenderek
+# Note: called "FIG vector drawing" by TrID,
+# 4 byte magic is assumed to be always at offset 0 and
+# verified by `fig2mpdf -v bootloader.fig && file bootloader.pdf`
+#0 search/1/tb #FIG FIG image text
+# GRR: with --keep-going option the line above gives duplicate messages
+0 search/1/ts #FIG
+>&0 use image-xfig
+# binary data variant with non ASCII text characters like Control-A or °C in thermostat.fig
+0 search/1/bs #FIG
+>&0 use image-xfig
+# display XFIG image describing text, mime type, file name extension and version
+0 name image-xfig
+>8 ubyte x FIG image text
+#!:mime text/plain
+# https://reposcope.com/mimetype/image/x-xfig
+!:mime image/x-xfig
+!:ext fig
+# version string like: 1.4 2.1 3.1 3.2
>5 string x \b, version %.3s
+# some times after version text like: "Produced by xfig version 3.2.5-alpha5"
+>8 ubyte >0x0D
+>>8 string x "%s"
+# should be point character (2Eh) of version string according to TrID
+#>6 ubyte !0x2E \b, at 6 %#x
+# caret character (23h) at the beginning in most or probaly all exanples
+#>0 ubyte !0x23 \b, starting with character %#x
+# URL: http://fileformats.archiveteam.org/wiki/DeskMate_Draw
+# http://en.wikipedia.org/wiki/Deskmate
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/d/dm-fig.trid.xml
+# From: Joerg Jenderek
+# Note: called "DeskMate Draw drawing" by TrID
+0 string \x14FIG DeskMate Drawing
+#!:mime application/octet-stream
+!:mime image/x-deskmate-fig
+!:ext fig
+# TODO:
+# "Cabri 3D Figure" by TrID fig-cabri.trid.xml
+# "Playmation Figure" by TrID fig-playmation.trid.xml
# PHIGS
0 string ARF_BEGARF PHIGS clear text archive
@@ -626,8 +667,8 @@
# facsimile data
1 string PC\ Research,\ Inc group 3 fax data
->29 byte 0 \b, normal resolution (204x98 DPI)
->29 byte 1 \b, fine resolution (204x196 DPI)
+>29 ubyte 0 \b, normal resolution (204x98 DPI)
+>29 ubyte 1 \b, fine resolution (204x196 DPI)
# From: Herbert Rosmanith <herp@wildsau.idv.uni.linz.at>
0 string Sfff structured fax file
@@ -652,23 +693,23 @@
# http://biosgfx.narod.ru/abr-2/
0 string AWBM
# Note: by bitmap-awbm.trid.xml called "Award BIOS logo bitmap (v2)"
->4 leshort <1981 Award BIOS Logo, version 2
-#>4 leshort <1981 Award BIOS bitmap
+>4 uleshort <1981 Award BIOS Logo, version 2
+#>4 uleshort <1981 Award BIOS bitmap
!:mime image/x-award-bioslogo2
#!:mime image/x-award-bmp
!:ext epa/bmp
# image width is a multiple of 4
->>4 leshort&0x0003 0
->>>4 leshort x \b, %d
->>>6 leshort x x %d
->>4 leshort&0x0003 >0 \b,
->>>4 leshort&0x0003 =1
->>>>4 leshort x %d+3
->>>4 leshort&0x0003 =2
->>>>4 leshort x %d+2
->>>4 leshort&0x0003 =3
->>>>4 leshort x %d+1
->>>6 leshort x x %d
+>>4 uleshort&0x0003 0
+>>>4 uleshort x \b, %d
+>>>6 uleshort x x %d
+>>4 uleshort&0x0003 >0 \b,
+>>>4 uleshort&0x0003 =1
+>>>>4 uleshort x %d+3
+>>>4 uleshort&0x0003 =2
+>>>>4 uleshort x %d+2
+>>>4 uleshort&0x0003 =3
+>>>>4 uleshort x %d+1
+>>>6 uleshort x x %d
# at offset 8 starts imagedata followed by "RGB " marker
# PC bitmaps (OS/2, Windows BMP files) (Greg Roelofs, newt@uchicago.edu)
@@ -677,15 +718,15 @@
# Note: variant starting direct with DIB header see
# http://fileformats.archiveteam.org/wiki/BMP
# verified by ImageMagick version 6.8.9-8 command `identify *.dib`
-0 leshort 40
+0 uleshort 40
# skip bad samples like GAME by looking for valid number of color planes
>12 uleshort 1 Device independent bitmap graphic
!:mime image/x-ms-bmp
!:apple ????BMPp
!:ext dib
->>4 lelong x \b, %d x
->>8 lelong x %d x
->>14 leshort x %d
+>>4 ulelong x \b, %d x
+>>8 ulelong x %d x
+>>14 uleshort x %d
# number of color planes (must be 1)
#>>12 uleshort >1 \b, %u color planes
# compression method: 0~no 1~RLE 8-bit/pixel 3~Huffman 1D
@@ -694,8 +735,8 @@
# image size is the size of raw bitmap; a dummy 0 can be given for BI_RGB bitmaps
>>20 ulelong x \b, image size %u
# horizontal and vertical resolution of the image (pixel per metre, signed integer)
->>24 lelong >0 \b, resolution %d x
->>>28 lelong x %d px/m
+>>24 ulelong >0 \b, resolution %d x
+>>>28 ulelong x %d px/m
# number of colors in palette, or 0 to default to 2**n
#>>32 ulelong >0 \b, %u colors
# number of important colors used, or 0 when every color is important
@@ -737,14 +778,14 @@
#
0 string BM
# check for magic and version 2 of VDC bitmap or BMP with cbSize=715=CB02
->2 beshort 0xCB02
+>2 ubeshort 0xCB02
>>6 short =0
>>>0 use bitmap-bmp
# VDC bitmap height or maybe a few OS/2 BMP with nonzero "hotspot coordinates"
>>6 short !0
>>>0 use bitmap-vbm
# check for magic and version 3 of VDC bitmap or BMP with cbSize=971=CB03
->2 beshort 0xCB03
+>2 ubeshort 0xCB03
# check for reserved value (=0) of VDC bitmap
>>14 short =0
>>>0 use bitmap-vbm
@@ -755,15 +796,15 @@
>2 default x
>>0 use bitmap-bmp
0 name bitmap-bmp
->14 lelong 12 PC bitmap, OS/2 1.x format
+>14 ulelong 12 PC bitmap, OS/2 1.x format
!:mime image/bmp
!:ext bmp
->>18 leshort x \b, %d x
->>20 leshort x %d
+>>18 uleshort x \b, %d x
+>>20 uleshort x %d
# number of color planes (must be 1)
-#>>22 leshort !1 \b, %u color planes
+#>>22 uleshort !1 \b, %u color planes
# number of bits per pixel (color depth); found 4 8
->>24 leshort x x %d
+>>24 uleshort x x %d
# x, y coordinates of the hotspot
>>6 uleshort >0 \b, hotspot %ux
>>>8 uleshort x \b%u
@@ -771,7 +812,7 @@
>>2 ulelong x \b, cbSize %u
#>>2 ulelong x \b, cbSize 0x%8.8x
# offBits; offset to bitmap data like:
->>10 ulelong x \b, bits offset %u
+>>10 ulelong x \b, bits offset %u
# http://fileformats.archiveteam.org/wiki/BMP#OS.2F2_BMP_2.0 no examples found
>14 ulelong 48 PC bitmap, OS/2 2.x format (DIB header size=48)
>14 ulelong 24 PC bitmap, OS/2 2.x format (DIB header size=24)
@@ -795,9 +836,9 @@
>>2 ulelong x \b, cbSize %u
#>>2 ulelong x \b, cbSize 0x%x
# offBits; offset to bitmap data like: 41E
->>10 ulelong x \b, bits offset %u
-#>>10 ulelong x \b, bits offset 0x%x
->14 lelong 64 PC bitmap, OS/2 2.x format
+>>10 ulelong x \b, bits offset %u
+#>>10 ulelong x \b, bits offset 0x%x
+>14 ulelong 64 PC bitmap, OS/2 2.x format
!:mime image/bmp
!:apple ????BMPp
!:ext bmp
@@ -815,18 +856,18 @@
# BMP with cbSize 000002CBh=715 or 000003CBh=971 maybe misinterpreted as VDC bitmap
#>>2 ulelong x \b, cbSize %#x
# offBits; offset to bitmap data like 56h 5Eh 8Eh 43Eh
->>10 ulelong x \b, bits offset %u
-#>>10 ulelong x \b, bits offset %#x
-#>>(10.l) ubequad !0 \b, bits %#16.16llx
+>>10 ulelong x \b, bits offset %u
+#>>10 ulelong x \b, bits offset %#x
+#>>(10.l) ubequad !0 \b, bits %#16.16llx
# BITMAPV2INFOHEADER adds RGB bit masks
->14 lelong 52 PC bitmap, Adobe Photoshop
+>14 ulelong 52 PC bitmap, Adobe Photoshop
!:mime image/bmp
!:apple ????BMPp
!:ext bmp
->>18 lelong x \b, %d x
->>22 lelong x %d x
+>>18 ulelong x \b, %d x
+>>22 ulelong x %d x
# number of bits per pixel (color depth); found 16 32
->>28 leshort x %d
+>>28 uleshort x %d
# x, y coordinates of the hotspot; should be zero for Windows variant
>>6 uleshort >0 \b, hotspot %ux
>>>8 uleshort x \b%u
@@ -834,17 +875,17 @@
>>2 ulelong x \b, cbSize %u
#>>2 ulelong x \b, cbSize 0x%x
# offBits; offset to bitmap data like: 42h
->>10 ulelong x \b, bits offset %u
-#>>10 ulelong x \b, bits offset 0x%x
+>>10 ulelong x \b, bits offset %u
+#>>10 ulelong x \b, bits offset 0x%x
# BITMAPV3INFOHEADER adds alpha channel bit mask
->14 lelong 56 PC bitmap, Adobe Photoshop with alpha channel mask
+>14 ulelong 56 PC bitmap, Adobe Photoshop with alpha channel mask
!:mime image/bmp
!:apple ????BMPp
!:ext bmp
->>18 lelong x \b, %d x
->>22 lelong x %d x
+>>18 ulelong x \b, %d x
+>>22 ulelong x %d x
# number of bits per pixel (color depth); found 16 32
->>28 leshort x %d
+>>28 uleshort x %d
# x, y coordinates of the hotspot; should be zero for Windows variant
>>6 uleshort >0 \b, hotspot %ux
>>>8 uleshort x \b%u
@@ -854,15 +895,15 @@
# offBits; offset to bitmap data like: 46h
>>10 ulelong x \b, bits offset %u
#>>10 ulelong x \b, bits offset 0x%x
->14 lelong 40
+>14 ulelong 40
# jump 4 bytes before end of file/header to skip fmt-116-signature-id-118.dib
# broken for large bitmaps
#>>(2.l-4) ulong x PC bitmap, Windows 3.x format
->>14 lelong 40 PC bitmap, Windows 3.x format
+>>14 ulelong 40 PC bitmap, Windows 3.x format
!:mime image/bmp
!:apple ????BMPp
->>>18 lelong x \b, %d x
->>>22 lelong x %d
+>>>18 ulelong x \b, %d x
+>>>22 ulelong x %d
# 320 x 400 https://en.wikipedia.org/wiki/LOGO.SYS
>>>18 ulequad =0x0000019000000140 x
!:ext bmp/sys
@@ -882,7 +923,7 @@
>>>>>18 default x x
!:ext bmp
# number of bits per pixel (color depth); found 1 2 4 8 16 24 32
->>>28 leshort x %d
+>>>28 uleshort x %d
# x, y coordinates of the hotspot; there is no hotspot in bitmaps, so values 0
#>>>6 uleshort >0 \b, hotspot %ux
#>>>>8 uleshort x \b%u
@@ -894,8 +935,8 @@
# image size is the size of raw bitmap; a dummy 0 can be given for BI_RGB bitmaps
>>>34 ulelong >0 \b, image size %u
# horizontal and vertical resolution of the image (pixel per metre, signed integer)
->>>38 lelong >0 \b, resolution %d x
->>>>42 lelong x %d px/m
+>>>38 ulelong >0 \b, resolution %d x
+>>>>42 ulelong x %d px/m
# number of colors in palette 16 256, or 0 to default to 2**n
#>>>46 ulelong >0 \b, %u colors
# number of important colors used, or 0 when every color is important
@@ -904,63 +945,63 @@
>>>2 ulelong x \b, cbSize %u
#>>>2 ulelong x \b, cbSize %#x
# offBits; offset to bitmap data like 36h 76h BEh 236h 406h 436h 4E6h
->>>10 ulelong x \b, bits offset %u
-#>>>10 ulelong x \b, bits offset %#x
-#>>>(10.l) ubequad !0 \b, bits %#16.16llxd
->14 lelong 124 PC bitmap, Windows 98/2000 and newer format
+>>>10 ulelong x \b, bits offset %u
+#>>>10 ulelong x \b, bits offset %#x
+#>>>(10.l) ubequad !0 \b, bits %#16.16llxd
+>14 ulelong 124 PC bitmap, Windows 98/2000 and newer format
!:mime image/bmp
!:ext bmp
->>18 lelong x \b, %d x
->>22 lelong x %d x
+>>18 ulelong x \b, %d x
+>>22 ulelong x %d x
# color planes; must be 1
#>>>26 uleshort >1 \b, %u color planes
# number of bits per pixel (color depth); found 4 8 16 24 32 1 (fmt-119-signature-id-121.bmp) 0 (rgb24jpeg.bmp rgb24png.bmp)
->>28 leshort x %d
+>>28 uleshort x %d
# x, y coordinates of the hotspot; should be zero for Windows variant
->>6 leshort >0 \b, hotspot %ux
->>>8 leshort x \b%u
+>>6 uleshort >0 \b, hotspot %ux
+>>>8 uleshort x \b%u
# cbSize; size of file like: 8E AA 48A 999 247A 4F02 7F8A 3F88E B216E 1D4C8A 100008A
>>2 ulelong x \b, cbSize %u
#>>2 ulelong x \b, cbSize 0x%x
# offBits; offset to bitmap data like: 8A 47A ABABABAB (fmt-119-signature-id-121.bmp)
->>10 ulelong x \b, bits offset %u
-#>>10 ulelong x \b, bits offset 0x%x
->14 lelong 108 PC bitmap, Windows 95/NT4 and newer format
+>>10 ulelong x \b, bits offset %u
+#>>10 ulelong x \b, bits offset 0x%x
+>14 ulelong 108 PC bitmap, Windows 95/NT4 and newer format
!:mime image/bmp
!:ext bmp
->>18 lelong x \b, %d x
->>22 lelong x %d x
+>>18 ulelong x \b, %d x
+>>22 ulelong x %d x
# number of bits per pixel (color depth); found 8 24 32
->>28 leshort x %d
+>>28 uleshort x %d
# x, y coordinates of the hotspot; should be zero for Windows variant
->>6 leshort >0 \b, hotspot %ux
->>>8 leshort x \b%u
+>>6 uleshort >0 \b, hotspot %ux
+>>>8 uleshort x \b%u
# cbSize; size of file like: 82 8A 9A 9F86 1E07A 3007A 88B7A C007A
>>2 ulelong x \b, cbSize %u
#>>2 ulelong x \b, cbSize 0x%x
# offBits; offset to bitmap data like: 7A 7E 46A
->>10 ulelong x \b, bits offset %u
-#>>10 ulelong x \b, bits offset 0x%x
+>>10 ulelong x \b, bits offset %u
+#>>10 ulelong x \b, bits offset 0x%x
# Update: Joerg Jenderek
# URL: http://fileformats.archiveteam.org/wiki/OS/2_Icon
# Reference: http://www.fileformat.info
# /format/os2bmp/spec/902d5c253f2a43ada39c2b81034f27fd/view.htm
# Note: verified by command like `deark -l -d3 OS2MEMU.ICO`
-0 string IC
+0 string IC
# skip Lotus smart icon *.smi by looking for valid hotspot coordinates
>6 ulelong&0xFF00FF00 =0 OS/2 icon
# jump 4 bytes before end of header/file and test for accessibility
-#>>(2.l-4) ubelong x End of header is OK!
+#>>(2.l-4) ubelong x End of header is OK!
!:mime image/x-os2-ico
!:ext ico
# cbSize; size of header or file in bytes like 1ah 120h 420h
->>2 ulelong x \b, cbSize %u
+>>2 ulelong x \b, cbSize %u
# xHotspot, yHotspot; coordinates of the hotspot for icons like 16 32
->>6 uleshort x \b, hotspot %ux
->>8 uleshort x \b%u
+>>6 uleshort x \b, hotspot %ux
+>>8 uleshort x \b%u
# offBits; offset in bytes to the beginning of the bit-map pel data like 20h
->>10 ulelong x \b, bits offset %u
-#>>(10.l) ubequad x \b, bits %#16.16llx
+>>10 ulelong x \b, bits offset %u
+#>>(10.l) ubequad x \b, bits %#16.16llx
#0 string PI PC pointer image data
#0 string CI PC color icon data
0 string CI
@@ -991,15 +1032,15 @@
>>>30 ulelong 3 \b, Huffman 1D compression
#>>>30 ulelong >0 \b, %u compression
# xHotspot, yHotspot; coordinates of the hotspot like 0 1 16 20 32 33 63 64
->>6 uleshort x \b, hotspot %ux
->>8 uleshort x \b%u
+>>6 uleshort x \b, hotspot %ux
+>>8 uleshort x \b%u
# cbSize; size of header or maybe file in bytes like 1Ah 4Eh 84Eh
->>2 ulelong x \b, cbSize %u
-#>>2 ulelong x \b, cbSize %x
+>>2 ulelong x \b, cbSize %u
+#>>2 ulelong x \b, cbSize %x
# offBits; offset to bitmap data (pixel array) like E4h 3Ah 66h 6Ah 33Ah 4A4h
->>10 ulelong x \b, bits offset %u
-#>>10 ulelong x \b, bits offset %#x
-#>>(10.l) ubequad !0 \b, bits %#16.16llx
+>>10 ulelong x \b, bits offset %u
+#>>10 ulelong x \b, bits offset %#x
+#>>(10.l) ubequad !0 \b, bits %#16.16llx
# dib header size: 12~Ch~OS/2 1.x 64~40h~OS/2 2.x
#>>14 ulelong x \b, dib header size %u
#0 string CP PC color pointer image data
@@ -1040,15 +1081,15 @@
>>>30 ulelong 3 \b, Huffman 1D compression
#>>>30 ulelong >0 \b, %u compression
# xHotspot, yHotspot; coordinates of the hotspot like 0 3 4 8 15 16 23 27 31
->>6 uleshort x \b, hotspot %ux
->>8 uleshort x \b%u
+>>6 uleshort x \b, hotspot %ux
+>>8 uleshort x \b%u
# cbSize; size of header or maybe file in bytes like 1Ah 4Eh
->>2 ulelong x \b, cbSize %u
-#>>2 ulelong x \b, cbSize %x
+>>2 ulelong x \b, cbSize %u
+#>>2 ulelong x \b, cbSize %x
# offBits; offset to bitmap data (pixel array) like 6Ah A4h E4h 4A4h
->>10 ulelong x \b, bits offset %u
-#>>10 ulelong x \b, bits offset %#x
-#>>(10.l) ubequad !0 \b, bits %#16.16llx
+>>10 ulelong x \b, bits offset %u
+#>>10 ulelong x \b, bits offset %#x
+#>>(10.l) ubequad !0 \b, bits %#16.16llx
# dib header size: 12~Ch~OS/2 1.x 64~40h~OS/2 2.x
#>>14 ulelong x \b, dib header size %u
# Conflicts with other entries [BABYL]
@@ -1061,12 +1102,12 @@
!:mime image/x-os2-graphics
#!:apple ????BMPf
# cbSize; size of header like 28h 5Ch
->>2 ulelong x \b, cbSize %u
-#>>2 ulelong x \b, cbSize %#x
+>>2 ulelong x \b, cbSize %u
+#>>2 ulelong x \b, cbSize %#x
# offNext; offset to data like 0 48h F2h 4Eh 64h C6h D2h D6h DAh E6h EAh 348h
->>6 ulelong >0 \b, data offset %u
-#>>6 ulelong >0 \b, data offset %#x
-#>>(6.l) ubequad !0 \b, data %#16.16llx
+>>6 ulelong >0 \b, data offset %u
+#>>6 ulelong >0 \b, data offset %#x
+#>>(6.l) ubequad !0 \b, data %#16.16llx
# dimensions of the intended device like 640 x 480 for VGA or 1024 x 768
>>10 uleshort >0 \b, display %u
>>>12 uleshort >0 x %u
@@ -1088,22 +1129,68 @@
>>14 indirect x
# XPM icons (Greg Roelofs, newt@uchicago.edu)
-0 search/1 /*\ XPM\ */ X pixmap image text
-!:mime image/x-xpmi
+# Update: Joerg Jenderek
+# URL: http://fileformats.archiveteam.org/wiki/XPM
+# Reference: http://www.x.org/docs/XPM/xpm.pdf
+# http://mark0.net/download/triddefs_xml.7z/defs/b/bitmap-xpm.trid.xml
+# Note: called "X PixMap bitmap" by TrID and "X-Windows Pixmap Image" by DROID via PUID x-fmt/208
+# starting with c comment like: logo.xpm
+0 string /*\040
+# 9 byte c-comment "/* XPM */" not at the beginning like: mozicon16.xpm mozicon50.xpm (thunderbird)
+>0 search/0xCE /*\ XPM\ */
+# skip DROID x-fmt-208-signature-id-620.xpm by looking for char aray without explict length
+# and match mh-logo.xpm (emacs)
+>>&0 search/1249 []
+>>>0 use xpm-image
+# non standard because no 9 byte c-comment "/* XPM */" like: logo.xpm in qemu package
+>0 default x
+# words are separated by a white space which can be composed of space and tabulation characters
+>>0 search/0x52 static\040char\040
+# skip debug.c testmlc.c by looking for char aray without explict length
+# https://www.clamav.net/downloads/production/clamav-0.104.2.tar.gz
+# clamav-0.104.2\libclammspack\mspack\debug.c
+>>>&0 search/64 []
+>>>>0 use xpm-image
+# display X pixmap image information
+0 name xpm-image
+>0 string x X pixmap image text
+#!:mime text/plain
+# https://reposcope.com/mimetype/image/x-xpixmap
+# alias
+#!:mime image/x-xpm
+!:mime image/x-xpixmap
+!:ext xpm
+# NO pm example found!
+#!:ext xpm/pm
+# look for start of character array at beginning of a line like: psetupl.xpm (OpenOffice 4.1.7)
+>0 search/0x406 \n"
+# DEBUG VALUES string
+#>>&0 string x '%s'
+# width with optional white space before like: 16 24 32 48 1280
+>>&0 regex/8 [0-9]{1,5} \b, %s
+# height with white space like: 15 16 17 24 32 48 1024
+>>>&0 regex/8 [0-9]{1,5} x %s
+# number of colors with white space like: 1 2 3 4 5 8 11 14 162 255 but unrelistic 4294967295 by hardcopy tool
+>>>>&0 regex/12 [0-9]{1,9} x %s
+# chars_per_pixel with white space like: 1 2
+>>>>>&0 regex/14 [0-9]{1,2} \b, %s chars/pixel
+# non standard because not starting with 9 byte c-comment "/* XPM */"
+>0 string !/*\ XPM\ */
+>>0 string x \b, 1st line "%s"
# Utah Raster Toolkit RLE images (janl@ifi.uio.no)
-0 leshort 0xcc52 RLE image data,
->6 leshort x %d x
->8 leshort x %d
->2 leshort >0 \b, lower left corner: %d
->4 leshort >0 \b, lower right corner: %d
->10 byte&0x1 =0x1 \b, clear first
->10 byte&0x2 =0x2 \b, no background
->10 byte&0x4 =0x4 \b, alpha channel
->10 byte&0x8 =0x8 \b, comment
->11 byte >0 \b, %d color channels
->12 byte >0 \b, %d bits per pixel
->13 byte >0 \b, %d color map channels
+0 uleshort 0xcc52 RLE image data,
+>6 uleshort x %d x
+>8 uleshort x %d
+>2 uleshort >0 \b, lower left corner: %d
+>4 uleshort >0 \b, lower right corner: %d
+>10 ubyte&0x1 =0x1 \b, clear first
+>10 ubyte&0x2 =0x2 \b, no background
+>10 ubyte&0x4 =0x4 \b, alpha channel
+>10 ubyte&0x8 =0x8 \b, comment
+>11 ubyte >0 \b, %d color channels
+>12 ubyte >0 \b, %d bits per pixel
+>13 ubyte >0 \b, %d color map channels
# image file format (Robert Potter, potter@cs.rochester.edu)
0 string Imagefile\ version- iff image data
@@ -1111,55 +1198,55 @@
>10 string >\0 %s
# Sun raster images, from Daniel Quinlan (quinlan@yggdrasil.com)
-0 belong 0x59a66a95 Sun raster image data
->4 belong >0 \b, %d x
->8 belong >0 %d,
->12 belong >0 %d-bit,
-#>16 belong >0 %d bytes long,
->20 belong 0 old format,
-#>20 belong 1 standard,
->20 belong 2 compressed,
->20 belong 3 RGB,
->20 belong 4 TIFF,
->20 belong 5 IFF,
->20 belong 0xffff reserved for testing,
->24 belong 0 no colormap
->24 belong 1 RGB colormap
->24 belong 2 raw colormap
-#>28 belong >0 colormap is %d bytes long
+0 ubelong 0x59a66a95 Sun raster image data
+>4 ubelong >0 \b, %d x
+>8 ubelong >0 %d,
+>12 ubelong >0 %d-bit,
+#>16 ubelong >0 %d bytes long,
+>20 ubelong 0 old format,
+#>20 ubelong 1 standard,
+>20 ubelong 2 compressed,
+>20 ubelong 3 RGB,
+>20 ubelong 4 TIFF,
+>20 ubelong 5 IFF,
+>20 ubelong 0xffff reserved for testing,
+>24 ubelong 0 no colormap
+>24 ubelong 1 RGB colormap
+>24 ubelong 2 raw colormap
+#>28 ubelong >0 colormap is %d bytes long
# SGI image file format, from Daniel Quinlan (quinlan@yggdrasil.com)
#
# See
# http://reality.sgi.com/grafica/sgiimage.html
#
-0 beshort 474 SGI image data
-#>2 byte 0 \b, verbatim
->2 byte 1 \b, RLE
-#>3 byte 1 \b, normal precision
->3 byte 2 \b, high precision
->4 beshort x \b, %d-D
->6 beshort x \b, %d x
->8 beshort x %d
->10 beshort x \b, %d channel
->10 beshort !1 \bs
+0 ubeshort 474 SGI image data
+#>2 ubyte 0 \b, verbatim
+>2 ubyte 1 \b, RLE
+#>3 ubyte 1 \b, normal precision
+>3 ubyte 2 \b, high precision
+>4 ubeshort x \b, %d-D
+>6 ubeshort x \b, %d x
+>8 ubeshort x %d
+>10 ubeshort x \b, %d channel
+>10 ubeshort !1 \bs
>80 string >0 \b, "%s"
0 string IT01 FIT image data
->4 belong x \b, %d x
->8 belong x %d x
->12 belong x %d
+>4 ubelong x \b, %d x
+>8 ubelong x %d x
+>12 ubelong x %d
#
0 string IT02 FIT image data
->4 belong x \b, %d x
->8 belong x %d x
->12 belong x %d
+>4 ubelong x \b, %d x
+>8 ubelong x %d x
+>12 ubelong x %d
#
2048 string PCD_IPI Kodak Photo CD image pack file
->0xe02 byte&0x03 0x00 , landscape mode
->0xe02 byte&0x03 0x01 , portrait mode
->0xe02 byte&0x03 0x02 , landscape mode
->0xe02 byte&0x03 0x03 , portrait mode
+>0xe02 ubyte&0x03 0x00 , landscape mode
+>0xe02 ubyte&0x03 0x01 , portrait mode
+>0xe02 ubyte&0x03 0x02 , landscape mode
+>0xe02 ubyte&0x03 0x03 , portrait mode
0 string PCD_OPA Kodak Photo CD overview pack file
# FITS format. Jeff Uphoff <juphoff@tarsier.cv.nrao.edu>
@@ -1181,7 +1268,7 @@
# From SunOS 5.5.1 "/etc/magic" - appeared right before Sun raster image
# stuff.
#
-0 beshort 0x1010 PEX Binary Archive
+0 ubeshort 0x1010 PEX Binary Archive
# DICOM medical imaging data
# URL: https://en.wikipedia.org/wiki/DICOM#Data_format
@@ -1192,23 +1279,138 @@
!:ext dcm/dicom/dic
# XWD - X Window Dump file.
+# URL: http://fileformats.archiveteam.org/wiki/XWD
+# Reference: https://wiki.multimedia.cx/index.php?title=XWD
+# http://mark0.net/download/triddefs_xml.7z/defs/x/xdm-x11.trid.xml
+# Note: called "X-Windows Screen Dump (X11)" by TrID and
+# "X-Windows Screen Dump" version X11 by DROID via PUID fmt/483
+# verfied by XnView `nconvert -in xwd -info *`
+# and ImageMagick 6.9.11 `identify -verbose *` as XWD X Windows system window dump
+# and `xwud -in fig41.wxd -dumpheader`
# As described in /usr/X11R6/include/X11/XWDFile.h
# used by the xwd program.
# Bradford Castalia, idaeim, 1/01
-# updated by Adam Buchbinder, 2/09
+# updated by Adam Buchbinder, 2/09 and Joerg Jenderek, May 2022
# The following assumes version 7 of the format; the first long is the length
# of the header, which is at least 25 4-byte longs, and the one at offset 8
# is a constant which is always either 1 or 2. Offset 12 is the pixmap depth,
# which is a maximum of 32.
-0 belong >100
->8 belong <3
->>12 belong <33
->>>4 belong 7 XWD X Window Dump image data
+# Size of the entire file header (bytes) like: 100 104 105 106 107 109 110 113 114 115 118 172
+0 ubelong >99
+# pixmap_format; Pixmap format; 0~1-bit (XYBitmap) format 1~single-plane (XYPixmap) 2~bitmap with two or more planes (ZPixmap)
+>8 ubelong <3
+# pixmap_depth; Pixmap depth; value 1 - 32
+>>12 ubelong <33
+# file_version; XWD_FILE_VERSION=7
+>>>4 ubelong 7
+# skip DROID fmt-401-signature-id-618.xwd by test for existing border field
+>>>>96 ubelong x X-Window screen dump image data, version X11
+# ./images (version 1.205) labeled the above entry as "XWD X Window Dump image data"
+# https://reposcope.com/mimetype/image/x-xwindowdump
!:mime image/x-xwindowdump
->>>>100 string >\0 \b, "%s"
->>>>16 belong x \b, %dx
->>>>20 belong x \b%dx
->>>>12 belong x \b%d
+#!:ext xwd
+!:ext xwd/dmp
+# https://www.xnview.com/en/image_formats/ NO example with x11 suffix FOUND!
+#!:ext xwd/dmp/x11
+# https://www.nationalarchives.gov.uk/PRONOM/fmt/401 NO example with xdm suffix FOUND!
+#!:ext xwd/dmp/x11/xmd
+# file comment if header > 100; so not in MARBLES.XWD and hardcopy-x-window-v11.xwd
+>>>>>0 ubelong >100
+# comment or windows name
+>>>>>>100 string >\0 \b, "%s"
+# pixmap_width; pixmap width like: 576 800 1014 1280 1419 NOT -1414812757=abABabABh
+>>>>>16 ubelong x \b, %dx
+# pixmap_height; pixmap height like: 449 454 600 704 720 1001 1024 NOT -1414812757=abABabABh
+>>>>>20 ubelong x \b%dx
+# pixmap_depth; pixmap depth
+>>>>>12 ubelong x \b%d
+# XOffset; Bitmap X offset; pixel numbers to ignore at the beginning of each scan-line
+#>>>>>24 ubelong x \b, %u ignore
+# ByteOrder; byte order of image data: 0~least significant byte first 1~most significant byte first
+>>>>>28 ubelong >0 \b, order %u
+# BitmapUnit; bitmap base data size unit in each scan line like: 8 16 32
+#>>>>>32 ubelong x \b, unit %u
+# BitmapBitOrder; bit-order of image data; apparently same as ByteOrder
+#>>>>>36 ubelong x \b, bit order %u
+# BitmapPad; number of padding bits added to each scan line like: 8 16 32
+#>>>>>40 ubelong x \b, pad %u
+# BitsPerPixel; Bits per pixel: 1~StaticGray and GrayScale 2-15~StaticColor and PseudoColor 16,24,32~TrueColor and DirectColor
+#>>>>>44 ubelong x \b, %u bits/pixel
+# BytesPerLine; size of each scan line in bytes
+#>>>>>48 ubelong x \b, %u bytes/line
+# VisualClass; class of the image: 0~StaticGray 1~GrayScale 2~StaticColor 3~PseudoColor 4~TrueColor 5~DirectColor
+#>>>>>52 ubelong x \b, %u Class
+# RedMask; red RGB mask values used by ZPixmaps like: 0 0xff0000
+#>>>>>56 ubelong !0 \b, %#x red
+# GreenMask; green mask like: 0
+#>>>>>60 ubelong !0 \b, %#x green
+# BlueMask; blue mask like: 0 0xff
+#>>>>>64 ubelong !0 \b, %#x blue
+# BitsPerRgb; Size of each color mask in bits like: 0 1 8 24
+#>>>>>68 ubelong x \b, %u bits/RGB
+# NumberOfColors; number of colors in image like: 256 4 2 0 (WHAT DOES THIS MEAN?)
+>>>>>72 ubelong x \b, %u colors
+# ColorMapEntries; number of entries in color map like: 256 16 2 0~no color map
+>>>>>76 ubelong x %u entries
+# WindowWidth; window width
+#>>>>>80 ubelong x \b, %u width
+# WindowHeight; window height
+#>>>>>84 ubelong x \b, %u height
+# WindowX; Window upper left X coordinate like: 0 24 32 80 237 290 422 466 568 (lenna.dmp)
+>>>>>88 ubelong !0 \b, x=%d
+# WindowY; Window upper left Y coordinate like: 0 8 18 26 60 73 107 (fig41.xwd) 128
+>>>>>92 ubelong !0 \b, y=%d
+# WindowBorderWidth; Window border width; apparently pixmap_width=WindowWidth+2*WindowBorderWidth
+# like: 1 (fig41.xwd) 2 (maze.dmp) 3 (lenna.dmp mandrill.dmp)
+>>>>>96 ubelong >0 \b, %u border
+# From: Joerg Jenderek
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/x/xdm-x10.trid.xml
+# Note: called "X-Windows Screen Dump (X10)" by TrID and
+# "X-Windows Screen Dump" version X10 by DROID via PUID x-fmt/300
+# verfied by XnView `nconvert -in xwd -info *`
+# HeaderSize is the size of the header in bytes; always 40 for X10 variant
+0 ubelong =0x000000028
+# FileVersion; always 6 for X10 variant
+>4 ubelong =6
+# skip DROID x-fmt-300-signature-id-619.xdm by test existing border field
+>>36 ubeshort x X-Window screen dump image data, version X10
+!:mime image/x-xwindowdump
+!:ext xwd
+# http://www.nationalarchives.gov.uk/pronom/fmt/401 NO example with xdm suffix FOUND!
+#!:ext xwd/xdm
+# PixmapWidth; pixmap width like: 127 1280
+>>>20 ubelong x \b, %d
+# PixmapHeight; pixmap height like: 64 1024
+>>>24 ubelong x \bx%d
+# DisplayPlanes; number of display planes like: 1 4 8
+>>>12 ubelong x \bx%u
+# DisplayType; display type like: 1 3
+#>>>8 ubelong x \b, type %u
+# PixmapFormat; pixmap format like: 1~bitmap with two or more planes (ZPixmap) 0~single-plane bitmap (XYBitmap)
+#>>>16 ubelong x \b, %u format
+# WindowWidth; window width; probably PixmapWidth=WindowWidth+2*WindowBorderWidth
+#>>>28 ubeshort x \b, width %u
+# WindowHeight; window height; probably PixmapWidth=PixmapHeight+2*WindowBorderWidth
+#>>>30 ubeshort x \b, height %u
+# WindowX; window upper left X coordinate like: 0
+>>>32 ubeshort !0 \b, x=%d
+# WindowY; window upper left Y coordinate like: 0
+>>>34 ubeshort !0 \b, y=%d
+# WindowBorderWidth; window border width like: 0
+>>>36 ubeshort !0 \b, %u border
+# WindowNumColors; Number of color entries in window like: 2 16 256
+#>>>38 ubeshort x \b, %u colors
+# if the image is a PseudoColor image, a color map immediately follows the header. X10COLORMAP[WindowNumColors];
+# EntryNumber; number of the color-map entry like: 0
+#>>>40 ubeshort x \b, colors #%u
+# Red; red-channel value
+#>>>42 ubeshort !0 \b, red %#x
+# Green; green-channel value
+#>>>44 ubeshort !0 \b, green %#x
+# Blue; blue-channel value
+#>>>46 ubeshort !0 \b, blue %#x
+# 2ND Entry like: 2
+#>>>48 ubeshort x \b, colors #%u
# PDS - Planetary Data System
# These files use Parameter Value Language in the header section.
@@ -1231,15 +1433,174 @@
# used for runs of yy.
#
0 string pM85 Atari ST STAD bitmap image data (hor)
->5 byte 0x00 (white background)
->5 byte 0xFF (black background)
+>5 ubyte 0x00 (white background)
+>5 ubyte 0xFF (black background)
0 string pM86 Atari ST STAD bitmap image data (vert)
->5 byte 0x00 (white background)
->5 byte 0xFF (black background)
+>5 ubyte 0x00 (white background)
+>5 ubyte 0xFF (black background)
# From: Alex Myczko <alex@aiei.ch>
# https://www.atarimax.com/jindroush.atari.org/afmtatr.html
-0 leshort 0x0296 Atari ATR image
+0 uleshort 0x0296 Atari ATR image
+
+# URL: http://fileformats.archiveteam.org/wiki/DEGAS_image
+# Reference: https://wiki.multimedia.cx/index.php?title=Degas
+# From: Joerg Jenderek
+# http://mark0.net/download/triddefs_xml.7z/defs/b
+# bitmap-pi2-degas.trid.xml bitmap-pi3-degas.trid.xml
+# bitmap-pc1-degas.trid.xml bitmap-pc2-degas.trid.xml bitmap-pc3-degas.trid.xml
+# Note: verified by NetPBM `pi3topbm sigirl1.pi3 | file`
+# `deark -m degas -l -d2 ataribak.pi1`
+# XnView `nconvert -fullinfo *.p??`
+# DEGAS low-res uncompressed bitmap *.pi1
+0 beshort 0x0000
+# skip some ISO 9660 CD-ROM filesystems like plpbt.iso by test for 4 non black colors in palette entries
+>2 quad !0
+# skip g3test.g3 by test for unused bits of 2nd color entry
+>>4 ubeshort&0xF000 0
+>>>0 use degas-bitmap
+# DEGAS mid-res uncompressed bitmap *.pi2 (strength=50) after GEM Images like:
+# BEETHVEN.IMG CHURCH.IMG GAMEOVR4.IMG TURKEY.IMG clinton.img
+0 beshort 0x0001
+#!:strength +0
+# skip many control files like gnucash-4.8.setup.exe.aria2 by test for non black in 4 palette entries
+>2 quad !0
+# skip control file load-v0001.aria2 by test for unused bits of 5th color palette entry
+>>10 ubeshort&0xF000 0
+# skip many GEM Image data like DANCER.IMG GAMEOVR4.IMG SHIP.IMG by test for unused bits of 8th color palette entry
+>>>16 ubeshort&0xF000 0
+# skip many GEM Image data like BEETHVEN.IMG CABINETS.IMG MEMO.IMG by test for unused bits of 14th color palette entry
+>>>>28 ubeshort&0xF000 0
+# skip few GEM Image data like CHURCH.IMG by test for unused bits of 15th color palette entry
+>>>>>30 ubeshort&0xF000 0
+# skip many GEM Image data like TIGER.IMG TURKEY.IMG XMAS.IMG by test for unused bits of 16th color palette entry
+>>>>>>32 ubeshort&0xF000 0
+# skip GEM Image data like clinton.img by test for existing bytes at the end
+>>>>>>>32026 quad x
+>>>>>>>>0 use degas-bitmap
+# DEGAS high-res uncompressed bitmap *.pi3
+0 beshort 0x0002
+# skip Intel ia64 COFF msvcrt.lib by test for unused bits of 1st atari color palette entry
+>2 ubeshort&0xF000 0
+# skip few Adobe PhotoShop Brushes like Faux-Spitzen.abr by check
+# for invalid Adobe PhotoShop Brush UTF16-LE string length
+>>19 ubyte =0
+# many like: 4th_ofj2.pi3 GEMINI03.PI3 PEOPLE18.PI3 POWERFIX.PI3 abydos.pi3 highres.pi3 sigirl1.pi3 vanna5.pi3
+>>>0 use degas-bitmap
+# Adobe PhotoShop Brush UTF16-LE string length 15 "Gitter - klein " 8 "Kreis 1 "
+>>19 ubyte !0
+#>>19 ubyte !0 \b, NOTE LENGTH %u
+#>>>21 lestring16 x \b, BRUSH NOTE "%s"
+>>>(19.b*2) ubequad x
+# maybe last character of Adobe PhotoShop Brush UTF16-LE string and terminating nul char like
+# 006e0000 for n in "Faux-Spitzen.abr" 00310000 for 1 in "Verschiedene Spitzen.abr"
+# 00000000 "LEREDACT.PI3" 03730773 "TBX_DEMO.PI3"
+#>>>>&8 ubelong x \b, LAST CHAR+NIL %8.8x
+>>>>&8 ubelong&0xff00ffFF !0
+# many DEGAS bitmap like: ARABDEMO.PI3 ELMRSESN.PI3 GEMVIEW.PI3 LEREDACT.PI3 PICCOLO.PI3 REPRO_JR.PI3 ST_TOOLS.PI3 TBX_DEMO.PI3 evgem7.pi3
+>>>>>0 use degas-bitmap
+# test for last character of Adobe PhotoShop Brush UTF16-LE string and terminating nul char
+>>>>&8 ubelong&0xff00ffFF =0
+# select last DEGAS bitmaps by invalid last char of brush note like BASICNES.PI3 DB_HELP.PI3 DB_WRITR.PI3 LEREDACT.PI3
+>>>>>&-4 ubelong&0x00FF0000 <0x00200000
+>>>>>>0 use degas-bitmap
+# last character of Adobe PhotoShop Brush UTF16-LE note
+#>>>>>&-4 ubelong&0x00FF0000 >0x001F0000 \b, THAT IS ABR
+# DEGAS low-res compressed bitmap *.pc1 like: BATTLSHP.PC1 GNUCHESS.PC1 MEDUSABL.PC1 MOONLORD.PC1 WILDROSE.PC1
+0 beshort 0x8000
+# skip lif files handled via ./lif by test for unused bits of 1st palette entry
+>2 ubeshort&0xF000 0
+>>0 use degas-bitmap
+# DEGAS mid-res compressed bitmap *.pc2 like: abydos.pc2 ARTIS3.PC2 SMTHDRAW.PC2 STAR_2K.PC2 TX2_DEMO.PC2
+0 beshort 0x8001
+>0 use degas-bitmap
+# DEGAS high-res compressed bitmap *.pc3 like: abydos.pc3 COYOTE.PC3 ELEPHANT.PC3 TX2_DEMO.PC3 SMTHDRAW.PC3
+0 beshort 0x8002
+>0 use degas-bitmap
+# display information of Atari DEGAS and DEGAS Elite bitmap images
+0 name degas-bitmap
+>0 ubyte x Atari DEGAS
+#!:mime application/octet-stream
+!:mime image/x-atari-degas
+# compressed
+>0 ubyte =0x80 Elite compressed
+# uncompressed
+#>0 ubyte =0x00 uncompressed
+#>0 ubyte =0x00 un.
+>0 ubyte =0x00
+# check for existence of footer for DEGAS Elite images
+>>32042 ubequad x Elite
+>0 beshort 0x0000 bitmap
+!:ext pi1
+>0 beshort 0x0001 bitmap
+!:ext pi2
+>0 beshort 0x0002 bitmap
+# no example with SUH extension found
+#!:ext pi3/suh
+!:ext pi3
+>0 beshort 0x8000 bitmap
+!:ext pc1
+>0 beshort 0x8001 bitmap
+!:ext pc2
+>0 beshort 0x8002 bitmap
+!:ext pc3
+# low resolution; 320x200, 16 colors
+>1 ubyte =0 320 x 200 x 16
+# medium resolution; 640x200, 4 colors
+>1 ubyte =1 640 x 200 x 4
+# high resolution; 640x400, 2 colors
+>1 ubyte =2 640 x 400 x 2
+# http://fileformats.archiveteam.org/wiki/Atari_ST_color_palette
+# hardware_palette[16]; 9 bit ?????RRR?GGG?BBB; 12 bit ????RRRRGGGGBBBB for Atari STE
+# for Atari DEGAS apparently no Spectrum 512 Enhanced 15 bit palette RGB?RRRRGGGGBBBB
+# Red Green Blue unused bit ? often 0 but not bilboule.pi1; color_value (examples or numbers)
+# 1st color palette entry like: 0777 (61) 0fff (LEREDACT.PI3) 0fcf (devgem7.pi3) 0001 (9)
+>2 ubeshort x \b, color palette %4.4x
+# 2nd palette entry like: 0000 (32) 0700 (38) 0f00 (LEREDACT.PI3 devgem7.pi3)
+>4 ubeshort x %4.4x
+# 3rd palette entry
+>6 ubeshort x %4.4x
+# 4th palette entry like: 0000 (72)
+>8 ubeshort x %4.4x
+# 5th palette entry
+>10 ubeshort x %4.4x
+>2 ubeshort x ...
+# 6th palette entry
+#>12 ubeshort x %4.4x
+# 7th palette entry like: 0000 (16) 0001 (ELMRSESN.PI3 elmrsesn.pi3) 0070 (51) 00f0 (BASICNES.PI3 LEREDACT.PI3) 00f8 (devgem7.pi3)
+#>14 ubeshort x %4.4x
+# 8th palette entry
+#>16 ubeshort x %4.4x
+# 9 palette entry
+#>18 ubeshort x %4.4x
+# 10 palette entry
+#>20 ubeshort x %4.4x
+# 11 palette entry
+#>22 ubeshort x %4.4x
+# 12 palette entry
+#>24 ubeshort x %4.4x
+# 13 palette entry
+#>26 ubeshort x %4.4x
+# 14th palette entry
+#>28 ubeshort x %4.4x
+# 15th palette entry
+#>30 ubeshort x %4.4x
+# 16th palette entry
+#>32 ubeshort x %4.4x
+# data[16000] for uncompressed images; pixel data
+#>34 ubequad x \b, DATA %#16.16llx...
+# footer for Elite variant images
+# https://www.fileformat.info/format/atari/egff.htm
+# https://pulkomandy.tk/projects/GrafX2/wiki/Develop/FileFormats/Atari
+# left_color_animation[4]; like: 0000000000000000 0000000100020003 fffafff000000030 (bigspid.pi1)
+#>32034 ubequad !0 \b, color animations %16.16llx (left)
+# right_color_animation[4]; like: 0000000000000000 0000000100020003
+#>>32042 ubequad !0 %16.16llx (right)
+# channel_direction[4]; 0~left 1~none 2~right like: 0001000100010001 0002000000010001 (cycle2.pi1)
+# sometimes unexpected like: feaafc0000000000 (bigspid.pi1)
+#>32050 ubequad !0 \b, channel directions %16.16llx
+# channel_delay[4]; 128 - channel delay, timebase 1/60 s
+#>32058 ubequad !0 \b, channel delays %16.16llx
# From: Joerg Jenderek
# URL: http://fileformats.archiveteam.org/wiki/ImageLab/PrintTechnic
@@ -1261,22 +1622,22 @@
# This is bad magic 0x5249 == 'RI' conflicts with RIFF and other
# magic.
# SGI RICE image file <mpruett@sgi.com>
-#0 beshort 0x5249 RICE image
-#>2 beshort x v%d
-#>4 beshort x (%d x
-#>6 beshort x %d)
-#>8 beshort 0 8 bit
-#>8 beshort 1 10 bit
-#>8 beshort 2 12 bit
-#>8 beshort 3 13 bit
-#>10 beshort 0 4:2:2
-#>10 beshort 1 4:2:2:4
-#>10 beshort 2 4:4:4
-#>10 beshort 3 4:4:4:4
-#>12 beshort 1 RGB
-#>12 beshort 2 CCIR601
-#>12 beshort 3 RP175
-#>12 beshort 4 YUV
+#0 ubeshort 0x5249 RICE image
+#>2 ubeshort x v%d
+#>4 ubeshort x (%d x
+#>6 ubeshort x %d)
+#>8 ubeshort 0 8 bit
+#>8 ubeshort 1 10 bit
+#>8 ubeshort 2 12 bit
+#>8 ubeshort 3 13 bit
+#>10 ubeshort 0 4:2:2
+#>10 ubeshort 1 4:2:2:4
+#>10 ubeshort 2 4:4:4
+#>10 ubeshort 3 4:4:4:4
+#>12 ubeshort 1 RGB
+#>12 ubeshort 2 CCIR601
+#>12 ubeshort 3 RP175
+#>12 ubeshort 4 YUV
# PCX image files
# From: Dan Fandrich <dan@coneharvesters.com>
@@ -1303,14 +1664,14 @@
>>>>10 uleshort x %d],
>>>>65 ubyte >1 %d planes each of
>>>>3 ubyte x %d-bit
->>>>68 byte 1 colour,
->>>>68 byte 2 grayscale,
+>>>>68 ubyte 1 colour,
+>>>>68 ubyte 2 grayscale,
# this should not happen
>>>>68 default x image,
->>>>12 leshort >0 %d x
+>>>>12 uleshort >0 %d x
>>>>>14 uleshort x %d dpi,
->>>>2 byte 0 uncompressed
->>>>2 byte 1 RLE compressed
+>>>>2 ubyte 0 uncompressed
+>>>>2 ubyte 1 RLE compressed
# Adobe Photoshop
# From: Asbjoern Sloth Toennesen <asbjorn@lila.io>
@@ -1320,7 +1681,7 @@
# and ImageMagick `identify -verbose *.pdd`
0 string 8BPS
# skip DROID x-fmt-92-signature-id-277.psd by checking valid width
->18 belong >0 Adobe Photoshop
+>18 ubelong >0 Adobe Photoshop
!:mime image/vnd.adobe.photoshop
!:apple ????8BPS
# version: always equal to 1, but 2 for PSB
@@ -1408,17 +1769,17 @@
0 name gem_info
# version is 2 for some XIMG and 1 for all others
->0 beshort <0x0003 GEM
+>0 ubeshort <0x0003 GEM
# https://www.snowstone.org.uk/riscos/mimeman/mimemap.txt
!:mime image/x-gem
# header_size 24 25 27 59 779 words for colored bitmaps
->>2 beshort >9
+>>2 ubeshort >9
>>>16 string STTT\0\x10 STTT
>>>16 string TIMG\0 TIMG
# HYPERPAINT or NOSIG variant
>>>16 string \0\x80
->>>>2 beshort =24 NOSIG
->>>>2 beshort !24 HYPERPAINT
+>>>>2 ubeshort =24 NOSIG
+>>>>2 ubeshort !24 HYPERPAINT
# NOSIG or XIMG variant
>>>16 default x
>>>>16 string !XIMG\0 NOSIG
@@ -1428,85 +1789,109 @@
>>16 string !XIMG\0 Image data
!:ext img
# header_size is 9 for Ventura files and 8 for other GEM Paint files
->>2 beshort 9 (Ventura)
-#>>2 beshort 8 (Paint)
->>12 beshort x %d x
->>14 beshort x %d,
+>>2 ubeshort 9 (Ventura)
+#>>2 ubeshort 8 (Paint)
+>>12 ubeshort x %d x
+>>14 ubeshort x %d,
# 1 4 8
->>4 beshort x %d planes,
+>>4 ubeshort x %d planes,
# in tenths of a millimetre
->>8 beshort x %d x
->>10 beshort x %d pixelsize
+>>8 ubeshort x %d x
+>>10 ubeshort x %d pixelsize
# pattern_size 1-8. 2 for GEM Paint
->>6 beshort !2 \b, pattern size %d
+>>6 ubeshort !2 \b, pattern size %d
# GEM Metafile (Wolfram Kleff)
-0 lelong 0x0018FFFF GEM Metafile data
->4 leshort x version %d
+0 ulelong 0x0018FFFF GEM Metafile data
+>4 uleshort x version %d
#
# SMJPEG. A custom Motion JPEG format used by Loki Entertainment
# Software Torbjorn Andersson <d91tan@Update.UU.SE>.
#
0 string \0\nSMJPEG SMJPEG
->8 belong x %d.x data
+>8 ubelong x %d.x data
# According to the specification you could find any number of _TXT
# headers here, but I can't think of any way of handling that. None of
# the SMJPEG files I tried it on used this feature. Even if such a
# file is encountered the output should still be reasonable.
->16 string _SND \b,
->>24 beshort >0 %d Hz
->>26 byte 8 8-bit
->>26 byte 16 16-bit
->>28 string NONE uncompressed
-# >>28 string APCM ADPCM compressed
->>27 byte 1 mono
->>28 byte 2 stereo
+>16 string _SND \b,
+>>24 ubeshort >0 %d Hz
+>>26 ubyte 8 8-bit
+>>26 ubyte 16 16-bit
+>>28 string NONE uncompressed
+# >>28 string APCM ADPCM compressed
+>>27 ubyte 1 mono
+>>28 ubyte 2 stereo
# Help! Isn't there any way to avoid writing this part twice?
->>32 string _VID \b,
-# >>>48 string JFIF JPEG
->>>40 belong >0 %d frames
->>>44 beshort >0 (%d x
->>>46 beshort >0 %d)
->16 string _VID \b,
-# >>32 string JFIF JPEG
->>24 belong >0 %d frames
->>28 beshort >0 (%d x
->>30 beshort >0 %d)
+# Yes, use a name/use
+>>32 string _VID \b,
+# >>>48 string JFIF JPEG
+>>>40 ubelong >0 %d frames
+>>>44 ubeshort >0 (%d x
+>>>46 ubeshort >0 %d)
+>16 string _VID \b,
+# >>32 string JFIF JPEG
+>>24 ubelong >0 %d frames
+>>28 ubeshort >0 (%d x
+>>30 ubeshort >0 %d)
0 string Paint\ Shop\ Pro\ Image\ File Paint Shop Pro Image File
# taken from fkiss: (<yav@mte.biglobe.ne.jp> ?)
-0 string KiSS KISS/GS
->4 byte 16 color
->>5 byte x %d bit
->>8 leshort x %d colors
->>10 leshort x %d groups
->4 byte 32 cell
->>5 byte x %d bit
->>8 leshort x %d x
->>10 leshort x %d
->>12 leshort x +%d
->>14 leshort x +%d
+0 string KiSS KISS/GS
+>4 ubyte 16 color
+>>5 ubyte x %d bit
+>>8 uleshort x %d colors
+>>10 uleshort x %d groups
+>4 ubyte 32 cell
+>>5 ubyte x %d bit
+>>8 uleshort x %d x
+>>10 uleshort x %d
+>>12 uleshort x +%d
+>>14 uleshort x +%d
# Webshots (www.webshots.com), by John Harrison
0 string C\253\221g\230\0\0\0 Webshots Desktop .wbz file
# Hercules DASD image files
-# From Jan Jaeger <jj@septa.nl>
+# From Jan Jaeger <jj@septa.nl> and Jay Maynard <jaymaynard@gmail.com>
0 string CKD_P370 Hercules CKD DASD image file
->8 long x \b, %d heads per cylinder
->12 long x \b, track size %d bytes
+>8 lelong x \b, %d heads per cylinder
+>12 lelong x \b, track size %d bytes
>16 byte x \b, device type 33%2.2X
0 string CKD_C370 Hercules compressed CKD DASD image file
->8 long x \b, %d heads per cylinder
->12 long x \b, track size %d bytes
+>8 lelong x \b, %d heads per cylinder
+>12 lelong x \b, track size %d bytes
>16 byte x \b, device type 33%2.2X
+>552 lelong x \b, %d total cylinders
+>>557 byte 0 \b, no compression
+>>557 byte 1 \b, ZLIB compression
+>>557 byte 2 \b, BZ2 compression
0 string CKD_S370 Hercules CKD DASD shadow file
->8 long x \b, %d heads per cylinder
->12 long x \b, track size %d bytes
+>8 lelong x \b, %d heads per cylinder
+>12 lelong x \b, track size %d bytes
+>16 byte x \b, device type 33%2.2X
+
+0 string CKD_P064 Hercules CKD64 DASD image file
+>8 lelong x \b, %d heads per cylinder
+>12 lelong x \b, track size %d bytes
+>16 byte x \b, device type 33%2.2X
+
+0 string CKD_C064 Hercules compressed CKD64 DASD image file
+>8 lelong x \b, %d heads per cylinder
+>12 lelong x \b, track size %d bytes
+>16 byte x \b, device type 33%2.2X
+>524 lelong x \b, %d total cylinders
+>>585 byte 0 \b, no compression
+>>585 byte 1 \b, ZLIB compression
+>>585 byte 2 \b, BZ2 compression
+
+0 string CKD_S064 Hercules CKD64 DASD shadow file
+>8 lelong x \b, %d heads per cylinder
+>12 lelong x \b, track size %d bytes
>16 byte x \b, device type 33%2.2X
# Squeak images and programs - etoffi@softhome.net
@@ -1517,17 +1902,17 @@
# 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 %d
+>>0x0060 ulelong >-1 volume %d
#>>0x0064 8 byte identifier
#>>0x007c reserved
>>0x0200 string >\0 type %s
>>0x1400 string >\0 device %s,
>>0x1600 string >\0 original filename %s,
# Some fields omitted
->>0x2744 lelong 0 not compressed
->>0x2744 lelong 1 gzip compressed
->>0x2744 lelong 2 bzip2 compressed
->>0x2744 lelong >2 compressed with unknown algorithm
+>>0x2744 ulelong 0 not compressed
+>>0x2744 ulelong 1 gzip compressed
+>>0x2744 ulelong 2 bzip2 compressed
+>>0x2744 ulelong >2 compressed with unknown algorithm
>0x0020 string >0.6.1 file version %s
>0x0020 string <0.6.1 file version %s
@@ -1536,27 +1921,27 @@
# From: Joerg Wunsch <joerg_wunsch@uriah.heep.sax.de>
# Update: Joerg Jenderek
# URL: http://fileformats.archiveteam.org/wiki/DCX
-0 lelong 987654321 DCX multi-page
+0 ulelong 987654321 DCX multi-page
# http://www.nationalarchives.gov.uk/pronom/x-fmt/348
!:mime image/x-dcx
!:ext dcx
# The first file offset usually starts at file offset 0x1004
# print 1 space after 0x100? offset and then handles PCX images by ./images
->4 lelong x \b, at %#x
+>4 ulelong x \b, at %#x
>(4.l) indirect x
# possible 2nd PCX image
-#>8 lelong !0 \b, at %#x
+#>8 ulelong !0 \b, at %#x
#>>(8.l) indirect x
# possible 3rd PCX image
-#>12 lelong !0 \b, at %#x
+#>12 ulelong !0 \b, at %#x
#>>(12.l) indirect x
# Simon Walton <simonw@matteworld.com>
# 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, %d x
->204 belong >0 %d
+0 ulelong 0xd75f2a80 Cineon image data
+>200 ubelong >0 \b, %d x
+>204 ubelong >0 %d
# Bio-Rad .PIC is an image format used by microscope control systems
@@ -1565,13 +1950,13 @@
# BOOL values are two-byte integers; use them to rule out false positives.
# https://web.archive.org/web/20050317223257/www.cs.ubc.ca/spider/ladic/text/biorad.txt
# Samples: https://www.loci.wisc.edu/software/sample-data
-14 leshort <2
->62 leshort <2
->>54 leshort 12345 Bio-Rad .PIC Image File
->>>0 leshort >0 %d x
->>>2 leshort >0 %d,
->>>4 leshort =1 1 image in file
->>>4 leshort >1 %d images in file
+14 uleshort <2
+>62 uleshort <2
+>>54 uleshort 12345 Bio-Rad .PIC Image File
+>>>0 uleshort >0 %d x
+>>>2 uleshort >0 %d,
+>>>4 uleshort =1 1 image in file
+>>>4 uleshort >1 %d images in file
# From Jan "Yenya" Kasprzak <kas@fi.muni.cz>
# The description of *.mrw format can be found at
@@ -1596,38 +1981,38 @@
# Originally by Marc Espie
# Modified by Robert Minsk <robertminsk at yahoo.com>
# https://www.openexr.com/openexrfilelayout.pdf
-0 lelong 20000630 OpenEXR image data,
+0 ulelong 20000630 OpenEXR image data,
!:mime image/x-exr
->4 lelong&0x000000ff x version %d,
->4 lelong ^0x00000200 storage: scanline
->4 lelong &0x00000200 storage: tiled
+>4 ulelong&0x000000ff x version %d,
+>4 ulelong ^0x00000200 storage: scanline
+>4 ulelong &0x00000200 storage: tiled
>8 search/0x1000 compression\0 \b, compression:
->>&16 byte 0 none
->>&16 byte 1 rle
->>&16 byte 2 zips
->>&16 byte 3 zip
->>&16 byte 4 piz
->>&16 byte 5 pxr24
->>&16 byte 6 b44
->>&16 byte 7 b44a
->>&16 byte 8 dwaa
->>&16 byte 9 dwab
->>&16 byte >9 unknown
+>>&16 ubyte 0 none
+>>&16 ubyte 1 rle
+>>&16 ubyte 2 zips
+>>&16 ubyte 3 zip
+>>&16 ubyte 4 piz
+>>&16 ubyte 5 pxr24
+>>&16 ubyte 6 b44
+>>&16 ubyte 7 b44a
+>>&16 ubyte 8 dwaa
+>>&16 ubyte 9 dwab
+>>&16 ubyte >9 unknown
>8 search/0x1000 dataWindow\0 \b, dataWindow:
->>&10 lelong x (%d
->>&14 lelong x %d)-
->>&18 lelong x \b(%d
->>&22 lelong x %d)
+>>&10 ulelong x (%d
+>>&14 ulelong x %d)-
+>>&18 ulelong x \b(%d
+>>&22 ulelong x %d)
>8 search/0x1000 displayWindow\0 \b, displayWindow:
->>&10 lelong x (%d
->>&14 lelong x %d)-
->>&18 lelong x \b(%d
->>&22 lelong x %d)
+>>&10 ulelong x (%d
+>>&14 ulelong x %d)-
+>>&18 ulelong x \b(%d
+>>&22 ulelong x %d)
>8 search/0x1000 lineOrder\0 \b, lineOrder:
->>&14 byte 0 increasing y
->>&14 byte 1 decreasing y
->>&14 byte 2 random y
->>&14 byte >2 unknown
+>>&14 ubyte 0 increasing y
+>>&14 ubyte 1 decreasing y
+>>&14 ubyte 2 random y
+>>&14 ubyte >2 unknown
# SMPTE Digital Picture Exchange Format, SMPTE DPX
#
@@ -1643,36 +2028,59 @@
>0 use \^dpx_info
0 name dpx_info
->768 beshort <4
->>772 belong x %dx
->>776 belong x \b%d,
->768 beshort >3
->>776 belong x %dx
->>772 belong x \b%d,
->768 beshort 0 left to right/top to bottom
->768 beshort 1 right to left/top to bottom
->768 beshort 2 left to right/bottom to top
->768 beshort 3 right to left/bottom to top
->768 beshort 4 top to bottom/left to right
->768 beshort 5 top to bottom/right to left
->768 beshort 6 bottom to top/left to right
->768 beshort 7 bottom to top/right to left
+>768 ubeshort <4
+>>772 ubelong x %dx
+>>776 ubelong x \b%d,
+>768 ubeshort >3
+>>776 ubelong x %dx
+>>772 ubelong x \b%d,
+>768 ubeshort 0 left to right/top to bottom
+>768 ubeshort 1 right to left/top to bottom
+>768 ubeshort 2 left to right/bottom to top
+>768 ubeshort 3 right to left/bottom to top
+>768 ubeshort 4 top to bottom/left to right
+>768 ubeshort 5 top to bottom/right to left
+>768 ubeshort 6 bottom to top/left to right
+>768 ubeshort 7 bottom to top/right to left
# From: Tom Hilinski <tom.hilinski@comcast.net>
-# https://www.unidata.ucar.edu/software/netcdf/
-0 string CDF\001 NetCDF Data Format data
+# Update: Joerg Jenderek
+# URL: https://en.wikipedia.org/wiki/NetCDF
+# http://fileformats.archiveteam.org/wiki/NetCDF
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/n/netcdf.trid.xml
+# https://www.loc.gov/preservation/digital/formats/fdd/fdd000330.shtml
+# Note: called "NetCDF Network Common Data Form" by TrID and
+# "netCDF-3 Classic" by DROID via PUID fmt/282
+# https://www.unidata.ucar.edu/packages/netcdf/
+0 string CDF\001
+# skip DROID fmt-282-signature-id-298.nc by test for more content bytes
+>3 uleshort >0 NetCDF Data Format data
+#!:mime application/netcdf
+# https://reposcope.com/mimetype/application/x-netcdf
+!:mime application/x-netcdf
+!:ext nc
+# https://fileinfo.com/extension/cdf
+# https://www.file-extensions.org/cdf-file-extension-unidata-network-common-data-form
+# in 1994 changed from CDF to NC file extension avoid a clash with other file formats
+#!:ext nc/cdf
# 64-bit offset netcdf Classic https://www.unidata.ucar.edu/software/netcdf/docs/file_format_specifications
-0 string CDF\002 NetCDF Data Format data (64-bit offset)
+# Note: called "netCDF-3 64-bit" by DROID via PUID fmt/283
+0 string CDF\002
+# skip DROID fmt-283-signature-id-299.nc by test for more content bytes
+>3 uleshort >0 NetCDF Data Format data (64-bit offset)
+#!:mime application/netcdf
+!:mime application/x-netcdf
+!:ext nc
# From: Michael Liu
# https://en.wikipedia.org/wiki/Common_Data_Format
-0 belong 0xCDF30001 Common Data Format (Version 3 or later) data
+0 ubelong 0xCDF30001 Common Data Format (Version 3 or later) data
!:mime application/x-cdf
-0 belong 0xCDF26002 Common Data Format (Version 2.6 or 2.7) data
+0 ubelong 0xCDF26002 Common Data Format (Version 2.6 or 2.7) data
!:mime application/x-cdf
-0 belong 0x0000FFFF Common Data Format (Version 2.5 or earlier) data
+0 ubelong 0x0000FFFF Common Data Format (Version 2.5 or earlier) data
!:mime application/x-cdf
# Hierarchical Data Format, used to facilitate scientific data exchange
@@ -1680,7 +2088,7 @@
# URL: http://fileformats.archiveteam.org/wiki/HDF
# https://en.wikipedia.org/wiki/Hierarchical_Data_Format
# Reference: https://portal.hdfgroup.org/download/attachments/52627880/HDF5_File_Format_Specification_Version-3.0.pdf
-0 belong 0x0e031301 Hierarchical Data Format (version 4) data
+0 ubelong 0x0e031301 Hierarchical Data Format (version 4) data
!:mime application/x-hdf
!:ext hdf/hdf4/h4
0 string \211HDF\r\n\032\n Hierarchical Data Format (version 5) data
@@ -1728,15 +2136,15 @@
# From Albert Cahalan <acahalan@gmail.com>
# puredigital used it for the CVS disposable camcorder
-#8 lelong 4 ZBM bitmap image data
-#>4 leshort x %u x
-#>6 leshort x %u
+#8 lelong 4 ZBM bitmap image data
+#>4 uleshort x %u x
+#>6 uleshort x %u
# From Albert Cahalan <acahalan@gmail.com>
# uncompressed 5:6:5 HighColor image for OLPC XO firmware icons
-0 string C565 OLPC firmware icon image data
->4 leshort x %u x
->6 leshort x %u
+0 string C565 OLPC firmware icon image data
+>4 uleshort x %u x
+>6 uleshort x %u
# Applied Images - Image files from Cytovision
# Gustavo Junior Alves <gjalves@gjalves.com.br>
@@ -1760,24 +2168,24 @@
# Note: Different versions exist for e.g. 8 bit and 16 bit images.
# Documentation is incomplete.
0 string/b PCO- PCO B16 image data
->12 lelong x \b, %dx
->16 lelong x \b%d
->20 lelong 0 \b, short header
->20 lelong -1 \b, extended header
->>24 lelong 0 \b, grayscale
->>>36 lelong 0 linear LUT
->>>36 lelong 1 logarithmic LUT
->>>28 lelong x [%d
->>>32 lelong x \b,%d]
->>24 lelong 1 \b, color
->>>64 lelong 0 linear LUT
->>>64 lelong 1 logarithmic LUT
->>>40 lelong x r[%d
->>>44 lelong x \b,%d]
->>>48 lelong x g[%d
->>>52 lelong x \b,%d]
->>>56 lelong x b[%d
->>>60 lelong x \b,%d]
+>12 ulelong x \b, %dx
+>16 ulelong x \b%d
+>20 ulelong 0 \b, short header
+>20 ulelong -1 \b, extended header
+>>24 ulelong 0 \b, grayscale
+>>>36 ulelong 0 linear LUT
+>>>36 ulelong 1 logarithmic LUT
+>>>28 ulelong x [%d
+>>>32 ulelong x \b,%d]
+>>24 ulelong 1 \b, color
+>>>64 ulelong 0 linear LUT
+>>>64 ulelong 1 logarithmic LUT
+>>>40 ulelong x r[%d
+>>>44 ulelong x \b,%d]
+>>>48 ulelong x g[%d
+>>>52 ulelong x \b,%d]
+>>>56 ulelong x b[%d
+>>>60 ulelong x \b,%d]
# Polar Monitor Bitmap (.pmb) used as logo for Polar Electro watches
# From: Markus Heidelberg <markus.heidelberg at web.de>
@@ -1840,8 +2248,8 @@
# actual common use, it should replace the one below.
0 string PFS1\x0a PFS HDR image data
#!mime image/x-pfs
->1 regex [0-9]*\ \b, %s
->>1 regex \ [0-9]{4} \bx%s
+>1 regex [0-9]*\ \b, %s
+>>1 regex \ [0-9]{4} \bx%s
# Type: Foveon X3F
# URL: https://www.photofo.com/downloads/x3f-raw-format.pdf
@@ -1850,10 +2258,10 @@
# there's a canonical type for this format, it should replace this one.
0 string FOVb Foveon X3F raw image data
!:mime image/x-x3f
->6 leshort x \b, version %d.
->4 leshort x \b%d
->28 lelong x \b, %dx
->32 lelong x \b%d
+>6 uleshort x \b, version %d.
+>4 uleshort x \b%d
+>28 ulelong x \b, %dx
+>32 ulelong x \b%d
# Paint.NET file
# From Adam Buchbinder <adam.buchbinder@gmail.com>
@@ -1866,53 +2274,53 @@
# doc: https://www.shikino.co.jp/eng/products/images/FLOWER.jpg.zip
# example: https://www.shikino.co.jp/eng/products/images/FLOWER.wdp.zip
-90 bequad 0x574D50484F544F00 JPEG-XR Image
->98 byte&0x08 =0x08 \b, hard tiling
->99 byte&0x80 =0x80 \b, tiling present
->99 byte&0x40 =0x40 \b, codestream present
->99 byte&0x38 x \b, spatial xform=
->99 byte&0x38 0x00 \bTL
->99 byte&0x38 0x08 \bBL
->99 byte&0x38 0x10 \bTR
->99 byte&0x38 0x18 \bBR
->99 byte&0x38 0x20 \bBT
->99 byte&0x38 0x28 \bRB
->99 byte&0x38 0x30 \bLT
->99 byte&0x38 0x38 \bLB
->100 byte&0x80 =0x80 \b, short header
->>102 beshort+1 x \b, %d
->>104 beshort+1 x \bx%d
->100 byte&0x80 =0x00 \b, long header
->>102 belong+1 x \b, %x
->>106 belong+1 x \bx%x
->101 beshort&0xf x \b, bitdepth=
->>101 beshort&0xf 0x0 \b1-WHITE=1
->>101 beshort&0xf 0x1 \b8
->>101 beshort&0xf 0x2 \b16
->>101 beshort&0xf 0x3 \b16-SIGNED
->>101 beshort&0xf 0x4 \b16-FLOAT
->>101 beshort&0xf 0x5 \b(reserved 5)
->>101 beshort&0xf 0x6 \b32-SIGNED
->>101 beshort&0xf 0x7 \b32-FLOAT
->>101 beshort&0xf 0x8 \b5
->>101 beshort&0xf 0x9 \b10
->>101 beshort&0xf 0xa \b5-6-5
->>101 beshort&0xf 0xb \b(reserved %d)
->>101 beshort&0xf 0xc \b(reserved %d)
->>101 beshort&0xf 0xd \b(reserved %d)
->>101 beshort&0xf 0xe \b(reserved %d)
->>101 beshort&0xf 0xf \b1-BLACK=1
->101 beshort&0xf0 x \b, colorfmt=
->>101 beshort&0xf0 0x00 \bYONLY
->>101 beshort&0xf0 0x10 \bYUV240
->>101 beshort&0xf0 0x20 \bYWV422
->>101 beshort&0xf0 0x30 \bYWV444
->>101 beshort&0xf0 0x40 \bCMYK
->>101 beshort&0xf0 0x50 \bCMYKDIRECT
->>101 beshort&0xf0 0x60 \bNCOMPONENT
->>101 beshort&0xf0 0x70 \bRGB
->>101 beshort&0xf0 0x80 \bRGBE
->>101 beshort&0xf0 >0x80 \b(reserved %#x)
+90 ubequad 0x574D50484F544F00 JPEG-XR Image
+>98 ubyte&0x08 =0x08 \b, hard tiling
+>99 ubyte&0x80 =0x80 \b, tiling present
+>99 ubyte&0x40 =0x40 \b, codestream present
+>99 ubyte&0x38 x \b, spatial xform=
+>99 ubyte&0x38 0x00 \bTL
+>99 ubyte&0x38 0x08 \bBL
+>99 ubyte&0x38 0x10 \bTR
+>99 ubyte&0x38 0x18 \bBR
+>99 ubyte&0x38 0x20 \bBT
+>99 ubyte&0x38 0x28 \bRB
+>99 ubyte&0x38 0x30 \bLT
+>99 ubyte&0x38 0x38 \bLB
+>100 ubyte&0x80 =0x80 \b, short header
+>>102 ubeshort+1 x \b, %d
+>>104 ubeshort+1 x \bx%d
+>100 ubyte&0x80 =0x00 \b, long header
+>>102 ubelong+1 x \b, %x
+>>106 ubelong+1 x \bx%x
+>101 ubeshort&0xf x \b, bitdepth=
+>>101 ubeshort&0xf 0x0 \b1-WHITE=1
+>>101 ubeshort&0xf 0x1 \b8
+>>101 ubeshort&0xf 0x2 \b16
+>>101 ubeshort&0xf 0x3 \b16-SIGNED
+>>101 ubeshort&0xf 0x4 \b16-FLOAT
+>>101 ubeshort&0xf 0x5 \b(reserved 5)
+>>101 ubeshort&0xf 0x6 \b32-SIGNED
+>>101 ubeshort&0xf 0x7 \b32-FLOAT
+>>101 ubeshort&0xf 0x8 \b5
+>>101 ubeshort&0xf 0x9 \b10
+>>101 ubeshort&0xf 0xa \b5-6-5
+>>101 ubeshort&0xf 0xb \b(reserved %d)
+>>101 ubeshort&0xf 0xc \b(reserved %d)
+>>101 ubeshort&0xf 0xd \b(reserved %d)
+>>101 ubeshort&0xf 0xe \b(reserved %d)
+>>101 ubeshort&0xf 0xf \b1-BLACK=1
+>101 ubeshort&0xf0 x \b, colorfmt=
+>>101 ubeshort&0xf0 0x00 \bYONLY
+>>101 ubeshort&0xf0 0x10 \bYUV240
+>>101 ubeshort&0xf0 0x20 \bYWV422
+>>101 ubeshort&0xf0 0x30 \bYWV444
+>>101 ubeshort&0xf0 0x40 \bCMYK
+>>101 ubeshort&0xf0 0x50 \bCMYKDIRECT
+>>101 ubeshort&0xf0 0x60 \bNCOMPONENT
+>>101 ubeshort&0xf0 0x70 \bRGB
+>>101 ubeshort&0xf0 0x80 \bRGBE
+>>101 ubeshort&0xf0 >0x80 \b(reserved %#x)
# From: Johan van der Knijff <johan.vanderknijff@kb.nl>
#
@@ -1944,82 +2352,82 @@
# by RECOIL `recoil2png -o TMP.PNG input.tim; file TMP.PNG` and often
# as "PSX TIM" by ImageMagick version 7.1.0-10 command `identify *.tim`
# here signed integers are used but according to Kaitai unsigned
-0 lelong 0x00000010
+0 ulelong 0x00000010
# 32 Flag bits *cttt; c~CLUT flag t~type 000~4BPP 001~8BPP 010~16BPP 011~24BPP 100~Mixed
-#>4 lelong x FLAGS=%#x
+#>4 ulelong x FLAGS=%#x
# 12+Size of CLUT (2Ch for 4BPP; 20Ch 40Ch 60Ch 80Ch C0Ch for 8BPP) or
# +image data size (800Ch 2000Ch 2580C for 16BPP) (02000003h for dBase memo test.dbt)
-#>8 lelong x \b, 12+CLUT or data size=%#8.8x
+#>8 ulelong x \b, 12+CLUT or data size=%#8.8x
# CLUT or data size remainder is 12 (Ch), but 03 for dBase memo test.dbt
#>8 ubyte&0x0F =0x0C \b, SIZE REMAINDER IS 12
# skip dBase III memo test.dbt with invalid flags 22D10189h
->4 lelong&0xffFFffF0 =0 Sony PlayStation PSX image,
+>4 ulelong&0xffFFffF0 =0 Sony PlayStation PSX image,
# file (version 5.40) labeled the above entry as "TIM image"
!:mime image/x-sony-tim
!:ext tim
-#>>4 lelong&0x00000007 x \b, BPP~%u
+#>>4 ulelong&0x00000007 x \b, BPP~%u
# 4BPP and 8BPP examples exist with CLUT or without CLUT
->>4 lelong&0x07 0x0 4-Bit,
->>4 lelong&0x07 0x1 8-Bit,
+>>4 ulelong&0x07 0x0 4-Bit,
+>>4 ulelong&0x07 0x1 8-Bit,
# 16BPP and 24BPP examples have no CLUT
->>4 lelong 0x2 15-Bit,
->>4 lelong 0x3 24-Bit,
+>>4 ulelong 0x2 15-Bit,
+>>4 ulelong 0x3 24-Bit,
# no example
->>4 lelong&0x07 0x4 Mixed-Bit,
+>>4 ulelong&0x07 0x4 Mixed-Bit,
# CLUT flag set
->>4 lelong &8
+>>4 ulelong &8
# 12 + size of CLUT like: 1000Ch 800Ch 400Ch 40Ch and 2FEh (KAGE.TIM)
-#>>>(8.l+8) lelong x \b, 12+CLUT SIZE=%#8.8x
->>>(8.l+12) leshort x Pixel at (%d,
->>>(8.l+14) leshort x \b%d) Size=
+#>>>(8.l+8) ulelong x \b, 12+CLUT SIZE=%#8.8x
+>>>(8.l+12) uleshort x Pixel at (%d,
+>>>(8.l+14) uleshort x \b%d) Size=
# image width (to get actual width multiply by 4 for 4BPP and by 2 for 8BPP)
->>>>4 lelong 0x8
->>>>>(8.l+16) leshort*4 x \b%d
->>>>4 lelong 0x9
->>>>>(8.l+16) leshort*2 x \b%d
+>>>>4 ulelong 0x8
+>>>>>(8.l+16) uleshort*4 x \b%d
+>>>>4 ulelong 0x9
+>>>>>(8.l+16) uleshort*2 x \b%d
# image height like: 32 64 128 144 160 208 256
->>>(8.l+18) leshort x \bx%d,
->>>4 lelong 0x8 16 CLUT Entries at
->>>4 lelong 0x9 256 CLUT Entries at
->>>12 leshort x (%d,
->>>14 leshort x \b%d)
+>>>(8.l+18) uleshort x \bx%d,
+>>>4 ulelong 0x8 16 CLUT Entries at
+>>>4 ulelong 0x9 256 CLUT Entries at
+>>>12 uleshort x (%d,
+>>>14 uleshort x \b%d)
# no Color LookUp Table (CLUT)
->>4 lelong ^8
-# image orgin X Y
->>>12 leshort x Pixel at (%d,
->>>14 leshort x \b%d) Size=
+>>4 ulelong ^8
+# image origin X Y
+>>>12 uleshort x Pixel at (%d,
+>>>14 uleshort x \b%d) Size=
# real image width = multiply by 4 (4BPP) 2 (8BPP) 1 (16BPP) 2/3 (24BPP)
->>>>4 lelong 0x0
->>>>>16 leshort*4 x \b%d
->>>>4 lelong 0x1
->>>>>16 leshort*2 x \b%d
->>>>4 lelong 0x2
->>>>>16 leshort x \b%d
->>>>4 lelong 0x3
+>>>>4 ulelong 0x0
+>>>>>16 uleshort*4 x \b%d
+>>>>4 ulelong 0x1
+>>>>>16 uleshort*2 x \b%d
+>>>>4 ulelong 0x2
+>>>>>16 uleshort x \b%d
+>>>>4 ulelong 0x3
# GRR: NOT working
-#>>>>>16 leshort*2/3 x \b%d
->>>>>16 leshort x \b2/3*%d
+#>>>>>16 uleshort*2/3 x \b%d
+>>>>>16 uleshort x \b2/3*%d
# mixed format width not explained!
->>>>4 lelong 0x4
->>>>>16 leshort x \b%d
+>>>>4 ulelong 0x4
+>>>>>16 uleshort x \b%d
# image height like: 64 240 256
->>>18 leshort x \bx%d
+>>>18 uleshort x \bx%d
# TIM image data
# MDEC streams
-0 lelong 0x80010160 MDEC video stream,
->16 leshort x %dx
->18 leshort x \b%d
-#>8 lelong x %d frames
-#>4 leshort x secCount=%d;
-#>6 leshort x nSectors=%d;
-#>12 lelong x frameSize=%d;
+0 ulelong 0x80010160 MDEC video stream,
+>16 uleshort x %dx
+>18 uleshort x \b%d
+#>8 ulelong x %d frames
+#>4 uleshort x secCount=%d;
+#>6 uleshort x nSectors=%d;
+#>12 ulelong x frameSize=%d;
# BS encoded bitstreams
-2 leshort 0x3800 BS image,
->6 leshort x Version %d,
->4 leshort x Quantization %d,
->0 leshort x (Decompresses to %d words)
+2 uleshort 0x3800 BS image,
+>6 uleshort x Version %d,
+>4 uleshort x Quantization %d,
+>0 uleshort x (Decompresses to %d words)
# Type: farbfeld image.
# Url: http://tools.suckless.org/farbfeld/
@@ -2029,6 +2437,185 @@
>8 ubelong x %dx
>12 ubelong x \b%d
+# Type: Microsoft DirectDraw Surface (DXGI formats)
+# URL: https://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp
+# From: Morten Hustveit <morten@debian.org>
+# Updated by: David Korth <gerbilsoft@gerbilsoft.com>
+0 name ms-directdraw-dx10
+>0 ulelong x \b, DXGI format:
+>0 ulelong 1 R32G32B32A32_TYPELESS
+>0 ulelong 2 R32G32B32A32_FLOAT
+>0 ulelong 3 R32G32B32A32_UINT
+>0 ulelong 4 R32G32B32A32_SINT
+>0 ulelong 5 R32G32B32_TYPELESS
+>0 ulelong 6 R32G32B32_FLOAT
+>0 ulelong 7 R32G32B32_UINT
+>0 ulelong 8 R32G32B32_SINT
+>0 ulelong 9 R16G16B16A16_TYPELESS
+>0 ulelong 10 R16G16B16A16_FLOAT
+>0 ulelong 11 R16G16B16A16_UNORM
+>0 ulelong 12 R16G16B16A16_UINT
+>0 ulelong 13 R16G16B16A16_SNORM
+>0 ulelong 14 R16G16B16A16_SINT
+>0 ulelong 15 R32G32_TYPELESS
+>0 ulelong 16 R32G32_FLOAT
+>0 ulelong 17 R32G32_UINT
+>0 ulelong 18 R32G32_SINT
+>0 ulelong 19 R32G8X24_TYPELESS
+>0 ulelong 20 D32_FLOAT_S8X24_UINT
+>0 ulelong 21 R32_FLOAT_X8X24_TYPELESS
+>0 ulelong 22 X32_TYPELESS_G8X24_UINT
+>0 ulelong 23 R10G10B10A2_TYPELESS
+>0 ulelong 24 R10G10B10A2_UNORM
+>0 ulelong 25 R10G10B10A2_UINT
+>0 ulelong 26 R11G11B10_FLOAT
+>0 ulelong 27 R8G8B8A8_TYPELESS
+>0 ulelong 28 R8G8B8A8_UNORM
+>0 ulelong 29 R8G8B8A8_UNORM_SRGB
+>0 ulelong 30 R8G8B8A8_UINT
+>0 ulelong 31 R8G8B8A8_SNORM
+>0 ulelong 32 R8G8B8A8_SINT
+>0 ulelong 33 R16G16_TYPELESS
+>0 ulelong 34 R16G16_FLOAT
+>0 ulelong 35 R16G16_UNORM
+>0 ulelong 36 R16G16_UINT
+>0 ulelong 37 R16G16_SNORM
+>0 ulelong 38 R16G16_SINT
+>0 ulelong 39 R32_TYPELESS
+>0 ulelong 40 D32_FLOAT
+>0 ulelong 41 R32_FLOAT
+>0 ulelong 42 R32_UINT
+>0 ulelong 43 R32_SINT
+>0 ulelong 44 R24G8_TYPELESS
+>0 ulelong 45 D24_UNORM_S8_UINT
+>0 ulelong 46 R24_UNORM_X8_TYPELESS
+>0 ulelong 47 X24_TYPELESS_G8_UINT
+>0 ulelong 48 R8G8_TYPELESS
+>0 ulelong 49 R8G8_UNORM
+>0 ulelong 50 R8G8_UINT
+>0 ulelong 51 R8G8_SNORM
+>0 ulelong 52 R8G8_SINT
+>0 ulelong 53 R16_TYPELESS
+>0 ulelong 54 R16_FLOAT
+>0 ulelong 55 D16_UNORM
+>0 ulelong 56 R16_UNORM
+>0 ulelong 57 R16_UINT
+>0 ulelong 58 R16_SNORM
+>0 ulelong 59 R16_SINT
+>0 ulelong 60 R8_TYPELESS
+>0 ulelong 61 R8_UNORM
+>0 ulelong 62 R8_UINT
+>0 ulelong 63 R8_SNORM
+>0 ulelong 64 R8_SINT
+>0 ulelong 65 A8_UNORM
+>0 ulelong 66 R1_UNORM
+>0 ulelong 67 R9G9B9E5_SHAREDEXP
+>0 ulelong 68 R8G8_B8G8_UNORM
+>0 ulelong 69 G8R8_G8B8_UNORM
+>0 ulelong 70 BC1_TYPELESS
+>0 ulelong 71 BC1_UNORM
+>0 ulelong 72 BC1_UNORM_SRGB
+>0 ulelong 73 BC2_TYPELESS
+>0 ulelong 74 BC2_UNORM
+>0 ulelong 75 BC2_UNORM_SRGB
+>0 ulelong 76 BC3_TYPELESS
+>0 ulelong 77 BC3_UNORM
+>0 ulelong 78 BC3_UNORM_SRGB
+>0 ulelong 79 BC4_TYPELESS
+>0 ulelong 80 BC4_UNORM
+>0 ulelong 81 BC4_SNORM
+>0 ulelong 82 BC5_TYPELESS
+>0 ulelong 83 BC5_UNORM
+>0 ulelong 84 BC5_SNORM
+>0 ulelong 85 B5G6R5_UNORM
+>0 ulelong 86 B5G5R5A1_UNORM
+>0 ulelong 87 B8G8R8A8_UNORM
+>0 ulelong 88 B8G8R8X8_UNORM
+>0 ulelong 89 R10G10B10_XR_BIAS_A2_UNORM
+>0 ulelong 90 B8G8R8A8_TYPELESS
+>0 ulelong 91 B8G8R8A8_UNORM_SRGB
+>0 ulelong 92 B8G8R8X8_TYPELESS
+>0 ulelong 93 B8G8R8X8_UNORM_SRGB
+>0 ulelong 94 BC6H_TYPELESS
+>0 ulelong 95 BC6H_UF16
+>0 ulelong 96 BC6H_SF16
+>0 ulelong 97 BC7_TYPELESS
+>0 ulelong 98 BC7_UNORM
+>0 ulelong 99 BC7_UNORM_SRGB
+>0 ulelong 100 AYUV
+>0 ulelong 101 Y410
+>0 ulelong 102 Y416
+>0 ulelong 103 NV12
+>0 ulelong 104 P010
+>0 ulelong 105 P016
+>0 ulelong 106 420_OPAQUE
+>0 ulelong 107 YUY2
+>0 ulelong 108 Y210
+>0 ulelong 109 Y216
+>0 ulelong 110 NV11
+>0 ulelong 111 AI44
+>0 ulelong 112 IA44
+>0 ulelong 113 P8
+>0 ulelong 114 A8P8
+>0 ulelong 115 B4G4R4A4_UNORM
+
+>0 ulelong 116 XBOX_R10G10B10_7E3_A2_FLOAT
+>0 ulelong 117 XBOX_R10G10B10_6E4_A2_FLOAT
+>0 ulelong 118 XBOX_D16_UNORM_S8_UINT
+>0 ulelong 119 XBOX_R16_UNORM_X8_TYPELESS
+>0 ulelong 120 XBOX_X16_TYPELESS_G8_UINT
+
+>0 ulelong 130 DXGI_FORMAT_P208
+>0 ulelong 131 DXGI_FORMAT_V208
+>0 ulelong 132 DXGI_FORMAT_V408
+
+>0 ulelong 133 ASTC_4X4_TYPELESS
+>0 ulelong 134 ASTC_4X4_UNORM
+>0 ulelong 135 ASTC_4X4_UNORM_SRGB
+>0 ulelong 137 ASTC_5X4_TYPELESS
+>0 ulelong 138 ASTC_5X4_UNORM
+>0 ulelong 139 ASTC_5X4_UNORM_SRGB
+>0 ulelong 141 ASTC_5X5_TYPELESS
+>0 ulelong 142 ASTC_5X5_UNORM
+>0 ulelong 143 ASTC_5X5_UNORM_SRGB
+>0 ulelong 145 ASTC_6X5_TYPELESS
+>0 ulelong 146 ASTC_6X5_UNORM
+>0 ulelong 147 ASTC_6X5_UNORM_SRGB
+>0 ulelong 149 ASTC_6X6_TYPELESS
+>0 ulelong 150 ASTC_6X6_UNORM
+>0 ulelong 151 ASTC_6X6_UNORM_SRGB
+>0 ulelong 153 ASTC_8X5_TYPELESS
+>0 ulelong 154 ASTC_8X5_UNORM
+>0 ulelong 155 ASTC_8X5_UNORM_SRGB
+>0 ulelong 157 ASTC_8X6_TYPELESS
+>0 ulelong 158 ASTC_8X6_UNORM
+>0 ulelong 159 ASTC_8X6_UNORM_SRGB
+>0 ulelong 161 ASTC_8X8_TYPELESS
+>0 ulelong 162 ASTC_8X8_UNORM
+>0 ulelong 163 ASTC_8X8_UNORM_SRGB
+>0 ulelong 165 ASTC_10X5_TYPELESS
+>0 ulelong 166 ASTC_10X5_UNORM
+>0 ulelong 167 ASTC_10X5_UNORM_SRGB
+>0 ulelong 169 ASTC_10X6_TYPELESS
+>0 ulelong 170 ASTC_10X6_UNORM
+>0 ulelong 171 ASTC_10X6_UNORM_SRGB
+>0 ulelong 173 ASTC_10X8_TYPELESS
+>0 ulelong 174 ASTC_10X8_UNORM
+>0 ulelong 175 ASTC_10X8_UNORM_SRGB
+>0 ulelong 177 ASTC_10X10_TYPELESS
+>0 ulelong 178 ASTC_10X10_UNORM
+>0 ulelong 179 ASTC_10X10_UNORM_SRGB
+>0 ulelong 181 ASTC_12X10_TYPELESS
+>0 ulelong 182 ASTC_12X10_UNORM
+>0 ulelong 183 ASTC_12X10_UNORM_SRGB
+>0 ulelong 185 ASTC_12X12_TYPELESS
+>0 ulelong 186 ASTC_12X12_UNORM
+>0 ulelong 187 ASTC_12X12_UNORM_SRGB
+
+>0 ulelong 190 XBOX_R10G10B10_SNORM_A2_UNORM
+>0 ulelong 189 XBOX_R4G4_UNORM
+>0 ulelong 0xFFFFFFFF DXGI_FORMAT_FORCE_UINT
+
# Type: Microsoft DirectDraw Surface (common data)
# URL: https://msdn.microsoft.com/library/default.asp?url=/library/en-us/directx9_c/directx/graphics/reference/DDSFileReference/ddsfileformat.asp
# From: Morten Hustveit <morten@debian.org>
@@ -2041,7 +2628,9 @@
# Determine the pixel format.
>0x50 ulelong&0x4 4
# FIXME: Handle DX10 and XBOX formats.
->>0x54 string x \b, compressed using %.4s
+>>0x54 string DX10
+>>>0x80 use ms-directdraw-dx10
+>>0x54 string !DX10 \b, compressed using %.4s
>0x50 ulelong&0x2 0x2 \b, alpha only
>0x50 ulelong&0x200 0x200 \b, YUV
>0x50 ulelong&0x20000 0x20000 \b, luminance
@@ -2147,37 +2736,37 @@
# Sega PVR header.
0 name sega-pvr-image-header
->0x0C leshort x %u x
->0x0E leshort x %u
+>0x0C uleshort x %u x
+>0x0E uleshort x %u
# Image format.
->0x08 byte 0 \b, ARGB1555
->0x08 byte 1 \b, RGB565
->0x08 byte 2 \b, ARGB4444
->0x08 byte 3 \b, YUV442
->0x08 byte 4 \b, Bump
->0x08 byte 5 \b, 4bpp
->0x08 byte 6 \b, 8bpp
+>0x08 ubyte 0 \b, ARGB1555
+>0x08 ubyte 1 \b, RGB565
+>0x08 ubyte 2 \b, ARGB4444
+>0x08 ubyte 3 \b, YUV442
+>0x08 ubyte 4 \b, Bump
+>0x08 ubyte 5 \b, 4bpp
+>0x08 ubyte 6 \b, 8bpp
# Image data type.
->0x09 byte 0x01 \b, square twiddled
->0x09 byte 0x02 \b, square twiddled & mipmap
->0x09 byte 0x03 \b, VQ
->0x09 byte 0x04 \b, VQ & mipmap
->0x09 byte 0x05 \b, 8-bit CLUT twiddled
->0x09 byte 0x06 \b, 4-bit CLUT twiddled
->0x09 byte 0x07 \b, 8-bit direct twiddled
->0x09 byte 0x08 \b, 4-bit direct twiddled
->0x09 byte 0x09 \b, rectangle
->0x09 byte 0x0B \b, rectangular stride
->0x09 byte 0x0D \b, rectangular twiddled
->0x09 byte 0x10 \b, small VQ
->0x09 byte 0x11 \b, small VQ & mipmap
->0x09 byte 0x12 \b, square twiddled & mipmap
+>0x09 ubyte 0x01 \b, square twiddled
+>0x09 ubyte 0x02 \b, square twiddled & mipmap
+>0x09 ubyte 0x03 \b, VQ
+>0x09 ubyte 0x04 \b, VQ & mipmap
+>0x09 ubyte 0x05 \b, 8-bit CLUT twiddled
+>0x09 ubyte 0x06 \b, 4-bit CLUT twiddled
+>0x09 ubyte 0x07 \b, 8-bit direct twiddled
+>0x09 ubyte 0x08 \b, 4-bit direct twiddled
+>0x09 ubyte 0x09 \b, rectangle
+>0x09 ubyte 0x0B \b, rectangular stride
+>0x09 ubyte 0x0D \b, rectangular twiddled
+>0x09 ubyte 0x10 \b, small VQ
+>0x09 ubyte 0x11 \b, small VQ & mipmap
+>0x09 ubyte 0x12 \b, square twiddled & mipmap
# Sega PVR image.
0 string PVRT
>0x10 string DDS\040\174\000\000\000 Sega PVR (Xbox) image:
>>0x20 use ms-directdraw-surface
->0x10 belong !0x44445320 Sega PVR image:
+>0x10 ubelong !0x44445320 Sega PVR image:
>>0 use sega-pvr-image-header
# Sega PVR image with GBIX.
@@ -2185,25 +2774,25 @@
>0x10 string PVRT
>>0x10 string DDS\040\174\000\000\000 Sega PVR (Xbox) image:
>>>0x20 use ms-directdraw-surface
->>0x10 belong !0x44445320 Sega PVR image:
+>>0x10 ubelong !0x44445320 Sega PVR image:
>>>0x10 use sega-pvr-image-header
->>0x08 lelong x \b, global index = %u
+>>0x08 ulelong x \b, global index = %u
# Sega GVR header.
0 name sega-gvr-image-header
->0x0C beshort x %u x
->0x0E beshort x %u
+>0x0C ubeshort x %u x
+>0x0E ubeshort x %u
# Image data format.
->0x0B byte 0 \b, I4
->0x0B byte 1 \b, I8
->0x0B byte 2 \b, IA4
->0x0B byte 3 \b, IA8
->0x0B byte 4 \b, RGB565
->0x0B byte 5 \b, RGB5A3
->0x0B byte 6 \b, ARGB8888
->0x0B byte 8 \b, CI4
->0x0B byte 9 \b, CI8
->0x0B byte 14 \b, DXT1
+>0x0B ubyte 0 \b, I4
+>0x0B ubyte 1 \b, I8
+>0x0B ubyte 2 \b, IA4
+>0x0B ubyte 3 \b, IA8
+>0x0B ubyte 4 \b, RGB565
+>0x0B ubyte 5 \b, RGB5A3
+>0x0B ubyte 6 \b, ARGB8888
+>0x0B ubyte 8 \b, CI4
+>0x0B ubyte 9 \b, CI8
+>0x0B ubyte 14 \b, DXT1
# Sega GVR image.
0 string GVRT Sega GVR image:
@@ -2213,22 +2802,22 @@
0 string GBIX
>0x10 string GVRT Sega GVR image:
>>0x10 use sega-gvr-image-header
->>0x08 belong x \b, global index = %u
+>>0x08 ubelong x \b, global index = %u
# Sega GVR image with GCIX. (Wii)
0 string GCIX
>0x10 string GVRT Sega GVR image:
>>0x10 use sega-gvr-image-header
->>0x08 belong x \b, global index = %u
+>>0x08 ubelong x \b, global index = %u
# Light Field Picture
# Documentation: http://optics.miloush.net/lytro/TheFileFormat.aspx
# Typical file extensions: .lfp .lfr .lfx
-0 belong 0x894C4650
->4 belong 0x0D0A1A0A
->12 belong 0x00000000 Lytro Light Field Picture
->8 belong x \b, version %d
+0 ubelong 0x894C4650
+>4 ubelong 0x0D0A1A0A
+>12 ubelong 0x00000000 Lytro Light Field Picture
+>8 ubelong x \b, version %d
# Type: Vision Research Phantom CINE Format
# URL: https://www.phantomhighspeed.com/
@@ -2238,24 +2827,24 @@
# This has a short "CI" code but the 44 is the size of the struct which is
# stable
0 string CI
->2 leshort 44 Vision Research CINE Video,
->>4 leshort 0 Grayscale,
->>4 leshort 1 JPEG Compressed,
->>4 leshort 2 RAW,
->>6 leshort x version %d,
->>20 lelong x %d frames,
->>48 lelong x %dx
->>52 lelong x \b%d
+>2 uleshort 44 Vision Research CINE Video,
+>>4 uleshort 0 Grayscale,
+>>4 uleshort 1 JPEG Compressed,
+>>4 uleshort 2 RAW,
+>>6 uleshort x version %d,
+>>20 ulelong x %d frames,
+>>48 ulelong x %dx
+>>52 ulelong x \b%d
# Type: ARRI Raw Image
# Info: SMPTE RDD30:2014
# From: Harry Mallon <hjmallon at gmail.com>
0 string ARRI ARRI ARI image data,
->4 lelong 0x78563412 little-endian,
->4 lelong 0x12345678 big-endian,
->12 lelong x version %d,
->20 lelong x %dx
->24 lelong x \b%d
+>4 ulelong 0x78563412 little-endian,
+>4 ulelong 0x12345678 big-endian,
+>12 ulelong x version %d,
+>20 ulelong x %dx
+>24 ulelong x \b%d
# Type: Khronos KTX texture.
# From: David Korth <gerbilsoft@gerbilsoft.com>
@@ -2264,79 +2853,79 @@
# glEnum decoding.
# NOTE: Only the most common formats are listed here.
0 name khronos-ktx-glEnum
->0 lelong 0x1907 \b, RGB
->0 lelong 0x1908 \b, RGBA
->0 lelong 0x1909 \b, LUMINANCE
->0 lelong 0x190A \b, LUMINANCE_ALPHA
->0 lelong 0x80E1 \b, BGR
->0 lelong 0x80E2 \b, BGRA
->0 lelong 0x83A0 \b, RGB_S3TC
->0 lelong 0x83A1 \b, RGB4_S3TC
->0 lelong 0x83A2 \b, RGBA_S3TC
->0 lelong 0x83A3 \b, RGBA4_S3TC
->0 lelong 0x83A4 \b, RGBA_DXT5_S3TC
->0 lelong 0x83A5 \b, RGBA4_DXT5_S3TC
->0 lelong 0x83F0 \b, COMPRESSED_RGB_S3TC_DXT1_EXT
->0 lelong 0x83F1 \b, COMPRESSED_RGBA_S3TC_DXT1_EXT
->0 lelong 0x83F2 \b, COMPRESSED_RGBA_S3TC_DXT3_EXT
->0 lelong 0x83F3 \b, COMPRESSED_RGBA_S3TC_DXT5_EXT
->0 lelong 0x8D64 \b, ETC1_RGB8_OES
->0 lelong 0x9270 \b, COMPRESSED_R11_EAC
->0 lelong 0x9271 \b, COMPRESSED_SIGNED_R11_EAC
->0 lelong 0x9272 \b, COMPRESSED_RG11_EAC
->0 lelong 0x9273 \b, COMPRESSED_SIGNED_RG11_EAC
->0 lelong 0x9274 \b, COMPRESSED_RGB8_ETC2
->0 lelong 0x9275 \b, COMPRESSED_SRGB8_ETC2
->0 lelong 0x9276 \b, COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
->0 lelong 0x9277 \b, COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
->0 lelong 0x9278 \b, COMPRESSED_RGBA2_ETC2_EAC
->0 lelong 0x9279 \b, COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
->0 lelong 0x93B0 \b, COMPRESSED_RGBA_ASTC_4x4_KHR
->0 lelong 0x93B1 \b, COMPRESSED_RGBA_ASTC_5x4_KHR
->0 lelong 0x93B2 \b, COMPRESSED_RGBA_ASTC_5x5_KHR
->0 lelong 0x93B3 \b, COMPRESSED_RGBA_ASTC_6x5_KHR
->0 lelong 0x93B4 \b, COMPRESSED_RGBA_ASTC_6x6_KHR
->0 lelong 0x93B5 \b, COMPRESSED_RGBA_ASTC_8x5_KHR
->0 lelong 0x93B6 \b, COMPRESSED_RGBA_ASTC_8x6_KHR
->0 lelong 0x93B7 \b, COMPRESSED_RGBA_ASTC_8x8_KHR
->0 lelong 0x93B8 \b, COMPRESSED_RGBA_ASTC_10x5_KHR
->0 lelong 0x93B9 \b, COMPRESSED_RGBA_ASTC_10x6_KHR
->0 lelong 0x93BA \b, COMPRESSED_RGBA_ASTC_10x8_KHR
->0 lelong 0x93BB \b, COMPRESSED_RGBA_ASTC_10x10_KHR
->0 lelong 0x93BC \b, COMPRESSED_RGBA_ASTC_12x10_KHR
->0 lelong 0x93BD \b, COMPRESSED_RGBA_ASTC_12x12_KHR
->0 lelong 0x93D0 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR
->0 lelong 0x93D1 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR
->0 lelong 0x93D2 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR
->0 lelong 0x93D3 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR
->0 lelong 0x93D4 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR
->0 lelong 0x93D5 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR
->0 lelong 0x93D6 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR
->0 lelong 0x93D7 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR
->0 lelong 0x93D8 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR
->0 lelong 0x93D9 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR
->0 lelong 0x93DA \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR
->0 lelong 0x93DB \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR
->0 lelong 0x93DC \b, COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR
->0 lelong 0x93DD \b, COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR
+>0 ulelong 0x1907 \b, RGB
+>0 ulelong 0x1908 \b, RGBA
+>0 ulelong 0x1909 \b, LUMINANCE
+>0 ulelong 0x190A \b, LUMINANCE_ALPHA
+>0 ulelong 0x80E1 \b, BGR
+>0 ulelong 0x80E2 \b, BGRA
+>0 ulelong 0x83A0 \b, RGB_S3TC
+>0 ulelong 0x83A1 \b, RGB4_S3TC
+>0 ulelong 0x83A2 \b, RGBA_S3TC
+>0 ulelong 0x83A3 \b, RGBA4_S3TC
+>0 ulelong 0x83A4 \b, RGBA_DXT5_S3TC
+>0 ulelong 0x83A5 \b, RGBA4_DXT5_S3TC
+>0 ulelong 0x83F0 \b, COMPRESSED_RGB_S3TC_DXT1_EXT
+>0 ulelong 0x83F1 \b, COMPRESSED_RGBA_S3TC_DXT1_EXT
+>0 ulelong 0x83F2 \b, COMPRESSED_RGBA_S3TC_DXT3_EXT
+>0 ulelong 0x83F3 \b, COMPRESSED_RGBA_S3TC_DXT5_EXT
+>0 ulelong 0x8D64 \b, ETC1_RGB8_OES
+>0 ulelong 0x9270 \b, COMPRESSED_R11_EAC
+>0 ulelong 0x9271 \b, COMPRESSED_SIGNED_R11_EAC
+>0 ulelong 0x9272 \b, COMPRESSED_RG11_EAC
+>0 ulelong 0x9273 \b, COMPRESSED_SIGNED_RG11_EAC
+>0 ulelong 0x9274 \b, COMPRESSED_RGB8_ETC2
+>0 ulelong 0x9275 \b, COMPRESSED_SRGB8_ETC2
+>0 ulelong 0x9276 \b, COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2
+>0 ulelong 0x9277 \b, COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2
+>0 ulelong 0x9278 \b, COMPRESSED_RGBA2_ETC2_EAC
+>0 ulelong 0x9279 \b, COMPRESSED_SRGB8_ALPHA8_ETC2_EAC
+>0 ulelong 0x93B0 \b, COMPRESSED_RGBA_ASTC_4x4_KHR
+>0 ulelong 0x93B1 \b, COMPRESSED_RGBA_ASTC_5x4_KHR
+>0 ulelong 0x93B2 \b, COMPRESSED_RGBA_ASTC_5x5_KHR
+>0 ulelong 0x93B3 \b, COMPRESSED_RGBA_ASTC_6x5_KHR
+>0 ulelong 0x93B4 \b, COMPRESSED_RGBA_ASTC_6x6_KHR
+>0 ulelong 0x93B5 \b, COMPRESSED_RGBA_ASTC_8x5_KHR
+>0 ulelong 0x93B6 \b, COMPRESSED_RGBA_ASTC_8x6_KHR
+>0 ulelong 0x93B7 \b, COMPRESSED_RGBA_ASTC_8x8_KHR
+>0 ulelong 0x93B8 \b, COMPRESSED_RGBA_ASTC_10x5_KHR
+>0 ulelong 0x93B9 \b, COMPRESSED_RGBA_ASTC_10x6_KHR
+>0 ulelong 0x93BA \b, COMPRESSED_RGBA_ASTC_10x8_KHR
+>0 ulelong 0x93BB \b, COMPRESSED_RGBA_ASTC_10x10_KHR
+>0 ulelong 0x93BC \b, COMPRESSED_RGBA_ASTC_12x10_KHR
+>0 ulelong 0x93BD \b, COMPRESSED_RGBA_ASTC_12x12_KHR
+>0 ulelong 0x93D0 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR
+>0 ulelong 0x93D1 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR
+>0 ulelong 0x93D2 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR
+>0 ulelong 0x93D3 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR
+>0 ulelong 0x93D4 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR
+>0 ulelong 0x93D5 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR
+>0 ulelong 0x93D6 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR
+>0 ulelong 0x93D7 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR
+>0 ulelong 0x93D8 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR
+>0 ulelong 0x93D9 \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR
+>0 ulelong 0x93DA \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR
+>0 ulelong 0x93DB \b, COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR
+>0 ulelong 0x93DC \b, COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR
+>0 ulelong 0x93DD \b, COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR
# Endian-specific KTX header.
# TODO: glType (all textures I've seen so far are GL_UNSIGNED_BYTE)
0 name khronos-ktx-endian-header
->20 lelong x \b, %u
->24 lelong >1 x %u
->28 lelong >1 x %u
->8 lelong >0
+>20 ulelong x \b, %u
+>24 ulelong >1 x %u
+>28 ulelong >1 x %u
+>8 ulelong >0
>>8 use khronos-ktx-glEnum
->8 lelong 0
+>8 ulelong 0
>>12 use khronos-ktx-glEnum
# Main KTX header.
# Determine endianness, then check the rest of the header.
0 string \xABKTX\ 11\xBB\r\n\x1A\n Khronos KTX texture
->12 lelong 0x04030201 (little-endian)
+>12 ulelong 0x04030201 (little-endian)
>>16 use khronos-ktx-endian-header
->12 belong 0x04030201 (big-endian)
+>12 ubelong 0x04030201 (big-endian)
>>16 use \^khronos-ktx-endian-header
# Type: Khronos KTX2 texture.
@@ -2346,273 +2935,273 @@
# Supercompression enum.
0 name khronos-ktx2-supercompression
->0 lelong 1 BasisLZ
->0 lelong 2 Zstandard
->0 lelong 3 ZLIB
+>0 ulelong 1 BasisLZ
+>0 ulelong 2 Zstandard
+>0 ulelong 3 ZLIB
# Vulkan format identifier.
# NOTE: Formats prohibited from KTX2 are commented out.
0 name khronos-ktx2-vkFormat
->0 lelong 0 UNDEFINED
->0 lelong 1 R4G4_UNORM_PACK8
->0 lelong 2 R4G4B4A4_UNORM_PACK16
->0 lelong 3 B4G4R4A4_UNORM_PACK16
->0 lelong 4 R5G6B5_UNORM_PACK16
->0 lelong 5 B5G6R5_UNORM_PACK16
->0 lelong 6 R5G5B5A1_UNORM_PACK16
->0 lelong 7 B5G5R5A1_UNORM_PACK16
->0 lelong 8 A1R5G5B5_UNORM_PACK16
->0 lelong 9 R8_UNORM
->0 lelong 10 R8_SNORM
-#>0 lelong 11 R8_USCALED
-#>0 lelong 12 R8_SSCALED
->0 lelong 13 R8_UINT
->0 lelong 14 R8_SINT
->0 lelong 15 R8_SRGB
->0 lelong 16 R8G8_UNORM
->0 lelong 17 R8G8_SNORM
-#>0 lelong 18 R8G8_USCALED
-#>0 lelong 19 R8G8_SSCALED
->0 lelong 20 R8G8_UINT
->0 lelong 21 R8G8_SINT
->0 lelong 22 R8G8_SRGB
->0 lelong 23 R8G8B8_UNORM
->0 lelong 24 R8G8B8_SNORM
-#>0 lelong 25 R8G8B8_USCALED
-#>0 lelong 26 R8G8B8_SSCALED
->0 lelong 27 R8G8B8_UINT
->0 lelong 28 R8G8B8_SINT
->0 lelong 29 R8G8B8_SRGB
->0 lelong 30 B8G8R8_UNORM
->0 lelong 31 B8G8R8_SNORM
-#>0 lelong 32 B8G8R8_USCALED
-#>0 lelong 33 B8G8R8_SSCALED
->0 lelong 34 B8G8R8_UINT
->0 lelong 35 B8G8R8_SINT
->0 lelong 36 B8G8R8_SRGB
->0 lelong 37 R8G8B8A8_UNORM
->0 lelong 38 R8G8B8A8_SNORM
-#>0 lelong 39 R8G8B8A8_USCALED
-#>0 lelong 40 R8G8B8A8_SSCALED
->0 lelong 41 R8G8B8A8_UINT
->0 lelong 42 R8G8B8A8_SINT
->0 lelong 43 R8G8B8A8_SRGB
->0 lelong 44 B8G8R8A8_UNORM
->0 lelong 45 B8G8R8A8_SNORM
-#>0 lelong 46 B8G8R8A8_USCALED
-#>0 lelong 47 B8G8R8A8_SSCALED
->0 lelong 48 B8G8R8A8_UINT
->0 lelong 49 B8G8R8A8_SINT
->0 lelong 50 B8G8R8A8_SRGB
-#>0 lelong 51 A8B8G8R8_UNORM_PACK32
-#>0 lelong 52 A8B8G8R8_SNORM_PACK32
-#>0 lelong 53 A8B8G8R8_USCALED_PACK32
-#>0 lelong 54 A8B8G8R8_SSCALED_PACK32
-#>0 lelong 55 A8B8G8R8_UINT_PACK32
-#>0 lelong 56 A8B8G8R8_SINT_PACK32
-#>0 lelong 57 A8B8G8R8_SRGB_PACK32
->0 lelong 58 A2R10G10B10_UNORM_PACK32
->0 lelong 59 A2R10G10B10_SNORM_PACK32
-#>0 lelong 60 A2R10G10B10_USCALED_PACK32
-#>0 lelong 61 A2R10G10B10_SSCALED_PACK32
->0 lelong 62 A2R10G10B10_UINT_PACK32
->0 lelong 63 A2R10G10B10_SINT_PACK32
->0 lelong 64 A2B10G10R10_UNORM_PACK32
->0 lelong 65 A2B10G10R10_SNORM_PACK32
-#>0 lelong 66 A2B10G10R10_USCALED_PACK32
-#>0 lelong 67 A2B10G10R10_SSCALED_PACK32
->0 lelong 68 A2B10G10R10_UINT_PACK32
->0 lelong 69 A2B10G10R10_SINT_PACK32
->0 lelong 70 R16_UNORM
->0 lelong 71 R16_SNORM
-#>0 lelong 72 R16_USCALED
-#>0 lelong 73 R16_SSCALED
->0 lelong 74 R16_UINT
->0 lelong 75 R16_SINT
->0 lelong 76 R16_SFLOAT
->0 lelong 77 R16G16_UNORM
->0 lelong 78 R16G16_SNORM
-#>0 lelong 79 R16G16_USCALED
-#>0 lelong 80 R16G16_SSCALED
->0 lelong 81 R16G16_UINT
->0 lelong 82 R16G16_SINT
->0 lelong 83 R16G16_SFLOAT
->0 lelong 84 R16G16B16_UNORM
->0 lelong 85 R16G16B16_SNORM
-#>0 lelong 86 R16G16B16_USCALED
-#>0 lelong 87 R16G16B16_SSCALED
->0 lelong 88 R16G16B16_UINT
->0 lelong 89 R16G16B16_SINT
->0 lelong 90 R16G16B16_SFLOAT
->0 lelong 91 R16G16B16A16_UNORM
->0 lelong 92 R16G16B16A16_SNORM
-#>0 lelong 93 R16G16B16A16_USCALED
-#>0 lelong 94 R16G16B16A16_SSCALED
->0 lelong 95 R16G16B16A16_UINT
->0 lelong 96 R16G16B16A16_SINT
->0 lelong 97 R16G16B16A16_SFLOAT
->0 lelong 98 R32_UINT
->0 lelong 99 R32_SINT
->0 lelong 100 R32_SFLOAT
->0 lelong 101 R32G32_UINT
->0 lelong 102 R32G32_SINT
->0 lelong 103 R32G32_SFLOAT
->0 lelong 104 R32G32B32_UINT
->0 lelong 105 R32G32B32_SINT
->0 lelong 106 R32G32B32_SFLOAT
->0 lelong 107 R32G32B32A32_UINT
->0 lelong 108 R32G32B32A32_SINT
->0 lelong 109 R32G32B32A32_SFLOAT
->0 lelong 110 R64_UINT
->0 lelong 111 R64_SINT
->0 lelong 112 R64_SFLOAT
->0 lelong 113 R64G64_UINT
->0 lelong 114 R64G64_SINT
->0 lelong 115 R64G64_SFLOAT
->0 lelong 116 R64G64B64_UINT
->0 lelong 117 R64G64B64_SINT
->0 lelong 118 R64G64B64_SFLOAT
->0 lelong 119 R64G64B64A64_UINT
->0 lelong 120 R64G64B64A64_SINT
->0 lelong 121 R64G64B64A64_SFLOAT
->0 lelong 122 B10G11R11_UFLOAT_PACK32
->0 lelong 123 E5B9G9R9_UFLOAT_PACK32
->0 lelong 124 D16_UNORM
->0 lelong 125 X8_D24_UNORM_PACK32
->0 lelong 126 D32_SFLOAT
->0 lelong 127 S8_UINT
->0 lelong 128 D16_UNORM_S8_UINT
->0 lelong 129 D24_UNORM_S8_UINT
->0 lelong 130 D32_SFLOAT_S8_UINT
+>0 ulelong 0 UNDEFINED
+>0 ulelong 1 R4G4_UNORM_PACK8
+>0 ulelong 2 R4G4B4A4_UNORM_PACK16
+>0 ulelong 3 B4G4R4A4_UNORM_PACK16
+>0 ulelong 4 R5G6B5_UNORM_PACK16
+>0 ulelong 5 B5G6R5_UNORM_PACK16
+>0 ulelong 6 R5G5B5A1_UNORM_PACK16
+>0 ulelong 7 B5G5R5A1_UNORM_PACK16
+>0 ulelong 8 A1R5G5B5_UNORM_PACK16
+>0 ulelong 9 R8_UNORM
+>0 ulelong 10 R8_SNORM
+#>0 ulelong 11 R8_USCALED
+#>0 ulelong 12 R8_SSCALED
+>0 ulelong 13 R8_UINT
+>0 ulelong 14 R8_SINT
+>0 ulelong 15 R8_SRGB
+>0 ulelong 16 R8G8_UNORM
+>0 ulelong 17 R8G8_SNORM
+#>0 ulelong 18 R8G8_USCALED
+#>0 ulelong 19 R8G8_SSCALED
+>0 ulelong 20 R8G8_UINT
+>0 ulelong 21 R8G8_SINT
+>0 ulelong 22 R8G8_SRGB
+>0 ulelong 23 R8G8B8_UNORM
+>0 ulelong 24 R8G8B8_SNORM
+#>0 ulelong 25 R8G8B8_USCALED
+#>0 ulelong 26 R8G8B8_SSCALED
+>0 ulelong 27 R8G8B8_UINT
+>0 ulelong 28 R8G8B8_SINT
+>0 ulelong 29 R8G8B8_SRGB
+>0 ulelong 30 B8G8R8_UNORM
+>0 ulelong 31 B8G8R8_SNORM
+#>0 ulelong 32 B8G8R8_USCALED
+#>0 ulelong 33 B8G8R8_SSCALED
+>0 ulelong 34 B8G8R8_UINT
+>0 ulelong 35 B8G8R8_SINT
+>0 ulelong 36 B8G8R8_SRGB
+>0 ulelong 37 R8G8B8A8_UNORM
+>0 ulelong 38 R8G8B8A8_SNORM
+#>0 ulelong 39 R8G8B8A8_USCALED
+#>0 ulelong 40 R8G8B8A8_SSCALED
+>0 ulelong 41 R8G8B8A8_UINT
+>0 ulelong 42 R8G8B8A8_SINT
+>0 ulelong 43 R8G8B8A8_SRGB
+>0 ulelong 44 B8G8R8A8_UNORM
+>0 ulelong 45 B8G8R8A8_SNORM
+#>0 ulelong 46 B8G8R8A8_USCALED
+#>0 ulelong 47 B8G8R8A8_SSCALED
+>0 ulelong 48 B8G8R8A8_UINT
+>0 ulelong 49 B8G8R8A8_SINT
+>0 ulelong 50 B8G8R8A8_SRGB
+#>0 ulelong 51 A8B8G8R8_UNORM_PACK32
+#>0 ulelong 52 A8B8G8R8_SNORM_PACK32
+#>0 ulelong 53 A8B8G8R8_USCALED_PACK32
+#>0 ulelong 54 A8B8G8R8_SSCALED_PACK32
+#>0 ulelong 55 A8B8G8R8_UINT_PACK32
+#>0 ulelong 56 A8B8G8R8_SINT_PACK32
+#>0 ulelong 57 A8B8G8R8_SRGB_PACK32
+>0 ulelong 58 A2R10G10B10_UNORM_PACK32
+>0 ulelong 59 A2R10G10B10_SNORM_PACK32
+#>0 ulelong 60 A2R10G10B10_USCALED_PACK32
+#>0 ulelong 61 A2R10G10B10_SSCALED_PACK32
+>0 ulelong 62 A2R10G10B10_UINT_PACK32
+>0 ulelong 63 A2R10G10B10_SINT_PACK32
+>0 ulelong 64 A2B10G10R10_UNORM_PACK32
+>0 ulelong 65 A2B10G10R10_SNORM_PACK32
+#>0 ulelong 66 A2B10G10R10_USCALED_PACK32
+#>0 ulelong 67 A2B10G10R10_SSCALED_PACK32
+>0 ulelong 68 A2B10G10R10_UINT_PACK32
+>0 ulelong 69 A2B10G10R10_SINT_PACK32
+>0 ulelong 70 R16_UNORM
+>0 ulelong 71 R16_SNORM
+#>0 ulelong 72 R16_USCALED
+#>0 ulelong 73 R16_SSCALED
+>0 ulelong 74 R16_UINT
+>0 ulelong 75 R16_SINT
+>0 ulelong 76 R16_SFLOAT
+>0 ulelong 77 R16G16_UNORM
+>0 ulelong 78 R16G16_SNORM
+#>0 ulelong 79 R16G16_USCALED
+#>0 ulelong 80 R16G16_SSCALED
+>0 ulelong 81 R16G16_UINT
+>0 ulelong 82 R16G16_SINT
+>0 ulelong 83 R16G16_SFLOAT
+>0 ulelong 84 R16G16B16_UNORM
+>0 ulelong 85 R16G16B16_SNORM
+#>0 ulelong 86 R16G16B16_USCALED
+#>0 ulelong 87 R16G16B16_SSCALED
+>0 ulelong 88 R16G16B16_UINT
+>0 ulelong 89 R16G16B16_SINT
+>0 ulelong 90 R16G16B16_SFLOAT
+>0 ulelong 91 R16G16B16A16_UNORM
+>0 ulelong 92 R16G16B16A16_SNORM
+#>0 ulelong 93 R16G16B16A16_USCALED
+#>0 ulelong 94 R16G16B16A16_SSCALED
+>0 ulelong 95 R16G16B16A16_UINT
+>0 ulelong 96 R16G16B16A16_SINT
+>0 ulelong 97 R16G16B16A16_SFLOAT
+>0 ulelong 98 R32_UINT
+>0 ulelong 99 R32_SINT
+>0 ulelong 100 R32_SFLOAT
+>0 ulelong 101 R32G32_UINT
+>0 ulelong 102 R32G32_SINT
+>0 ulelong 103 R32G32_SFLOAT
+>0 ulelong 104 R32G32B32_UINT
+>0 ulelong 105 R32G32B32_SINT
+>0 ulelong 106 R32G32B32_SFLOAT
+>0 ulelong 107 R32G32B32A32_UINT
+>0 ulelong 108 R32G32B32A32_SINT
+>0 ulelong 109 R32G32B32A32_SFLOAT
+>0 ulelong 110 R64_UINT
+>0 ulelong 111 R64_SINT
+>0 ulelong 112 R64_SFLOAT
+>0 ulelong 113 R64G64_UINT
+>0 ulelong 114 R64G64_SINT
+>0 ulelong 115 R64G64_SFLOAT
+>0 ulelong 116 R64G64B64_UINT
+>0 ulelong 117 R64G64B64_SINT
+>0 ulelong 118 R64G64B64_SFLOAT
+>0 ulelong 119 R64G64B64A64_UINT
+>0 ulelong 120 R64G64B64A64_SINT
+>0 ulelong 121 R64G64B64A64_SFLOAT
+>0 ulelong 122 B10G11R11_UFLOAT_PACK32
+>0 ulelong 123 E5B9G9R9_UFLOAT_PACK32
+>0 ulelong 124 D16_UNORM
+>0 ulelong 125 X8_D24_UNORM_PACK32
+>0 ulelong 126 D32_SFLOAT
+>0 ulelong 127 S8_UINT
+>0 ulelong 128 D16_UNORM_S8_UINT
+>0 ulelong 129 D24_UNORM_S8_UINT
+>0 ulelong 130 D32_SFLOAT_S8_UINT
->0 lelong 131 BC1_RGB_UNORM_BLOCK
->0 lelong 132 BC1_RGB_SRGB_BLOCK
->0 lelong 133 BC1_RGBA_UNORM_BLOCK
->0 lelong 134 BC1_RGBA_SRGB_BLOCK
->0 lelong 135 BC2_UNORM_BLOCK
->0 lelong 136 BC2_SRGB_BLOCK
->0 lelong 137 BC3_UNORM_BLOCK
->0 lelong 138 BC3_SRGB_BLOCK
->0 lelong 139 BC4_UNORM_BLOCK
->0 lelong 140 BC4_SNORM_BLOCK
->0 lelong 141 BC5_UNORM_BLOCK
->0 lelong 142 BC5_SNORM_BLOCK
->0 lelong 143 BC6H_UFLOAT_BLOCK
->0 lelong 144 BC6H_SFLOAT_BLOCK
->0 lelong 145 BC7_UNORM_BLOCK
->0 lelong 146 BC7_SRGB_BLOCK
+>0 ulelong 131 BC1_RGB_UNORM_BLOCK
+>0 ulelong 132 BC1_RGB_SRGB_BLOCK
+>0 ulelong 133 BC1_RGBA_UNORM_BLOCK
+>0 ulelong 134 BC1_RGBA_SRGB_BLOCK
+>0 ulelong 135 BC2_UNORM_BLOCK
+>0 ulelong 136 BC2_SRGB_BLOCK
+>0 ulelong 137 BC3_UNORM_BLOCK
+>0 ulelong 138 BC3_SRGB_BLOCK
+>0 ulelong 139 BC4_UNORM_BLOCK
+>0 ulelong 140 BC4_SNORM_BLOCK
+>0 ulelong 141 BC5_UNORM_BLOCK
+>0 ulelong 142 BC5_SNORM_BLOCK
+>0 ulelong 143 BC6H_UFLOAT_BLOCK
+>0 ulelong 144 BC6H_SFLOAT_BLOCK
+>0 ulelong 145 BC7_UNORM_BLOCK
+>0 ulelong 146 BC7_SRGB_BLOCK
->0 lelong 147 ETC2_R8G8B8_UNORM_BLOCK
->0 lelong 148 ETC2_R8G8B8_SRGB_BLOCK
->0 lelong 149 ETC2_R8G8B8A1_UNORM_BLOCK
->0 lelong 150 ETC2_R8G8B8A1_SRGB_BLOCK
->0 lelong 151 ETC2_R8G8B8A8_UNORM_BLOCK
->0 lelong 152 ETC2_R8G8B8A8_SRGB_BLOCK
+>0 ulelong 147 ETC2_R8G8B8_UNORM_BLOCK
+>0 ulelong 148 ETC2_R8G8B8_SRGB_BLOCK
+>0 ulelong 149 ETC2_R8G8B8A1_UNORM_BLOCK
+>0 ulelong 150 ETC2_R8G8B8A1_SRGB_BLOCK
+>0 ulelong 151 ETC2_R8G8B8A8_UNORM_BLOCK
+>0 ulelong 152 ETC2_R8G8B8A8_SRGB_BLOCK
->0 lelong 153 EAC_R11_UNORM_BLOCK
->0 lelong 154 EAC_R11_SNORM_BLOCK
->0 lelong 155 EAC_R11G11_UNORM_BLOCK
->0 lelong 156 EAC_R11G11_SNORM_BLOCK
+>0 ulelong 153 EAC_R11_UNORM_BLOCK
+>0 ulelong 154 EAC_R11_SNORM_BLOCK
+>0 ulelong 155 EAC_R11G11_UNORM_BLOCK
+>0 ulelong 156 EAC_R11G11_SNORM_BLOCK
->0 lelong 157 ASTC_4x4_UNORM_BLOCK
->0 lelong 158 ASTC_4x4_SRGB_BLOCK
->0 lelong 159 ASTC_5x4_UNORM_BLOCK
->0 lelong 160 ASTC_5x4_SRGB_BLOCK
->0 lelong 161 ASTC_5x5_UNORM_BLOCK
->0 lelong 162 ASTC_5x5_SRGB_BLOCK
->0 lelong 163 ASTC_6x5_UNORM_BLOCK
->0 lelong 164 ASTC_6x5_SRGB_BLOCK
->0 lelong 165 ASTC_6x6_UNORM_BLOCK
->0 lelong 166 ASTC_6x6_SRGB_BLOCK
->0 lelong 167 ASTC_8x5_UNORM_BLOCK
->0 lelong 168 ASTC_8x5_SRGB_BLOCK
->0 lelong 169 ASTC_8x6_UNORM_BLOCK
->0 lelong 170 ASTC_8x6_SRGB_BLOCK
->0 lelong 171 ASTC_8x8_UNORM_BLOCK
->0 lelong 172 ASTC_8x8_SRGB_BLOCK
->0 lelong 173 ASTC_10x5_UNORM_BLOCK
->0 lelong 174 ASTC_10x5_SRGB_BLOCK
->0 lelong 175 ASTC_10x6_UNORM_BLOCK
->0 lelong 176 ASTC_10x6_SRGB_BLOCK
->0 lelong 177 ASTC_10x8_UNORM_BLOCK
->0 lelong 178 ASTC_10x8_SRGB_BLOCK
->0 lelong 179 ASTC_10x10_UNORM_BLOCK
->0 lelong 180 ASTC_10x10_SRGB_BLOCK
->0 lelong 181 ASTC_12x10_UNORM_BLOCK
->0 lelong 182 ASTC_12x10_SRGB_BLOCK
->0 lelong 183 ASTC_12x12_UNORM_BLOCK
->0 lelong 184 ASTC_12x12_SRGB_BLOCK
+>0 ulelong 157 ASTC_4x4_UNORM_BLOCK
+>0 ulelong 158 ASTC_4x4_SRGB_BLOCK
+>0 ulelong 159 ASTC_5x4_UNORM_BLOCK
+>0 ulelong 160 ASTC_5x4_SRGB_BLOCK
+>0 ulelong 161 ASTC_5x5_UNORM_BLOCK
+>0 ulelong 162 ASTC_5x5_SRGB_BLOCK
+>0 ulelong 163 ASTC_6x5_UNORM_BLOCK
+>0 ulelong 164 ASTC_6x5_SRGB_BLOCK
+>0 ulelong 165 ASTC_6x6_UNORM_BLOCK
+>0 ulelong 166 ASTC_6x6_SRGB_BLOCK
+>0 ulelong 167 ASTC_8x5_UNORM_BLOCK
+>0 ulelong 168 ASTC_8x5_SRGB_BLOCK
+>0 ulelong 169 ASTC_8x6_UNORM_BLOCK
+>0 ulelong 170 ASTC_8x6_SRGB_BLOCK
+>0 ulelong 171 ASTC_8x8_UNORM_BLOCK
+>0 ulelong 172 ASTC_8x8_SRGB_BLOCK
+>0 ulelong 173 ASTC_10x5_UNORM_BLOCK
+>0 ulelong 174 ASTC_10x5_SRGB_BLOCK
+>0 ulelong 175 ASTC_10x6_UNORM_BLOCK
+>0 ulelong 176 ASTC_10x6_SRGB_BLOCK
+>0 ulelong 177 ASTC_10x8_UNORM_BLOCK
+>0 ulelong 178 ASTC_10x8_SRGB_BLOCK
+>0 ulelong 179 ASTC_10x10_UNORM_BLOCK
+>0 ulelong 180 ASTC_10x10_SRGB_BLOCK
+>0 ulelong 181 ASTC_12x10_UNORM_BLOCK
+>0 ulelong 182 ASTC_12x10_SRGB_BLOCK
+>0 ulelong 183 ASTC_12x12_UNORM_BLOCK
+>0 ulelong 184 ASTC_12x12_SRGB_BLOCK
->0 lelong 1000156000 G8B8G8R8_422_UNORM
->0 lelong 1000156001 B8G8R8G8_422_UNORM
->0 lelong 1000156002 G8_B8_R8_3PLANE_420_UNORM
->0 lelong 1000156003 G8_B8R8_2PLANE_420_UNORM
->0 lelong 1000156004 G8_B8_R8_3PLANE_422_UNORM
->0 lelong 1000156005 G8_B8R8_2PLANE_422_UNORM
->0 lelong 1000156006 G8_B8_R8_3PLANE_444_UNORM
->0 lelong 1000156007 R10X6_UNORM_PACK16
->0 lelong 1000156008 R10X6G10X6_UNORM_2PACK16
->0 lelong 1000156009 R10X6G10X6B10X6A10X6_UNORM_4PACK16
->0 lelong 1000156010 G10X6B10X6G10X6R10X6_422_UNORM_4PACK16
->0 lelong 1000156011 B10X6G10X6R10X6G10X6_422_UNORM_4PACK16
->0 lelong 1000156012 G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16
->0 lelong 1000156013 G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16
->0 lelong 1000156014 G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16
->0 lelong 1000156015 G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16
->0 lelong 1000156016 G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16
->0 lelong 1000156017 R12X4_UNORM_PACK16
->0 lelong 1000156018 R12X4G12X4_UNORM_2PACK16
->0 lelong 1000156019 R12X4G12X4B12X4A12X4_UNORM_4PACK16
->0 lelong 1000156020 G12X4B12X4G12X4R12X4_422_UNORM_4PACK16
->0 lelong 1000156021 B12X4G12X4R12X4G12X4_422_UNORM_4PACK16
->0 lelong 1000156022 G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16
->0 lelong 1000156023 G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16
->0 lelong 1000156024 G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16
->0 lelong 1000156025 G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16
->0 lelong 1000156026 G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16
->0 lelong 1000156027 G16B16G16R16_422_UNORM
->0 lelong 1000156028 B16G16R16G16_422_UNORM
->0 lelong 1000156029 G16_B16_R16_3PLANE_420_UNORM
->0 lelong 1000156030 G16_B16R16_2PLANE_420_UNORM
->0 lelong 1000156031 G16_B16_R16_3PLANE_422_UNORM
->0 lelong 1000156032 G16_B16R16_2PLANE_422_UNORM
->0 lelong 1000156033 G16_B16_R16_3PLANE_444_UNORM
+>0 ulelong 1000156000 G8B8G8R8_422_UNORM
+>0 ulelong 1000156001 B8G8R8G8_422_UNORM
+>0 ulelong 1000156002 G8_B8_R8_3PLANE_420_UNORM
+>0 ulelong 1000156003 G8_B8R8_2PLANE_420_UNORM
+>0 ulelong 1000156004 G8_B8_R8_3PLANE_422_UNORM
+>0 ulelong 1000156005 G8_B8R8_2PLANE_422_UNORM
+>0 ulelong 1000156006 G8_B8_R8_3PLANE_444_UNORM
+>0 ulelong 1000156007 R10X6_UNORM_PACK16
+>0 ulelong 1000156008 R10X6G10X6_UNORM_2PACK16
+>0 ulelong 1000156009 R10X6G10X6B10X6A10X6_UNORM_4PACK16
+>0 ulelong 1000156010 G10X6B10X6G10X6R10X6_422_UNORM_4PACK16
+>0 ulelong 1000156011 B10X6G10X6R10X6G10X6_422_UNORM_4PACK16
+>0 ulelong 1000156012 G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16
+>0 ulelong 1000156013 G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16
+>0 ulelong 1000156014 G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16
+>0 ulelong 1000156015 G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16
+>0 ulelong 1000156016 G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16
+>0 ulelong 1000156017 R12X4_UNORM_PACK16
+>0 ulelong 1000156018 R12X4G12X4_UNORM_2PACK16
+>0 ulelong 1000156019 R12X4G12X4B12X4A12X4_UNORM_4PACK16
+>0 ulelong 1000156020 G12X4B12X4G12X4R12X4_422_UNORM_4PACK16
+>0 ulelong 1000156021 B12X4G12X4R12X4G12X4_422_UNORM_4PACK16
+>0 ulelong 1000156022 G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16
+>0 ulelong 1000156023 G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16
+>0 ulelong 1000156024 G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16
+>0 ulelong 1000156025 G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16
+>0 ulelong 1000156026 G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16
+>0 ulelong 1000156027 G16B16G16R16_422_UNORM
+>0 ulelong 1000156028 B16G16R16G16_422_UNORM
+>0 ulelong 1000156029 G16_B16_R16_3PLANE_420_UNORM
+>0 ulelong 1000156030 G16_B16R16_2PLANE_420_UNORM
+>0 ulelong 1000156031 G16_B16_R16_3PLANE_422_UNORM
+>0 ulelong 1000156032 G16_B16R16_2PLANE_422_UNORM
+>0 ulelong 1000156033 G16_B16_R16_3PLANE_444_UNORM
->0 lelong 1000054000 PVRTC1_2BPP_UNORM_BLOCK_IMG
->0 lelong 1000054001 PVRTC1_4BPP_UNORM_BLOCK_IMG
->0 lelong 1000054002 PVRTC2_2BPP_UNORM_BLOCK_IMG
->0 lelong 1000054003 PVRTC2_4BPP_UNORM_BLOCK_IMG
->0 lelong 1000054004 PVRTC1_2BPP_SRGB_BLOCK_IMG
->0 lelong 1000054005 PVRTC1_4BPP_SRGB_BLOCK_IMG
->0 lelong 1000054006 PVRTC2_2BPP_SRGB_BLOCK_IMG
->0 lelong 1000054007 PVRTC2_4BPP_SRGB_BLOCK_IMG
+>0 ulelong 1000054000 PVRTC1_2BPP_UNORM_BLOCK_IMG
+>0 ulelong 1000054001 PVRTC1_4BPP_UNORM_BLOCK_IMG
+>0 ulelong 1000054002 PVRTC2_2BPP_UNORM_BLOCK_IMG
+>0 ulelong 1000054003 PVRTC2_4BPP_UNORM_BLOCK_IMG
+>0 ulelong 1000054004 PVRTC1_2BPP_SRGB_BLOCK_IMG
+>0 ulelong 1000054005 PVRTC1_4BPP_SRGB_BLOCK_IMG
+>0 ulelong 1000054006 PVRTC2_2BPP_SRGB_BLOCK_IMG
+>0 ulelong 1000054007 PVRTC2_4BPP_SRGB_BLOCK_IMG
->0 lelong 1000066000 ASTC_4x4_SFLOAT_BLOCK_EXT
->0 lelong 1000066001 ASTC_5x4_SFLOAT_BLOCK_EXT
->0 lelong 1000066002 ASTC_5x5_SFLOAT_BLOCK_EXT
->0 lelong 1000066003 ASTC_6x5_SFLOAT_BLOCK_EXT
->0 lelong 1000066004 ASTC_6x6_SFLOAT_BLOCK_EXT
->0 lelong 1000066005 ASTC_8x5_SFLOAT_BLOCK_EXT
->0 lelong 1000066006 ASTC_8x6_SFLOAT_BLOCK_EXT
->0 lelong 1000066007 ASTC_8x8_SFLOAT_BLOCK_EXT
->0 lelong 1000066008 ASTC_10x5_SFLOAT_BLOCK_EXT
->0 lelong 1000066009 ASTC_10x6_SFLOAT_BLOCK_EXT
->0 lelong 1000066010 ASTC_10x8_SFLOAT_BLOCK_EXT
->0 lelong 1000066011 ASTC_10x10_SFLOAT_BLOCK_EXT
->0 lelong 1000066012 ASTC_12x10_SFLOAT_BLOCK_EXT
->0 lelong 1000066013 ASTC_12x12_SFLOAT_BLOCK_EXT
+>0 ulelong 1000066000 ASTC_4x4_SFLOAT_BLOCK_EXT
+>0 ulelong 1000066001 ASTC_5x4_SFLOAT_BLOCK_EXT
+>0 ulelong 1000066002 ASTC_5x5_SFLOAT_BLOCK_EXT
+>0 ulelong 1000066003 ASTC_6x5_SFLOAT_BLOCK_EXT
+>0 ulelong 1000066004 ASTC_6x6_SFLOAT_BLOCK_EXT
+>0 ulelong 1000066005 ASTC_8x5_SFLOAT_BLOCK_EXT
+>0 ulelong 1000066006 ASTC_8x6_SFLOAT_BLOCK_EXT
+>0 ulelong 1000066007 ASTC_8x8_SFLOAT_BLOCK_EXT
+>0 ulelong 1000066008 ASTC_10x5_SFLOAT_BLOCK_EXT
+>0 ulelong 1000066009 ASTC_10x6_SFLOAT_BLOCK_EXT
+>0 ulelong 1000066010 ASTC_10x8_SFLOAT_BLOCK_EXT
+>0 ulelong 1000066011 ASTC_10x10_SFLOAT_BLOCK_EXT
+>0 ulelong 1000066012 ASTC_12x10_SFLOAT_BLOCK_EXT
+>0 ulelong 1000066013 ASTC_12x12_SFLOAT_BLOCK_EXT
# Main KTX2 header.
0 string \xABKTX\ 20\xBB\r\n\x1A\n Khronos KTX2 texture
->20 lelong x \b, %u
->24 lelong >1 x %u
->28 lelong >1 x %u
->32 lelong >1 \b, %u layers
->36 lelong >1 \b, %u faces
->40 lelong >1 \b, %u mipmaps
->44 lelong >0 \b,
+>20 ulelong x \b, %u
+>24 ulelong >1 x %u
+>28 ulelong >1 x %u
+>32 ulelong >1 \b, %u layers
+>36 ulelong >1 \b, %u faces
+>40 ulelong >1 \b, %u mipmaps
+>44 ulelong >0 \b,
>>44 use khronos-ktx2-supercompression
->12 lelong >0 \b,
+>12 ulelong >0 \b,
>>12 use khronos-ktx2-vkFormat
# Type: Valve VTF texture.
@@ -2622,87 +3211,87 @@
# VTF image formats.
0 name vtf-image-format
->0 lelong 0 RGBA8888
->0 lelong 1 ABGR8888
->0 lelong 2 RGB888
->0 lelong 3 BGR888
->0 lelong 4 RGB565
->0 lelong 5 I8
->0 lelong 6 IA88
->0 lelong 7 P8
->0 lelong 8 A8
->0 lelong 9 RGB888 (bluescreen)
->0 lelong 10 BGR888 (bluescreen)
->0 lelong 11 ARGB8888
->0 lelong 12 BGRA8888
->0 lelong 13 DXT1
->0 lelong 14 DXT3
->0 lelong 15 DXT5
->0 lelong 16 BGRx8888
->0 lelong 17 BGR565
->0 lelong 18 BGRx5551
->0 lelong 19 BGRA4444
->0 lelong 20 DXT1+A1
->0 lelong 21 BGRA5551
->0 lelong 22 UV88
->0 lelong 23 UVWQ8888
->0 lelong 24 RGBA16161616F
->0 lelong 25 RGBA16161616
->0 lelong 26 UVLX8888
+>0 ulelong 0 RGBA8888
+>0 ulelong 1 ABGR8888
+>0 ulelong 2 RGB888
+>0 ulelong 3 BGR888
+>0 ulelong 4 RGB565
+>0 ulelong 5 I8
+>0 ulelong 6 IA88
+>0 ulelong 7 P8
+>0 ulelong 8 A8
+>0 ulelong 9 RGB888 (bluescreen)
+>0 ulelong 10 BGR888 (bluescreen)
+>0 ulelong 11 ARGB8888
+>0 ulelong 12 BGRA8888
+>0 ulelong 13 DXT1
+>0 ulelong 14 DXT3
+>0 ulelong 15 DXT5
+>0 ulelong 16 BGRx8888
+>0 ulelong 17 BGR565
+>0 ulelong 18 BGRx5551
+>0 ulelong 19 BGRA4444
+>0 ulelong 20 DXT1+A1
+>0 ulelong 21 BGRA5551
+>0 ulelong 22 UV88
+>0 ulelong 23 UVWQ8888
+>0 ulelong 24 RGBA16161616F
+>0 ulelong 25 RGBA16161616
+>0 ulelong 26 UVLX8888
# Main VTF header.
0 string VTF\0 Valve Texture Format
->4 lelong x v%u
->8 lelong x \b.%u
->0x10 leshort x \b, %u
->0x12 leshort >1 x %u
+>4 ulelong x v%u
+>8 ulelong x \b.%u
+>0x10 uleshort x \b, %u
+>0x12 uleshort >1 x %u
>4 lequad 0x0000000700000002
->>0x3F leshort >1 x %u
->0x18 leshort >1 \b, %u frames
->0x38 byte x \b, mipmaps: %u
->0x34 lelong >-1 \b,
+>>0x3F uleshort >1 x %u
+>0x18 uleshort >1 \b, %u frames
+>0x38 ubyte x \b, mipmaps: %u
+>0x34 ulelong >-1 \b,
>>0x34 use vtf-image-format
# Type: Valve VTF3 (PS3) texture.
# From: David Korth <gerbilsoft@gerbilsoft.com>
0 string VTF3 Valve Texture Format (PS3)
->0x14 beshort x \b, %u
->0x16 beshort x \b x %u
->0x10 belong&0x2000 0 \b, DXT1
->0x10 belong&0x2000 0x2000 \b, DXT5
+>0x14 ubeshort x \b, %u
+>0x16 ubeshort x \b x %u
+>0x10 ubelong&0x2000 0 \b, DXT1
+>0x10 ubelong&0x2000 0x2000 \b, DXT5
# Type: ASTC texture.
# From: David Korth <gerbilsoft@gerbilsoft.com>
# References:
# - https://stackoverflow.com/questions/22600678/determine-internal-format-of-given-astc-compressed-image-through-its-header
# - https://stackoverflow.com/a/22682244
-0 lelong 0x5ca1ab13 ASTC
->4 byte x %u
->5 byte x \bx%u
->6 byte >1 \bx%u
+0 ulelong 0x5ca1ab13 ASTC
+>4 ubyte x %u
+>5 ubyte x \bx%u
+>6 ubyte >1 \bx%u
# X, Y, and Z dimensions are stored as 24-bit LE.
# Pretend it's 32-bit and mask off the high byte.
->7 lelong&0x00FFFFFF x texture, %u
->10 lelong&0x00FFFFFF x x %u
->13 lelong&0x00FFFFFF >1 x %u
+>7 ulelong&0x00FFFFFF x texture, %u
+>10 ulelong&0x00FFFFFF x x %u
+>13 ulelong&0x00FFFFFF >1 x %u
# Zebra Metafile graphic
# http://www.fileformat.info/format/zbr/egff.htm
-0 beshort 0x9a02 Zebra Metafile graphic
->2 leshort 1 (version 1.x)
->2 leshort 2 (version 1.1x or 1.2x)
->2 leshort 3 (version 1.49)
->2 leshort 4 (version 1.50)
+0 ubeshort 0x9a02 Zebra Metafile graphic
+>2 uleshort 1 (version 1.x)
+>2 uleshort 2 (version 1.1x or 1.2x)
+>2 uleshort 3 (version 1.49)
+>2 uleshort 4 (version 1.50)
>4 string x (comment = %s)
# Microsoft Paint graphic
# http://www.fileformat.info/format/mspaint/egff.htm
0 string DanM icrosoft Paint image data (version 1.x)
->4 leshort x (%d
->>6 leshort x x %d)
+>4 uleshort x (%d
+>>6 uleshort x x %d)
0 string LinS Microsoft Paint image data (version 2.0)
->4 leshort x (%d
->>6 leshort x x %d)
+>4 uleshort x (%d
+>>6 uleshort x x %d)
# reMarkable tablet internal file format (https://www.remarkable.com/)
# https://github.com/ax3l/lines-are-beautiful
@@ -2715,15 +3304,15 @@
>>>22 string selections
>>>>33 string and
>>>>>37 string layers
->>>>>>43 lelong x reMarkable tablet notebook lines, 1404 x 1872, %x page(s)
+>>>>>>43 ulelong x reMarkable tablet notebook lines, 1404 x 1872, %x page(s)
# newer per-page files for the reMarkable
0 string reMarkable
>11 string .lines
>>18 string file,
>>>24 string version=
->>>>32 byte x reMarkable tablet page (v%c), 1404 x 1872,
->>>>>43 lelong x %d layer(s)
+>>>>32 ubyte x reMarkable tablet page (v%c), 1404 x 1872,
+>>>>>43 ulelong x %d layer(s)
# Type: PVR3 texture.
# From: David Korth <gerbilsoft@gerbilsoft.com>
@@ -2788,18 +3377,18 @@
>0x18 ulelong x %u x
>0x1C ulelong x %u
>0x20 ulelong >1 x %u
->0x08 byte x \b,
+>0x08 ubyte x \b,
>0x0C ulelong 0
>>0x08 use pvr3-pixel-format
>0x0C ulelong !0
->>0x08 byte !0 %c
->>>0x0C byte !0 \b%u
->>0x09 byte !0 \b%c
->>>0x0D byte !0 \b%u
->>0x0A byte !0 \b%c
->>>0x0E byte !0 \b%u
->>0x0B byte !0 \b%c
->>>0x0F byte !0 \b%u
+>>0x08 ubyte !0 %c
+>>>0x0C ubyte !0 \b%u
+>>0x09 ubyte !0 \b%c
+>>>0x0D ubyte !0 \b%u
+>>0x0A ubyte !0 \b%c
+>>>0x0E ubyte !0 \b%u
+>>0x0B ubyte !0 \b%c
+>>>0x0F ubyte !0 \b%u
>0x10 ulelong 1 \b, sRGB
>0x04 ulelong&0x02 0x02 \b, premultiplied alpha
@@ -2807,18 +3396,18 @@
>0x18 ubelong x %u x
>0x1C ubelong x %u
>0x20 ubelong >1 x %u
->0x08 byte x \b,
+>0x08 ubyte x \b,
>0x0C ubelong 0
>>0x08 use pvr3-pixel-format
>0x0C ubelong !0
->>0x0B byte !0 %c
->>>0x0F byte !0 \b%u
->>0x0A byte !0 \b%c
->>>0x0E byte !0 \b%u
->>0x09 byte !0 \b%c
->>>0x0D byte !0 \b%u
->>0x08 byte !0 \b%c
->>>0x0C byte !0 \b%u
+>>0x0B ubyte !0 %c
+>>>0x0F ubyte !0 \b%u
+>>0x0A ubyte !0 \b%c
+>>>0x0E ubyte !0 \b%u
+>>0x09 ubyte !0 \b%c
+>>>0x0D ubyte !0 \b%u
+>>0x08 ubyte !0 \b%c
+>>>0x0C ubyte !0 \b%u
>0x10 ubelong 1 \b, sRGB
>0x04 ubelong&0x02 0x02 \b, premultiplied alpha
@@ -2829,64 +3418,64 @@
# XPR pixel formats.
0 name xbox-xpr-pixel-format
->0 byte 0x00 L8
->0 byte 0x01 AL8
->0 byte 0x02 ARGB1555
->0 byte 0x03 RGB555
->0 byte 0x04 ARGB4444
->0 byte 0x05 RGB565
->0 byte 0x06 ARGB8888
->0 byte 0x07 xRGB8888
->0 byte 0x0B P8
->0 byte 0x0C DXT1
->0 byte 0x0E DXT2
->0 byte 0x0F DXT4
->0 byte 0x10 Linear ARGB1555
->0 byte 0x11 Linear RGB565
->0 byte 0x12 Linear ARGB8888
->0 byte 0x13 Linear L8
->0 byte 0x16 Linear R8B8
->0 byte 0x17 Linear G8B8
->0 byte 0x19 A8
->0 byte 0x1A A8L8
->0 byte 0x1B Linear AL8
->0 byte 0x1C Linear RGB555
->0 byte 0x1D Linear ARGB4444
->0 byte 0x1E Linear xRGB8888
->0 byte 0x1F Linear A8
->0 byte 0x20 Linear A8L8
->0 byte 0x24 YUY2
->0 byte 0x25 UYVY
->0 byte 0x27 L6V5U5
->0 byte 0x28 V8U8
->0 byte 0x29 R8B8
->0 byte 0x2A D24S8
->0 byte 0x2B F24S8
->0 byte 0x2C D16
->0 byte 0x2D F16
->0 byte 0x2E Linear D24S8
->0 byte 0x2F Linear F24S8
->0 byte 0x30 Linear D16
->0 byte 0x31 Linear F16
->0 byte 0x32 L16
->0 byte 0x33 V16U16
->0 byte 0x35 Linear L16
->0 byte 0x36 Linear V16U16
->0 byte 0x37 Linear L6V5U5
->0 byte 0x38 RGBA5551
->0 byte 0x39 RGBA4444
->0 byte 0x3A QWVU8888
->0 byte 0x3B BGRA8888
->0 byte 0x3C RGBA8888
->0 byte 0x3D Linear RGBA5551
->0 byte 0x3E Linear RGBA4444
->0 byte 0x3F Linear ABGR8888
->0 byte 0x40 Linear BGRA8888
->0 byte 0x41 Linear RGBA8888
->0 byte 0x64 Vertex Data
+>0 ubyte 0x00 L8
+>0 ubyte 0x01 AL8
+>0 ubyte 0x02 ARGB1555
+>0 ubyte 0x03 RGB555
+>0 ubyte 0x04 ARGB4444
+>0 ubyte 0x05 RGB565
+>0 ubyte 0x06 ARGB8888
+>0 ubyte 0x07 xRGB8888
+>0 ubyte 0x0B P8
+>0 ubyte 0x0C DXT1
+>0 ubyte 0x0E DXT2
+>0 ubyte 0x0F DXT4
+>0 ubyte 0x10 Linear ARGB1555
+>0 ubyte 0x11 Linear RGB565
+>0 ubyte 0x12 Linear ARGB8888
+>0 ubyte 0x13 Linear L8
+>0 ubyte 0x16 Linear R8B8
+>0 ubyte 0x17 Linear G8B8
+>0 ubyte 0x19 A8
+>0 ubyte 0x1A A8L8
+>0 ubyte 0x1B Linear AL8
+>0 ubyte 0x1C Linear RGB555
+>0 ubyte 0x1D Linear ARGB4444
+>0 ubyte 0x1E Linear xRGB8888
+>0 ubyte 0x1F Linear A8
+>0 ubyte 0x20 Linear A8L8
+>0 ubyte 0x24 YUY2
+>0 ubyte 0x25 UYVY
+>0 ubyte 0x27 L6V5U5
+>0 ubyte 0x28 V8U8
+>0 ubyte 0x29 R8B8
+>0 ubyte 0x2A D24S8
+>0 ubyte 0x2B F24S8
+>0 ubyte 0x2C D16
+>0 ubyte 0x2D F16
+>0 ubyte 0x2E Linear D24S8
+>0 ubyte 0x2F Linear F24S8
+>0 ubyte 0x30 Linear D16
+>0 ubyte 0x31 Linear F16
+>0 ubyte 0x32 L16
+>0 ubyte 0x33 V16U16
+>0 ubyte 0x35 Linear L16
+>0 ubyte 0x36 Linear V16U16
+>0 ubyte 0x37 Linear L6V5U5
+>0 ubyte 0x38 RGBA5551
+>0 ubyte 0x39 RGBA4444
+>0 ubyte 0x3A QWVU8888
+>0 ubyte 0x3B BGRA8888
+>0 ubyte 0x3C RGBA8888
+>0 ubyte 0x3D Linear RGBA5551
+>0 ubyte 0x3E Linear RGBA4444
+>0 ubyte 0x3F Linear ABGR8888
+>0 ubyte 0x40 Linear BGRA8888
+>0 ubyte 0x41 Linear RGBA8888
+>0 ubyte 0x64 Vertex Data
0 string XPR0 Microsoft Xbox XPR0 texture
->0x19 byte x \b, format:
+>0x19 ubyte x \b, format:
>>0x19 use xbox-xpr-pixel-format
# ILDA Image Data Transfer Format
@@ -2894,41 +3483,41 @@
#
# Updated by Chuck Hein (laser@geekdude.com)
#
-0 string ILDA ILDA Image Data Transfer Format
->7 byte 0x00 3D Coordinates with Indexed Color
->7 byte 0x01 2D Coordinates with Indexed Color
->7 byte 0x02 Color Palette
->7 byte 0x04 3D Coordinates with True Color
->7 byte 0x05 2D Coordinates with True Color
->8 string >0 \b, palette %s
->16 string >0 \b, company %s
->24 beshort >0 \b, number of records %d
->>26 beshort x \b, palette number %d
->>28 beshort >0 \b, number of frames %d
->>30 byte >0 \b, projector number %d
+0 string ILDA ILDA Image Data Transfer Format
+>7 ubyte 0x00 3D Coordinates with Indexed Color
+>7 ubyte 0x01 2D Coordinates with Indexed Color
+>7 ubyte 0x02 Color Palette
+>7 ubyte 0x04 3D Coordinates with True Color
+>7 ubyte 0x05 2D Coordinates with True Color
+>8 string >0 \b, palette %s
+>16 string >0 \b, company %s
+>24 ubeshort >0 \b, number of records %d
+>>26 ubeshort x \b, palette number %d
+>>28 ubeshort >0 \b, number of frames %d
+>>30 ubyte >0 \b, projector number %d
# Dropbox "lepton" compressed jpeg format
# https://github.com/dropbox/lepton
-0 belong&0xfffff0ff 0xcf84005a Lepton image file
->2 byte x (version %d)
+0 ubelong&0xfffff0ff 0xcf84005a Lepton image file
+>2 ubyte x (version %d)
# Apple QuickTake camera raw images
# https://en.wikipedia.org/wiki/Apple_QuickTake
# dcraw can decode them
0 name quicktake
->4 belong 8
->>544 beshort x \b, %dx
->>546 beshort x \b%d
->4 belong 4
->>546 beshort x \b, %dx
->>544 beshort x \b%d
+>4 ubelong 8
+>>544 ubeshort x \b, %dx
+>>546 ubeshort x \b%d
+>4 ubelong 4
+>>546 ubeshort x \b, %dx
+>>544 ubeshort x \b%d
0 string qktk Apple QuickTake 100 Raw Image
>0 use quicktake
0 string qktn
->4 byte 0 Apple QuickTake 150 Raw Image
->4 byte >0 Apple QuickTake 200 Raw Image
+>4 ubyte 0 Apple QuickTake 150 Raw Image
+>4 ubyte >0 Apple QuickTake 200 Raw Image
>0 use quicktake
# From: Joerg Jenderek
@@ -3061,3 +3650,167 @@
0 string ASTM-E57 ASTM E57 three-dimensional model
!:mime model/e57
!:ext e57
+
+# QOI [Quite OK Image Format] images
+# (Horia Mihai David, mihaidavid@posteo.net)
+#
+# QOI format by Dominic Szablewski <http://phoboslab.org/>
+# <https://qoiformat.org/>
+#
+# Based on spec v1.0 (2022.01.05) <https://qoiformat.org/qoi-specification.pdf>
+
+0 string qoif QOI image data
+!:ext qoi
+!:mime image/x-qoi
+# See <https://github.com/phoboslab/qoi/issues/167>
+>4 ubelong x %ux
+>8 ubelong x \b%u,
+>>13 ubyte 0 s
+>>>12 ubyte 3 \bRGB
+>>>12 ubyte 4 \bRGBA
+>>>12 default x
+>>>>12 ubyte x \b*bad channels %u*
+>>>13 ubyte 0 (linear alpha)
+>>13 ubyte 1
+>>>12 ubyte 3 RGB
+>>>12 ubyte 4 RGBA
+>>>13 ubyte 1 (all channels linear)
+>>13 default x
+>>>13 ubyte x *bad colorspace %u*
+
+
+# Type: Godot 3, 4 texture (pixel format)
+# From: David Korth <gerbilsoft@gerbilsoft.com>
+0 name godot-pixel-format
+>0 ulelong&0xFFFFF 0 L8
+>0 ulelong&0xFFFFF 1 LA8
+>0 ulelong&0xFFFFF 2 R8
+>0 ulelong&0xFFFFF 3 RG8
+>0 ulelong&0xFFFFF 4 RGB8
+>0 ulelong&0xFFFFF 5 RGBA8
+>0 ulelong&0xFFFFF 6 RGBA4444
+>0 ulelong&0xFFFFF 7 RGB565
+>0 ulelong&0xFFFFF 8 RF
+>0 ulelong&0xFFFFF 9 RGF
+>0 ulelong&0xFFFFF 10 RGBF
+>0 ulelong&0xFFFFF 11 RGBAF
+>0 ulelong&0xFFFFF 12 RH
+>0 ulelong&0xFFFFF 13 RGH
+>0 ulelong&0xFFFFF 14 RGBH
+>0 ulelong&0xFFFFF 15 RGBAH
+>0 ulelong&0xFFFFF 16 RGBE9995
+>0 ulelong&0xFFFFF 17 DXT1
+>0 ulelong&0xFFFFF 18 DXT3
+>0 ulelong&0xFFFFF 19 DXT5
+>0 ulelong&0xFFFFF 20 RGTC_R
+>0 ulelong&0xFFFFF 21 RGTC_RG
+>0 ulelong&0xFFFFF 22 BPTC_RGBA
+>0 ulelong&0xFFFFF 23 BPTC_RGBF
+>0 ulelong&0xFFFFF 24 BPTC_RGBFU
+>0 ulelong&0xFFFFF 25 PVRTC1_2
+>0 ulelong&0xFFFFF 26 PVRTC1_2A
+>0 ulelong&0xFFFFF 27 PVRTC1_4
+>0 ulelong&0xFFFFF 28 PVRTC1_4A
+>0 ulelong&0xFFFFF 29 ETC
+>0 ulelong&0xFFFFF 30 ETC2_R11
+>0 ulelong&0xFFFFF 31 ETC2_R11S
+>0 ulelong&0xFFFFF 32 ETC2_RG11
+>0 ulelong&0xFFFFF 33 ETC2_RG11S
+>0 ulelong&0xFFFFF 34 ETC2_RGB8
+>0 ulelong&0xFFFFF 35 ETC2_RGBA8
+>0 ulelong&0xFFFFF 36 ETC2_RGB8A1
+>0 ulelong&0xFFFFF 37 ASTC_8x8
+
+# Type: Godot 3, 4 texture (rescale display, width)
+# From: David Korth <gerbilsoft@gerbilsoft.com>
+# Shows rescale value if it's not a power of 2.
+0 name godot-rescale-display-w
+>0 uleshort 0
+>0 uleshort 1
+>0 uleshort 2
+>0 uleshort 4
+>0 uleshort 8
+>0 uleshort 16
+>0 uleshort 32
+>0 uleshort 64
+>0 uleshort 128
+>0 uleshort 256
+>0 uleshort 512
+>0 uleshort 1024
+>0 uleshort 2048
+>0 uleshort 4096
+>0 uleshort 8192
+>0 uleshort 16384
+>0 uleshort 32768
+>0 default x
+>>0 uleshort x (rescale to %u x
+
+# Type: Godot 3, 4 texture (rescale display, height)
+# From: David Korth <gerbilsoft@gerbilsoft.com>
+# Shows rescale value if it's not a power of 2.
+0 name godot-rescale-display-h
+>0 clear x
+>0 uleshort 0
+>0 uleshort 1
+>0 uleshort 2
+>0 uleshort 4
+>0 uleshort 8
+>0 uleshort 16
+>0 uleshort 32
+>0 uleshort 64
+>0 uleshort 128
+>0 uleshort 256
+>0 uleshort 512
+>0 uleshort 1024
+>0 uleshort 2048
+>0 uleshort 4096
+>0 uleshort 8192
+>0 uleshort 16384
+>0 uleshort 32768
+>0 default x
+>>0 uleshort x %u)
+
+# Type: Godot 3 texture
+# From: David Korth <gerbilsoft@gerbilsoft.com>
+# References:
+# - https://github.com/godotengine/godot/blob/3.3/core/image.h
+# - https://github.com/godotengine/godot/blob/3.3/scene/resources/texture.cpp
+# - https://github.com/godotengine/godot/blob/3.3/scene/resources/texture.h
+# TODO: Don't show "rescale to" if it matches the image size.
+0 string GDST Godot 3 texture:
+!:ext stex
+!:mime image/x-godot-stex
+>4 uleshort x %u x
+>8 uleshort x %u
+>6 uleshort 0 \b,
+>6 uleshort !0
+>>6 use godot-rescale-display-w
+>>10 use godot-rescale-display-h
+>>10 uleshort x \b,
+>16 ulelong&0x800000 !0 has mipmaps,
+>16 ulelong&0x100000 0x100000 lossless encoding
+>16 ulelong&0x200000 0x200000 lossy encoding
+>16 ulelong&0x300000 0
+>>16 use godot-pixel-format
+
+# Type: Godot 4 texture
+# From: David Korth <gerbilsoft@gerbilsoft.com>
+# References:
+# - https://github.com/godotengine/godot/blob/master/core/io/image.h
+# - https://github.com/godotengine/godot/blob/master/scene/resources/texture.cpp
+# - https://github.com/godotengine/godot/blob/master/scene/resources/texture.h
+# TODO: Don't show "rescale to" if it matches the image size.
+0 string GST2 Godot 4 texture
+!:ext stex
+!:mime image/x-godot-stex
+>4 ulelong x v%u:
+>0x28 uleshort x %u x
+>0x2A uleshort x %u
+>8 use godot-rescale-display-w
+>12 use godot-rescale-display-h
+>12 uleshort x \b,
+>0x2C ulelong >1 %u mipmaps,
+>0x30 use godot-pixel-format
+>0x24 ulelong 1 \b, embedded PNG image
+>0x24 ulelong 2 \b, embedded WebP image
+>0x24 ulelong 3 \b, Basis Universal
diff --git a/magic/Magdir/intel b/magic/Magdir/intel
index 531dd6548ddb..2b57fd1b246a 100644
--- a/magic/Magdir/intel
+++ b/magic/Magdir/intel
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: intel,v 1.20 2021/04/26 15:56:00 christos Exp $
+# $File: intel,v 1.22 2022/04/02 14:47:42 christos Exp $
# intel: file(1) magic for x86 Unix
#
# Various flavors of x86 UNIX executable/object (other than Xenix, which
@@ -43,7 +43,16 @@
# no hint found, that at offset 22 is version
#>22 leshort >0 - version %d
0 leshort 0x0200
->0 use display-coff
+# no F_EXEC flag bit implies Intel ia64 COFF object file without optional header
+>18 leshort ^0x0002
+# skip some DEGAS high-res uncompressed bitmap *.pi3 handled by ./images like
+# GEMINI03.PI3 MODEM2.PI3 POWERFIX.PI3 sigirl1.pi3 vanna5.pi3
+# by test for valid starting character (often point 0x2E) of 1st section name
+>>20 ubyte >0x1F
+>>>0 use display-coff
+# F_EXEC flag bit implies Intel ia64 COFF executable
+>18 leshort &0x0002
+>>0 use display-coff
0 leshort 0x8664
>0 use display-coff
@@ -52,16 +61,191 @@
# From: Alex Myczko <alex@aiei.ch>
# updated by Joerg Jenderek
# https://en.wikipedia.org/wiki/Option_ROM
-0 beshort 0x55AA BIOS (ia32) ROM Ext.
-!:mime application/octet-stream
+# URL: http://fileformats.archiveteam.org/wiki/BIOS
+# Reference: http://www.lejabeach.com/sisubb/BIOS_Disassembly_Ninjutsu_Uncovered.pdf
+0 beshort 0x55AA
+# skip misidentified raspberry pi pieeprom-*.bin by check for
+# unlikely high ROM size (0xF0*512=240*512) and not observed start instruction 0x0F
+>2 ubeshort !0xF00F
+# skip 2 byte sized eof.bin with start magic
+>>0 use rom-x86
+0 name rom-x86
+>0 beshort x BIOS (ia32) ROM Ext.
+#!:mime application/octet-stream
+!:mime application/x-ibm-rom
!:ext rom/bin
->5 string USB USB
->7 string LDR UNDI image
+################################################################################
+# not Plug aNd Play ($PnP) like 00000000 (ide_xtp.bin kvmvapic.bin V7VGA.ROM) 000000fc (MCT-VGA.bin)
+# 55aaf00f (pieeprom-*.bin) 55aa40e9 (Trm3x5.bin) 24506f4f (sgabios-bin.rom)
+# 55aa4be9 (vgabios-stdvga.rom vgabios-cirrus-bin.rom vgabios-vmware-bin.rom)
+>(26.s) ubelong !0x24506e50
+#>(26.s) ubelong !0x24506e50 NOT PNP=%8.8x
+# also not PCI (PCIR) implies "old" ISA cards or foo like: 8a168404 (MCT-VGA.bin)
+# 55aaf00f (pieeprom*.bin)
+>>(24.s) ubelong !0x50434952
+#>>(24.s) ubelong !0x50434952 ISA CARD=%8.8x
+# "old" identification strings used in file version 5.41 and earlier
+# probably an USB controller
+>>>5 string USB USB
+# probably https://en.wikipedia.org/wiki/Preboot_Execution_Environment
+>>>7 string LDR UNDI image
+# probably another Adaptec SCSI controller
+>>>26 string Adaptec Adaptec
+# http://minuszerodegrees.net/rom/bin/adaptec_aha1542cp_bios_908501-00.bin
+# already done by PNP variant
+#>>>28 string Adaptec Adaptec
+# probably Promise SCSI controller
+>>>42 string PROMISE Promise
+# old test for IBM compatible Video cards; INTERNAL FACTS WHY IS THIS WORKING?
>30 string IBM IBM comp. Video
->26 string Adaptec Adaptec
->28 string Adaptec Adaptec
->42 string PROMISE Promise
->2 byte x (%d*512)
+# display exact text for IBM compatible Video cards with longer text
+>>33 ubyte !0
+>>>30 string x "%s"
+# http://minuszerodegrees.net/rom/bin/unknown/MCT-VGA-16%20-%20TDVGA%203588%20BIOS%20Version%20V1.04A.zip
+# "IBM COMPATIBLETDVGA 3588 BIOS Version V1.04A2+" "MCT-VGA-16 - TDVGA 3588 BIOS Version V1.04A.bin"
+# "IBM VGA Compatible\001" NVidia44.bin
+# "IBM EGA ROM Video Seven BIOS Code, Version 1.04" V7VGA.ROM
+# "IBM" vgabios-stdvga.rom
+# "IBM" vgabios-vmware-bin.rom:
+# "IBM" vgabios-cirrus-bin.rom
+# "IBM" vgabios-virtio-bin.rom
+################################################################################
+# ROM size in 512B blocks must be interpreted as unsigned for ROM of network cards
+# like: efi-eepro100.rom efi-rtl8139.rom pxe-e1000.rom
+>2 ubyte x (%u*512)
+# file name file size calculated size remark
+# eof.bin 2 - with start magic nothing is shown here
+# orchid.bin 188 0 =0*512 on window 95 CD in Drivers\audio\orchid3d
+# multiboot.bin 1024 1024 =2*512 QEMU emulator
+# loader1.bin 512 2048 =4*512
+# ide_xtp.bin 8192 8192 =16*512
+# kvmvapic.bin 9216 9216 =18*512
+# V7VGA.ROM 18832 16384 =32*512
+# adaptec1542.bin 32768 16384 =32*512
+# MCT-VGA.bin 32768 24576 =48*512
+# 2975BIOS.BIN 32768 32256 =63*512
+# efi-e1000.rom 196608 64000 =125*512
+# efi-rtl8139.rom 176640 66048 =129*512
+# pieeprom*.bin 524288 122880 =240*512
+################################################################################
+# initialization vector with executable code; often near JuMP instruction E9 yy zz
+>3 ubyte =0xE9 jmp
+# jmp offset like: 008fh 0093h 009fh 00afh 0143h 3ad7h 5417h 54ech 594dh 895fh
+>>4 uleshort x %#4.4x
+# for initialization vector samples without 3 byte jump instruction
+>3 ubyte !0xE9 instruction
+# eb4b3734h NVidia44.bin
+# 00003234h V7VGA.ROM
+# 060e0731h kvmvapic.bin
+# cb000000h linuxboot-bin.rom
+# e80d0fcbh PXE-Intel.rom
+# b8004875h orchid.bin
+>>3 ubelong x %#8.8x
+# For misidetified raspberry pi pieeprom-*.bin like: 0xf00f
+#>2 ubeshort x \b, AT 2 %#4.4x
+################################################################################
+# new sections for BIOS (ia32) ROM Extension
+# 4 bytes ASCII Signature "$PnP" for Plug aNd Play expansion header
+>(26.s) string =$PnP \b;
+#>(26.s) string =$PnP FOUND $PnP
+# at 1Ah possible offset to expansion header structure; new for Plug aNd Play
+>>26 uleshort x at %#x PNP
+# Plug and Play vendor+device ID like: 0 0x000f1000 (2975BIOS.BIN) 0x31121095 (4243.bin) 0x04904215 (adaptec1542.bin)
+#>>(26.s+0x0A) ulelong !0 NOT-nullID=%8.8x
+>>(26.s+0x0A) uleshort !0
+# show PnP Vendor identification in human readable text form instead of numeric
+# For adaptec_ava1515_bios_585201-00.bin reverted endian! BUT IS THIS ALWAYS TRUE?
+>>>(26.s+0x0C) use \^PCI-vendor
+>>>(26.s+0x0A) ubeshort x device=%#4.4x
+# 3 byte Device type code; probably the same meaning as in PCI section?
+# OK for storage controller SCSI (2975BIOS.BIN adaptec1542.bin)
+# and network controller ethernet (efi-e1000.rom efi-rtl8139.rom)
+>>(26.s+0x12) use PCI-class
+# structure revision like: 01h
+>>(26.s+4) ubyte !1 \b, revision %u
+# PnP Header structure length in multiple of 16 bytes like: 2
+>>(26.s+5) uleshort !2 \b, length %u*16
+# offset to next header; 0 if none
+>>(26.s+7) uleshort !0 \b, at %#x next header
+# reserved byte; seems to be zero
+>>(26.s+8) ubyte !0 \b, reserved %#x
+# 8-bit checksum for this header; calculated and patched by patch2pnprom
+>>(26.s+9) ubyte !0 \b, CRC %#x
+# pointer to optional manufacturer string; like: 0 (4243.bin) 59h 5ch 60h c7h 14eh 27ch 296h 324h 3662h
+>>(26.s+0x0E) uleshort >0 \b, at %#x
+>>>(26.s+0x0C) uleshort x
+# manufacturer ASCII-Z string like "http://ipxe.org" "Plop - Elmar Hanlhofer www.plop.at" "QEMU"
+>>>>(&0.s) string x "%s"
+# pointer to optional product string; like: 0 (2975BIOS.BIN) 6ch 70h 7ch d9h 160h 281h 29bh 329h
+>>(26.s+0x10) uleshort >0 \b, at %#x
+>>>(26.s+0x0E) uleshort x
+# often human readable product ASCII-Z string like "iPXE" "Plop Boot Manager"
+# "multiboot loader" "Intel UNDI, PXE-2.0 (build 082)"
+>>>>(&0.s) string x "%s"
+# PnP Device indicators; contains bits that identify the device as being capable of bootable
+#>>(26.s+0x15) ubyte x \b, INDICATORS %#x
+# device is a display device
+>>(26.s+0x15) ubyte &0x01 \b, display
+# device is an input device
+>>(26.s+0x15) ubyte &0x02 \b, input
+# device is an IPL device
+>>(26.s+0x15) ubyte &0x04 \b, IPL
+#>>(26.s+0x15) ubyte &0x08 reserved
+# ROM is only required if this device is selected as a boot device
+>>(26.s+0x15) ubyte &0x10 \b, bootable
+# indicates ROM is read cacheable
+>>(26.s+0x15) ubyte &0x20 \b, cacheable
+# ROM may be shadowed in RAM
+>>(26.s+0x15) ubyte &0x40 \b, shadowable
+# ROM supports the device driver initialization model
+>>(26.s+0x15) ubyte &0x80 \b, InitialModel
+# boot connection vector; an offset to a routine that hook into INT 9h, INT 10h, or INT 13h
+# 0 means disabled 0x0429 (4650_sr5.bin) 0x0072 (adaptec1542.bin)
+>>(26.s+0x16) uleshort !0 \b, boot vector offset %#x
+# disconnect vector; offset to routine that do cleanup from an unsuccessful boot attempt
+>>(26.s+0x18) uleshort !0 \b, disconnect offset %#x
+# bootstrap entry point/vector (BEV); offset to a routine (like RPL) that hook into INT 19h
+# 0 means disabled 0x3c (multiboot.bin) 0x358 (efi-rtl8139.rom) 0xae7 (PXE-Intel.rom)
+>>(26.s+0x1A) uleshort !0 \b, bootstrap offset %#x
+# 2nd reserved area; seems to be zero
+>>(26.s+0x1C) uleshort !0 \b, 2nd reserved %#x
+# static resource information vector; 0 means disabled
+>>(26.s+0x1E) uleshort !0 \b, static offset %#4.4x
+################################################################################
+# 4 bytes ASCII Signature "PCIR" for PCI Data Structure
+#>(24.s) string =PCIR FOUND PCIR
+>(24.s) string =PCIR \b;
+# pointer to PCI data structure like: 1Ch 38h 104h 8E44h
+>>24 uleshort x at %#x PCI
+# Vendor identification (ID) https://pci-ids.ucw.cz/v2.2/pci.ids
+#>>(24.s+4) uleshort x ID=%4.4x
+# show Vendor identification in human readable text form instead of numeric
+>>(24.s+4) use PCI-vendor
+# device identification (ID)
+>>(24.s+6) uleshort x device=%#4.4x
+# Base+sub class code https://wiki.osdev.org/PCI
+>>(24.s+0x0D) use PCI-class
+# pointer to vital product data (VPD); 0 indicates no VPD; WHAT EXACTLY iS VPD?
+>>(24.s+8) uleshort !0 \b, at %#x VPD
+# PCI data structure length like: 24h 28h
+>>(24.s+0xA) uleshort >0x28 \b, length %u
+# PCI data structure revision like: 0 3
+>>(24.s+0xC) ubyte >0 \b, revison %u
+# image length (hexadecimal) in multiple of 512 bytes like: 54 56 68 6a 76 78 7c 7d 7e 7f 80 81 83
+# Apparently this gives the same information as given by byte at offset 2 but as 16-bit
+#>>(24.s+0x10) uleshort x \b, length %u*512
+# revision level of code/data like: 0 1 201h 502h
+>>(24.s+0xC) ubyte >1 \b, code revison %#x
+# code type: 0~Intel x86/PC-AT compatible 1~Open firmware standard for PCI42 FF~Reserved
+>>(24.s+0x14) ubyte >0 \b, code type %#x
+# last image indicator; bit 7 indicates "last image"; bits 0-6 are reserved
+>>(24.s+0x15) ubyte >0
+>>>(24.s+0x15) ubyte =0x80 \b, last ROM
+# THIS SHOULD NOT HAPPEN!
+>>>(24.s+0x15) ubyte !0x80 \b, indicator %x
+# 3rd reserved area; seems to be zero in most cases but not for
+# efi-e1000.rom efi-rtl8139.rom
+>>(24.s+0x16) ubeshort !0 \b, 3rd reserved %#x
# Flash descriptors for Intel SPI flash roms.
# From Dr. Jesus <j@hug.gs>
diff --git a/magic/Magdir/javascript b/magic/Magdir/javascript
index 7fa9d9d404ca..1e29c5e8e875 100644
--- a/magic/Magdir/javascript
+++ b/magic/Magdir/javascript
@@ -1,19 +1,19 @@
#------------------------------------------------------------------------------
-# $File: javascript,v 1.2 2019/08/05 10:34:26 christos Exp $
+# $File: javascript,v 1.3 2021/12/08 13:42:00 christos Exp $
# javascript: magic for javascript and node.js scripts.
#
-0 search/1/w #!/bin/node Node.js script text executable
+0 string/w #!/bin/node Node.js script text executable
!:mime application/javascript
-0 search/1/w #!/usr/bin/node Node.js script text executable
+0 string/w #!/usr/bin/node Node.js script text executable
!:mime application/javascript
-0 search/1/w #!/bin/nodejs Node.js script text executable
+0 string/w #!/bin/nodejs Node.js script text executable
!:mime application/javascript
-0 search/1/w #!/usr/bin/nodejs Node.js script text executable
+0 string/w #!/usr/bin/nodejs Node.js script text executable
!:mime application/javascript
-0 search/1 #!/usr/bin/env\ node Node.js script text executable
+0 string #!/usr/bin/env\ node Node.js script text executable
!:mime application/javascript
-0 search/1 #!/usr/bin/env\ nodejs Node.js script text executable
+0 string #!/usr/bin/env\ nodejs Node.js script text executable
!:mime application/javascript
# Hermes by Facebook https://hermesengine.dev/
# https://github.com/facebook/hermes/blob/master/include/hermes/\
diff --git a/magic/Magdir/linux b/magic/Magdir/linux
index f5216087f0cf..0405f778aa35 100644
--- a/magic/Magdir/linux
+++ b/magic/Magdir/linux
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: linux,v 1.79 2021/04/26 15:56:00 christos Exp $
+# $File: linux,v 1.80 2022/03/24 15:48:58 christos Exp $
# linux: file(1) magic for Linux files
#
# Values for Linux/i386 binaries, from Daniel Quinlan <quinlan@yggdrasil.com>
@@ -532,6 +532,6 @@
# ansible vault (does not really belong here)
0 string $ANSIBLE_VAULT; Ansible Vault
->&0 regex [0-9]*\.[0-9]* \b, version %s
+>&0 regex [0-9]+\\.[0-9]+ \b, version %s
>>&0 string ;
->>>&0 regex [A-Z0-9]* \b, encryption %s
+>>>&0 regex [A-Z0-9]+ \b, encryption %s
diff --git a/magic/Magdir/make b/magic/Magdir/make
index f522b4f18b11..1abdf7a3ee2e 100644
--- a/magic/Magdir/make
+++ b/magic/Magdir/make
@@ -1,36 +1,21 @@
#------------------------------------------------------------------------------
-# $File: make,v 1.4 2018/05/29 17:26:02 christos Exp $
+# $File: make,v 1.5 2022/03/12 15:09:47 christos Exp $
# make: file(1) magic for makefiles
#
# URL: https://en.wikipedia.org/wiki/Make_(software)
-0 regex/100l \^CFLAGS makefile script text
-!:mime text/x-makefile
-0 regex/100l \^VPATH makefile script text
-!:mime text/x-makefile
-0 regex/100l \^LDFLAGS makefile script text
-!:mime text/x-makefile
-0 regex/100l \^all: makefile script text
-!:mime text/x-makefile
-0 regex/100l \^\\.PRECIOUS makefile script text
+0 regex/100l \^(CFLAGS|VPATH|LDFLAGS|all:|\\.PRECIOUS) makefile script text
!:mime text/x-makefile
+!:strength -15
# Update: Joerg Jenderek
# Reference: https://www.freebsd.org/cgi/man.cgi?make(1)
# exclude grub-core\lib\libgcrypt\mpi\Makefile.am with "#BEGIN_ASM_LIST"
# by additional escaping point character
-0 regex/100l \^\\.BEGIN BSD makefile script text
-!:mime text/x-makefile
-!:ext /mk
-!:strength +10
# exclude MS Windows help file CoNtenT with ":include FOOBAR.CNT"
# and NSIS script with "!include" by additional escaping point character
-0 regex/100l \^\\.include BSD makefile script text
-!:mime text/x-makefile
-!:ext /mk
-!:strength +10
-0 regex/100l \^\\.endif BSD makefile script text
+0 regex/100l \^\\.(BEGIN|endif|include) BSD makefile script text
!:mime text/x-makefile
!:ext /mk
-!:strength +10
-0 regex/100l \^SUBDIRS automake makefile script text
+!:strength -10
+0 regex/100l \^SUBDIRS[[:space:]]+= automake makefile script text
!:mime text/x-makefile
-!:strength +10
+!:strength -15
diff --git a/magic/Magdir/mathematica b/magic/Magdir/mathematica
index 77903b5fe8c3..1563e34ba21a 100644
--- a/magic/Magdir/mathematica
+++ b/magic/Magdir/mathematica
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: mathematica,v 1.13 2021/07/14 09:06:24 christos Exp $
+# $File: mathematica,v 1.14 2021/11/07 16:27:36 christos Exp $
# mathematica: file(1) magic for mathematica files
# "H. Nanosecond" <aldomel@ix.netcom.com>
# Mathematica a multi-purpose math program
@@ -117,16 +117,29 @@
13 ushort 0
# check for valid ASCII matrix name
>20 ubyte >0x1F
+# skip PreviousEntries.dat with "invalid high" name \304P\344@\001
+>>20 ubyte <0304
+# skip some Netwfw*.dat and $I3KREPH.dat by checking for non zero number of rows
+>>>4 ulong !0
# skip some CD-ROM filesystem like test-hfs.iso by looking for valid big endian type flag
->>0 ubelong&0xFFffFF00 0x00000300
->>>0 use matlab4
+>>>>0 ubelong&0xFFffFF00 0x00000300
+>>>>>0 use matlab4
# no example for 8-bit and 16-bit integers matrix
->>0 ubelong&0xFFffFF00 0x00000400
->>>0 use matlab4
->>0 ulelong x
+>>>>0 ubelong&0xFFffFF00 0x00000400
+>>>>>0 use matlab4
+# branch for Little-Endian variant of Matlab MATrix version 4
# skip big endian variant by looking for valid low lttle endian type flag
->>0 ulelong <53
->>>0 use \^matlab4
+>>>>0 ulelong <53
+# skip tokens.dat and some Netwfw*.dat by check for valid imaginary flag value of MAT version 4
+>>>>>12 ulelong <2
+# no misidentfied little endian MATrix example with "short" matrix name
+>>>>>>16 ulelong <3
+>>>>>>>0 use \^matlab4
+# little endian MATrix with "long" matrix name or some misidentified samples
+>>>>>>16 ulelong >2
+# skip TileCacheLogo-*.dat with invalid 2nd character \001 of matrix name with length 96
+>>>>>>>21 ubyte >0x1F
+>>>>>>>>0 use \^matlab4
# display information of Matlab v4 mat-file
0 name matlab4 Matlab v4 mat-file
#!:mime application/octet-stream
@@ -145,8 +158,10 @@
>0 ubelong/1000 4 (Cray)
# namlen; the length of the matrix name
#>16 ubelong x \b, name length %u
+#>(16.L+19) ubyte x \b, TERMINATING NAME CHARACTER=%#x
# nul terminated matrix name like: fit_params testmatrix testsparsecomplex teststringarray
#>20 string x \b, MATRIX NAME="%s"
+#>21 ubyte x \b, MAYBE 2ND CHAR=%c
>16 pstring/L x %s
# T indicates the matrix type: 0~numeric 1~text 2~sparse
#>0 ubelong%10 x \b, T=%u
@@ -158,5 +173,5 @@
# ncols; number of columns in the matrix like: 1 3 4 5 9 43
>8 ubelong x \b, columns %u
# imagf; imaginary flag; 1~matrix has an imaginary part 0~only real data
->12 ubelong !0 \b, imaginary
+>12 ubelong !0 \b, imaginary (%u)
# real; Real part of the matrix consists of mrows * ncols numbers
diff --git a/magic/Magdir/mcrypt b/magic/Magdir/mcrypt
index 9c66af48b2a2..f2edd08912dd 100644
--- a/magic/Magdir/mcrypt
+++ b/magic/Magdir/mcrypt
@@ -1,14 +1,28 @@
#------------------------------------------------------------------------------
-# $File: mcrypt,v 1.5 2009/09/19 16:28:10 christos Exp $
+# $File: mcrypt,v 1.6 2022/02/08 18:51:45 christos Exp $
# Mavroyanopoulos Nikos <nmav@hellug.gr>
# mcrypt: file(1) magic for mcrypt 2.2.x;
+# URL: https://en.wikipedia.org/wiki/Mcrypt
+# http://fileformats.archiveteam.org/wiki/MCrypt
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/n/nc-mcrypt.trid.xml
+# Update: Joerg Jenderek
+# Note: called by TrID "mcrypt encrypted (v2.5)"
0 string \0m\3 mcrypt 2.5 encrypted data,
+#!:mime application/octet-stream
+!:mime application/x-crypt-nc
+!:ext nc
>4 string >\0 algorithm: %s,
>>&1 leshort >0 keysize: %d bytes,
>>>&0 string >\0 mode: %s,
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/n/nc-mcrypt-22.trid.xml
+# Note: called by TrID "mcrypt encrypted (v2.2)"
0 string \0m\2 mcrypt 2.2 encrypted data,
+#!:mime application/octet-stream
+!:mime application/x-crypt-nc
+# no example
+!:ext nc
>3 byte 0 algorithm: blowfish-448,
>3 byte 1 algorithm: DES,
>3 byte 2 algorithm: 3DES,
diff --git a/magic/Magdir/msdos b/magic/Magdir/msdos
index c586210218bf..a8d6d0f43e3e 100644
--- a/magic/Magdir/msdos
+++ b/magic/Magdir/msdos
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: msdos,v 1.152 2021/10/12 18:26:10 christos Exp $
+# $File: msdos,v 1.154 2022/03/21 21:25:50 christos Exp $
# msdos: file(1) magic for MS-DOS files
#
@@ -1367,6 +1367,8 @@
# HtmlHelp files (.chm)
0 string/b ITSF\003\000\000\000\x60\000\000\000 MS Windows HtmlHelp Data
+!:mime application/vnd.ms-htmlhelp
+!:ext chm
# GFA-BASIC (Wolfram Kleff)
2 string/b GFA-BASIC3 GFA-BASIC 3 data
@@ -1765,3 +1767,37 @@
# NB: The BACKUP.nnn files consist of the files backed up,
# concatenated.
+
+# From: Joerg Jenderek
+# URL: http://fileformats.archiveteam.org/wiki/MS-DOS_date/time
+# Reference: https://docs.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-dosdatetimetofiletime
+# Note: DOS date+time format is different from formats such as Unix epoch
+# bit encoded; uses year values relative to 1980 and 2 second precision
+0 name dos-date
+# HHHHHMMMMMMSSSSS bit encoded Hour (0-23) Minute (0-59) SecondPart (*2)
+#>0 uleshort x RAW TIME [%#4.4x]
+# hour part
+#>0 uleshort/2048 x hour [%u]
+# YYYYYMMMMDDDDD bit encoded YearPart (+1980) Month (1-12) Day (1-31)
+#>2 uleshort x RAW DATE [%#4.4x]
+# day part
+>2 uleshort&0x001F x %u
+#>2 uleshort/16 x MONTH PART [%#x]
+# GRR: not working
+#>2 uleshort/16 &0x000F MONTH [%u]
+#>2 uleshort&0x01E0 x MONTH PART [%#4.4x]
+>2 uleshort&0x01E0 =0x0020 jan
+>2 uleshort&0x01E0 =0x0040 feb
+>2 uleshort&0x01E0 =0x0060 mar
+>2 uleshort&0x01E0 =0x0080 apr
+>2 uleshort&0x01E0 =0x00A0 may
+>2 uleshort&0x01E0 =0x00C0 jun
+>2 uleshort&0x01E0 =0x00E0 jul
+>2 uleshort&0x01E0 =0x0100 aug
+>2 uleshort&0x01E0 =0x0120 sep
+>2 uleshort&0x01E0 =0x0140 oct
+>2 uleshort&0x01E0 =0x0160 nov
+>2 uleshort&0x01E0 =0x0180 dec
+# year part
+>2 uleshort/512 x 1980+%u
+#
diff --git a/magic/Magdir/msooxml b/magic/Magdir/msooxml
index 06f244fa132c..9303411f6356 100644
--- a/magic/Magdir/msooxml
+++ b/magic/Magdir/msooxml
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: msooxml,v 1.16 2021/08/16 10:06:55 christos Exp $
+# $File: msooxml,v 1.17 2021/11/08 13:53:43 christos Exp $
# msooxml: file(1) magic for Microsoft Office XML
# From: Ralf Brown <ralf.brown@gmail.com>
@@ -30,7 +30,7 @@
# make sure the first file is correct
>0x1E use msooxml
>0x1E default x
->>0x1E regex \\[Content_Types\\]\\.xml|_rels/\\.rels|docProps
+>>0x1E regex \\[Content_Types\\]\\.xml|_rels/\\.rels|docProps|customXml
# skip to the second local file header
# since some documents include a 520-byte extra field following the file
# header, we need to scan for the next header
@@ -46,5 +46,10 @@
# OpenOffice/Libreoffice orders ZIP entry differently, so check the 4th file
>>>>>>&26 search/6000 PK\003\004
>>>>>>>&26 use msooxml
+# Some OOXML generators add an extra customXml directory. Check another file.
+>>>>>>>&26 default x
+>>>>>>>>&26 search/6000 PK\003\004
+>>>>>>>>>&26 use msooxml
+>>>>>>>>>&26 default x Microsoft OOXML
>>>>>>>&26 default x Microsoft OOXML
>>>>>&26 default x Microsoft OOXML
diff --git a/magic/Magdir/msvc b/magic/Magdir/msvc
index 8cf5c166d3f1..fbfa4f266f9b 100644
--- a/magic/Magdir/msvc
+++ b/magic/Magdir/msvc
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: msvc,v 1.10 2018/10/01 19:14:03 christos Exp $
+# $File: msvc,v 1.11 2022/01/17 17:17:30 christos Exp $
# msvc: file(1) magic for msvc
# "H. Nanosecond" <aldomel@ix.netcom.com>
# Microsoft visual C
@@ -20,9 +20,162 @@
0 string \377\003\000\377\001\000\060\020\350 MSVC .res
#.lib
-0 string \360\015\000\000 Microsoft Visual C library
-0 string \360\075\000\000 Microsoft Visual C library
-0 string \360\175\000\000 Microsoft Visual C library
+# URL: https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B
+# http://fileformats.archiveteam.org/wiki/Microsoft_Library
+# http://fileformats.archiveteam.org/wiki/OMF
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/l/lib-msvc.trid.xml
+# https://pierrelib.pagesperso-orange.fr/exec_formats/OMF_v1.1.pdf
+# Update: Joerg Jenderek
+#0 string \360\015\000\000 Microsoft Visual C library
+#0 string \360\075\000\000 Microsoft Visual C library
+#0 string \360\175\000\000 Microsoft Visual C library
+# test for RecordType~LibraryHeaderRecord=0xF0 + RecordLength=???Dh + dictionary offset is multiple of 0x200
+0 ubelong&0xFF0f80ff =0xF00d0000
+# Microsoft Visual C library (strength=70) before MIDI SysEx messages (strength=50) handled by ./sysex
+#!:strength +0
+# test for valid 2nd RecordType~Translator Header Record=THEADR=80h or LHEADR=82h
+>(1.s+3) ubyte&0xFD =0x80
+>>0 use omf-lib
+# display information about Microsoft Visual C/OMF library
+0 name omf-lib
+# RecordType~LibraryHeaderRecord=0xF0
+#>0 byte 0xF0 Microsoft Visual C library
+# the above description was used in file version 5.41
+>0 byte 0xF0 Microsoft Visual C/OMF library
+#>0 byte 0xF0 relocatable Object Module Format (OMF) libray
+#!:mime application/octet-stream
+!:mime application/x-omf-lib
+!:ext lib
+# 1st record data length like 13=0Dh 29=1Dh 61=3Dh 125=7Dh 509=01FDh ... 32765=7FFDh
+#>1 uleshort x \b, 1st record data length %u
+#>1 uleshort x \b, 1st record data length %#x
+# 2**4=16 <= RecordLength+3 = PageSize = 2**n {16 32 512 no examples 64 128 256 1024 2048 ...32768} <= 2**15=32768
+>1 uleshort+3 x \b, page size %u
+# dictionary offset like: 400h 600h a00h c00h 1200h 1800h 2400h 5600h 12800h 19200h 28a00h
+>3 ulelong x \b, at %#x dictionary
+# dictionary block a 512 bytes; the first 37 bytes correspond to the 37 buckets
+#>(3.l) ubequad x (%#16.16llx...)
+# dictionary size; length in 512-byte blocks; a prime number? like:
+# 1 2 3 4 5 6 7 9 11 13 15 16 18 21 22 23 24 25 31 50 53 89 101 117 277
+>7 uleshort x with %u block
+# plurals s
+>7 uleshort >1 \bs
+# If dictionary byte 38 (FFLAG) has the value 255, there is no space left
+>(3.l+37) ubyte <0xFF (FFLAG=%#x)
+>(3.l+37) ubyte =0xFF (FFLAG=full)
+# dictionary entry; length byte of following symbol, the following text bytes of symbol, two bytes specifies the page number
+# like: dbfntx1! DBFNTX.LIB zlibCompileFlags_ ZLIB.LIB atoi! mwlibc.lib
+>(3.l+38) pstring x 1st entry %s
+# like: 1 33 41 47 458 8783
+>>&0 uleshort x in page %u
+# library flags; 0 or 1, but WHAT IS 0x4d in MOUSE.LIB ?
+>9 ubyte >1 \b, flags %#x
+>9 ubyte =1 case sensitive
+# In the library after header comes first object module with a Library Module Header Record (LHEADR=82h)
+# but in examples Translator Header Record (THEADR=80h) which is handled identically
+>(1.s+3) ubyte x \b, 2nd record
+>(1.s+3) ubyte !0x80 (type %#x)
+#>(1.s+4) uleshort x \b, 2nd record data length %u
+# Module name often source name like "dos\crt0.asm" in mlibce.lib or "QB4UTIL.ASM" in QB4UTIL.LIB
+# or "C:\Documents and Settings\Allan Campbell\My Documents\FDOSBoot\zlib\zutil.c" in ZLIB.LIB
+# or title like "87INIT" in FP87.LIB or "ACOSASIN" in MATHC.LIB or "Copyright" in calc-bcc.lib
+>(1.s+6) pstring x "%s"
+# 2nd record checksum
+#>>&0 ubyte x checksum %#x
+# 3rd RecordType: 96h~LNAMES 88h~COMENT
+>>&1 ubyte x \b, 3rd record
+>>&1 ubyte !0x88
+>>>&-1 ubyte !0x96
+# 3rd unusual record type
+>>>>&-1 ubyte x (type %#x)
+# 3rd record is a List of Names Record (LNAMES=96h)
+>>&1 ubyte =0x96 LNAMES
+# LNAMES record length like: 2 15 19
+#>>>&0 uleshort x \b, LNAMES record length %u
+>>>&0 uleshort >2
+# 1st LNAME string length; null is valid; maximal 255
+#>>>>&0 ubyte x 1st LNAME length %u
+>>>>&0 ubyte =0
+# 2nd LNAME length like: 4 7 8 17 31
+#>>>>>&0 ubyte x 2nd LNAME length %u
+# name used for segment, class, group, overlay, etc like:
+# CODE (mwlibc.lib) _TEXT32 (JMPPM32.LIB) _OVLCODE (WOVL.LIB)
+>>>>>&0 pstring x %s
+# 3rd LNAME length like: 4 5
+#>>>>>>&0 ubyte x 3rd LNAME length %u
+# like: DATA (mwlibc.lib) CODE (JMPPM32.LIB) _TEXT (EMU87.LIB)
+>>>>>>&0 pstring x %s
+# maybe 4th LNAME length like: 4 6
+>>>>>>>&0 ubyte <44
+# like: DATA (DEBUG.LIB) DGROUP (mwlibc.lib MOUSE.LIB)
+>>>>>>>>&-1 pstring x %s
+# 3rd record is a COMMENT (Including all comment class extensions)
+>>&1 ubyte =0x88 COMMENT
+# comment record length like: 3 FLIB7M.LIB 1Bh 1Eh 23h 27h 2Bh 30h freetype-bcc.lib
+#>>>&0 uleshort x \b, record length %#x
+# real comment length = record length - 1 (comment type) - 1 (comment Class) - 1 (checksum) -1 (char count)
+# like: 2 LIBFL.LIB 4 "UUID" 5 "dscap" 6 "int386" 7 "qb4util" 8 "AMSGEXIT" 16 REXX.LIB 20 27 35 44 freetype-bcc.lib
+#>>>>&-2 uleshort-4 >0 \b, comment length %u
+# check that record contain at least comment type (1 byte), comment class (1 byte), checksum (1 byte)
+# probably always true
+>>>&0 uleshort >2
+# comment type: 80h~NP~no purge bit 40h~NL~no list bit
+#>>>>&0 ubyte !0 Type %#x
+>>>>&0 ubyte &0x80 Preserved
+# no example
+>>>>&0 ubyte &0x40 NoList
+# comment class like: 0~Translator A0~OMF extensions A3~LIBMOD A1~New OMF extensions AA~UNKNOWN
+>>>>&1 ubyte x class=%#x
+# check that comment record contains at least real content
+>>>>&-2 uleshort >3
+# Translator comment record (0); it may name the source language or translator
+>>>>>&1 ubyte =0 Translator
+#>>>>>>&0 ubyte x Translator length %u
+# like: "TC86 Borland Turbo C 2.01 " (GEMS.LIB) "TC86 Borland Turbo C++ 3.00" (CATDB.LIB)
+>>>>>>&0 pstring x "%s"
+# OMF extensions comment record (A0); first byte of commentary string identifies subtype
+>>>>>&1 ubyte =0xA0 OMF extensions
+# A0 subtype like: 1~IMPDEF
+>>>>>>&0 ubyte !1 subtype %#x
+# Import Definition Record (Comment Class A0, Subtype 01~IMPDEF)
+>>>>>>&0 ubyte 1 IMPDEF
+# ordinal flag; determines form of Entry Ident field. If nonzero (seems to be 1) Entry is ordinal
+>>>>>>>&0 ubyte !0 ordinal
+# like: IMPORT.LIB DOSCALLS.LIB mlibw.lib mwinlibc.lib REXX.LIB
+>>>>>>>>&-1 ubyte >1 %u
+# Internal Name in count, char string format; module name for the imported symbol
+# like: 7 "REXXSAA" 9 11 13 14 15 16 20 21 26 "_Z10_clip_linePdS_S_S_dddd"
+#>>>>>>>&1 ubyte x internal name length %u
+# internal module name like: _DllGetVersion DllGetVersion BezierTerminationTest Copyright
+>>>>>>>&1 pstring x %s
+# module name in count, char string format; DLL name that supplies a matching export symbol
+# like: jpeg62.dll (jpeg-bcc.lib) unrar3.dll (unrar-bcc.lib) REXX (REXX.LIB)
+>>>>>>>>&0 pstring x exported by %s
+# Entry Ident; 16-bit if ordinal flag != 0 or imported name in count, char string format if ordinal flag = 0
+# like: \0 (calc-bcc.lib) DllGetVersion (libtiff-bcc.lib) UTF8ToHtml (libxml2-bcc.lib) xslAddCall (libxslt-bcc.lib)
+#>>>>>>>>>&0 pstring >\0 entry ident %s
+# "New OMF" extensions comment (A1); indicate version of symbolic debug information
+# like: LIBFL.LIB
+>>>>>&1 ubyte =0xA1 New OMF extensions
+# symbolic debug information version n
+>>>>>>&0 ubyte x n=%u
+# symbolic debug information style like: HL~IBM PM Debugger style (LIBFL.LIB) DX~AIX style CV~Microsoft symbol and type style
+>>>>>>>&0 string HL IBM style
+>>>>>>>&0 string DX AIX style
+>>>>>>>&0 string CV Microsoft style
+# LIBMOD comment record (A3) used only by the librarian
+# Microsoft extension added for LIB version 3.07 in macro assembler (MASM 5.0)
+>>>>>&1 ubyte =0xA3 LIBMOD
+# The A3 LIBMOD record contains only the ASCII string of the module name in count char format
+#>>>>>>&0 ubyte x LIBMOD length %u
+# LIBMOD comment record module name without path and extension like:
+# qb4util (QB4UTIL.LIB) affaldiv (libh.lib) crt0 (slibc.lib) clipper (DDDRAWS.LIB) dinpdev (DINPUTS.LIB) UUID (UUID.LIB)
+>>>>>>&0 pstring x %s
+# GRR: WHAT iS THAT? AA foo comment record
+#>>>>>&1 ubyte =0xAA AA-comment
+# like: OS220
+#>>>>>>&0 string x what=%-5.5s
+#
#.pch
0 string DTJPCH0\000\022\103\006\200 Microsoft Visual C .pch
diff --git a/magic/Magdir/nifty b/magic/Magdir/nifty
new file mode 100644
index 000000000000..151d869872d4
--- /dev/null
+++ b/magic/Magdir/nifty
@@ -0,0 +1,202 @@
+
+#------------------------------------------------------------------------------
+# $File: nifty,v 1.1 2022/02/14 16:51:15 christos Exp $
+# file(1) magic for the NIfTI file format
+
+# Type: NIfTI, Neuroimaging file format
+# URL: https://nifti.nimh.nih.gov/
+# From: Yann Leprince <yann.leprince@cea.fr>, 2022
+
+344 string n+1\0 NIfTI-1 neuroimaging data,
+!:mime image/x.nifti
+!:ext nii
+>0 use nifti1
+344 string ni1\0 NIfTI-1 neuroimaging data header,
+!:mime image/x.nifti
+!:ext hdr
+>0 use nifti1
+
+4 string n+2\0\r\n\032\n NIfTI-2 neuroimaging data,
+!:mime image/x.nifti
+!:ext nii
+>0 use nifti2
+4 string ni2\0\r\n\032\n NIfTI-2 neuroimaging data header,
+!:mime image/x.nifti
+!:ext hdr
+>0 use nifti2
+
+# Main subroutine for NIfTI-1
+0 name nifti1
+>0 clear x
+>0 lelong =348 little endian
+>>70 use nifti-datatype-le
+>>112 lefloat !0 with scaling
+>>0 use nifti1-dim-le
+>>252 leshort >0 \b, with qform
+>>>252 use xform-code-nifti1-le
+>>254 leshort >0 \b, with sform
+>>>254 use xform-code-nifti1-le
+>>136 string >\0 \b, description: %s
+>0 belong =348 big endian
+>>70 use \^nifti-datatype-le
+>>112 befloat !0 with scaling
+>>0 use \^nifti1-dim-le
+>>252 beshort >0 \b, with qform
+>>>252 use \^xform-code-nifti1-le
+>>254 beshort >0 \b, with sform
+>>>254 use \^xform-code-nifti1-le
+>>136 string >\0 \b, description: %s
+>0 default x
+>>0 long x invalid sizeof_hdr=%d
+
+# Main subroutine for NIfTI-2
+0 name nifti2
+>0 clear x
+>0 lelong =540 little endian
+>>12 use nifti-datatype-le
+>>176 lefloat !0 with scaling
+>>0 use nifti2-dim-le
+>>344 lelong >0 \b, with qform
+>>>344 use xform-code-nifti2-le
+>>348 lelong >0 \b, with sform
+>>>348 use xform-code-nifti2-le
+>>240 string >\0 \b, description: %s
+>0 belong =540 big endian
+>>12 use \^nifti-datatype-le
+>>176 befloat !0 with scaling
+>>0 use \^nifti2-dim-le
+>>344 lelong >0 \b, with qform
+>>>344 use \^xform-code-nifti2-le
+>>348 lelong >0 \b, with sform
+>>>348 use \^xform-code-nifti2-le
+>>240 string >\0 \b, description: %s
+>0 default x
+>>0 long x invalid sizeof_hdr=%d
+
+
+# Other subroutines for details of NIfTI files
+
+0 name nifti-datatype-le
+>0 clear x
+>0 leshort =1 \b, binary datatype
+>0 leshort =2 \b, uint8 datatype
+>0 leshort =4 \b, int16 datatype
+>0 leshort =8 \b, int32 datatype
+>0 leshort =16 \b, float32 datatype
+>0 leshort =32 \b, complex64 datatype
+>0 leshort =64 \b, float64 datatype
+>0 leshort =128 \b, RGB24 datatype
+>0 leshort =256 \b, int8 datatype
+>0 leshort =512 \b, uint16 datatype
+>0 leshort =768 \b, uint32 datatype
+>0 leshort =1024 \b, int64 datatype
+>0 leshort =1280 \b, uint64 datatype
+>0 leshort =1536 \b, float128 datatype
+>0 leshort =1792 \b, complex128 datatype
+>0 leshort =2048 \b, complex256 datatype
+>0 leshort =2304 \b, RGBA32 datatype
+>0 default x
+>>0 leshort x \b, unknown datatype 0x%x
+>>2 leshort x (%d bits/pixel)
+
+0 name nifti1-dim-le
+>0 clear x
+>40 leshort <0 \b, INVALID dim[0]=%d
+>40 leshort >7 \b, INVALID dim[0]=%d
+>0 default x
+>>40 leshort x \b, %d-dimensional (size
+>>42 leshort x %d
+>>40 leshort >1
+>>>44 leshort x \bx%d
+>>40 leshort >2
+>>>46 leshort x \bx%d
+>>40 leshort >3
+>>>48 leshort x \bx%d
+>>40 leshort >4
+>>>50 leshort x \bx%d
+>>40 leshort >5
+>>>52 leshort x \bx%d
+>>40 leshort >6
+>>>54 leshort x \bx%d
+>>80 lefloat x \b, voxel size %f
+>>40 leshort >1
+>>>84 lefloat x x %f
+>>40 leshort >2
+>>>88 lefloat x x %f
+>>123 use nifti1-xyz-unit
+>>40 leshort >3
+>>>92 lefloat x x %f
+>>>123 use nifti1-t-unit
+>>40 leshort x \b)
+
+0 name nifti2-dim-le
+>0 clear x
+>16 lequad <0 \b, INVALID dim[0]=%lld
+>16 lequad >7 \b, INVALID dim[0]=%lld
+>0 default x
+>>16 lequad x \b, %lld-dimensional (size
+>>24 lequad x %lld
+>>16 lequad >1
+>>>32 lequad x \bx%lld
+>>16 lequad >2
+>>>40 lequad x \bx%lld
+>>16 lequad >3
+>>>48 lequad x \bx%lld
+>>16 lequad >4
+>>>56 lequad x \bx%lld
+>>16 lequad >5
+>>>64 lequad x \bx%lld
+>>16 lequad >6
+>>>72 lequad x \bx%lld,
+>>112 ledouble x \b, voxel size %f
+>>16 lequad >1
+>>>120 ledouble x x %f
+>>16 lequad >2
+>>>128 ledouble x x %f
+>>500 use nifti2-xyz-unit
+>>16 lequad >3
+>>>136 ledouble x x %f
+>>>500 use nifti2-t-unit
+>>16 lequad x \b)
+
+0 name xform-code-nifti1-le
+>0 leshort =1 to scanner-based coordinates
+>0 leshort =2 to aligned coordinates
+>0 leshort =3 to Talairach coordinates
+>0 leshort =4 to MNI152 coordinates
+>0 leshort =5 to template coordinates
+
+0 name xform-code-nifti2-le
+>0 lelong =1 to scanner-based coordinates
+>0 lelong =2 to aligned coordinates
+>0 lelong =3 to Talairach coordinates
+>0 lelong =4 to MNI152 coordinates
+>0 lelong =5 to template coordinates
+
+0 name nifti1-xyz-unit
+>0 byte &0x01
+>>0 byte ^0x02 m
+>>0 byte &0x02 micron
+>0 byte ^0x01
+>>0 byte &0x02 mm
+
+0 name nifti1-t-unit
+>0 byte &0x08
+>>0 byte ^0x10 s
+>>0 byte &0x10 ms
+>0 byte ^0x08
+>>0 byte &0x10 microsecond
+
+0 name nifti2-xyz-unit
+>0 lelong &0x01
+>>0 lelong ^0x02 m
+>>0 lelong &0x02 micron
+>0 lelong ^0x01
+>>0 lelong &0x02 mm
+
+0 name nifti2-t-unit
+>0 lelong &0x08
+>>0 lelong ^0x10 s
+>>0 lelong &0x10 ms
+>0 lelong ^0x08
+>>0 lelong &0x10 microsecond
diff --git a/magic/Magdir/ole2compounddocs b/magic/Magdir/ole2compounddocs
index a5e60a821b5e..1379e569e122 100644
--- a/magic/Magdir/ole2compounddocs
+++ b/magic/Magdir/ole2compounddocs
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: ole2compounddocs,v 1.12 2021/09/04 16:00:38 christos Exp $
+# $File: ole2compounddocs,v 1.18 2022/05/31 17:38:36 christos Exp $
# Microsoft OLE 2 Compound Documents : file(1) magic for Microsoft Structured
# storage (https://en.wikipedia.org/wiki/Compound_File_Binary_Format)
# Additional tests for OLE 2 Compound Documents should be under this recipe.
@@ -200,6 +200,22 @@
!:mime application/x-ms-info
!:ext nfo
#
+# From: Joerg Jenderek
+# URL: https://en.wikipedia.org/wiki/Microsoft_Access
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/m/mdz.trid.xml
+# http://fileformats.archiveteam.org/wiki/Microsoft_Compound_File
+# Note: only version foo tested and called "Microsoft Access Wizard template" by TrID
+# Fourth directory entry name TemplateID
+>>>>384 lestring16 TemplateID : Microsoft Access wizard template
+# Second directory entry name like \005SummaryInformation and 3rd name like \005DocumentSummaryInformation
+#!:mime application/x-ole-storage
+#!:mime application/vnd.ms-office
+#!:mime application/vnd.ms-access
+#!:mime application/msaccess
+!:mime application/x-ms-mdz
+# http://extension.nirsoft.net/mdz
+!:ext mdz
+#
# URL: http://fileformats.archiveteam.org/wiki/Corel_Print_House
# Second directory entry name Thumbnail
>>>>128 lestring16 Thumbnail : Corel PrintHouse image
@@ -258,6 +274,24 @@
!:ext prd/prv
# 2nd directory entry name Pictures
>>>>>>128 lestring16 Pictures with pictures
+#
+# URL: http://fileformats.archiveteam.org/wiki/PageMaker
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/p
+# pagemaker-generic.trid.xml
+# pagemaker-pm6.trid.xml
+# pagemaker-pm65.trid.xml
+# pmd-pm7.trid.xml
+# From: Joerg Jenderek
+# Note: since version 6 embedd as stream with PageMaker name the "old" format handled by ./wordprocessors
+# verified by Michal Mutl Structured Storage Viewer `SSView.exe brochus.pt6`
+# Second directory entry name PageMaker
+>>>>128 lestring16 PageMaker :
+# look for magic of "old" PageMaker like in 02TEMPLT.T65
+>>>>>0 search/0xa900/s \0\0\0\0\0\0\xff\x99
+# GRR: jump to PageMaker stream and inspect it by sub routine PageMaker of ./wordprocessors failed with wrong version!
+#>>>>>>&0 use PageMaker
+# THIS WORKS PARTLY!
+>>>>>>&0 indirect x
# remaining null clsid
>>>>128 default x : UNKNOWN
# second directory entry name like VisioDocument Control000
@@ -267,6 +301,9 @@
# forth
>>>>>384 lestring16 x %.20s
!:mime application/x-ole-storage
+# according to file version 5.41 with -e soft option
+#!:mime application/CDFV2
+#!:ext ???
# look for known clsid GUID
# - Visio documents
# URL: http://fileformats.archiveteam.org/wiki/Visio
@@ -417,6 +454,28 @@
!:apple ????PPT3
# /autostart/template
!:ext ppt/pps/pot
+# From: Joerg Jenderek
+# URL: https://www.file-extensions.org/ppa-file-extension
+# https://en.wikipedia.org/wiki/Microsoft_PowerPoint#cite_note-231
+# Reference: http://fileformats.archiveteam.org/wiki/Microsoft_Compound_File
+>>88 ubequad 0x871800aa0060263b : Microsoft
+# only version 8 (97) tested; PowerPoint 4.0 to 11.0 (2004) (Wikipedia); 97 to 2003 (file-extensions.org)
+>>>80 ubequad 0xf04672810a72cf11 PowerPoint Addin or Wizard
+# second, third and fourth directory entry name like VBA PROJECT PROJECTwm
+# http://extension.nirsoft.net/pwz
+!:mime application/vnd.ms-powerpoint
+# like: BSHPPT97.PPA "AutoContent Wizard.pwz"
+!:ext ppa/pwz
+#
+# From: Joerg Jenderek
+# URL: http://fileformats.archiveteam.org/wiki/AWD_(At_Work_Document)
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/a/awd-fax.trid.xml
+# Note: called "Microsoft At Work Fax document" by TrID
+>>88 ubequad 0xb29400dd010f2bf9 : Microsoft
+>>>80 ubequad 0x801cb0023de01a10 At Work fax Document
+#!:mime application/x-ole-storage
+!:mime image/x-ms-awd
+!:ext awd
#
# URL: https://en.wikipedia.org/wiki/Microsoft_Project
#??
@@ -424,6 +483,20 @@
>>>80 ubequad 0x3a8fb774c8c8d111 Project
!:mime application/vnd.ms-project
!:ext mpp
+# From: Joerg Jenderek
+# URL: https://en.wikipedia.org/wiki/Microsoft_Office_shared_tools#Binder
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/o/obd.trid.xml
+# http://fileformats.archiveteam.org/wiki/Microsoft_Compound_File
+# Note: only version 8 tested and called "Office Binder Document" by TrID and
+# "Microsoft Office Binder File for Windows" version 97-2000 by DROID fmt/240
+>>88 ubequad 0xb21c00aa004ba90b : Microsoft
+>>>80 ubequad 0x0004855964661b10 Office Binder Document, Template or wizard
+# second directory entry name like Binder
+# https://www.file-extensions.org/obd-file-extension
+#!:mime application/vnd.ms-binder
+!:mime application/x-msbinder
+# obt for template; obz for Microsoft Office Binder wizard
+!:ext obd/obt/obz
#
# URL: http://fileformats.archiveteam.org/wiki/WordPerfect
# Reference: http://fileformats.archiveteam.org/wiki/Microsoft_Compound_File
@@ -560,9 +633,29 @@
!:mime application/vnd.softmaker.planmaker
# pmv for template https://www.file-extensions.org/pmv-file-extension
!:ext pmd/pmv
+# URL: http://fileformats.archiveteam.org/wiki/MAX_(3ds_Max)
+# https://en.wikipedia.org/wiki/Autodesk_3ds_Max
+# Reference: http://fileformats.archiveteam.org/wiki/Microsoft_Compound_File
+# Note: called "3D Studio Max Scene" by TrID and "3DS Max" by DROID and
+# "3DSMax thumbnail" by XnView and verfied by `nconvert -info A380.max`
+# applies only to "newer" versions (about 2008-2020)
+>>88 ubequad 0x9fed04143144cc1e : Autodesk
+>>>80 ubequad 0x7b8cdd1cc081a045 3ds Max
+#!:mime application/x-ole-storage
+!:mime model/x-autodesk-max
+# like: https://static.free3d.com/models/dropbox/dropbox/sq/A380.7z/A380.max
+!:ext max
+# also chr for character file according to DROID https://www.nationalarchives.gov.uk/PRONOM/fmt/978
+#!:ext max/chr
# remaining non null clsid
->>88 default x : UNKNOWN
+>>88 default x
+# GRR: check again for non null clsid because wrong when called by indirect directive
+>>>88 ubequad !0 : UNKNOWN
+# https://reposcope.com/mimetype/application/x-ole-storage
!:mime application/x-ole-storage
->>>80 ubequad !0 \b, clsid %#16.16llx
->>>88 ubequad x \b%16.16llx
+# according to file version 5.41 with -e soft option
+#!:mime application/CDFV2
+#!:ext ???
+>>>>80 ubequad !0 \b, clsid %#16.16llx
+>>>>88 ubequad x \b%16.16llx
diff --git a/magic/Magdir/oric b/magic/Magdir/oric
new file mode 100644
index 000000000000..38c02c5751d3
--- /dev/null
+++ b/magic/Magdir/oric
@@ -0,0 +1,16 @@
+
+#------------------------------------------------------------------------------
+# $File: oric,v 1.2 2022/04/25 17:28:20 christos Exp $
+# Oric tape files
+# From: Stefan A. Haubenthal <polluks@sdf.lonestar.org>
+# References:
+# http://fileformats.archiveteam.org/wiki/TAP_(Oric)
+# http://fileformats.archiveteam.org/wiki/DSK_(Oric)
+0 string \x16\x16\x16\x24 Oric tape,
+>6 byte =0x00 BASIC,
+>6 byte =0x80 memory block,
+>7 byte >0x00 autorun,
+>13 string x "%.15s"
+
+0 string ORICDISK Oric Image
+0 string MFM_DISK Oric Image
diff --git a/magic/Magdir/os2 b/magic/Magdir/os2
index 02f27fa6b075..cb43e999f6f6 100644
--- a/magic/Magdir/os2
+++ b/magic/Magdir/os2
@@ -1,12 +1,14 @@
#------------------------------------------------------------------------------
-# $File: os2,v 1.13 2021/04/26 15:56:00 christos Exp $
+# $File: os2,v 1.14 2022/03/21 21:25:50 christos Exp $
# os2: file(1) magic for OS/2 files
#
# Provided 1998/08/22 by
# David Mediavilla <davidme.news@REMOVEIFNOTSPAMusa.net>
1 search/100 InternetShortcut MS Windows 95 Internet shortcut text
+!:mime application/x-mswinurl
+!:ext url
>17 search/100 URL= (URL=<
>>&0 string x \b%s>)
diff --git a/magic/Magdir/palm b/magic/Magdir/palm
index 8cec9df20db1..5d2b913c35fe 100644
--- a/magic/Magdir/palm
+++ b/magic/Magdir/palm
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: palm,v 1.14 2019/04/19 00:42:27 christos Exp $
+# $File: palm,v 1.15 2021/12/16 21:50:06 christos Exp $
# palm: file(1) magic for PalmOS {.prc,.pdb}: applications, docfiles, and hacks
#
# Brian Lalor <blalor@hcirisc.cs.binghamton.edu>
@@ -55,6 +55,7 @@
# Mobipocket (www.mobipocket.com), donated by Carl Witty
# expanded by Ralf Brown
60 string BOOKMOBI Mobipocket E-book
+!:mime application/x-mobipocket-ebook
# MobiPocket stores a full title, pointed at by the belong at offset
# 0x54 in its header at (78.L), with length given by the belong at
# offset 0x58.
diff --git a/magic/Magdir/pci_ids b/magic/Magdir/pci_ids
new file mode 100644
index 000000000000..34bc2e2f8afc
--- /dev/null
+++ b/magic/Magdir/pci_ids
@@ -0,0 +1,116 @@
+
+#------------------------------------------------------------------------------
+# $File: pci_ids,v 1.1 2022/04/02 14:47:42 christos Exp $
+# pci.ids: file(1) magic for PCI specific informations
+#
+
+# Vendor identification (ID) https://pci-ids.ucw.cz/v2.2/pci.ids
+# show hexadecimal PCI vendor identification in human readable text form
+0 name PCI-vendor
+# ID vendor name
+#>0 uleshort =0x0f00 fOO
+>0 uleshort =0x1000 Broadcom
+>0 uleshort =0x1002 AMD/ATI
+>0 uleshort =0x1013 Cirrus Logic
+>0 uleshort =0x1014 IBM
+>0 uleshort =0x1022 AMD
+>0 uleshort =0x1050 Winbond
+>0 uleshort =0x105a Promise
+>0 uleshort =0x1095 Silicon
+>0 uleshort =0x10EC Realtek
+>0 uleshort =0x10de NVIDIA
+>0 uleshort =0x1106 VIA
+# Woodward McCoach, Inc.
+>0 uleshort =0x1231 Woodward
+#
+>0 uleshort =0x1234 Bochs
+>0 uleshort =0x15ad VMware
+>0 uleshort =0x1af4 Virtio
+>0 uleshort =0x1b36 QEMU
+>0 uleshort =0x1de1 Tekram
+# maybe also Promise?
+#>0 uleshort =0x4289 Promise
+#>0 uleshort =0x66a1 FOO
+>0 uleshort =0x8086 Intel
+>0 uleshort =0x9004 Adaptec
+# also Adaptec; but no example
+>0 uleshort =0x9005 Adaptec
+# for unknown/missing manufactors
+>0 default x UNKNOWN
+>>0 uleshort x (%#4.4x)
+
+# https://blog.ladsai.com/pci-configuration-space-class-code.html
+# Base class code https://wiki.osdev.org/PCI
+# show hexadecimal PCI class+sub+ProgIF identification in human readable text form
+0 name PCI-class
+#>0 ubyte x CLASS=%x
+>0 ubyte x
+# Device was built prior definition of the class code field
+>>0 ubyte 0x00 PRIOR
+# Any device except for VGA-Compatible devices like: 2975BIOS.BIN Trm3x5.bin
+# BUT also NVidia44.bin vgabios-stdvga-bin.rom
+#>>>0 ubyte 0x00 NOT VGA
+# VGA-Compatible Device; NO EXAMPLE found here!!
+#>>>0 ubyte 0x01 VGA
+# like 4243.bin
+#>>>0 ubyte 0x04 SUB_CLASS_4
+>>0 ubyte 0x01 storage controller
+# device sub-type and its definition is dependent upon the base-type code
+>>>1 ubyte 0x00 SCSI
+>>>1 ubyte 0x01 IDE
+>>>1 ubyte 0x02 Floppy
+>>>1 ubyte 0x03 IPI
+>>>0 ubyte 0x04 RAID
+>>>1 ubyte 0x05 ATA
+>>>1 ubyte 0x06 SATA
+>>>1 ubyte 0x07 SAS
+>>>1 ubyte 0x08 NVM
+# 4650_sr5.bin "PROMISE" "FT TX4650 Ary X"
+>>>1 ubyte 0x80 OTHER
+>>0 ubyte 0x02 network controller
+>>>1 ubyte 0x00 ethernet
+>>>1 ubyte 0x01 token ring
+>>>1 ubyte 0x02 FDDI
+>>>1 ubyte 0x03 ATM
+>>>1 ubyte 0x04 ISDN
+>>>1 ubyte 0x05 WorldFip
+# PICMG 2.14 Multi Computing
+>>>1 ubyte 0x06 PICMG
+>>>1 ubyte 0x80 OTHER
+>>0 ubyte 0x03 display controller
+>>0 ubyte 0x04 multimedia controller
+>>0 ubyte 0x05 memory controller
+>>0 ubyte 0x06 bridge device
+# Simple Communication Controllers
+>>0 ubyte 0x07 communication controller
+# Base System Peripherals
+>>0 ubyte 0x08 base peripheral
+# Input Devices
+>>0 ubyte 0x09 input device
+# Docking Stations
+>>0 ubyte 0x0A docking station
+>>0 ubyte 0x0B processor
+>>0 ubyte 0x0C serial bus controller
+>>0 ubyte 0x0D wireless controller
+# Intelligent I/O Controllers
+>>0 ubyte 0x0E I/O controller
+# Satellite Communication Controllers
+>>0 ubyte 0x0F satellite controller
+# Encryption/Decryption Controllers
+>>0 ubyte 0x10 encryption controller
+# Data Acquisition and Signal Processing Controllers
+>>0 ubyte 0x11 signal controller
+# Processing Accelerator
+>>0 ubyte 0x12 processing accelerator
+# Non-Essential Instrumentation
+>>0 ubyte 0x13 non-essential
+# reserved or unassigned
+>>0 default x
+# device does not fit any defined class; Unassigned Class (Vendor specific)
+>>>0 ubyte 0xFF UNASSIGNED
+# THIS SHOULD NOT HAPPEN! BUT CLASS=8f for Promise 4650_sr5.bin 8660_sr5.bin
+>>>0 default x RESERVED
+>>>>0 ubyte x (%#x)
+# Prog IF of PCI class code?
+# defines the specific device programming interface
+>2 ubyte >0 \b, ProgIF=%u
diff --git a/magic/Magdir/python b/magic/Magdir/python
index 80a59959bea2..ed5888591aae 100644
--- a/magic/Magdir/python
+++ b/magic/Magdir/python
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: python,v 1.43 2021/05/25 15:12:03 christos Exp $
+# $File: python,v 1.44 2021/10/20 11:15:35 christos Exp $
# python: file(1) magic for python
#
# Outlook puts """ too for urgent messages
@@ -8,6 +8,7 @@
# often the module starts with a multiline string
0 string/t """ Python script text executable
# MAGIC as specified in Python/import.c (1.0 to 3.7)
+# and in Lib/importlib/_bootstrap_external.py (3.5+)
# two bytes of magic followed by "\r\n" in little endian order
0 belong 0x02099900 python 1.0 byte-compiled
!:mime application/x-bytecode.python
@@ -215,6 +216,50 @@
!:mime application/x-bytecode.python
0 belong 0x610d0d0a python 3.9 byte-compiled
!:mime application/x-bytecode.python
+0 belong 0x660d0d0a python 3.10 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x670d0d0a python 3.10 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x680d0d0a python 3.10 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x690d0d0a python 3.10 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x6a0d0d0a python 3.10 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x6b0d0d0a python 3.10 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x6c0d0d0a python 3.10 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x6d0d0d0a python 3.10 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x6e0d0d0a python 3.10 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x6f0d0d0a python 3.10 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x7a0d0d0a python 3.11 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x7b0d0d0a python 3.11 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x7c0d0d0a python 3.11 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x7d0d0d0a python 3.11 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x7e0d0d0a python 3.11 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x7f0d0d0a python 3.11 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x800d0d0a python 3.11 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x810d0d0a python 3.11 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x820d0d0a python 3.11 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x830d0d0a python 3.11 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x840d0d0a python 3.11 byte-compiled
+!:mime application/x-bytecode.python
+0 belong 0x850d0d0a python 3.11 byte-compiled
+!:mime application/x-bytecode.python
0 search/1/w #!\040/usr/bin/python Python script text executable
!:strength + 15
diff --git a/magic/Magdir/riff b/magic/Magdir/riff
index 39a5acbe23b9..6421bcb6747d 100644
--- a/magic/Magdir/riff
+++ b/magic/Magdir/riff
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: riff,v 1.43 2021/04/26 15:56:00 christos Exp $
+# $File: riff,v 1.44 2022/05/14 19:42:47 christos Exp $
# riff: file(1) magic for RIFF format
# See
#
@@ -161,6 +161,64 @@
#>0 string x we got %s
#>>&(4.l+4) use riff-walk
+# RecorderGear TR500 call recorder digits (BCD)
+0 name tr500-call-recorder-digits
+>0 byte&0xF0 0x00 \b0
+>0 byte&0xF0 0x10 \b1
+>0 byte&0xF0 0x20 \b2
+>0 byte&0xF0 0x30 \b3
+>0 byte&0xF0 0x40 \b4
+>0 byte&0xF0 0x50 \b5
+>0 byte&0xF0 0x60 \b6
+>0 byte&0xF0 0x70 \b7
+>0 byte&0xF0 0x80 \b8
+>0 byte&0xF0 0x90 \b9
+>0 byte&0xF0 0xb0 \b*
+>0 byte&0xF0 0xc0 \b#
+>0 byte&0x0F 0 \b0
+>0 byte&0x0F 1 \b1
+>0 byte&0x0F 2 \b2
+>0 byte&0x0F 3 \b3
+>0 byte&0x0F 4 \b4
+>0 byte&0x0F 5 \b5
+>0 byte&0x0F 6 \b6
+>0 byte&0x0F 7 \b7
+>0 byte&0x0F 8 \b8
+>0 byte&0x0F 9 \b9
+>0 byte&0x0F 0xb \b*
+>0 byte&0x0F 0xc \b#
+
+# TR500 call recorder extended header
+# From: David Korth <gerbilsoft@gerbilsoft.com>
+# Contains dialed/incoming phone number and timestamp.
+# TODO: Verify byte 15.
+0 name tr500-call-recorder-header
+>15 byte 2 (outgoing call:
+>15 byte 4 (incoming call:
+>1 byte 0xFF \bno number
+>1 byte !0xFF
+>>1 use tr500-call-recorder-digits
+>>2 byte !0xFF
+>>>2 use tr500-call-recorder-digits
+>>3 byte !0xFF
+>>>3 use tr500-call-recorder-digits
+>>4 byte !0xFF
+>>>4 use tr500-call-recorder-digits
+>>5 byte !0xFF
+>>>5 use tr500-call-recorder-digits
+>>6 byte !0xFF
+>>>6 use tr500-call-recorder-digits
+>>7 byte !0xFF
+>>>7 use tr500-call-recorder-digits
+>>8 byte !0xFF
+>>>8 use tr500-call-recorder-digits
+>9 byte x \b, 20%02x
+>10 byte x \b/%02x
+>11 byte x \b/%02x
+>12 byte x %02x
+>13 byte x \b:%02x
+>14 byte x \b:%02x)
+
# AVI section extended by Patrik Radman <patrik+file-magic@iki.fi>
#
0 string RIFF RIFF (little-endian) data
@@ -231,6 +289,11 @@
!:ext wav/wave
>>12 string >\0
>>>12 use riff-walk
+# TR500 call recorder extended header
+>>16 ulelong 0x1E4
+>>>20 leshort 0x11
+>>>>256 byte 4
+>>>>>256 use tr500-call-recorder-header
# Update: Joerg Jenderek
# lower case for Corel Draw version 8 Bidi
>8 string/c cdr
@@ -676,6 +739,7 @@
# for debugging purpose display 5th chunk like: LIST osfp
#>>(26.l+30) string x \b, 5th "%-4.4s"
>4 ulelong+8 x \b, %u bytes
+
#
# XXX - some of the below may only appear in little-endian form.
#
diff --git a/magic/Magdir/rpi b/magic/Magdir/rpi
index 58e6dfde70a5..0d213b5357e7 100644
--- a/magic/Magdir/rpi
+++ b/magic/Magdir/rpi
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: rpi,v 1.2 2019/10/02 02:07:30 christos Exp $
+# $File: rpi,v 1.3 2022/04/02 14:39:34 christos Exp $
# rpi: file(1) magic for Raspberry Pi images
-44 lelong 0
>4 lelong 0
@@ -27,3 +27,26 @@
>>>>>>>>>40 string DDTK8
>>>>>>>>>>48 lelong 4
>>>>>>>>>>>52 string RPTL Raspberry PI kernel image
+
+# From: Joerg Jenderek
+# URL: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html
+# #raspberry-pi-4-boot-eeprom
+# Reference: https://github.com/raspberrypi/rpi-eeprom/blob/master/rpi-eeprom-config
+# Note: start with same magic as for BIOS (ia32) ROM Extension handled by ./intel
+# masked with MAGIC_MASK and then compared with MAGIC
+0 belong&0xFFffF00F 0x55aaF00F Raspberry PI EEPROM
+#!:mime application/octet-stream
+!:mime application/x-raspberry-eeprom
+# like: pieeprom-2020-09-03.bin
+!:ext bin
+# a 32 bit offset to the next section like: 000184d4 000184c8 00018534 ... 0000bb84 0000bbd4 0000bbd4
+>4 ubelong x \b, offset %8.8x
+#>(4.L) ubelong x NEXT=%8.8x
+# self.length
+>8 ubelong !0 \b, length %x
+# self.filename
+>12 string >0 \b, "%s"
+# length is zero
+>8 ubelong =0
+# if length is zero then 2nd section magic here can be zero; this means sections parsing done
+>>8 ubelong !0 \b, 2nd MAGIC=%8.8x
diff --git a/magic/Magdir/sgml b/magic/Magdir/sgml
index a1c0484ce4dd..a191c3015fa4 100644
--- a/magic/Magdir/sgml
+++ b/magic/Magdir/sgml
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: sgml,v 1.42 2020/12/12 20:01:47 christos Exp $
+# $File: sgml,v 1.45 2022/03/21 21:36:55 christos Exp $
# Type: SVG Vectorial Graphics
# From: Noel Torres <tecnico@ejerciciosresueltos.com>
0 string \<?xml\ version=
@@ -52,66 +52,66 @@
# https://www.w3.org/TR/SVG/single-page.html
0 search/4096/cWbt \<!doctype\ svg SVG XML document
!:mime image/svg+xml
-!:strength + 5
+!:strength + 15
0 search/4096/cwt \<head\> HTML document text
!:mime text/html
-!:strength + 5
+!:strength + 15
0 search/4096/cWt \<head\ HTML document text
!:mime text/html
-!:strength + 5
+!:strength + 15
0 search/4096/cwt \<title\> HTML document text
!:mime text/html
-!:strength + 5
+!:strength + 15
0 search/4096/cWt \<title\ HTML document text
!:mime text/html
-!:strength + 5
+!:strength + 15
0 search/4096/cwt \<html\> HTML document text
!:mime text/html
-!:strength + 5
+!:strength + 15
0 search/4096/cWt \<html\ HTML document text
!:mime text/html
-!:strength + 5
+!:strength + 15
0 search/4096/cwt \<script\> HTML document text
!:mime text/html
-!:strength + 5
+!:strength + 15
0 search/4096/cWt \<script\ HTML document text
!:mime text/html
-!:strength + 5
+!:strength + 15
0 search/4096/cwt \<style\> HTML document text
!:mime text/html
-!:strength + 5
+!:strength + 15
0 search/4096/cWt \<style\ HTML document text
!:mime text/html
-!:strength + 5
+!:strength + 15
0 search/4096/cwt \<table\> HTML document text
!:mime text/html
-!:strength + 5
+!:strength + 15
0 search/4096/cWt \<table\ HTML document text
!:mime text/html
-!:strength + 5
+!:strength + 15
0 search/4096/cwt \<a\ href= HTML document text
!:mime text/html
-!:strength + 5
+!:strength + 15
# Extensible markup language (XML), a subset of SGML
# from Marc Prud'hommeaux (marc@apocalypse.org)
0 search/1/cwt \<?xml XML document text
!:mime text/xml
-!:strength + 5
+!:strength + 15
0 string/t \<?xml\ version\ " XML
!:mime text/xml
-!:strength + 5
+!:strength + 15
0 string/t \<?xml\ version=" XML
!:mime text/xml
-!:strength + 5
+!:strength + 15
>15 string/t >\0 %.3s document text
>>23 search/1 \<xsl:stylesheet (XSL stylesheet)
>>24 search/1 \<xsl:stylesheet (XSL stylesheet)
0 string/t \<?xml\ version=' XML
!:mime text/xml
-!:strength + 5
+!:strength + 15
>15 string/t >\0 %.3s document text
>>23 search/1 \<xsl:stylesheet (XSL stylesheet)
>>24 search/1 \<xsl:stylesheet (XSL stylesheet)
@@ -139,7 +139,10 @@
# http://files.pef-format.org/specifications/pef-2008-1/pef-specification.html
#
# Simon Aittamaa <simon.aittamaa@gmail.com>
-0 string \<?xml\ version=
->14 regex ['"\ \t]*[0-9.]+['"\ \t]*
->>19 search/4096 \<pef Portable Embosser Format
+0 string \<?xml\ version=
+>14 regex ['"\ \t]*[0-9.]+['"\ \t]*
+>>19 search/4096 \<pef Portable Embosser Format
!:mime application/x-pef+xml
+
+# https://www.qgis.org/en/site/
+0 string \<!DOCTYPE\040qgis QGIS XML document
diff --git a/magic/Magdir/sniffer b/magic/Magdir/sniffer
index 816ecb907a3e..87bff6b03e6c 100644
--- a/magic/Magdir/sniffer
+++ b/magic/Magdir/sniffer
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: sniffer,v 1.30 2021/07/03 13:51:56 christos Exp $
+# $File: sniffer,v 1.31 2022/03/20 22:45:43 christos Exp $
# sniffer: file(1) magic for packet capture files
#
# From: guy@alum.mit.edu (Guy Harris)
@@ -362,4 +362,51 @@
#
# Files from Accellent Group's 5View products.
#
-0 string \xaa\xaa\xaa\xaa 5View capture file
+# URL: http://www.infovista.com
+# Reference: http://mark0.net/download/triddefs_xml.7z
+# defs/0/5vw.trid.xml
+# https://2.na.dl.wireshark.org/src/wireshark-3.6.2.tar.xz
+# wireshark-3.6.2/wiretap/5views.c
+# Update: Joerg Jenderek
+# Note: called "5View capture" by TrID and
+# "Wireshark capture file" on Windows or
+# "Packet Capture (Accellent/InfoVista 5view)" by shared MIME-info database
+# verified/falsified by `wireshark *.5vw`
+0 string \xaa\xaa\xaa\xaa
+# skip misidentified boot/x86_64/loader/kroete.dat on Suse LEAP DVD
+# by check for valid record version
+>8 ulelong =0x00010000
+>>0 use 5view-le
+0 name 5view-le
+# t_5VW_Info_Header.Signature = CST_5VW_INFO_HEADER_KEY = 0xAAAAAAAAU
+>0 ulelong x 5View capture file
+# https://reposcope.com/mimetype/application/x-5view
+!:mime application/x-5view
+!:ext 5vw
+# size of header in bytes (included signature and reserved fields); probably always 20h
+>4 ulelong !0x00000020 \b, header size %#x
+# version of header record; apparently always CST_5VW_INFO_RECORD_VERSION=0x00010000U
+>8 ulelong !0x00010000 \b, record version %#x
+# DataSize; total size of data without header like: 18h
+>12 ulelong x \b, record size %#x
+# filetype; type of the capture file like: 18001000h
+>16 ulelong x \b, file type %#8.8x
+# Reserved[3]; reserved for future use; apparently zero
+>20 quad !0 \b, Reserved %#llx
+# look for record header key CST_5VW_RECORDS_HEADER_KEY of structure t_5VW_TimeStamped_Header
+>0x20 search/0xB8/b \xEE\xEE\x33\x33 \b; record
+# HeaderSize; actual size of this header in bytes like: 32 24h
+>>&0 uleshort x size %#x
+# HeaderType; exact type of this header; probably always 0x4000
+>>&2 uleshort !0x4000 \b, header type %#x
+# RecType; type of record like: 80000000h
+>>&4 ulelong x \b, record type %#x
+# RecSubType; subtype of record like: 0
+>>&8 ulelong !0 \b, subtype %#x
+# RecSize; Size of one record like: 5Ch
+>>&12 ulelong x \b, RecSize %#x
+# RecNb; Number of records like: 1
+>>&16 ulelong >1 \b, %#x records
+# Timestamp Utc
+#>>&20 ulelong x \b, RAW TIME %#8.8x
+>>&20 date x \b, Time-stamp %s
diff --git a/magic/Magdir/statistics b/magic/Magdir/statistics
index 0ceb82cd272f..ca9f8591b68e 100644
--- a/magic/Magdir/statistics
+++ b/magic/Magdir/statistics
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: statistics,v 1.2 2020/10/08 17:51:53 christos Exp $
+# $File: statistics,v 1.3 2022/03/24 15:48:58 christos Exp $
# statistics: file(1) magic for statistics related software
#
@@ -42,4 +42,4 @@
# Example of those files can be found on Zenodo:
# https://zenodo.org/search?page=1&size=20&q=&file_type=dta
0 string \<stata_dta\>\<header\>\<release\> Stata Data File
->&0 regex [0-9]* (Release %s)
+>&0 regex [0-9]+ (Release %s)
diff --git a/magic/Magdir/sysex b/magic/Magdir/sysex
index 967ac0ce30c1..0065ad17e432 100644
--- a/magic/Magdir/sysex
+++ b/magic/Magdir/sysex
@@ -1,20 +1,42 @@
#------------------------------------------------------------------------
-# $File: sysex,v 1.10 2019/04/19 00:42:27 christos Exp $
+# $File: sysex,v 1.11 2022/01/17 17:16:51 christos Exp $
# sysex: file(1) magic for MIDI sysex files
#
# GRR: original 1 byte test at offset was too general as it catches also many FATs of DOS filesystems
# where real SYStem EXclusive messages at offset 1 are limited to seven bits
# https://en.wikipedia.org/wiki/MIDI
-0 ubeshort&0xFF80 0xF000 SysEx File -
-
+# test for StartSysEx byte and upper unsed bit of vendor ID
+0 ubeshort&0xFF80 0xF000
+# MIDI System Exclusive (SysEx) messages (strength=50) after Microsoft Visual C library (strength=70)
+#!:strength +0
+# skip Microsoft Visual C library with page size 16 misidentifed as ADA and
+# page size 32 misidentifed as Inventronics by looking for terminating End Of eXclusive byte (EOX)
+>2 search/12 \xF7
+>>0 use midi-sysex
+# display information about MIDI System Exclusive (SysEx) messages
+0 name midi-sysex
+# https://fileinfo.com/extension/syx
+>1 ubyte x MIDI audio System Exclusive (SysEx) message -
+# Note: file (version 5.41) labeled the above entry as "SysEx File"
+#!:mime application/octet-stream
+!:mime audio/x-syx
+# https://onsongapp.com/docs/features/formats/sysex
+!:ext syx/sysex
+# https://www.midi.org/specifications-old/item/manufacturer-id-numbers
+# https://raw.githubusercontent.com/insolace/MIDI-Sysex-MFG-IDs/master/Sysex%20ID%20Tables/MIDI%20Sysex%20MFG%20IDs.csv
+# SysEx manufacturer ID; originally one byte, but now 0 is used as an escapement to reach the next two
# North American Group
->1 byte 0x01 Sequential
+#>1 byte 0x01 Sequential
+>1 byte 0x01 Sequential Circuits
>1 byte 0x02 IDP
->1 byte 0x03 OctavePlateau
+#>1 byte 0x03 OctavePlateau
+>1 byte 0x03 Voyetra Turtle Beach
>1 byte 0x04 Moog
->1 byte 0x05 Passport
->1 byte 0x06 Lexicon
+#>1 byte 0x05 Passport
+>1 byte 0x05 Passport Designs
+#>1 byte 0x06 Lexicon
+>1 byte 0x06 Lexicon Inc.
>1 byte 0x07 Kurzweil/Future Retro
>>3 byte 0x77 777
>>4 byte 0x00 Bank
@@ -38,12 +60,17 @@
>>5 byte 0x10 (ALL)
>>2 byte x \b, Channel %d
>1 byte 0x08 Fender
->1 byte 0x09 Gulbransen
->1 byte 0x0a AKG
+#>1 byte 0x09 Gulbransen
+>1 byte 0x09 MIDI9
+#>1 byte 0x0a AKG
+>1 byte 0x0a AKG Acoustics
>1 byte 0x0b Voyce
>1 byte 0x0c Waveframe
->1 byte 0x0d ADA
->1 byte 0x0e Garfield
+# not ADA programming language
+#>1 byte 0x0d ADA
+>1 byte 0x0d ADA Signal Processors Inc.
+#>1 byte 0x0e Garfield
+>1 byte 0x0e Garfield Electronics
>1 byte 0x0f Ensoniq
>1 byte 0x10 Oberheim
>>2 byte 0x06 Matrix 6 series
@@ -59,7 +86,8 @@
>1 byte 0x16 Lowrey
>1 byte 0x17 AdamsSmith
>1 byte 0x18 E-mu
->1 byte 0x19 Harmony
+#>1 byte 0x19 Harmony
+>1 byte 0x19 Harmony Systems
>1 byte 0x1a ART
>1 byte 0x1b Baldwin
>1 byte 0x1c Eventide
@@ -67,23 +95,28 @@
>1 byte 0x1f Clarity
# European Group
->1 byte 0x21 SIEL
+#>1 byte 0x21 SIEL
+>1 byte 0x21 Proel Labs (SIEL)
>1 byte 0x22 Synthaxe
>1 byte 0x24 Hohner
>1 byte 0x25 Twister
->1 byte 0x26 Solton
+#>1 byte 0x26 Solton
+>1 byte 0x26 Ketron s.r.l.
>1 byte 0x27 Jellinghaus
>1 byte 0x28 Southworth
>1 byte 0x29 PPG
>1 byte 0x2a JEN
->1 byte 0x2b SSL
->1 byte 0x2c AudioVertrieb
+#>1 byte 0x2b SSL
+>1 byte 0x2b Solid State Logic Organ Systems
+#>1 byte 0x2c AudioVertrieb
+>1 byte 0x2c Audio Veritrieb-P. Struven
>1 byte 0x2f ELKA
>>3 byte 0x09 EK-44
>1 byte 0x30 Dynacord
->1 byte 0x31 Jomox
+#>1 byte 0x31 Jomox
+>1 byte 0x31 Viscount International Spa
>1 byte 0x33 Clavia
>1 byte 0x39 Soundcraft
# Some Waldorf info from http://Stromeko.Synth.net/Downloads#WaldorfDocs
@@ -202,14 +235,16 @@
>1 byte 0x44 Casio
>1 byte 0x46 Kamiya
>1 byte 0x47 Akai
->1 byte 0x48 Victor
+#>1 byte 0x48 Victor
+>1 byte 0x48 Victor Company of Japan. Ltd.
>1 byte 0x49 Mesosha
>1 byte 0x4b Fujitsu
>1 byte 0x4c Sony
>1 byte 0x4e Teac
>1 byte 0x50 Matsushita
>1 byte 0x51 Fostex
->1 byte 0x52 Zoom
+#>1 byte 0x52 Zoom
+>1 byte 0x52 Zoom Corporation
>1 byte 0x54 Matsushita
>1 byte 0x57 Acoustic tech. lab.
# https://www.midi.org/techspecs/manid.php
@@ -317,4 +352,78 @@
>1 belong&0xffffff00 0x00204700 Klavis Tech.
>1 belong&0xffffff00 0x00204800 Noteheads AB
+# Update: Joerg Jenderek; January 2022
+>1 byte 0x00 ID EXTENSIONS
+>1 byte 0x13 Digidesign Inc.
+>1 byte 0x1e Key Concepts
+>1 byte 0x20 Passac
+>1 byte 0x23 Stepp
+>1 byte 0x2d Neve
+>1 byte 0x2e Soundtracs Ltd.
+>1 byte 0x32 Drawmer
+>1 byte 0x34 Audio Architecture
+>1 byte 0x35 Generalmusic Corp SpA
+>1 byte 0x36 Cheetah Marketing
+>1 byte 0x37 C.T.M.
+>1 byte 0x38 Simmons UK
+>1 byte 0x3a Steinberg
+>1 byte 0x3b Wersi GmbH
+>1 byte 0x3c AVAB Niethammer AB
+>1 byte 0x3d Digigram
+>1 byte 0x3f Quasimidi
+#
+>1 byte 0x40 Kawai Musical Instruments MFG. CO. Ltd
+#>1 byte 0x45 foo
+#>1 byte 0x4a foo
+#>1 byte 0x4d foo
+#>1 byte 0x4f foo
+#>1 byte 0x53 foo
+>1 byte 0x55 Suzuki Musical Instruments MFG. Co. Ltd.
+>1 byte 0x56 Fuji Sound Corporation Ltd.
+#>1 byte 0x58 foo
+>1 byte 0x59 Faith. Inc.
+>1 byte 0x5a Internet Corporation
+#>1 byte 0x5b foo
+>1 byte 0x5c Seekers Co. Ltd.
+#>1 byte 0x5d foo
+#>1 byte 0x5e foo
+>1 byte 0x5f SD Card Association
+# Reserved for other uses for 60H to 7FH
+# URL: https://www.philscomputerlab.com/roland-midi-emulator-project-20.html
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/s/syx--midiemu.trid.xml
+# Note: called by TrID "MIDI Emulator Project SysEx preset command"
+>1 byte 0x66 MIDI Emulator
+# https://electronicmusic.fandom.com/wiki/List_of_MIDI_Manufacturer_IDs
+# Educational, prototyping, test, private use and experimentation
+>1 byte 0x7D PROTOTYPING
+# universal non-real-time (sample dump, tuning table, etc.)
+>1 byte 0x7E UNIVERSAL
+# universal real time (MIDI time code, MIDI Machine control, etc.)
+>1 byte 0x7F universal real time
+# display information about End Of eXclusive byte (EOX=F7)
+#>2 ubyte 0xF7 \b, at 2 EOX
+#>3 ubyte 0xF7 \b, at 3 EOX
+# https://tttapa.github.io/Control-Surface-doc/new-input/Doxygen/d2/d93/SysEx-Send-Receive_8ino-example.html
+>4 ubyte 0xF7 \b, at 4 EOX
+# http://www.1manband.nl/tutorials2/sysex.htm
+>5 ubyte 0xF7 \b, at 5 EOX
+# http://www.somascape.org/midi/tech/mfile.html#sysex
+>6 ubyte 0xF7 \b, at 6 EOX
+#
+>7 ubyte 0xF7 \b, at 7 EOX
+# https://webmidijs.org/forum/discussion/34/how-to-send-or-receive-system-exclusive-messages
+>8 ubyte 0xF7 \b, at 8 EOX
+#
+>9 ubyte 0xF7 \b, at 9 EOX
+# https://www.chd-el.cz/wp-content/uploads/845010_syxcom.pdf
+>10 ubyte 0xF7 \b, at 10 EOX
+# https://stackoverflow.com/questions/52906076/handling-midi-the-input-of-multiple-system-exclusive-messages-in-vb
+>11 ubyte 0xF7 \b, at 11 EOX
+# https://www.2writers.com/eddie/TutSysEx.htm
+>12 ubyte 0xF7 \b, at 12 EOX
+>13 ubyte 0xF7 \b, at 13 EOX
+# http://www.chromakinetics.com/handsonic/rolSysEx.htm
+>14 ubyte 0xF7 \b, at 14 EOX
+#>15 ubyte 0xF7 \b, at 15 EOX
+
0 string T707 Roland TR-707 Data
diff --git a/magic/Magdir/uuencode b/magic/Magdir/uuencode
index 7844468484c2..df70dc5319a5 100644
--- a/magic/Magdir/uuencode
+++ b/magic/Magdir/uuencode
@@ -1,16 +1,18 @@
#------------------------------------------------------------------------------
-# $File: uuencode,v 1.8 2019/12/14 20:40:26 christos Exp $
+# $File: uuencode,v 1.9 2021/11/13 17:48:10 christos Exp $
# uuencode: file(1) magic for ASCII-encoded files
#
-# GRR: the first line of xxencoded files is identical to that in uuencoded
-# files, but the first character in most subsequent lines is 'h' instead of
-# 'M'. (xxencoding uses lowercase letters in place of most of uuencode's
-# punctuation and survives BITNET gateways better.) If regular expressions
-# were supported, this entry could possibly be split into two with
-# "begin\040\.\*\012M" or "begin\040\.\*\012h" (where \. and \* are REs).
-0 search/1 begin\ uuencoded or xxencoded text
+# The first line of xxencoded files is identical to that in uuencoded files,
+# but the first character in most subsequent lines is 'h' instead of 'M'.
+# (xxencoding uses lowercase letters in place of most of uuencode's
+# punctuation and survives BITNET gateways better.)
+0 regex/1024 \^begin\040[0-7]{3}\040
+>&0 regex/256 [\012\015]+M[\040-\140]{60}[\012\015]+ uuencoded text
+>&0 regex/256 [\012\015]+h[0-9A-Za-z\053\055]{60}[\012\015]+ xxencoded text
+>&0 default x uuencoded or xxencoded text
+>&0 string >\0 \b, file name "%s"
# btoa(1) is an alternative to uuencode that requires less space.
0 search/1 xbtoa\ Begin btoa'd text
diff --git a/magic/Magdir/virtual b/magic/Magdir/virtual
index 86fe9fcd36d0..7872e32483ba 100644
--- a/magic/Magdir/virtual
+++ b/magic/Magdir/virtual
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: virtual,v 1.14 2021/04/26 15:56:00 christos Exp $
+# $File: virtual,v 1.16 2022/01/18 14:08:15 christos Exp $
# From: James Nobis <quel@quelrod.net>
# Microsoft hard disk images for:
# Virtual Server
@@ -219,7 +219,8 @@
# 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
+0 string/b QFI\xFB QEMU QCOW Image
+!:mime application/x-qemu-disk
# Uncomment the following line to display Magic (only used for debugging
# this magic number)
@@ -227,8 +228,7 @@
# There are currently 2 Versions: "1" and "2".
# https://www.gnome.org/~markmc/qcow-image-format-version-1.html
->4 belong !1 QEMU QCOW2 Image
->4 belong 1 QEMU QCOW Image (v1)
+>4 belong x (v%d)
# Using the existence of the Backing File Offset to determine whether
# to read Backing File Information
diff --git a/magic/Magdir/windows b/magic/Magdir/windows
index 4ec0af3e32d6..c98708ae1bae 100644
--- a/magic/Magdir/windows
+++ b/magic/Magdir/windows
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: windows,v 1.37 2021/04/26 15:56:00 christos Exp $
+# $File: windows,v 1.44 2022/05/31 17:39:08 christos Exp $
# windows: file(1) magic for Microsoft Windows
#
# This file is mainly reserved for files where programs
@@ -358,7 +358,7 @@
# skip space at beginning
>0 string \040
# name without extension and greater character or name with hlp extension
->>1 regex/c \^([^\xd>]*|.*\.hlp) MS Windows help file Content, based "%s"
+>>1 regex/c \^([^\xd>]*|.*\\.hlp) MS Windows help file Content, based "%s"
!:mime text/plain
!:apple ????TEXT
!:ext cnt
@@ -382,6 +382,8 @@
# Created by: unknown
# 'L' + GUUID
0 string \114\0\0\0\001\024\002\0\0\0\0\0\300\0\0\0\0\0\0\106 MS Windows shortcut
+!:mime application/x-ms-shortcut
+!:ext lnk
>20 lelong&1 1 \b, Item id list present
>20 lelong&2 2 \b, Points to a file or directory
>20 lelong&4 4 \b, Has Description string
@@ -495,10 +497,16 @@
# empty line CRLF
0 ubeshort 0x0D0A
>0 use ini-file
-# comment line
+# comment line starting with semicolon
0 string ;
->0 use ini-file
-# section line
+# look for phrase of Windows policy ADMinistrative template (with starting remark)
+# like: WINDOW_95_CD/TOOLS/RESKIT/netadmin/poledit/conf.adm
+>1 search/3548 END\040CATEGORY
+# ADM with remark (by adm-rem.trid.xml) already done by generic ASCII variant
+# if no Windows policy ADMinistrative template then Windows INItialization
+>1 default x
+>>0 use ini-file
+# section line starting with left bracket
0 string [
>0 use ini-file
# check and then display Windows INItialization configuration
@@ -510,7 +518,7 @@
# space after right bracket
# or AutoRun.Amd64 for 64 bit systems
# or only NL separator
->>&0 regex/c \^(autorun)
+>>&0 regex/c \^autorun
# but sometimes total commander directory tree file "treeinfo.wc" with lines like
# [AUTORUN]
# [boot]
@@ -535,11 +543,11 @@
# http://www.winfaq.de/faq_html/Content/tip2500/onlinefaq.php?h=tip2653.htm
# https://msdn.microsoft.com/en-us/library/windows/desktop/cc144102.aspx
# .ShellClassInfo DeleteOnCopy LocalizedFileNames ASCII coded case-independent
->>&0 regex/c \^(\.ShellClassInfo|DeleteOnCopy|LocalizedFileNames)] Windows desktop.ini
+>>&0 regex/1024c \^(\\.ShellClassInfo|DeleteOnCopy|LocalizedFileNames)] Windows desktop.ini
!:mime application/x-wine-extension-ini
#!:mime text/plain
# https://support.microsoft.com/kb/84709/
->>&0 regex/c \^(don't\ load)] Windows CONTROL.INI
+>>&0 regex/c \^don't\ load] Windows CONTROL.INI
!:mime application/x-wine-extension-ini
!:ext ini
>>&0 regex/c \^(ndishlp\\$|protman\\$|NETBEUI\\$)] Windows PROTOCOL.INI
@@ -555,34 +563,57 @@
!:mime application/x-wine-extension-ini
!:ext ini
# http://www.mdgx.com/newtip6.htm
->>&0 regex/c \^(SafeList)] Windows IOS.INI
+>>&0 regex/c \^SafeList] Windows IOS.INI
!:mime application/x-wine-extension-ini
!:ext ini
# https://en.wikipedia.org/wiki/NTLDR Windows Boot Loader information
->>&0 regex/c \^(boot\x20loader)] Windows boot.ini
+>>&0 regex/c \^boot\x20loader] Windows boot.ini
!:mime application/x-wine-extension-ini
!:ext ini
# https://en.wikipedia.org/wiki/CONFIG.SYS
->>&0 regex/c \^(menu)] MS-DOS CONFIG.SYS
+>>&0 regex/c \^menu] MS-DOS CONFIG.SYS
# @CONFIG.UI configuration file of previous DOS version saved by Caldera OPENDOS INSTALL.EXE
# CONFIG.PSS saved version of file CONFIG.SYS created by %WINDIR%\SYSTEM\MSCONFIG.EXE
# CONFIG.TSH renamed file CONFIG.SYS.BAT by %WINDIR%\SYSTEM\MSCONFIG.EXE
# dos and w40 used in dual booting scene
!:ext sys/dos/w40
# https://support.microsoft.com/kb/118579/
->>&0 regex/c \^(Paths)]\r\n MS-DOS MSDOS.SYS
+>>&0 regex/c \^Paths]\r\n MS-DOS MSDOS.SYS
!:ext sys/dos
# http://chmspec.nongnu.org/latest/INI.html#HHP
->>&0 regex/c \^(options)]\r\n Microsoft HTML Help Project
+>>&0 regex/c \^options]\r\n Microsoft HTML Help Project
!:mime text/plain
!:ext hhp
# From: Joerg Jenderek
-# URL: https://documentation.basis.com/BASISHelp/WebHelp/b3odbc/obdcdriv_character_translation.htm
+# URL: https://documentation.basis.com/BASISHelp/WebHelp/b3odbc/ODBC_Driver/obdcdriv_character_translation.htm
# Reference: https://www.garykessler.net/library/file_sigs.html
+# http://mark0.net/download/triddefs_xml.7z/defs/c/cpx.trid.xml
# Note: stored in directory %WINDIR%\SysWOW64 or %WINDIR%\system
->>&0 regex/c \^(Windows\ Latin) Windows codepage translator
-!:mime text/plain
+# second word often Latin but sometimes Cyrillic like in 12510866.CPX
+>>&0 regex/c \^Windows\ (Latin|Cyrillic) Windows codepage translator
+#!:mime text/plain
+!:mime text/x-ms-cpx
+# like: 12510866.CPX
!:ext cpx
+# From: Joerg Jenderek
+# URL: https://en.wikipedia.org/wiki/InstallShield
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/l/lid-is.trid.xml
+# Note: contain also 3 keywords like: count Default key0
+>>&0 regex/c \^Languages] InstallShield Language Identifier
+#!:mime text/plain
+!:mime text/x-installshield-lid
+# like: SETUP.LID
+!:ext lid
+# From: Joerg Jenderek
+# URL: https://www.file-extensions.org/tag-file-extension
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/t/taginfo.trid.xml
+# Note: contain also keywords like: Application Category Company Misc Version
+>>&0 regex/c \^TagInfo] TagInfo
+#!:mime text/plain
+#!:mime text/prs.lines.tag
+!:mime text/x-ms-tag
+# like: DATA.TAG
+!:ext tag
# unknown keyword after opening bracket
>>&0 default x
#>>>&0 string/c x UNKNOWN [%s
@@ -603,28 +634,73 @@
!:mime application/x-wine-extension-ini
#!:mime text/plain
!:ext ini/inf
+# UTF-16 BOM
+0 ubeshort =0xFFFE
+# look for phrase of Windows policy ADMinistrative template (UTF-16 by adm-uni.trid.xml)
+# like: wuau.adm
+>2 search/0x384A E\0N\0D\0\040\0C\0A\0T\0E\0G\0O\0R\0Y\0
+>>0 use windows-adm
+# if no Windows policy ADMinistrative template then Windows INFormation
+>2 default x
# UTF-16 BOM followed by CR~0D00 , comment~semicolon~3B00 , section~bracket~5B00
-0 ubelong&0xFFff89FF =0xFFFE0900
+>>0 ubelong&0xFFff89FF =0xFFFE0900
# look for left bracket in section line
->2 search/8192 [
+>>>2 search/8192 [
# keyword without 1st letter which is maybe up-/down-case
->>&3 lestring16 ersion] Windows setup INFormation
+>>>>&3 lestring16 ersion] Windows setup INFormation
!:mime application/x-setupscript
+# like: hdaudio.inf iscsi.inf spaceport.inf tpm.inf usbhub3.inf UVncVirtualDisplay.inf
!:ext inf
->>&3 lestring16 trings] Windows setup INFormation
+>>>>&3 lestring16 trings] Windows setup INFormation
!:mime application/x-setupscript
+# like: arduino_gemma.inf iis.inf MSM8960.inf
!:ext inf
->>&3 lestring16 ourceDisksNames] Windows setup INFormation
+>>>>&3 lestring16 ourceDisksNames] Windows setup INFormation
!:mime application/x-setupscript
+# like: atiixpag.inf mdmnokia.inf netefe32.inf rdpbus.inf
!:ext inf
# netnwcli.inf start with ;---[ NetNWCli.INX ]
->>&3 default x
+>>>>&3 default x
# look for NL followed by left bracket
->>>&0 search/8192 \x0A\x00\x5b
->>>>&3 lestring16 ersion] Windows setup INFormation
+>>>>>&0 search/8192 \x0A\x00\x5b
+# like: defltwk.inf netvwifibus.inf WSDPrint.inf
+>>>>>>&3 lestring16 ersion] Windows setup INFormation
!:mime application/x-setupscript
!:ext inf
+# Summary: Windows Policy ADMinistrative template
+# From: Joerg Jenderek
+# URL: https://en.wikipedia.org/wiki/Administrative_Template
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/a/adm.trid.xml
+# Note: typically stored in directory like: %WINDIR%\system32\GroupPolicy\ADM
+# worst case ASCII variant starting with remark line like: inetset.adm
+0 search/0x4E CLASS\040
+>&0 string MACHINE
+>>0 use windows-adm
+>&0 string USER
+>>0 use windows-adm
+# display information about Windows policy ADMinistrative template
+0 name windows-adm Windows Policy Administrative Template
+!:mime text/x-ms-adm
+!:ext adm
+# UTF-16 BOM implies UTF-16 encoded ADM (by adm-uni.trid.xml)
+>0 ubeshort =0xFFFE
+>>2 lestring16 x \b, 1st line "%s"
+# look for UTF-16 encoded CarriageReturn LineFeed
+>>>2 search/0x3A \r\0\n\0
+>>>>&0 lestring16 x \b, 2nd line "%s"
+# no UTF-16 BOM implies "ASCII" encoded ADM (by adm.trid.xml)
+>0 ubeshort !0xFFFE
+>>0 string x \b, 1st line "%s"
+#>>>&0 ubequad x \b, 2ND %16.16llx
+# 2nd line empty
+>>>&2 beshort =0x0D0A
+>>>>&0 beshort !0x0D0A \b, 3th line
+>>>>>&-2 string x "%s"
+# 2nd line with content
+>>>&2 beshort !0x0D0A \b, 2nd line
+>>>>&-2 string x "%s"
+
# Windows Precompiled INF files *.PNF added by Joerg Jenderek at Mar 2013 of _PNF_HEADER inf.h
# http://read.pudn.com/downloads3/sourcecode/windows/248345/win2k/private/windows/setup/setupapi/inf.h__.htm
# URL: http://fileformats.archiveteam.org/wiki/INF_(Windows)
@@ -1080,3 +1156,61 @@
0 string ID;P Microsoft SYLK program
>4 string >0 \b, created by %s
!:ext slk/sylk
+
+# Summary: Windows Performance Monitor Alert
+# From: Joerg Jenderek
+# URL: https://en.wikipedia.org/wiki/Performance_Monitor
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/p/pma.trid.xml
+# Note: called "Windows Performance Monitor Alert" by TrID
+0 ubelong =0xDC058340
+>4 ubyte =0 Windows Performance Monitor Alert
+#!:mime application/octet-stream
+# https://www.thoughtco.com/mime-types-by-content-type-3469108
+# https://filext.com/file-extension/PAM
+!:mime application/x-perfmon
+#!:mime application/x-ms-pma
+!:ext pma
+# metric type like: "BrowserMetrics" "CrashpadMetrics" "SetupMetrics"
+>>80 string x \b, "%s"
+
+# From: Joerg Jenderek
+# URL: https://en.wikipedia.org/wiki/InstallShield
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/i/ins.trid.xml
+# Note: contain also keywords like: BATCH_INSTALL ISVERSION LOGHANDLE SRCDIR SRCDISK WINDIR WINSYSDISK
+0 ubelong 0xB8C90C00 InstallShield Script
+#!:mime application/octet-stream
+!:mime application/x-installshield-ins
+# like test.ins Setup.ins
+!:ext ins
+# UNKNOWN like: 160034121de07e00 1600341260befe00 16003412e0783700
+# 5000010021083f00 50000100b0335600 50000100cbfdf800 50000100dfbc4700
+#>4 ubequad x \b, at 4 %#16.16llx
+# copyright text like: "Stirling Technologies, Inc. (c) 1990-1994"
+# "InstallSHIELD Software Coporation (c) 1990-1997"
+>13 pstring/h x "%s"
+# look for specific ASCII variable names
+>1 search/0x121/s SRCDIR \b, variable names:
+# 1st like: SRCDIR
+>>&-4 leshort x #%u
+>>&-2 pstring/h x %s
+# 2nd like: SRCDISK
+>>>&0 leshort x #%u
+>>>&2 pstring/h x %s
+# 3rd like: TARGETDISK
+>>>>&0 leshort x #%u
+>>>>&2 pstring/h x %s
+# 4th like: TARGETDIR
+#>>>>>&0 leshort x #%u
+#>>>>>&2 pstring/h x %s
+# 5th like: WINDIR
+#>>>>>>&0 leshort x #%u
+#>>>>>>&2 pstring/h x %s
+# 6th like: WINDISK
+#>>>>>>>&0 leshort x #%u
+#>>>>>>>&2 pstring/h x %s
+# 7th like: WINSYSDIR
+#>>>>>>>>&0 leshort x #%u
+#>>>>>>>>&2 pstring/h x %s
+# ... LOGHANDLE
+>0 ubelong x ...
+#
diff --git a/magic/Magdir/wordprocessors b/magic/Magdir/wordprocessors
index 297addfb114c..8032053d06c3 100644
--- a/magic/Magdir/wordprocessors
+++ b/magic/Magdir/wordprocessors
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: wordprocessors,v 1.26 2021/08/21 12:45:34 christos Exp $
+# $File: wordprocessors,v 1.27 2021/12/06 15:05:16 christos Exp $
# wordprocessors: file(1) magic fo word processors.
#
####### PWP file format used on Smith Corona Personal Word Processors:
@@ -229,6 +229,68 @@
!:mime application/x-quark-xpress-3
2 string MMXPRa Motorola Quark Express Document (Korean)
+# From: Joerg Jenderek
+# URL: http://fileformats.archiveteam.org/wiki/PageMaker
+# https://en.wikipedia.org/wiki/Adobe_PageMaker
+# Reference: http://mark0.net/download/triddefs_xml.7z/defs/p
+# pm4-pagemaker.trid.xml
+# pm5-pagemaker.trid.xml
+# Note: since version 6 in 1995 called Adobe PageMaker and
+# embedded in Compound Document handled by ./ole2compounddocs
+# mainly tested little endian variant
+4 ubelong =0x0000FF99
+>0 use PageMaker
+# big endian variant
+4 ubelong =0x000099FF
+>0 use \^PageMaker
+# display information of Aldus/Adobe PageMaker document/publication
+0 name PageMaker
+>110 uleshort <0x0600 Aldus
+>110 uleshort >0x05FF Adobe
+>110 uleshort x PageMaker
+# "MP" marker for newer version 4 and above according to TrID
+#>108 string x \b, MARKER "%.2s"
+# http://www.nationalarchives.gov.uk/pronom/fmt/876
+!:mime application/vnd.pagemaker
+#!:mime application/x-pagemaker
+# different file name extensions are used depending on version
+# older version like 3
+>110 uleshort/256 =0 document
+# https://www.macdisk.com/macsigen.php
+!:apple ALB3ALD3
+# PT3 for template and no example for PageMaker document/publiction with PM3 extension
+!:ext pm3/pt3
+>110 uleshort/256 =4 document
+!:apple ALD4ALB4
+# no example for PT4 template
+!:ext pm4/pt4
+>110 uleshort/256 =5 document
+!:apple ALD5ALB5
+# no example for PT5 template
+!:ext pm5/pt5
+>110 uleshort =0x0600 document
+!:apple ALD6ALB6
+# PT6 for template
+!:ext pm6/pt6
+# HOWTO to distinguish version 7 from 6.5 ?
+>110 uleshort =0x0632 document
+!:apple AD65AB65
+# no example for T65 template
+!:ext p65/t65/pmd/pmt
+# version 7 with PMT extension for template
+#!:ext pmd/pmt
+#!:apple ????PUBF
+# endian marker FF 99 for little endian
+>6 ubyte =0xFF \b, little-endian
+>6 ubyte =0x99 \b, big-endian
+# newer numeric version like: 4 5 6 6.50
+#>110 uleshort x \b, VERSION=%#x
+>110 uleshort >0x03FF
+>>110 uleshort/256 x \b, version %u
+>>110 uleshort%256 >0 \b.%u
+# older version like 3
+>110 uleshort <0x0400 \b, maybe version 3
+
# adobe indesign (document, whatever...) from querkan
0 belong 0x0606edf5 Adobe InDesign
>16 string DOCUMENT Document
diff --git a/magic/Magdir/xwindows b/magic/Magdir/xwindows
index 37ed8744c5b8..d8c08c8702e7 100644
--- a/magic/Magdir/xwindows
+++ b/magic/Magdir/xwindows
@@ -1,6 +1,6 @@
#------------------------------------------------------------------------------
-# $File: xwindows,v 1.12 2021/08/24 08:31:10 christos Exp $
+# $File: xwindows,v 1.13 2022/03/24 15:48:58 christos Exp $
# xwindows: file(1) magic for various X/Window system file formats.
# Compiled X Keymap
@@ -37,7 +37,7 @@
# X bitmap https://en.wikipedia.org/wiki/X_BitMap
0 search/2048 #define\040
>&0 regex [a-zA-Z0-9]+_width\040 xbm image
->>&0 regex [0-9]* (%sx
+>>&0 regex [0-9]+ (%sx
>>>&0 string \n#define\040
>>>>&0 regex [a-zA-Z0-9]+_height\040
->>>>>&0 regex [0-9]* \b%s)
+>>>>>&0 regex [0-9]+ \b%s)
diff --git a/magic/Magdir/zip b/magic/Magdir/zip
index d70434db0f29..abf5284776d4 100644
--- a/magic/Magdir/zip
+++ b/magic/Magdir/zip
@@ -1,20 +1,28 @@
#------------------------------------------------------------------------------
-# $File: zip,v 1.7 2021/04/26 15:56:00 christos Exp $
+# $File: zip,v 1.8 2021/10/24 15:53:56 christos Exp $
# zip: file(1) magic for zip files; this is not use
# Note the version of magic in archive is currently stronger, this is
# just an example until negative offsets are supported better
+# Note: All fields unless otherwise noted are unsigned!
# Zip Central Directory record
0 name zipcd
>0 string PK\001\002 Zip archive data
!:mime application/zip
+# no "made by" in local file header with PK\3\4 magic
>>4 leshort x \b, made by
>>4 use zipversion
>>4 use ziphost
+# inside ./archive 1.151 called "at least" zipversion "to extract"
>>6 leshort x \b, extract using at least
>>6 use zipversion
->>12 ledate x \b, last modified %s
->>24 lelong >0 \b, uncompressed size %d
+# This is DOS date like: ledate 21:00:48 19 Dec 2001 != DOS 00:00 1 Jan 2010 ~ 0000213C
+>>12 ulelong x \b, last modified
+>>14 lemsdosdate x \b, last modified %s
+>>12 lemsdostime x %s
+# uncompressed size of 1st entry; FFffFFff means real value stored in ZIP64 record
+>>24 ulelong !0xFFffFFff \b, uncompressed size %u
+# inside ./archive 1.151 called "compression method="zipcompression
>>10 leshort x \b, method=
>>10 use zipcompression
@@ -102,11 +110,17 @@
#>1 ubyte >19 unused %#x
# Zip End Of Central Directory record
+# GRR: wrong for ZIP with comment archive
-22 string PK\005\006
-#>4 leshort >1 \b, %d disks
-#>6 leshort >1 \b, central directory disk %d
-#>8 leshort >1 \b, %d central directories on this disk
-#>10 leshort >1 \b, %d central directories
-#>12 lelong x \b, %d central directory bytes
+#>4 uleshort !0xFFff \b, %u disks
+#>6 uleshort !0xFFff \b, central directory disk %u
+#>8 uleshort !0xFFff \b, %u central directories on this disk
+#>10 uleshort !0xFFff \b, %u central directories
+#>12 ulelong !0xFFffFFff \b, %u central directory bytes
+# offset of central directory
+#>16 ulelong x \b, central directory offset %#x
>(16.l) use zipcd
+# archive comment length n
+#>>20 uleshort >0 \b, comment length %u
+# archive comment
>>20 pstring/l >0 \b, %s
diff --git a/magic/Makefile.am b/magic/Makefile.am
index ab8c43287ef8..fafa9b7d0fb1 100644
--- a/magic/Makefile.am
+++ b/magic/Makefile.am
@@ -1,5 +1,5 @@
#
-# $File: Makefile.am,v 1.172 2021/10/07 15:41:22 christos Exp $
+# $File: Makefile.am,v 1.178 2022/04/02 14:47:42 christos Exp $
#
MAGIC_FRAGMENT_BASE = Magdir
MAGIC_DIR = $(top_srcdir)/magic
@@ -29,6 +29,7 @@ $(MAGIC_FRAGMENT_DIR)/application \
$(MAGIC_FRAGMENT_DIR)/applix \
$(MAGIC_FRAGMENT_DIR)/apt \
$(MAGIC_FRAGMENT_DIR)/archive \
+$(MAGIC_FRAGMENT_DIR)/aria \
$(MAGIC_FRAGMENT_DIR)/arm \
$(MAGIC_FRAGMENT_DIR)/asf \
$(MAGIC_FRAGMENT_DIR)/assembler \
@@ -58,6 +59,7 @@ $(MAGIC_FRAGMENT_DIR)/c64 \
$(MAGIC_FRAGMENT_DIR)/cad \
$(MAGIC_FRAGMENT_DIR)/cafebabe \
$(MAGIC_FRAGMENT_DIR)/cbor \
+$(MAGIC_FRAGMENT_DIR)/ccf \
$(MAGIC_FRAGMENT_DIR)/cddb \
$(MAGIC_FRAGMENT_DIR)/chord \
$(MAGIC_FRAGMENT_DIR)/cisco \
@@ -89,6 +91,7 @@ $(MAGIC_FRAGMENT_DIR)/dif \
$(MAGIC_FRAGMENT_DIR)/diff \
$(MAGIC_FRAGMENT_DIR)/digital \
$(MAGIC_FRAGMENT_DIR)/dolby \
+$(MAGIC_FRAGMENT_DIR)/dsf \
$(MAGIC_FRAGMENT_DIR)/dump \
$(MAGIC_FRAGMENT_DIR)/dyadic \
$(MAGIC_FRAGMENT_DIR)/ebml \
@@ -206,6 +209,7 @@ $(MAGIC_FRAGMENT_DIR)/netbsd \
$(MAGIC_FRAGMENT_DIR)/netscape \
$(MAGIC_FRAGMENT_DIR)/netware \
$(MAGIC_FRAGMENT_DIR)/news \
+$(MAGIC_FRAGMENT_DIR)/nifty \
$(MAGIC_FRAGMENT_DIR)/nim-lang \
$(MAGIC_FRAGMENT_DIR)/nitpicker \
$(MAGIC_FRAGMENT_DIR)/numpy \
@@ -216,6 +220,7 @@ $(MAGIC_FRAGMENT_DIR)/ole2compounddocs \
$(MAGIC_FRAGMENT_DIR)/olf \
$(MAGIC_FRAGMENT_DIR)/openfst \
$(MAGIC_FRAGMENT_DIR)/opentimestamps \
+$(MAGIC_FRAGMENT_DIR)/oric \
$(MAGIC_FRAGMENT_DIR)/os2 \
$(MAGIC_FRAGMENT_DIR)/os400 \
$(MAGIC_FRAGMENT_DIR)/os9 \
@@ -228,6 +233,7 @@ $(MAGIC_FRAGMENT_DIR)/pbf \
$(MAGIC_FRAGMENT_DIR)/pbm \
$(MAGIC_FRAGMENT_DIR)/pc88 \
$(MAGIC_FRAGMENT_DIR)/pc98 \
+$(MAGIC_FRAGMENT_DIR)/pci_ids \
$(MAGIC_FRAGMENT_DIR)/pcjr \
$(MAGIC_FRAGMENT_DIR)/pdf \
$(MAGIC_FRAGMENT_DIR)/pdp \
diff --git a/magic/Makefile.in b/magic/Makefile.in
index 71eb168d0a2e..2b1b3f1842de 100644
--- a/magic/Makefile.in
+++ b/magic/Makefile.in
@@ -275,7 +275,7 @@ top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
#
-# $File: Makefile.am,v 1.172 2021/10/07 15:41:22 christos Exp $
+# $File: Makefile.am,v 1.178 2022/04/02 14:47:42 christos Exp $
#
MAGIC_FRAGMENT_BASE = Magdir
MAGIC_DIR = $(top_srcdir)/magic
@@ -303,6 +303,7 @@ $(MAGIC_FRAGMENT_DIR)/application \
$(MAGIC_FRAGMENT_DIR)/applix \
$(MAGIC_FRAGMENT_DIR)/apt \
$(MAGIC_FRAGMENT_DIR)/archive \
+$(MAGIC_FRAGMENT_DIR)/aria \
$(MAGIC_FRAGMENT_DIR)/arm \
$(MAGIC_FRAGMENT_DIR)/asf \
$(MAGIC_FRAGMENT_DIR)/assembler \
@@ -332,6 +333,7 @@ $(MAGIC_FRAGMENT_DIR)/c64 \
$(MAGIC_FRAGMENT_DIR)/cad \
$(MAGIC_FRAGMENT_DIR)/cafebabe \
$(MAGIC_FRAGMENT_DIR)/cbor \
+$(MAGIC_FRAGMENT_DIR)/ccf \
$(MAGIC_FRAGMENT_DIR)/cddb \
$(MAGIC_FRAGMENT_DIR)/chord \
$(MAGIC_FRAGMENT_DIR)/cisco \
@@ -363,6 +365,7 @@ $(MAGIC_FRAGMENT_DIR)/dif \
$(MAGIC_FRAGMENT_DIR)/diff \
$(MAGIC_FRAGMENT_DIR)/digital \
$(MAGIC_FRAGMENT_DIR)/dolby \
+$(MAGIC_FRAGMENT_DIR)/dsf \
$(MAGIC_FRAGMENT_DIR)/dump \
$(MAGIC_FRAGMENT_DIR)/dyadic \
$(MAGIC_FRAGMENT_DIR)/ebml \
@@ -480,6 +483,7 @@ $(MAGIC_FRAGMENT_DIR)/netbsd \
$(MAGIC_FRAGMENT_DIR)/netscape \
$(MAGIC_FRAGMENT_DIR)/netware \
$(MAGIC_FRAGMENT_DIR)/news \
+$(MAGIC_FRAGMENT_DIR)/nifty \
$(MAGIC_FRAGMENT_DIR)/nim-lang \
$(MAGIC_FRAGMENT_DIR)/nitpicker \
$(MAGIC_FRAGMENT_DIR)/numpy \
@@ -490,6 +494,7 @@ $(MAGIC_FRAGMENT_DIR)/ole2compounddocs \
$(MAGIC_FRAGMENT_DIR)/olf \
$(MAGIC_FRAGMENT_DIR)/openfst \
$(MAGIC_FRAGMENT_DIR)/opentimestamps \
+$(MAGIC_FRAGMENT_DIR)/oric \
$(MAGIC_FRAGMENT_DIR)/os2 \
$(MAGIC_FRAGMENT_DIR)/os400 \
$(MAGIC_FRAGMENT_DIR)/os9 \
@@ -502,6 +507,7 @@ $(MAGIC_FRAGMENT_DIR)/pbf \
$(MAGIC_FRAGMENT_DIR)/pbm \
$(MAGIC_FRAGMENT_DIR)/pc88 \
$(MAGIC_FRAGMENT_DIR)/pc98 \
+$(MAGIC_FRAGMENT_DIR)/pci_ids \
$(MAGIC_FRAGMENT_DIR)/pcjr \
$(MAGIC_FRAGMENT_DIR)/pdf \
$(MAGIC_FRAGMENT_DIR)/pdp \