DAT Format (Sango Fighter)

From ModdingWiki
Jump to navigation Jump to search
DAT Format (Sango Fighter)
Format typeArchive
Max filesUnlimited
File Allocation Table (FAT)Beginning
Filenames?No
Metadata?None
Supports compression?No
Supports encryption?No
Supports subdirectories?No
Hidden data?No
Games

The DAT format is used by Sango Fighter to store various types of game data across a number of different files. The file extensions used are related to the content type rather than indicating the file is in DAT format (so .mid is used for a collection of music, .pcm for sound files, and so on.) The format does not store any filenames.

Although .dat is one of the many extensions used, it was chosen to describe the format as, like the format itself, it is fairly generic.

File format

Signature

There is no signature for this format. One method to identify files is to read in the first four bytes to get the size of the FAT. This should be less than the total file size, and when divided by four (the size of a single file entry) it will yield the number of files in the collection. The rest of the file entries can then be read, and each file offset must be less than the total size of the DAT file. The very last file entry is a "terminator" (there is no associated file) so it must equal the size of the DAT file. It is extremely unlikely that this method would incorrectly identify a file.

File entry

The file starts off with a single UINT32LE repeated once for each file. As the first file's data comes directly after the FAT, the first file entry will also reveal the size of the FAT. Dividing this number by four (the size of a UINT32LE) and subtracting one (to ignore the "terminator") will return the number of files.

Data type Description
UINT32LE offset File offset

The very last file entry is a terminator and has no associated file. It must be equal to the size of the DAT file, i.e. it points to the end of the file.

File sizes must be calculated by working out the difference between two neighbouring file offsets.

Alternate version

Some files use an alternate version of this format, where all UINT32LE fields are instead UINT16LE. These files are otherwise identical.

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/WindowsYesN/AYesYesN/AN/AN/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!)