summaryrefslogtreecommitdiff
path: root/patterns/tokenstore.pat
blob: 2d62fc2e2ce3b51e5208db8492487e046a573569 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
struct EntryContent {
    u8 header[32];
    u32 data_len;
    u8 sha256[32];
    u8 data[data_len];
    u8 footer[32];
};

struct Metadata {
    u32 entry_off;
    u32 populated;
    u32 content_off;
    u32 content_len;
    u32 alloc_len;
    char16 name[65];
    char16 ext[4];

    if (populated == 1) {
        EntryContent content @ content_off;
    }
};

struct Block {
    u32 self_off;
    u32 next_off;
    Metadata metadata[103];
    padding[16384 - sizeof(self_off) - sizeof(next_off) - sizeof(metadata)];
    u8 sha256[32];

    if (next_off != 0) {
        Block next @ next_off;
    }
};

struct FileHeader {
    u32 version;
    u8 sha256[32];
    Block block;
};

FileHeader fileheader @ 0x00;