TIM Resource Format

From ModdingWiki
Jump to: navigation, search
TIM Resource Format
Format typeArchive
Max files65,535
File Allocation Table (FAT)External + embedded
Filenames?Yes, 8.3
Metadata?None
Supports compression?No
Supports encryption?No
Supports subdirectories?No
Hidden data?No
Games

The TIM Resource Format is used by The Incredible Machine to store much of the game data.

File format

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.

Signature

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.

Structure

The .MAP file begins with a header:

Data type Name Description
UINT16LE unknown ! maybe version?
UINT16LE unknown ! ?
UINT16LE fileCount Number of data files

This is then followed by a file structure, repeated fileCount times:

Data type Name Description
char[13] 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:

Data type Name Description
UINT16LE unknown1 ! ?
UINT16LE unknown2 ! ?
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:

Data type Name Description
char[13] filename Filename of subfile (DOS 8.3, null terminated)
UINT32LE len Length of subfile data, in bytes
BYTE[len] content Subfile content

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.)

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!)