Furcadia/Specifications/File Formats/RCH

From FurcadiaWiki

Jump to: navigation, search

Contents

Credits

This text is based on [1]. Respective texts copyright © 2002 Morpius, Klass, Dia Sapphire, Hollyberry, Copper Dragon.

RCH Fileformat

RCH File Header

PositionSizeContents
04'FR01'
44Version
84Timestamp (time_t) They no longer use the timestamp, so it's usually 0
124Reserved (0)
164Reserved (0)
204Reserved (0)
244Reserved (0)
28-Filechunks (no way of telling how many)

RCH-File Chunk

PositionSizeDesc
02'FZ'
240Filename (blank=nulls)
424Version (of what, I wonder?)
464Timestamp (time_t) They no longer use the timestamp, so it's usually 0
504File size (int)
544File CRC-32
584compression_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.
Personal tools