DAT Format (Hugo)
|File Allocation Table (FAT)||Beginning/external|
The DAT format is used to store most of the data for Hugo II, Whodunit? and Hugo III, Jungle of Doom! Unfortunately the format has no signature and a generic filename extension (.dat) so automatic detection of these files is difficult. The format also does not store any filenames.
There is no signature for this format. One method to identify files is to read in the first four bytes to get the offset of the first file. This should be less than the total file size, and when divided by eight (the size of a single file entry) it will yield the number of files in the group. The rest of the file entries can then be read, and each file offset plus its size must be less than the total size of the DAT file. It is extremely unlikely that this method would incorrectly identify a file.
The file starts off with the following structure which is repeated once for each file. It is unknown whether there is a set method to detect the number of files, but reading file entries until the offset of the first file is reached seems to work well enough.
|UINT32LE offset||File offset|
|UINT32LE size||File size|
It is possible for the file offset and size to be zero (this could be considered a spare or unused file entry.) It is not known (i.e. not yet tested) whether any zero offset+size entries must be present to terminate the FAT, however this is perhaps not required given these empty/spare entries are present throughout the FAT.
Hugo II, Whodunit? uses this format for scenery.dat, however Hugo III, Jungle of Doom! has scenery1.dat and scenery2.dat. All file entries are stored in scenery1.dat, and in the middle of the entries the file offset will revert back to zero, after which all subsequent entries are for scenery2.dat.
Note that unlike other formats, the file offsets are not sequential, i.e. the FAT entries are in a different order to the actual file data. The only exception to this seems to be for Hugo III in that after the second zero-offset file, all subsequent FAT entries - although still jumbled - are for the second .dat file.
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|
|Camoto||Linux/Windows||Yes||N/A||Hugo II only||Yes||N/A||No||N/A|
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!)