BIN Format (Chasm)

From ModdingWiki
Jump to: navigation, search
BIN Format (Chasm)
Format typeArchive
Max files65,535 ! test/confirm
File Allocation Table (FAT)Beginning
Filenames?Yes, 8.3
Supports compression?No
Supports encryption?No
Supports subdirectories?No
Hidden data?Yes

Chasm: The Rift archive format.

Archive header and TOC

Data type Name Description
char[4] id Archive ID string. Must be "CSid" string (not null-terminated)
INT16LE count Number of files in the archive

Immediately after the header is count records of the TOC data:

Data type Name Description
BYTE length File name length
char[12] name File name (only length chars used)
INT32LE size File size
INT32LE offs File offset (absolute)

Note that TOC actually larger (filled with zeros) and has room for the 2048 records. Also note that length+name - it's string type for Borland Pascal (Chasm is written in it). ! Is TOC somehow limited to 2048 items in total?

Notes and comments

Archive TOC contains only filenames. Because of that you can extract files from "CSM.BIN" to "CHASMDAT" folder and move out, rename or delete "CSM.BIN" (this forces game to use extracted files), but you MUST restore appropriate original path. For example file "LOADING.CEL" from the "CSM.BIN" must be saved as "CHASMDAT\COMMON\LOADING.CEL" in the game folder. See the file structure from the game addon folder.

Please note that this archive structure (since every different files in the game has it's uniquie name) allow to eleminate duplicates - for example in the game addon there are two exactly the same files:



But inside the game archive this will be only one file - "SWITCH5.WAV".


If you find this information helpful in a project you're working on, please give credit where credit is due. (A link back to this wiki would be nice too!)