Expand description
DBS (Siglus database) loader.
This module implements the .dbs expansion and table access logic used by the engine runtime.
File layout (on disk):
i32 type(little-endian)payload[...]: obfuscated LZSS stream
Expansion algorithm (tnm_database_expand):
- XOR payload as u32 stream with
XORCODE[2]. - LZSS-unpack payload into
unpack_data. - Apply a tiled binary mask split into A/B using
tile_copysemantics. - XOR A with
XORCODE[0], XOR B withXORCODE[1]. - Re-composite A/B back into the final expanded buffer using the same mask.
Expanded buffer layout (in memory):
S_tnm_database_headerat offset 0- row headers table (array of
S_tnm_database_row_header) - column headers table (array of
S_tnm_database_column_header) - data table (row_cnt * column_cnt DWORDs)
- string table
String encoding:
- If
type == 0: strings are multibyte (typically Shift-JIS) and NUL-terminated. - Else: strings are UTF-16LE (
TCHAR) and NUL-terminated.