From 8db011b6e563686c9476a3261141ddba3831852f Mon Sep 17 00:00:00 2001 From: Nik Date: Tue, 14 Jan 2025 20:01:36 +0100 Subject: [PATCH] patterns: Added MIME types and magic numbers to all patterns that have them --- README.md | 30 +++++++++++------------ patterns/Crashlvl.hexpat | 1 + patterns/adts.hexpat | 2 +- patterns/afe2.hexpat | 4 ++++ patterns/bgcode.hexpat | 1 + patterns/bplist.hexpat | 1 + patterns/cda.hexpat | 38 +++++++++++++++--------------- patterns/chm.hexpat | 1 + patterns/dex.hexpat | 1 + patterns/dmg.hexpat | 1 + patterns/dmp64.hexpat | 4 ++-- patterns/dsstore.hexpat | 1 + patterns/dted.hexpat | 2 ++ patterns/evtx.hexpat | 2 +- patterns/fdt.hexpat | 1 + patterns/flac.hexpat | 1 + patterns/fs.hexpat | 1 + patterns/hinf_luas.hexpat | 1 + patterns/hinf_module.hexpat | 5 ++-- patterns/hinf_tag.hexpat | 1 + patterns/hsdt.hexpat | 4 +++- patterns/intel_hex.hexpat | 1 + patterns/ips.hexpat | 1 + patterns/iso.hexpat | 1 + patterns/loc.hexpat | 4 ++-- patterns/lua51.hexpat | 1 + patterns/lua52.hexpat | 1 + patterns/lua53.hexpat | 1 + patterns/lua54.hexpat | 1 + patterns/max_v104.hexpat | 4 ++-- patterns/msscmp.hexpat | 4 ++-- patterns/ne.hexpat | 1 + patterns/nes.hexpat | 1 + patterns/notepad-cache.hexpat | 1 + patterns/notepadwindowstate.hexpat | 1 + patterns/nro.hexpat | 1 + patterns/pbz.hexpat | 1 + patterns/pfs0.hexpat | 1 + patterns/pkm.hexpat | 1 + patterns/prodinfo.hexpat | 1 + patterns/psafe3.hexpat | 1 + patterns/pyc.hexpat | 1 + patterns/selinux.hexpat | 6 +++-- patterns/selinuxpp.hexpat | 1 + patterns/shp.hexpat | 1 + patterns/shx.hexpat | 1 + patterns/sup.hexpat | 2 +- patterns/swf.hexpat | 3 ++- patterns/ubiquiti.hexpat | 1 + patterns/vbmeta.hexpat | 1 + patterns/veado.hexpat | 3 ++- patterns/wad.hexpat | 1 + patterns/xci.hexpat | 1 + patterns/xilinx_bootgen.hexpat | 1 + 54 files changed, 103 insertions(+), 52 deletions(-) diff --git a/README.md b/README.md index 2c6ee0d..6977d9d 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi |------|------|------|-------------| | 3DS | | [`patterns/3ds.hexpat`](patterns/3ds.hexpat) | Autodesk 3DS Max Model file | | 7Z | | [`patterns/7z.hexpat`](patterns/7z.hexpat) | 7z File Format | -| ADTS | | [`patterns/adts.hexpat`](patterns/adts.hexpat) | ADTS/AAC audio files | +| ADTS | `audio/x-hx-aac-adts` | [`patterns/adts.hexpat`](patterns/adts.hexpat) | ADTS/AAC audio files | | AFE2 | | [`patterns/afe2.hexpat`](patterns/afe2.hexpat) | Nintendo Switch Atmosphère CFW Fatal Error log | | ANI | `application/x-navi-animation` | [`patterns/ani.hexpat`](patterns/ani.hexpat) | Windows Animated Cursor file | | AR | `application/x-archive` | [`patterns/ar.hexpat`](patterns/ar.hexpat) | Static library archive files | @@ -41,14 +41,14 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi | BIN | | [`patterns/selinux.hexpat`](patterns/selinux.pat) | SE Linux modules | | BINKA | | [`patterns/binka.hexpat`](patterns/binka.pat) | RAD Game Tools Bink Audio (BINKA) files | | BSON | `application/bson` | [`patterns/bson.hexpat`](patterns/bson.hexpat) | BSON (Binary JSON) format | -| bplist | | [`patterns/bplist.hexpat`](patterns/bplist.hexpat) | Apple's binary property list format (bplist) | +| bplist | `application/x-bplist` | [`patterns/bplist.hexpat`](patterns/bplist.hexpat) | Apple's binary property list format (bplist) | | BSP | | [`patterns/bsp_goldsrc.hexpat`](patterns/bsp_goldsrc.hexpat) | GoldSrc engine maps format (used in Half-Life 1) | | BZIP3 | | [`patterns/bzip3.hexpat`](patterns/bzip3.hexpat) | GoldSrc engine maps format (used in Half-Life 1) | | CCHVA | | [`patterns/cchva.hexpat`](patterns/cchva.hexpat) | Command and Conquer Voxel Animation | | CCVXL | | [`patterns/ccvxl.hexpat`](patterns/ccvxl.hexpat) | Command and Conquer Voxel Model | | CCPAL | | [`patterns/ccpal.hexpat`](patterns/ccpal.hexpat) | Command and Conquer Voxel Palette | | CDA | | [`patterns/cda.hexpat`](patterns/cda.hexpat) | Compact Disc Audio track | -| CHM | | [`patterns/chm.hexpat`](patterns/chm.hexpat) | Windows HtmlHelp Data (ITSF / CHM) | +| CHM | `application/vnd.ms-htmlhelp` | [`patterns/chm.hexpat`](patterns/chm.hexpat) | Windows HtmlHelp Data (ITSF / CHM) | | COFF | `application/x-coff` | [`patterns/coff.hexpat`](patterns/coff.hexpat) | Common Object File Format (COFF) executable | | CPIO | `application/x-cpio` | [`patterns/cpio.hexpat`](patterns/cpio.hexpat) | Old Binary CPIO Format | | CrashLvl | | [`patterns/Crashlvl.hexpat`](patterns/Crashlvl.hexpat) | Crash Bandicoot - Back in Time (fan game) User created level format | @@ -64,13 +64,13 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi | DTA | | [`patterns/max_v104.hexpat`](patterns/max_v104.hexpat) | Mechanized Assault and Exploration v1.04 (strategy game) save file format | | DTED | | [`patterns/dted.hexpat`](patterns/dted.hexpat) | Digital Terrain Elevation Data (DTED) | | ELF | `application/x-executable` | [`patterns/elf.hexpat`](patterns/elf.hexpat) | ELF header in elf binaries | -| EVTX | | [`patterns/evtx.hexpat`](patterns/evtx.hexpat) | MS Windows Vista Event Log | +| EVTX | `application/x-ms-evtx` | [`patterns/evtx.hexpat`](patterns/evtx.hexpat) | MS Windows Vista Event Log | | EXT4 | | [`patterns/ext4.hexpat`](patterns/ext4.hexpat) | Ext4 filesystem | | FAS | | [`patterns/fas_oskasoftware.hexpat`](patterns/fas_oskasoftware.hexpat) [`patterns/fas_oskasoftware_old.hexpat`](patterns/fas_oskasoftware_old.hexpat) (Old versions of Oska DeskMate) | Oska Software DeskMates FAS (Frames and Sequences) file | | FBX | | [`patterns/fbx.hexpat`](patterns/fbx.hexpat) | Kaydara FBX Binary | | FDT | | [`patterns/fdt.hexpat`](patterns/fdt.hexpat) | Flat Linux Device Tree blob | | FFX | | [`patterns/ffx/*`](https://gitlab.com/EvelynTSMG/imhex-ffx-pats) | Various Final Fantasy X files | -| File System | | [`patterns/fs.hexpat`](patterns/fs.hexpat) | Drive File System | +| File System | `application/x-ima` | [`patterns/fs.hexpat`](patterns/fs.hexpat) | Drive File System | | FLAC | `audio/flac` | [`patterns/flac.hexpat`](patterns/flac.hexpat) | Free Lossless Audio Codec, FLAC Audio Format | | Flipper Zero Settings | | [`patterns/flipper_settings.hexpat`](patterns/flipper_settings.hexpat) | Flipper Zero Settings Files | | GB | `application/x-gameboy-rom` | [`patterns/gb.hexpat`](patterns/gb.hexpat) | Game Boy ROM | @@ -88,7 +88,7 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi | Intel HEX | | [`patterns/intel_hex.hexpat`](patterns/intel_hex.hexpat) | [Intel hexadecimal object file format definition]("https://en.wikipedia.org/wiki/Intel_HEX") | | IP | | [`patterns/ip.hexpat`](patterns/ip.hexpat) | Ethernet II Frames (IP Packets) | | IPS | | [`patterns/ips.hexpat`](patterns/ips.hexpat) | IPS (International Patching System) files | -| ISO | | [`patterns/iso.hexpat`](patterns/iso.hexpat) | ISO 9660 file system | +| ISO | `application/x-iso9660-image` | [`patterns/iso.hexpat`](patterns/iso.hexpat) | ISO 9660 file system | | Java Class | `application/x-java-applet` | [`patterns/java_class.hexpat`](patterns/java_class.hexpat) | Java Class files | | JPEG | `image/jpeg` | [`patterns/jpeg.hexpat`](patterns/jpeg.hexpat) | JPEG Image Format | | LOC | | [`patterns/loc.hexpat`](patterns/loc.hexpat) | Minecraft Legacy Console Edition Language file | @@ -106,8 +106,8 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi | MSSCMP | | [`patterns/msscmp.hexpat`](patterns/msscmp.hexpat) | Miles Sound System Compressed Archive | | NACP | | [`patterns/nacp.hexpat`](patterns/nacp.hexpat) | Nintendo Switch NACP files | | NBT | | [`patterns/nbt.hexpat`](patterns/nbt.hexpat) | Minecraft NBT format | -| NE | | [`patterns/ne.hexpat`](patterns/ne.hexpat) | NE header and Standard NE fields | -| nes | | [`patterns/nes.hexpat`](patterns/nes.hexpat) | .nes file format | +| NE | `application/x-ms-ne-executable` | [`patterns/ne.hexpat`](patterns/ne.hexpat) | NE header and Standard NE fields | +| nes | | [`patterns/nes.hexpat`](patterns/nes.hexpat) | .nes file format | | NotepadCache | | [`patterns/notepad-cache.hexpat`](patterns/notepad-cache.hexpat) | Windows Notepad Cache | | NotepadWindowState | | [`patterns/notepadwindowstate.hexpat`](patterns/notepadwindowstate.hexpat) | Windows 11 Notepad - Window State .bin file | | NRO | | [`patterns/nro.hexpat`](patterns/nro.hexpat) | Nintendo Switch NRO files | @@ -117,8 +117,8 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi | PCAP | `application/vnd.tcpdump.pcap` | [`patterns/pcap.hexpat`](patterns/pcap.hexpat) | pcap header and packets | | PCK | | [`patterns/pck.hexpat`](patterns/pck.hexpat) | Minecraft Legacy Console Edition .pck file | | PCX | `application/x-pcx` | [`patterns/pcx.hexpat`](patterns/pcx.hexpat) | PCX Image format | -| PE | `application/x-dosexec` `application/x-msdownload` | [`patterns/pe.hexpat`](patterns/pe.hexpat) | PE header, COFF header, Standard COFF fields and Windows Specific fields | -| PP | | [`patterns/selinuxpp.hexpat`](patterns/selinuxpp.pat) | SE Linux package | +| PE | `application/x-dosexec` `application/x-msdownload` | [`patterns/pe.hexpat`](patterns/pe.hexpat) | PE header, COFF header, Standard COFF fields and Windows Specific fields | +| PP | | [`patterns/selinuxpp.hexpat`](patterns/selinuxpp.pat) | SE Linux package | | PFS0 | | [`patterns/pfs0.hexpat`](patterns/pfs0.hexpat) | Nintendo Switch PFS0 archive (NSP files) | | PIF | `image/pif` | [`patterns/pif.hexpat`](patterns/pif.hexpat) | PIF Image Format | | PKM | | [`patterns/pkm.hexpat`](patterns/pkm.hexpat) | PKM texture format | @@ -127,12 +127,12 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi | Protobuf | | [`patterns/protobuf.hexpat`](patterns/protobuf.hexpat) | Google Protobuf encoding | | psafe3 | | [`patterns/psafe3.hexpat`](patterns/psafe3.hexpat`) | Password Safe V3 | | PyInstaller | | [`patterns/pyinstaller.hexpat`](patterns/pyinstaller.hexpat) | PyInstaller binray files | -| PYC | | [`patterns/pyc.hexpat`](patterns/pyc.hexpat) | Python bytecode files | +| PYC | `application/x-bytecode.python` | [`patterns/pyc.hexpat`](patterns/pyc.hexpat) | Python bytecode files | | QBCL | | [`patterns/qbcl.hexpat`](patterns/qbcl.hexpat) | Qubicle voxel scene project file | -| QOI | `image/qoi` | [`patterns/qoi.hexpat`](patterns/qoi.hexpat) | QOI image files | +| QOI | `image/qoi` | [`patterns/qoi.hexpat`](patterns/qoi.hexpat) | QOI image files | | quantized-mesh | | [`patterns/quantized-mesh.hexpat`](patterns/quantized-mesh.hexpat) | Cesium quantized-mesh terrain | | RAR | `application/x-rar` | [`patterns/rar.hexpat`](patterns/rar.hexpat) | RAR archive file format | -| RAS | `image/x-sun-raster` | [`patterns/ras.hexpat`](patterns/ras.hexpat) | RAS image files | +| RAS | `image/x-sun-raster` | [`patterns/ras.hexpat`](patterns/ras.hexpat) | RAS image files | | ReFS | | [`patterns/refs.hexpat`](patterns/refs.hexpat) | Microsoft Resilient File System | | RGBDS | | [`patterns/rgbds.hexpat`](patterns/rgbds.hexpat) | [RGBDS](https://rgbds.gbdev.io) object file format | | Shell Link | `application/x-ms-shortcut` | [`patterns/lnk.hexpat`](patterns/lnk.hexpat) | Windows Shell Link file format | @@ -143,7 +143,7 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi | STL | `model/stl` | [`patterns/stl.hexpat`](patterns/stl.hexpat) | STL 3D Model format | | StuffItV5 | `application/x-stuffit` | [`patterns/sit5.hexpat`](patterns/sit5.hexpat) | StuffIt V5 archive | | SQLite3 | `application/vnd.sqlite3` | [`patterns/sqlite3.hexpat`](patterns/sqlite3.hexpat) | SQLite3 Database | -| SWF | |[`patterns/swf.hexpat`](patterns/swf.hexpat) | Shockwave Flash file format | +| SWF | `application/x-shockwave-flash` |[`patterns/swf.hexpat`](patterns/swf.hexpat) | Shockwave Flash file format | | TAR | `application/x-tar` | [`patterns/tar.hexpat`](patterns/tar.hexpat) | Tar file format | | TES | | [`patterns/wintec_tes.hexpat`](patterns/wintec_tes.hexpat) | Wintec TES GPS log | | TIFF | `image/tiff` | [`patterns/tiff.hexpat`](patterns/tiff.hexpat) | Tag Image File Format | @@ -166,7 +166,7 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi | XCI | | [`patterns/xci.hexpat`](patterns/xci.hexpat) | Nintendo Switch XCI cartridge ROM | | XGT | | [`patterns/xgt.hexpat`](patterns/xgstexture.hexpat) | Exient XGS Engine Texture | | Xilinx BIT | | [`patterns/xilinx_bit.hexpat`](patterns/xilinx_bit.hexpat) | Xilinx FPGA Bitstreams | -| Xilinx Bootgen | | [`patterns/xilinx_bootgen.hexpat`](patterns/xilinx_bootgen.hexpat) | Xilinx ZynqMP Boot Images | +| Xilinx Bootgen | `application/x-xilinx-boot-zynqmp` | [`patterns/xilinx_bootgen.hexpat`](patterns/xilinx_bootgen.hexpat) | Xilinx ZynqMP Boot Images | | ZIP | `application/zip` | [`patterns/zip.hexpat`](patterns/zip.hexpat) | End of Central Directory Header, Central Directory File Headers | | ZLIB | `application/zlib` | [`patterns/zlib.hexpat`](patterns/zlib.hexpat) | ZLIB compressed data format | | ZSTD | `application/zstd` | [`patterns/zstd.hexpat`](patterns/zstd.hexpat) | Zstandard compressed data format | diff --git a/patterns/Crashlvl.hexpat b/patterns/Crashlvl.hexpat index a3db781..c01d794 100644 --- a/patterns/Crashlvl.hexpat +++ b/patterns/Crashlvl.hexpat @@ -1,5 +1,6 @@ #pragma author AdventureT #pragma description Crash Bandicoot - Back in Time (fan game) User created level +#pragma magic [ 43 52 41 53 48 4C 56 4C ] @ 0x00 #pragma history #pragma 0.3 2024-05-15 Added support for version 0.95 #pragma 0.2 2023-10-29 Added support for version 0.94c diff --git a/patterns/adts.hexpat b/patterns/adts.hexpat index 85b23a1..3058497 100644 --- a/patterns/adts.hexpat +++ b/patterns/adts.hexpat @@ -1,6 +1,6 @@ #pragma author zhoubo #pragma description AAC ADTSn (Audio Data Transport Stream) Audio -#pragma magic [ FF F? ] @ 0x00 +#pragma MIME audio/x-hx-aac-adts #pragma pattern_limit 0xFFFFFF // History diff --git a/patterns/afe2.hexpat b/patterns/afe2.hexpat index 76b293d..c8a1fed 100644 --- a/patterns/afe2.hexpat +++ b/patterns/afe2.hexpat @@ -1,6 +1,10 @@ #pragma author WerWolv #pragma description Nintendo Switch Atmosphère CFW Fatal Error log +#pramga magic [ 41 46 45 30 ] @ 0x00 +#pramga magic [ 41 46 45 31 ] @ 0x00 +#pramga magic [ 41 46 45 32 ] @ 0x00 + #pragma endian little import std.io; diff --git a/patterns/bgcode.hexpat b/patterns/bgcode.hexpat index fd4c2f9..65c823b 100644 --- a/patterns/bgcode.hexpat +++ b/patterns/bgcode.hexpat @@ -1,5 +1,6 @@ #pragma author Shadlock0133 (aka Aurora) / WerWolv #pragma description Prusa Binary G-Code +#pragma magic [ 47 43 44 45 ] @ 0x00 import type.magic; import std.mem; diff --git a/patterns/bplist.hexpat b/patterns/bplist.hexpat index 0a49f91..e8e8a0b 100644 --- a/patterns/bplist.hexpat +++ b/patterns/bplist.hexpat @@ -1,4 +1,5 @@ #pragma description Apple binary property list +#pragma MIME application/x-bplist import std.math; import std.core; diff --git a/patterns/cda.hexpat b/patterns/cda.hexpat index c819414..c068b40 100644 --- a/patterns/cda.hexpat +++ b/patterns/cda.hexpat @@ -1,29 +1,29 @@ #pragma description Compact Disc Audio track +#pragma magic [ 52 49 46 46 ] @ 0x00 struct Header { -u32 RIFF; -s32 size; -u32 CDDA; -u32 fmt; -u32 lenghtofthechunck; -u16 versionofcdformat; -u16 numberofrange; -u32 identifier; + u32 RIFF; + s32 size; + u32 CDDA; + u32 fmt; + u32 lenghtofthechunck; + u16 versionofcdformat; + u16 numberofrange; + u32 identifier; }; struct DataInfo { - -u32 range; -u32 duration; -u8 rangepositionframes; -u8 rangepositionseconds; -u8 rangepositionminutes; -u8 nullbyte; -u8 durationtrackframes; -u8 durationtrackseconds; -u8 durationtrackminutes; -u8 nullbytee; + u32 range; + u32 duration; + u8 rangepositionframes; + u8 rangepositionseconds; + u8 rangepositionminutes; + u8 nullbyte; + u8 durationtrackframes; + u8 durationtrackseconds; + u8 durationtrackminutes; + u8 nullbytee; }; diff --git a/patterns/chm.hexpat b/patterns/chm.hexpat index 6b29237..954ff3a 100644 --- a/patterns/chm.hexpat +++ b/patterns/chm.hexpat @@ -1,5 +1,6 @@ #pragma author WerWolv #pragma description Windows HtmlHelp Data (ITSF / CHM) +#pragma MIME application/vnd.ms-htmlhelp import type.magic; import type.size; diff --git a/patterns/dex.hexpat b/patterns/dex.hexpat index 6598e0c..ad53574 100644 --- a/patterns/dex.hexpat +++ b/patterns/dex.hexpat @@ -1,4 +1,5 @@ #pragma description Dalvik EXecutable +#pragma magic [ 64 65 78 0A ?? ?? ?? 00 ] import type.leb128; diff --git a/patterns/dmg.hexpat b/patterns/dmg.hexpat index 3d513d6..f8b32c6 100644 --- a/patterns/dmg.hexpat +++ b/patterns/dmg.hexpat @@ -1,4 +1,5 @@ #pragma description Apple Disk Image Trailer (DMG) +#pragma magic [ 6B 6F 6C 79 ] @ -512 #pragma endian big diff --git a/patterns/dmp64.hexpat b/patterns/dmp64.hexpat index f70fb12..c9083e9 100644 --- a/patterns/dmp64.hexpat +++ b/patterns/dmp64.hexpat @@ -1,4 +1,4 @@ -#pragma magic [50 41 47 45] // PAGE +#pragma magic [ 50 41 47 45 ] @ 0x00 // PAGE #pragma author "5h4rrK" #pragma description "KERNEL DUMP" @@ -99,4 +99,4 @@ struct DUMP_HEADER64 { }; -DUMP_HEADER64 dmp @0x00 [[name("DumpHeader")]]; +DUMP_HEADER64 dmp @ 0x00 [[name("DumpHeader")]]; diff --git a/patterns/dsstore.hexpat b/patterns/dsstore.hexpat index 1df0a78..7d3970b 100644 --- a/patterns/dsstore.hexpat +++ b/patterns/dsstore.hexpat @@ -1,4 +1,5 @@ #pragma description macOS .DS_Store +#pragma magic [ 42 75 64 31 ] @ 0x04 // Apple macOS .DS_Store format #pragma endian big diff --git a/patterns/dted.hexpat b/patterns/dted.hexpat index 9cc45ff..c45c7d9 100644 --- a/patterns/dted.hexpat +++ b/patterns/dted.hexpat @@ -1,6 +1,8 @@ #pragma description Digital Terrain Elevation Data #pragma endian big +#pragma magic [ 4C 48 55 ] @ 0x00 + import std.core; import std.io; import std.mem; diff --git a/patterns/evtx.hexpat b/patterns/evtx.hexpat index aecb190..674aa3d 100644 --- a/patterns/evtx.hexpat +++ b/patterns/evtx.hexpat @@ -1,5 +1,5 @@ #pragma description MS Windows Vista Event Log - +#pragma MIME application/x-ms-evtx #pragma endian little struct Header { diff --git a/patterns/fdt.hexpat b/patterns/fdt.hexpat index f93c302..691b5d1 100644 --- a/patterns/fdt.hexpat +++ b/patterns/fdt.hexpat @@ -1,5 +1,6 @@ #pragma author WerWolv #pragma description Flat Linux Device Tree blob +#pragma magic [ D0 0D FE ED ] @ 0x00 #pragma endian big diff --git a/patterns/flac.hexpat b/patterns/flac.hexpat index 7de7fe0..e5d20fe 100644 --- a/patterns/flac.hexpat +++ b/patterns/flac.hexpat @@ -1,5 +1,6 @@ #pragma author WerWolv #pragma description Free Lossless Audio Codec, FLAC Audio Format +#pragma MIME audio/flac import std.sys; import std.core; diff --git a/patterns/fs.hexpat b/patterns/fs.hexpat index bed3101..e261c5a 100644 --- a/patterns/fs.hexpat +++ b/patterns/fs.hexpat @@ -1,5 +1,6 @@ #pragma author WerWolv #pragma description Drive File System +#pragma MIME application/x-ima import std.io; import std.core; diff --git a/patterns/hinf_luas.hexpat b/patterns/hinf_luas.hexpat index e9aa7d5..9a628fb 100644 --- a/patterns/hinf_luas.hexpat +++ b/patterns/hinf_luas.hexpat @@ -1,5 +1,6 @@ #pragma author Surasia #pragma description Halo Infinite HavokScript 5.1 "luas" +#pragma magic [ 75 63 73 68 ] @ 0x00 import std.io; import std.mem; diff --git a/patterns/hinf_module.hexpat b/patterns/hinf_module.hexpat index c60fbe6..edd773c 100644 --- a/patterns/hinf_module.hexpat +++ b/patterns/hinf_module.hexpat @@ -1,7 +1,8 @@ #pragma author Surasia #pragma description Halo Infinite Module -#pragma array_limit 4294967295 -#pragma pattern_limit 4294967295 +#pragma array_limit 0 +#pragma pattern_limit 0 +#pragma magic [ 6D 6F 68 64 ] @ 0x00 import std.string; diff --git a/patterns/hinf_tag.hexpat b/patterns/hinf_tag.hexpat index 40a354b..80c35c1 100644 --- a/patterns/hinf_tag.hexpat +++ b/patterns/hinf_tag.hexpat @@ -1,5 +1,6 @@ #pragma author Surasia #pragma description Halo Infinite Tag +#pragma magic [ 75 63 73 68 ] @ 0x00 import std.string; import type.guid; diff --git a/patterns/hsdt.hexpat b/patterns/hsdt.hexpat index d15b898..6a2a189 100644 --- a/patterns/hsdt.hexpat +++ b/patterns/hsdt.hexpat @@ -2,9 +2,11 @@ #pragma author xtex #pragma description HiSilicon HSDT device-tree table +#pragma endian little +#pragma magic [ 48 53 44 54 ] @ 0x00 + import std.sys; import std.mem; -#pragma endian little u32 dt_hdr_offset; if (std::mem::read_unsigned(4096, 4, std::mem::Endian::Little) == 0x54445348) { diff --git a/patterns/intel_hex.hexpat b/patterns/intel_hex.hexpat index c4add24..8a6a57b 100644 --- a/patterns/intel_hex.hexpat +++ b/patterns/intel_hex.hexpat @@ -7,6 +7,7 @@ * values */ #pragma endian big +#pragma MIME text/x-hex import std.mem; diff --git a/patterns/ips.hexpat b/patterns/ips.hexpat index bbdfb70..bccee99 100644 --- a/patterns/ips.hexpat +++ b/patterns/ips.hexpat @@ -1,5 +1,6 @@ #pragma author gmestanley #pragma description IPS (International Patching System) +#pragma magic [ 50 41 54 43 48 ] @ 0x00 #pragma endian big diff --git a/patterns/iso.hexpat b/patterns/iso.hexpat index b1983f7..8845060 100644 --- a/patterns/iso.hexpat +++ b/patterns/iso.hexpat @@ -1,4 +1,5 @@ #pragma description ISO 9660 file system +#pragma MIME application/x-iso9660-image #pragma endian little diff --git a/patterns/loc.hexpat b/patterns/loc.hexpat index 3b5a8ae..03466aa 100644 --- a/patterns/loc.hexpat +++ b/patterns/loc.hexpat @@ -2,8 +2,8 @@ #pragma description Minecraft LCE LOC file #pragma endian big -#pragma array_limit 739845729834 -#pragma pattern_limit 34893726894 +#pragma array_limit 0 +#pragma pattern_limit 0 import std.string; diff --git a/patterns/lua51.hexpat b/patterns/lua51.hexpat index a1bbbdd..83bf0db 100644 --- a/patterns/lua51.hexpat +++ b/patterns/lua51.hexpat @@ -1,4 +1,5 @@ #pragma description Lua 5.1 bytecode +#pragma magic [ 1B 4C 75 61 51 ] @ 0x00 import std.io; diff --git a/patterns/lua52.hexpat b/patterns/lua52.hexpat index 5fd3bb4..2656801 100644 --- a/patterns/lua52.hexpat +++ b/patterns/lua52.hexpat @@ -1,4 +1,5 @@ #pragma description Lua 5.2 bytecode +#pragma magic [ 1B 4C 75 61 52 ] @ 0x00 import std.io; import std.mem; diff --git a/patterns/lua53.hexpat b/patterns/lua53.hexpat index f05d33a..12ef685 100644 --- a/patterns/lua53.hexpat +++ b/patterns/lua53.hexpat @@ -1,4 +1,5 @@ #pragma description Lua 5.3 bytecode +#pragma magic [ 1B 4C 75 61 53 ] @ 0x00 import std.io; import type.base; diff --git a/patterns/lua54.hexpat b/patterns/lua54.hexpat index 0810dec..ada3c22 100644 --- a/patterns/lua54.hexpat +++ b/patterns/lua54.hexpat @@ -1,4 +1,5 @@ #pragma description Lua 5.4 bytecode +#pragma magic [ 1B 4C 75 61 54 ] @ 0x00 import std.io; import std.mem; diff --git a/patterns/max_v104.hexpat b/patterns/max_v104.hexpat index 8f5735d..9930555 100644 --- a/patterns/max_v104.hexpat +++ b/patterns/max_v104.hexpat @@ -3,8 +3,8 @@ import std.sys; import std.mem; -#pragma array_limit 12544 -#pragma pattern_limit 2000000 +#pragma array_limit 0 +#pragma pattern_limit 0 #pragma eval_depth 32 enum FileType : u8 diff --git a/patterns/msscmp.hexpat b/patterns/msscmp.hexpat index 81d354f..1ecca9d 100644 --- a/patterns/msscmp.hexpat +++ b/patterns/msscmp.hexpat @@ -2,8 +2,8 @@ #pragma description MSSCMP (Miles Sound System Compressed Archive) #pragma magic [ 42 41 4E 4B ] @ 0x00 #pragma magic [ 4B 4E 41 42 ] @ 0x00 -#pragma array_limit 4294967295 -#pragma pattern_limit 4294967295 +#pragma array_limit 0 +#pragma pattern_limit 0 import type.magic; import std.core; diff --git a/patterns/ne.hexpat b/patterns/ne.hexpat index 637ffe5..3cae5c2 100644 --- a/patterns/ne.hexpat +++ b/patterns/ne.hexpat @@ -1,4 +1,5 @@ #pragma description Microsoft DOS NE executable +#pragma MIME application/x-ms-ne-executable import std.mem; diff --git a/patterns/nes.hexpat b/patterns/nes.hexpat index 8f1747f..1fdce89 100644 --- a/patterns/nes.hexpat +++ b/patterns/nes.hexpat @@ -1,5 +1,6 @@ #pragma author gmestanley #pragma description Nintendo Entertainment System ROM (.nes) +#pragma MIME application/x-nes-rom import std.mem; import std.string; diff --git a/patterns/notepad-cache.hexpat b/patterns/notepad-cache.hexpat index d5a3cc2..cb6f686 100644 --- a/patterns/notepad-cache.hexpat +++ b/patterns/notepad-cache.hexpat @@ -1,5 +1,6 @@ #pragma author sethhall #pragma description Windows Notepad Cache Files +#pragma magic [ 4E 50 00 ] @ 0x00 // This was written based on the following blog post: // https://u0041.co/posts/articals/exploring-windows-artifacts-notepad-files/ diff --git a/patterns/notepadwindowstate.hexpat b/patterns/notepadwindowstate.hexpat index 24afb1b..afd840f 100644 --- a/patterns/notepadwindowstate.hexpat +++ b/patterns/notepadwindowstate.hexpat @@ -1,5 +1,6 @@ #pragma author ogmini https://github.com/ogmini #pragma description Windows 11 Notepad Window State file +#pragma magic [ 4E 50 ] @ 0x00 // File found at %localappdata%/Packages/Microsoft.WindowsNotepad_8wekyb3d8bbwe/LocalState/WindowState #include diff --git a/patterns/nro.hexpat b/patterns/nro.hexpat index 2f39553..057a7fd 100644 --- a/patterns/nro.hexpat +++ b/patterns/nro.hexpat @@ -1,5 +1,6 @@ #pragma author WerWolv #pragma description Nintendo Switch NRO +#pragma magic [ 4E 52 4F 30 ] @ 0x10 import std.io; import std.sys; diff --git a/patterns/pbz.hexpat b/patterns/pbz.hexpat index 7026113..e90098d 100644 --- a/patterns/pbz.hexpat +++ b/patterns/pbz.hexpat @@ -8,6 +8,7 @@ #pragma author Nicolás Alvarez #pragma description Apple pbz +#pragma magic [ 70 62 7A ] @ 0x00 import std.mem; import type.magic; diff --git a/patterns/pfs0.hexpat b/patterns/pfs0.hexpat index ca63700..f9b3da5 100644 --- a/patterns/pfs0.hexpat +++ b/patterns/pfs0.hexpat @@ -1,5 +1,6 @@ #pragma author WerWolv #pragma description Nintendo Switch PFS0 archive (.nsp) +#pragma magic [ 50 46 53 30 ] @ 0x00 import type.magic; import type.size; diff --git a/patterns/pkm.hexpat b/patterns/pkm.hexpat index 7751dc3..6339c73 100644 --- a/patterns/pkm.hexpat +++ b/patterns/pkm.hexpat @@ -1,6 +1,7 @@ #pragma author applecuckoo #pragma description PKM (PacKMan) files containing ETC (Ericsson Texture Compression) #pragma endian big +#pragma magic [ 50 4B 4D 20 ] @ 0x00 enum PKMFormat : u16 { ETC1_RGB_NO_MIPMAPS, diff --git a/patterns/prodinfo.hexpat b/patterns/prodinfo.hexpat index bb315c5..a4b941c 100644 --- a/patterns/prodinfo.hexpat +++ b/patterns/prodinfo.hexpat @@ -1,5 +1,6 @@ #pragma author WerWolv #pragma description Nintendo Switch PRODINFO +#pragma magic [ 43 41 4C 30 ] @ 0x00 enum Model : u16 { NX = 1 diff --git a/patterns/psafe3.hexpat b/patterns/psafe3.hexpat index eb3ecb7..72eb589 100644 --- a/patterns/psafe3.hexpat +++ b/patterns/psafe3.hexpat @@ -3,6 +3,7 @@ #pragma endian little #pragma description Password Safe V3 +#pragma magic [ 50 57 53 33 ] @ 0x00 import std.mem; import std.sys; diff --git a/patterns/pyc.hexpat b/patterns/pyc.hexpat index edefd85..e747a39 100644 --- a/patterns/pyc.hexpat +++ b/patterns/pyc.hexpat @@ -1,4 +1,5 @@ #pragma description Python bytecode +#pragma MIME application/x-bytecode.python import type.time; import std.mem; diff --git a/patterns/selinux.hexpat b/patterns/selinux.hexpat index 16b887b..c71727c 100644 --- a/patterns/selinux.hexpat +++ b/patterns/selinux.hexpat @@ -2,9 +2,11 @@ #pragma author Ange Albertini import std.sys; -#pragma pattern_limit 13107200 -#pragma array_limit 13107200 +#pragma pattern_limit 0 +#pragma array_limit 0 #pragma endian little +#pragma magic [ 8C FF 7C F9 ] @ 0x00 +#pragma magic [ 8D FF 7C F9 ] @ 0x00 u32 version; u32 symbols_count; diff --git a/patterns/selinuxpp.hexpat b/patterns/selinuxpp.hexpat index 6d0d3a5..23c8c35 100644 --- a/patterns/selinuxpp.hexpat +++ b/patterns/selinuxpp.hexpat @@ -4,6 +4,7 @@ // Extension: PP // https://github.com/SELinuxProject/selinux/blob/master/libsepol/src/module.c +#pragma magic [ 8F FF 7C F9 ] @ 0x00 #pragma endian little import std.sys; diff --git a/patterns/shp.hexpat b/patterns/shp.hexpat index 150b5c3..c8f7e6c 100644 --- a/patterns/shp.hexpat +++ b/patterns/shp.hexpat @@ -1,5 +1,6 @@ #pragma author Calcoph #pragma description ESRI shapefile +#pragma magic [ 00 00 27 0A ] @ 0x00 // Spec: // https://www.esri.com/content/dam/esrisites/sitecore-archive/Files/Pdfs/library/whitepapers/pdfs/shapefile.pdf diff --git a/patterns/shx.hexpat b/patterns/shx.hexpat index 1c20cd7..e61c960 100644 --- a/patterns/shx.hexpat +++ b/patterns/shx.hexpat @@ -1,5 +1,6 @@ #pragma author Calcoph #pragma description ESRI shapefile indices +#pragma magic [ 00 00 27 0A ] @ 0x00 // Spec: // https://www.esri.com/content/dam/esrisites/sitecore-archive/Files/Pdfs/library/whitepapers/pdfs/shapefile.pdf diff --git a/patterns/sup.hexpat b/patterns/sup.hexpat index 055bece..5fde5b1 100644 --- a/patterns/sup.hexpat +++ b/patterns/sup.hexpat @@ -1,6 +1,6 @@ #pragma description SUP Bluray Subtitle -#pragma magic [50 47] @ 0x00 +#pragma magic [ 50 47 ] @ 0x00 #pragma endian big import std.mem; diff --git a/patterns/swf.hexpat b/patterns/swf.hexpat index 525777e..04760f5 100644 --- a/patterns/swf.hexpat +++ b/patterns/swf.hexpat @@ -1,8 +1,9 @@ #pragma author saturnaliam #pragma description Shockwave Flash Movie (SWF) #pragma endian little -import type.magic; +#pragma MIME application/x-shockwave-flash +import type.magic; // RECTs are more complicated, but for the header, // this works fine. diff --git a/patterns/ubiquiti.hexpat b/patterns/ubiquiti.hexpat index e34ce3e..c35a394 100644 --- a/patterns/ubiquiti.hexpat +++ b/patterns/ubiquiti.hexpat @@ -1,6 +1,7 @@ #pragma description Ubiquiti Firmware (update) image #pragma endian big +#pragma magic [ 55 42 4E 54 ] @ 0x00 import std.mem; import std.sys; diff --git a/patterns/vbmeta.hexpat b/patterns/vbmeta.hexpat index 9681b08..72068c7 100644 --- a/patterns/vbmeta.hexpat +++ b/patterns/vbmeta.hexpat @@ -1,4 +1,5 @@ #pragma description Android VBMeta image +#pragma magic [ 41 56 42 30 ] @ 0x00 #pragma endian big import std.core; diff --git a/patterns/veado.hexpat b/patterns/veado.hexpat index 6ba7f64..cc69378 100644 --- a/patterns/veado.hexpat +++ b/patterns/veado.hexpat @@ -1,5 +1,6 @@ #pragma author bake -#pragma description veadotube mini avatar file +#pragma description Veadotube Mini Avatar File +#pragma magic [ 56 45 41 44 4F 54 55 42 45 ] @ 0x00 import std.mem; import std.io; diff --git a/patterns/wad.hexpat b/patterns/wad.hexpat index 42fb54b..cf5fc4e 100644 --- a/patterns/wad.hexpat +++ b/patterns/wad.hexpat @@ -1,5 +1,6 @@ #pragma author WerWolv #pragma description DOOM WAD Archive +#pragma magic [ 50 57 41 44 ] @ 0x00 import type.magic; import type.size; diff --git a/patterns/xci.hexpat b/patterns/xci.hexpat index 6c24f7a..e299c66 100644 --- a/patterns/xci.hexpat +++ b/patterns/xci.hexpat @@ -1,5 +1,6 @@ #pragma author WerWolv #pragma description Nintendo Switch XCI cartridge ROM +#pragma magic [ 48 46 53 30 ] @ 0x00 import std.core; diff --git a/patterns/xilinx_bootgen.hexpat b/patterns/xilinx_bootgen.hexpat index 3c620eb..5fb9b40 100644 --- a/patterns/xilinx_bootgen.hexpat +++ b/patterns/xilinx_bootgen.hexpat @@ -1,5 +1,6 @@ #pragma endian little #pragma description Xilinx Zynq UltraScale+ Boot Image +#pragma MIME application/x-xilinx-boot-zynqmp #pragma magic [ 58 4E 4C 58 ] @ 0x24 // Spec: Xilinx UG1283 https://docs.xilinx.com/r/en-US/ug1283-bootgen-user-guide/Zynq-UltraScale-MPSoC-Boot-and-Configuration