Skip to main content

Module pkg

Module pkg 

Source
Expand description

Packages (.pkg, and mods as .pkm): the archives that hold the game’s data.

Original: IO::PackageFile::ReadPackfile, Runtime 0x1800b6f10.

u32 header        bit31 = extended header, bits0..30 = TOC offset
...file data      each entry a block stream, except `.index` stubs and raw `.str` audio
u32 tocSize       at TOC offset, followed by the TOC as a block stream

Decoded TOC: u32 count, u32 version, u32 gameVersion, u32 userVersion, u32 priority, u32 skip, u8 canOverride, u32 crc, u32 iconW, u32 iconH, icon RGBA, [v>1] u32 previewLen + bytes, [v>2] name/author/description (u32 len + bytes), count x { u32 nameLen, name, u32 offset, u32 size }.

Structs§

Archive
A set of packages resolved by priority: higher priority shadows lower for the same name.
Entry
One entry of a package: its name, and where its bytes are.
Header
The header of a package: versions, priority, and a mod’s name, icon and description.
Package
One package: its header, its entries and its bytes.

Enums§

EntryKind
How an entry is stored.

Functions§

normalise
The normalised form of an entry name or a reference: forward slashes, lower case.
ref_to_entry
Dir\Name.rsc:object -> Dir\Name_object.crs.