Project X/Library file
From Worms Knowledge Base
A library file contains 0 to infinite (2^32) items of the type file, script or weapon. The count of the items is given at the start of the file, then, each entry is written after another, prefixed to specify its type and name.
The data types are in C# notation.
The header provides general information about the library file details.
The content table simply says how many items are following in the file.
The item structure is repeated as often as the content table specified.
|9 (first)||1||byte||Type||0x02 = File, 0x04 = Script, 0x08 = Weapon||S. below how to parse each type.|
Each item structure contains a type field which determines the type of the item and thus the format of the data following. The following three item types are valid:
- 0x02: A raw file attachment (any format and size is accepted as long as the file item start index plus length do not overflow 2^32). An integer specifies the length of the following data which is simply the file bytes.
- 0x04: A script. The data is a typical int-prefixed ASCII string consisting of the scripts source code.
- 0x08: A weapon. The data follows the reused Project X weapon block structure. The length depends on the weapon block content, so it has to be parsed to retrieve it.