forked from WerWolv/ImHex-Patterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrcf_v1_2.hexpat
More file actions
49 lines (43 loc) · 1.05 KB
/
rcf_v1_2.hexpat
File metadata and controls
49 lines (43 loc) · 1.05 KB
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
// Ported from LRCFB @ https://donutteam.com/@lucasc190/releases
// Tested with files from:
// - Hulk (PS2)
// - Tetris Worlds (Gamecube)
// - The Simpsons Hit and Run (PC)
#pragma author blu
#pragma description Radcore Cement Library file header (.rcf) v1.2
import std.core;
import type.time;
struct DataEntry {
u32 hash;
u32 position;
u32 size;
};
struct NameEntry {
le u32 length;
char name[length];
le type::time32_t time;
};
struct Header {
char signature[32];
u8 version_major;
u8 version_minor;
bool is_bigendian; // true for gamecube
u8 unk_0; //always "1" according to LRCFB
if (is_bigendian) {
std::core::set_endian(std::mem::Endian::Big);
}
u32 alignment;
u32 unk_1;
u32 directory_position;
$ = directory_position;
s32 data_count;
u32 names_position;
u32 data_position;
le u32 data_pointer;
DataEntry data_entries[data_count];
$ = names_position;
le u32 names_count;
le u32 names_pointer;
NameEntry name_entries[names_count];
};
Header header @ 0x00;