Skip to main content

Module parser

Module parser 

Source
Expand description

Encoding file binary parser and CKey-to-EKey lookup. Binary parser for the CASC encoding file.

The encoding file begins with a 22-byte header (magic "EN", version 1), followed by an ESpec string block, a page index, and then the actual CKey-to-EKey (CE) data pages. Each page contains variable-length entries consisting of a key count, a 5-byte file size (big-endian u40), the CKey, and one or more EKeys.

Use EncodingFile::parse to build a lookup table, then EncodingFile::find_ekey to resolve a CKey to its EKey(s).

Structsยง

EncodingEntry
A single CKey -> EKey mapping entry.
EncodingFile
Parsed encoding file with fast CKey -> EKey lookup.
EncodingHeader
Header of the encoding file (0x16 bytes, big-endian).