Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: pattern file for ImHex #46

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
47 changes: 47 additions & 0 deletions dissect.hexpat
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
#pragma endian little
#pragma pattern_limit 500000

#include <std/sys.pat>

struct HeaderProperty {
u8 keyLen [[name("Key Length")]];
padding[7];
char key[keyLen] [[name("Key")]];
u8 valueLen [[name("Value Length")]];
padding[7];
char value[valueLen] [[name("Value")]];
};

struct Header {
char magic[7] [[name("Magic"), comment("Decompressed Dissect files always start with this sequence.")]];
std::assert(magic == "dissect", "Incorrect magic");

padding[28];

u8 size [[name("Properties Size"), comment("The number of header properties.")]];
padding[7];
HeaderProperty properties[size] [[name("Properties")]];
};

Header header @0x00;

// unknown, contains incrementing numbers
struct InitTableItem {
u24 unknown;
u8 unknown2;
u8 unknown3;
u8 unknown4;
u8 unknown5;
padding[3];
u8 unknown6;
u8 unknown7;
};

struct InitTable {
padding[8];
u16 size;
padding[21];
InitTableItem items[size];
};

InitTable initTable @sizeof(header);