Skip to content

Commit c94d42d

Browse files
authored
patterns: Added Radcore Cement v1.2 file pattern (#382)
* Add Radcore Cement file pattern * Update pattern list in README.md
1 parent 45c4c1d commit c94d42d

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ Everything will immediately show up in ImHex's Content Store and gets bundled wi
140140
| quantized-mesh | | [`patterns/quantized-mesh.hexpat`](patterns/quantized-mesh.hexpat) | Cesium quantized-mesh terrain |
141141
| RAR | `application/x-rar` | [`patterns/rar.hexpat`](patterns/rar.hexpat) | RAR archive file format |
142142
| RAS | `image/x-sun-raster` | [`patterns/ras.hexpat`](patterns/ras.hexpat) | RAS image files |
143+
| RCF 1.2 | | [`patterns/rcf_v1_2.hexpat`](patterns/rcf_v1_2.hexpat) | Radcore Cement Library 1.2 file header |
143144
| ReFS | | [`patterns/refs.hexpat`](patterns/refs.hexpat) | Microsoft Resilient File System |
144145
| RGBDS | | [`patterns/rgbds.hexpat`](patterns/rgbds.hexpat) | [RGBDS](https://rgbds.gbdev.io) object file format |
145146
| RPM | | [`patterns/rpm.hexpat`](patterns/rpm.hexpat) | [RPM](http://ftp.rpm.org/max-rpm/s1-rpm-file-format-rpm-file-format.html) package file format |

patterns/rcf_v1_2.hexpat

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
// Ported from LRCFB @ https://donutteam.com/@lucasc190/releases
2+
// Tested with files from:
3+
// - Hulk (PS2)
4+
// - Tetris Worlds (Gamecube)
5+
// - The Simpsons Hit and Run (PC)
6+
7+
#pragma author blu
8+
#pragma description Radcore Cement Library file header (.rcf) v1.2
9+
10+
import std.core;
11+
import type.time;
12+
13+
struct DataEntry {
14+
u32 hash;
15+
u32 position;
16+
u32 size;
17+
};
18+
19+
struct NameEntry {
20+
le u32 length;
21+
char name[length];
22+
le type::time32_t time;
23+
};
24+
25+
struct Header {
26+
char signature[32];
27+
u8 version_major;
28+
u8 version_minor;
29+
bool is_bigendian; // true for gamecube
30+
u8 unk_0; //always "1" according to LRCFB
31+
if (is_bigendian) {
32+
std::core::set_endian(std::mem::Endian::Big);
33+
}
34+
u32 alignment;
35+
u32 unk_1;
36+
u32 directory_position;
37+
$ = directory_position;
38+
s32 data_count;
39+
u32 names_position;
40+
u32 data_position;
41+
le u32 data_pointer;
42+
DataEntry data_entries[data_count];
43+
$ = names_position;
44+
le u32 names_count;
45+
le u32 names_pointer;
46+
NameEntry name_entries[names_count];
47+
};
48+
49+
Header header @ 0x00;

0 commit comments

Comments
 (0)