Skip to content

Latest commit

 

History

History
48 lines (33 loc) · 2.18 KB

File metadata and controls

48 lines (33 loc) · 2.18 KB

Resource Assoc Table

The resource assoc table is an array, each entry representing a parent-child belongs-to relationship for resources within the file. Each entry has a primary key consisting of the resource id of the parent and the FourCC of the child. The other entry data is simply the resource id of the child.

This means that there can be multiple child resources to each parent resource, but only a single child resource of each chunk type.

The FourCC of the chunk is KEY*.

Structure

The resource assoc table chunk is saved in little-endian.

The structure is described by:

Ref. Bytes Description
  HL Chunk header
  EL × AAE Array data

Chunk header

The structure of the chunk header is:

Ref. Bytes Type(s) Name Description
HL 2 uint16 header‑length Length of the header data.
EL 2 uint16 entry‑length The length of a single entry.
AAE 4 uint32 allocated‑array‑elements The number of allocated array slots.
UAE 4 uint32 used‑array‑elements The number of array slots filled by entries.

Array data

The array entries are simply stacked one after another. While AAE array elements are allocated, only UAE array elements actually contains real entries, so we must not parse more than UAE entries.

Array entries

The structure of a resource assoc table array entry is:

Ref. Bytes Type(s) Name Description
  4 uint32 child‑resource‑id The resource id of the child resource.
  4 uint32 parent‑resource‑id The resource id of the parent resource.
  4 char four‑cc The FourCC identifying the of the child resource.