DAT Format (Sango Fighter)
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.
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.
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.
|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.
The following tools are able to work with files in this format.
|Name||Platform||Extract files?||Decompress on extract?||Create new?||Modify?||Compress on insert?||Access hidden data?||Edit metadata?||Notes|
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!)