summaryrefslogtreecommitdiff
path: root/doc/respack.md
blob: eb316c05742381cad338973fa6d54d122c3fee79 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Resource Package Format

Multiple related resources can be packages into a single file for easier
distribution and storage outside of the game.

A resource pack has a header describing the layout of the contained resources.
It maps resource hashes to absolute offset-size ranges in file. There is no
guarantee that the resource data is tightly packed in the file. There may also
be an entry point resource specified which is of type `RespackEntry`, or not in
which case the field is zeroed.

```
MMMM EEEEEEEE CC [RRRRRRRR OO SS]... Data...
^    ^        ^   ^        ^  ^
|    |        |   |        |  | Size (u64)
|    | Entry Point Res     | Offset (u64)
| Magic bytes |   | Resource hash (256-bit)
              | Resources count
```

The magic bytes are `0f0c 5745 4152 4501 5245 5350 4143 4b02`
(`\x0f\x0cWEARE\x01RESPACK\x02`).