Skip to content

Instantly share code, notes, and snippets.

@wisniewski94
Created January 27, 2024 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wisniewski94/286f80c7ac5eefbcb0a77f3bfd824e5b to your computer and use it in GitHub Desktop.
Save wisniewski94/286f80c7ac5eefbcb0a77f3bfd824e5b to your computer and use it in GitHub Desktop.
#include <std/core.pat>
enum Tables : u16 {
name = 4,
};
struct table_entry_t {
char name[4];
u32 offset;
u64 length;
};
struct header_t {
u8 signature[4];
std::core::set_endian(std::mem::Endian::Big);
u16 numTables;
u16 offset = 12;
table_entry_t entries[numTables] @offset;
};
header_t header @0x00 [[comment("TTF Signature"), name("Signature")]];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment