LEGO Stunt Rally RFH/RFD extraction


2022-01-22

The game stores its files in a series of RFH/RFD files. RFHs contain the archive index; RFDs contain the raw data.

Some files are actually a 4-byte header followed by a raw DEFLATE stream. This should be decompressed upon extraction.

Extraction code can be found here (mirror).

RFH

This is simply a series of consecutive structs, each containing 20 bytes and a NULL-terminated C string.

Type Name Offset Purpose
uint32_t unk1 0 Unknown
uint32_t unk2 4 Unknown
uint32_t unk3 8 Unknown
uint32_t size 12 Size of the file in bytes.
uint32_t offset 16 Offset to the start of the file in the corresponding RFD.
char[] path 20 Full path and name of the file, using \ path separators.

stuntrally_index.bt

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
typedef uint32 uint32_t;

typedef struct SRIndexEntry {
    uint32_t unk1;
    uint32_t unk2;
    uint32_t unk3;
    uint32_t size;
    uint32_t offset;
    string path;
} SRIndexEntry;

struct {
    LittleEndian();
    while(!FEof()) {
        SRIndexEntry index;
    }
} x;

Music

The game’s music is stored as DirectMusic SGP files. This is a sequenced format which can be opened in DirectMusic Producer 9.

File Info

File Size SHA1
res/ART0001.RFH 298924 b16d66dc9ddb2c28bc64978955ae6bd11a3df82e
res/ART0001.RFD 78815447 2a2e8715e2782ced8ce9112defbf97d3c71bb659
res/CITY0001.RFH 29270 575b234c539bf7d68770cccf257fb569643f66ee
res/CITY0001.RFD 1091397 4dd020711bfe235a0aba9639841da30583674da7
res/DESERT0001.RFH 23346 cc718a15e41d234e9dfa1aa95c06bebab67eff6c
res/DESERT0001.RFD 1393167 b44f7bdbde9c7408e3be0d106c2f40bef323641b
res/ICE0001.RFH 26406 aca77e2e24abfaeb6530de1d77e737d0e4dbaa2f
res/ICE0001.RFD 1324889 c8e80ae80d09e6cabe4697db16ff7c7518cf28ae
res/JUNGLE0001.RFH 24749 09ea94e02273cdf2f3d7b2bceb52abecd6cf754b
res/JUNGLE0001.RFD 1681960 5b28fef47e0bd9db4e16b4757b4d39fc0a75166a
res/SPEECH0001.RFH 8508 048630fa75824e7032f009384e868499b42ba15a
res/SPEECH0001.RFD 9698913 dd74b30c21aff48fd106d0abe621edf496488b9e
res/TEXT0001.RFH 5245 d2bc5bc37cb279f49830cc365bbf465aac6628a0
res/TEXT0001.RFD 3528 029de4d1f63a7b3b747bab86cbb75fc1081c2f78