Skip to content
This repository has been archived by the owner on Jun 19, 2021. It is now read-only.

Latest commit

 

History

History
36 lines (27 loc) · 1.74 KB

SPEC.org

File metadata and controls

36 lines (27 loc) · 1.74 KB

KingsIsle WAD File Format Specification

This document details the anatomy of a KingsIsle WAD file (KIWAD). To begin, a KIWAD file can be divided into three basic parts:

  1. the archive header, containing the magic bytes, WAD version, and file count;
  2. the file list, which provides info on every file in the archive; and
  3. the data section, which contains the data of all the files in the archive.

Archive header

Every archive begins with a short header with the following structure:

fieldtypedescription
magicstringKIWAD; used for identification
versionint32what version of the WAD format the file is
countint32the number of files in the archive

If the KIWAD is version 2 or greater, there will be a spacing byte appended at the end of the header.

File list

After the header comes the file list, which is composed of many smaller chunks of data detailing each file in the archive. Each chunk is structured as follows:

fieldtypedescription
offsetint32the offset of the file’s data in the archive
sizeint32how large the file is (in bytes)
comp_sizeint32how large the file is when compressed (in bytes)
compressedboolwhether the file is compressed or not
checksumint32the CRC checksum of the file
path_lenint32how long (in bytes) the file’s path is
pathstringthe path of the file in the archive