TIM Resource Format
The TIM Resource Format is used by The Incredible Machine to store much of the game data.
The format comprised of multiple files. The index file is a .MAP file which stores the offsets of each subfile. The subfile data is split between a number of real files, and the .MAP file also provides the filenames of these real files. In The Incredible Machine, the index file is called RESOURCE.MAP and the data files are RESOURCE.001 to RESOURCE.004.
In theory data can be read from the data files alone (without the .MAP file) however if the data is to be modified then the .MAP file will have to be updated with the new offsets.
There is no known signature, other than carefully reading the file structure and verifying it seems correct (e.g. offsets don't go past the end of the file.) The data filenames can also be read from the .MAP file and checked to see whether they exist in the current directory.
The .MAP file begins with a header:
|UINT16LE||fileCount||Number of data files|
This is then followed by a file structure, repeated fileCount times:
|char||filename||Filename of real data file (DOS 8.3, null terminated)|
|UINT16LE||count||Number of file entries|
|FILE_ENTRY[count]||entry||Actual file entries|
A single FILE_ENTRY is defined as:
|UINT32LE||offset||Offset of file from start of data|
To read the subfile data, the filename must be read from the .MAP file (the filename field above) along with the offset. The file identified by filename must then be opened. It should be in the same directory as the .MAP file. Seeking to offset in this newly opened file will result in the file pointer being at the start of the subfile header:
|char||filename||Filename of subfile (DOS 8.3, null terminated)|
|UINT32LE||len||Length of subfile data, in bytes|
If the .MAP file is not being used, the data files simply consist of the above subfile header and data concatenated one after the other. Subfiles aren't split between real files, so each data file can be considered independent (with the exception that the .MAP file contains the offsets for all the subfiles across all the data files.)
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!)