TTComp archive data decompressor

The TTDecomp utility will decompress files that are identified by the Unix file command as “TTComp archive data”.

Usage: ttdecomp infile outfile

Note that the TTComp archive data format is used by some libraries/utilities as a wrapper for multiple files. The TTDecomp utility does not parse the internal content of the input file; it simply decompresses the archive into the output file.

Some other utilities that handle such archives include:

If the output of TTDecomp is not directly usable then you should check if one of these other utilities can make sense of the archive.



Mac OS X executablettdecomp

Windows executablettdecomp.exe

Technical details

The actual decompression is performed in implode.c, which is found in the Starcraft/Brood War Library. The following files are from that library: The library is licensed under the GNU Lesser GPL.

For all of these files I had to remove Unicode characters in order for them to compile using older versions of gcc.

I also changed some system include file references to local references. For example, from:
  #include <common.h>
  #include "common.h" /* changed from <common.h> by Tony Lewis */

All such changes are indicated with a comment including my name.

Note that gcc version 3.2.2 emits a warning for implode.c:

  implode.c: In function `implode':
  implode.c:124: warning: `copy_off' might be used uninitialized in this function

Since ttdecomp does not call the implode function, this warning can be safely ignored.

Shannon-Fano coding

The compression algorithm is an example of Shannon-Fano coding.
Send me reports of any errors or suggestions you have about my tools.

The utility described on this page is Copyright 2012 Tony Lewis <>.

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see <>.