Utilities for managing WC3/WC4 .tre files


2nd Lieutenant
I made the couple of utilities for assembling-disasssembling .tre files from Wing Commander III and IV games.
  • trextra trename.tre
    disassembles trename.tre file to separate IFF files into directory named trename, uncompressing them if necessary (names of that IFF files are simply hex offsets of their records in Level 1 header of .tre file; also, copies of uncompressed IFFs is stored separately into trename\comp directory, and "orphan" IFFs (i.e. IFFs which have no record in Level 1 header) stored into trename\orphan dir), and writes list of IFFs into trename.lst in human-readable form and into trename\files.bbs in format designed for further assembling into new .tre file.
    Utility is mainly based on Mario Brito's xtre and his description of .tre format but has improved algorithm of detecting compressed IFFs and can also unpack IFFs with associated strings in Level 2 header.
  • tremake trename-dir
    assembles new trename.tre file from directory with IFFs previously made by trextra.
    (Also this utility can merge several dirs made by trextra (when called in form "tremake trename1-dir [ trename2-dir ... ]") so all IFFs is assembled into first .tre file and other generated .tre files consist only of Level 0/1/2 headers; this trick allows to save some disk space when merge some original game CDs into one DVD or flash card but requires some modification to game code I not have made yet.)
I hope that utilities pack will be useful for Wing Commander fans. Sorry for incomplete translation of Russian comments in source code. Russian speaking people also welcome to my development thread in old-games.ru.


  • treutils.zip
    106.7 KB · Views: 61


WC EXE archaeologist
Very cool! :) That's a great set of tools and will definitely come in handy. Thanks for sharing!