-
Notifications
You must be signed in to change notification settings - Fork 0
/
DPC.hexpat
64 lines (54 loc) · 1.48 KB
/
DPC.hexpat
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#pragma MIME application/x-dpc
#pragma pattern_limit 0
#include <std/core.pat>
#include <std/sys.pat>
#include <std/mem.pat>
struct BlockDescription {
u32 object_count;
u64 padded_size;
u64 data_size;
u64 working_buffer_offset;
};
struct Header {
char version[256];
u32 version_oneple; // Like the version triple but theres only one
u32 is_not_rtc;
u32 block_count;
u64 block_working_buffer_capacity_even;
u64 block_working_buffer_capacity_odd;
u64 total_padded_block_size;
BlockDescription block_descriptions[block_count];
std::mem::AlignTo<0x6E8>;
u64 block_sector_padding_size;
u64 pool_sector_padding_size;
std::assert(pool_sector_padding_size == 0, "pool_sector_padding_size != 0");
u64 file_size;
u64 total_decompressed_size;
u64 zero;
std::assert(zero == 0, "zero != 0");
u32 total_resource_count;
char time[0x14];
std::mem::AlignTo<2048>;
};
struct ObjectHeader {
u32 data_size;
u32 link_header_size;
u32 decompressed_size;
u32 compressed_size;
u32 class_name;
u32 object_name;
};
struct BlockObject {
ObjectHeader header;
u8 data[header.data_size];
};
struct Block {
BlockObject objects[parent.header.block_descriptions[std::core::array_index()].object_count];
std::mem::AlignTo<2048>;
};
struct RushBigFile {
Header header;
Block blocks[header.block_count];
};
RushBigFile rush_big_file @ 0x0;
std::assert(std::mem::eof(), "Whole input not consumed");