Broderbund Mohawk Archive Format
by Gabe Bauman <gabeb@canada.com>
with some help from Simon Woodside

This document is version 1.1. If you find _any_ new information, please contact 
me and tell me about it - after all, I got you this far... =)

1. Introduction

Mohawk archives have been used by Broderbund for several years to bundle up 
assets for many of their games, notably Myst and Riven. The file structure fits 
nicely inside an EA IFF compliant data chunk.  If you use this information for 
some reason, please give credit where it's due.

2. Points to remember

- All integer fields are in BIG ENDIAN (Motorola) byte order.
- Some Mohawk archives contain unknown data in funny places. USE THE OFFSETS to 
find what you're looking for. Don't count on things being in what would seem to 
be the logical position.
- only resources whose types begin with 't' have resource names. Names are 
stored as null-terminated strings, offset to beginning of name list is found in 
TYPE TABLE HEADER.
- This document is based on guesswork. Don't count on anything here.

3. File structure

:IFF HEADER

	4 bytes		['M','H','W','K']		magic number, identifies MHK 
Archive.
	4 bytes		unsigned long		size of the rest of the file

:RESOURCE HEADER	

	4 bytes		['R','S','R','C']			Identifies a resource 
chunk.
	4 bytes		unsigned long		*should* be length of RSRC 
chunk.
	4 bytes		unsigned long		Size of the entire Mohawk file.
	4 bytes		unsigned long		Offset of RESOURCE DIR from 0
	2 bytes		unsigned short		Offset IN RESOURCE DIR of FILE 
TABLE
	2 bytes		unsigned short		Size of FILE TABLE in bytes.

:TYPE TABLE (This is the beginning of the RESOURCE DIR)
	
   :TYPE TABLE HEADER

	2 bytes		unsigned short		Offset of RESOURCE NAMES in 
RESOURCE DIR
	2 bytes		unsigned short		Number of RESOURCE TYPES in file
	
   :TYPE TABLE ENTRY (1 entry for each RESOURCE TYPE, see above line)
	
	4 bytes		['A','B','C','D']	Resource type identifier
	2 bytes		unsigned short		offset IN DIR of RESOURCE TABLE 
for type
	2 bytes		unknown				unknown
	
:RESOURCE TABLE (repeated for each type)

   :RESOURCE TABLE HEADER
	
	2 bytes		unsigned short		resources count for this 
RESOURCE TYPE
	
   :RESOURCE TABLE ENTRY (1 entry for each resource in this type (see above)

	2 bytes		unsigned short		local resource id number
	2 bytes		unsigned short		index in FILE TABLE, (always < 
0)

:FILE TABLE

   :FILE TABLE HEADER
	
	4 bytes		unsigned long		number of FILE TABLE ENTRIES
	
   :FILE TABLE ENTRY
	
	4 bytes		unsigned long		offset of resource's data
	2 bytes							bits 15 - 0 of resource 
size
	1 byte							bits 23 - 16 of resource 
size
	1 byte		byte				resource flags
	2 bytes							unknown

Questions? Send 'em to me, I might be able to help.
	
