/home/lucio.albenga.es

Quasijarus2Gzip: How A Program Starts By Accident

It turns out that recently I got an old *.tar.Z file with source code of various very old Unix programs. I was curious about some of them like a very old version of sendmail, but when I tried to decompress one of the files I found out that I couldn't.

Previously I had already decompressed *.tar.Z files with gzip so the next thing I did was to see exactly what that *.tar.Z file was. To do this I used the file command and found out that it was a Quasijarus Strong Compression Data file. I didn't know what it was so I kept investigating.

My next step was to find out exactly what the Quasijarus Strong Compression Data format was. First I found a brief description of the format1 which contained links to the Quasijarus project website. These links are no longer online, but thanks to archive.org2 I was able to see the Quasijarus project website3 and specifically the information on the compression format4.

After reading it all, the main points for me were:

  1. The file format is based on Gzip and both formats only differ in their headers.
  2. The header of the Quasijarus Strong Compression Data format is only composed by the 0x1f 0xa1 bytes (magic number).

So I decided to make a Quasijarus Strong Compression Data to Gzip converter as it couldn't be very complicated. It also provided to me an excuse to have some fun ;p.

The last step was to find out the format of the header of the Gzip file format. According to its specification5, it has a header of 10 bytes distributed as follows:

  • 2 bytes for the magic number 0x1f 0x8b
  • 1 byte for the compression algorithm (08 for DEFLATE).
  • 1 byte for headers flags that could be set to 0.
  • 4 bytes for the file timestamp that can also be set to 0.
  • 1 byte for compression flags that can be set to 0 too.
  • 1 byte for the operating system identifier (3 for Unix)

With all this information I made my Quasijarus Strong Compression Data to Gzip converter. You can download it here.

(This post is a translation of the original one in Spanish).