Skip to content
This repository has been archived by the owner on Feb 3, 2019. It is now read-only.

Latest commit

 

History

History
40 lines (32 loc) · 1.92 KB

README.md

File metadata and controls

40 lines (32 loc) · 1.92 KB

colobot-dat: read game data files from Colobot

This code is obsolete! The open-source Colobot project hasn't used the DAT container format since colobot/colobot@6cce7ec6; this code is of use to the historically curious only and shouldn't actually be used for anything. It especially shouldn't be used for anyone wanting a container file format, because this format is a terrible one; use tarballs or zip files instead.

Release builds of Ceebot and Colobot store their game files in DAT containers. This project consists of (1) a library for reading DAT files and (2) a command-line utility to extract files from a DAT container.

Library

Read a container file by passing an io.ReaderAt and a Codec to New(). A Codec XORs data in the container with a predefined table; Codecs for the demo and full versions of Ceebot and Colobot are included with the library. (The tables were extracted from the src/metafile.cpp of the original Colobot source.) The resulting Container contains a slice of Files, each of which has an io.SectionReader which will read the data from that file.

Command-line extractor

colobot-dat is an extractor for DAT files. Given a path to a DAT file, it will extract each file into the current directory, unless a file with the same name already exists. (If the -l flag is given, only list the files. If the -v flag is also given, list the start and end offsets for each file.) The codec can be specified with the -H flag and is one of ceebot, ceebot-demo, colobot (the default), colobot-demo, and none (which does not decode the file).