Jump to navigation Jump to search
.wad file format is exactly the same as Worms .dir format, only extension is different.
- file data spans up to the "address of directory". These two subpoints are optional, but they provide nice alignment
- There is
1A 00at the end of each file
- There may be
00padding after that, so the next file/section starts at offset % 4 == 0
- There is
Following offsets are counted from "Directory address"
|0x4||0x1000||Hash table, 1024 4-byte entries|
- each entry value + "address of directory" is a pointer to corresponding file descriptor
- each position is calculated, hash function is available at https://worms2d.info/Graphics_directory
each file descriptor have following structure:
|0x0||0x4||Next hash, by default is set to |
|0x4||0x4||File data offset in archive|
|0xC||0x4||Filename with path|
- if two files have the same hash, then hash table points to first file, which have "next hash" to another file descriptor with the same hash. If there is no collision then it's 0.
- filename is 4 bytes aligned, terminated by 0x00 (and padded with 0x00 to 4 bytes)