Doofus Game Data Format

From ModdingWiki
Jump to navigation Jump to search
Doofus Game Data Format
Format typeArchive
Max filesUnlimited
File Allocation Table (FAT)External
Filenames?No
Metadata?None
Supports compression?Yes
Supports encryption?No
Supports subdirectories?No
Hidden data?No
Games

The Doofus Game Data Format is used by Doofus to store much of the game's data.

File format

Signature

There is no signature, but since some file entries begin with the letters "GB", this could be used to identify files, by checking to see whether these characters appear at the expected locations. The music files also start with "TBSA0.01".

FAT

The File Allocation Table (FAT) is stored in doofus.exe.

EXE version FAT offset Identification method
1.0 0x15372 0xFB10 contains text "The Bone Shaker Architect", after reversing PKLite compression

The FAT consists of the following structure, repeated 65 times. There are another four 0x00 bytes following this, but it is unknown whether these belong to the FAT (as a final terminator) or whether they belong to the data following the FAT.

Data type Name Description
UINT16LE length Length of file data, in bytes
UINT16LE type File type
BYTE[4] padding Always 0x00

The first file begins at offset 0 in gamedata.g-d. To calculate the offsets of subsequent files, the length fields must be totalled.

The type field appears to contain a code representing the type of data stored at that file's location. Known types are:

Code File type
0x0000 Generic data
0x1636 ! Unknown
0x2376 ! Unknown
0x3276 ! Unknown
0x3F2E ! Unknown
0x3F64 ! Unknown
0x48BE ! Unknown
0x43EE ! Unknown
0x59EE TBSA Music Format

Files

#0: Config

The first file contains configuration data.

Data type Name Description
UINT8 option1 0=70Hz videomode, 1=55Hz videomode
UINT8 option2 0=scrollmode-1, 1=scrollmode-2
UINT8 option3 0=keyboard, 1=keyboard+joystick
UINT8 option4 bitfield: 0x80=turbo mode, 0x08=samples, 0x04=music, 0x03=always set. Turbo mode only allowed with samples on.
char[8] playerName Player's name, padded with spaces and not null-terminated
char[8] password Level password, padded with spaces and not null-terminated

#1: High scores

Data type Name Description
UINT32LE[7] score Score for each of the seven high-score entries
char[20][7] highName Name for each of the seven high-score entries (20 chars each, not null-terminated)

Each high score entry begins with a space, a number and a full-stop, and is padded with dashes and a final space, e.g. " 1.example ------ ". The dashes are replaced with the actual score when displayed in-game.

Compressed/encrypted files

These files all start with a particular header.

Data type Name Description
char[2] signature "GB"
UINT16LE length Length of data in file
UINT16LE unknown
UINT16LE unknown2
BYTE[47] padding Bring total structure up to 55 bytes
BYTE[length] content Actual data for this file

Music files

The music files start with the characters "TBSA0.01". This probably stands for "The Bone Shaker Architect", the name of the music player library. They are in TBSA Music Format.

Tools

The following tools are able to work with files in this format.

Name PlatformExtract files? Decompress on extract? Create new? Modify? Compress on insert? Access hidden data? Edit metadata? Notes
Camoto Linux/WindowsYesNoNoYesNoNoN/A
Camoto/gamearchive.js AnyYesNoYesYesNoNoN/A

Credits

This file format was reverse engineered by Malvineous. 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!)