Furcadia/Specifications/File Formats/RCH
From FurcadiaWiki
< Furcadia | Specifications | File Formats(Redirected from Furcadia/Furcadia Specifications/File Formats/RCH)
Contents |
Credits
This text is based on [1]. Respective texts copyright © 2002 Morpius, Klass, Dia Sapphire, Hollyberry, Copper Dragon.
RCH Fileformat
RCH File Header
| Position | Size | Contents | |
| 0 | 4 | 'FR01' | |
| 4 | 4 | Version | |
| 8 | 4 | Timestamp (time_t) They no longer use the timestamp, so it's usually 0 | |
| 12 | 4 | Reserved (0) | |
| 16 | 4 | Reserved (0) | |
| 20 | 4 | Reserved (0) | |
| 24 | 4 | Reserved (0) | |
| 28 | - | Filechunks (no way of telling how many) |
RCH-File Chunk
| Position | Size | Desc | |
| 0 | 2 | 'FZ' | |
| 2 | 40 | Filename (blank=nulls) | |
| 42 | 4 | Version (of what, I wonder?) | |
| 46 | 4 | Timestamp (time_t) They no longer use the timestamp, so it's usually 0 | |
| 50 | 4 | File size (int) | |
| 54 | 4 | File CRC-32 | |
| 58 | 4 | compression_algo | |
| 62 | - | Compressed Data (see below) |
The data is "compressed" one of three ways.
- If the compression_algo is 0, XOR the data by 0xFF, then run the result through the lzw decompression algo written by David Bourgin's. This algo is avaiable as dcodlzw.c One way to decomress the data is to save the the data block to a file, xor'ing each byte by 0xFF before writing the byte to the file, then run dcodlzw on the file. Compile dcodlzw.c with the default settings: 12 bit blocks, with TYPE_GIF_ENCODING and AUTO_REINT_DIC defined.
- If the compression_algo is 1, then you simply start reading File_size bytes at the data block, and then XOR each byte by 0xFF and save it to a file.
- If the compression_algo is 2, then the data is compressed with bzip2. Use standard bzip2 compression to decompress. One way is to save the data to a file, then call bzip2 on the file.

