Format:CRI UTF table
| Developer | CRI Middleware |
|---|---|
| Magic | @UTF (40 55 54 46) |
| Endianness | big |
| License | proprietary; readers: vgmstream (ISC) |
| On this wiki | Facts · Code · Notes · Topics |
CRI's generic database-like table (magic @UTF): a header with section offsets, a column schema (flag + type + name), fixed-width rows, a string pool and a binary data pool; the base of CPK, ACB, ACF and USM headers. Big-endian.
Identification
Magic @UTF at the start of a table (at 0x10 inside a CPK, at 0x20 inside a USM, at 0 in .acb). Everything is big-endian. Used as 'objects as tables' by CRI libraries: .cpk (file list), .acb/.acf (cues, waveforms), .usm (stream info), .aax.
Layout
Header at table start (offsets in the header count from table_start + 8): 0x04 size minus 8, 0x08 u16 version (0 or 1), 0x0A u16 offset of rows, 0x0C u32 string pool offset, 0x10 u32 data pool offset, 0x14 u32 table name (offset into the string pool), 0x18 u16 column count, 0x1A u16 row width, 0x1C u32 row count; the schema starts at 0x20. See Fact:CRI UTF table/struct/UTF header and schema.
Schema: per column one byte (high nibble = flags, low = type) and a u32 name offset in the string pool, followed by the constant for flag 0x20. Flags: 0x10 has name, 0x20 constant stored in the schema (same for all rows), 0x40 value stored in each row. Types: 0 u8, 1 s8, 2 u16, 3 s16, 4 u32, 5 s32, 6 u64, 7 s64, 8 float, 9 double, 0x0A string (u32 offset into the pool), 0x0B variable-length data (u32 offset + u32 size in the data pool, which can hold another @UTF table), 0x0C 128-bit GUID. Rows are fixed width and store the row-flagged columns in column order.
To read a table: parse the header, walk the schema computing each row-flagged column's offset inside the row, then read cell (row, column name). Sections are in order schema, rows, strings, data. Newer game CPKs and ACBs may encrypt the table by XORing the bytes (the magic then is not visible): Unverified here, check the CRI reader sources.
Related
Format:CRI CPK, Library:CRIWARE, Format:CRI USM.
Evidence & references
- vgmstream commit db77f98f405a45ad08df98aa444cae3848f95e6c (ISC):
src/util/cri_utf.clines 9-260,cri_utf.h(comment credits hcs64's utf_tab).