From c4c75a9ab2a7b6963e1d91426d157c84e929f20e Mon Sep 17 00:00:00 2001 From: mjarduk <66081585+mjarduk@users.noreply.github.com> Date: Mon, 25 Aug 2025 23:22:32 +0300 Subject: [PATCH] patterns: Add a pattern for Roblox .pack files (#435) * Added the .pack format * Clarified some fields by changing the naming --- README.md | 1 + patterns/roblox_pack.hexpat | 33 ++++++++++++++++++ .../test_data/roblox_pack.hexpat.pack | Bin 0 -> 116 bytes 3 files changed, 34 insertions(+) create mode 100644 patterns/roblox_pack.hexpat create mode 100644 tests/patterns/test_data/roblox_pack.hexpat.pack diff --git a/README.md b/README.md index c5459fc..03cefbd 100644 --- a/README.md +++ b/README.md @@ -128,6 +128,7 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi | NTFS | | [`patterns/fs/ntfs.hexpat`](patterns/fs/ntfs.hexpat) | NTFS (NT File System) | | OGG | `audio/ogg` | [`patterns/ogg.hexpat`](patterns/ogg.hexpat) | OGG Audio format | | ORP / ORS | | [`patterns/orp.hexpat`](patterns/orp.hexpat) | OpenRGB profile format | +| PACK | | [`patterns/roblox_pack.hexpat`](patterns/roblox_pack.hexpat) | Roblox shader archive format | | PAK | | [`patterns/xgspak.hexpat`](patterns/xgspak.hexpat) | Exient XGS Engine Pak files | | PCAP | `application/vnd.tcpdump.pcap` | [`patterns/pcap.hexpat`](patterns/pcap.hexpat) | pcap header and packets | | PcapNG | `application/vnd.tcpdump.pcap` | [`patterns/pcapng.hexpat`](patterns/pcapng.hexpat) | pcapng header and packets | diff --git a/patterns/roblox_pack.hexpat b/patterns/roblox_pack.hexpat new file mode 100644 index 0000000..2c63493 --- /dev/null +++ b/patterns/roblox_pack.hexpat @@ -0,0 +1,33 @@ +#pragma author marduk.ru +#pragma description Roblox .pack shader archive format +#pragma magic [ 52 42 58 53 ] @ 0x00 + +import std.string; +import hex.core; +import type.magic; + +struct Header { + type::Magic<"RBXS"> magic; + u32 fileCount; +}; + +struct FileIndex { + char name[0x40]; + u128 md5Hash; + u32 offset; + u32 size; + u64 reserved; + + u8 file[size] @ offset; + + #ifdef __IMHEX__ + hex::core::add_virtual_file(name, file); + #endif +} [[name(name)]]; + +struct RBXPack { + Header header; + FileIndex files[header.fileCount]; +}; + +RBXPack pack @ 0x0; \ No newline at end of file diff --git a/tests/patterns/test_data/roblox_pack.hexpat.pack b/tests/patterns/test_data/roblox_pack.hexpat.pack new file mode 100644 index 0000000000000000000000000000000000000000..99be9630cafaa6020a499159d310e24ec4cd1ab3 GIT binary patch literal 116 tcmWG?iU?+8U|