Heroes of Might and Magic III

Reverse Engineering

SND File Format

The SND file format is very simple. The first 4 bytes tell us how many files are in the archive:

0..3 Number of Files

Then, there is a list of files, with each structure containing the file name, offset and size is as follows:

40 Bytes – File Name
4 Bytes – Offset
4 Bytes – Size

This is repeated for as many times as the first four bytes of the SND file indicates, e.g. Heroes3.snd equals 1014 files.

H3M File Format (Compressed)

The file is stored as a basic zlib stream, so using zlib (version 1.2.3 here), you should be able to uncompress the map file without any special treatment. The accompany zpipe.c example inf() function works just fine.

H3M File Format (Uncompressed)

0..3 – Header

RoE – 0×0000000E;
AB – 0×00000015;
SoD – 0×0000001C;
WoG 0×00000033;

4 – Junk Byte
5..8 – Size of Map (e.g. 36 = 36×36, 72 = 72×72, etc)