I finally could find a couple of hours to go further on the converter.

As you remember the OS 3.x TNS file format has 4 layers: 1) XML compression, 2) zlib compression, 3) triple-DES encryption and 4) zip wrapper. 4) and 3) are now supported by the converter, but it fails miserably on the inflate() call for 2) with a Z_DATA_ERROR… The deflated 512-byte block to inflate seems OK, and can be inflated on the computer side without problem.

What could be wrong?

[edit 2011/08/01] 2) (zlib compression) now passes! the zlib stream needs to be produced with a negative windowBits parameter, to avoid emitting a zlib header.

And now probably the last step: 1) (the XML compression) fails at the 13th 512-byte block of the Lua sample program I use, in the TNS decryption loop…