Skip to content

Constructor .FIL files

RyanfaeScotland edited this page Feb 9, 2022 · 4 revisions

Description

FIL files are the Archive format used in Constructor. At the beginning of the archive there is an index of all files stored. The index is encrypted. After that follows plain file data.

Location

FIL files in the GOG version of Constructor can be accessed by copying the file "const.gog" (found in the Constructor folder) and renaming it to "const.iso". Then, mount this file and open it to find a selection of self explanatory directories each of which (except a couple) contain a "DATA.FIL" file that can be opened in FilEdit.

drawing

Tools

FilEdit 0.61 from http://www.black-mesa.freeserve.co.uk/ can be used to view, extract and create FIL archives. Source is available. All information below were taken from the source of FilEdit

Index Format

0x00  uint32             num       Number of Index Entries (encrypted. XOR 0x3BD7A59A)
0x04  IndexEntry[num]    index     The Index itself

Each IndexEntry is 17 bytes:

0x00 char[13]            Filename  Zero-terminated
0x0D uint32              Offset

The index is also encrypted. Pseudocode for decryption:

for each byte[n]:
    byte[n] -= 39
    byte[n] ^= 0xA5
    byte[n] -= (27 + n)

TODO: upload python script for extraction