Skip to main content

Module dbs

Module dbs 

Source
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):

  1. XOR payload as u32 stream with XORCODE[2].
  2. LZSS-unpack payload into unpack_data.
  3. Apply a tiled binary mask split into A/B using tile_copy semantics.
  4. XOR A with XORCODE[0], XOR B with XORCODE[1].
  5. Re-composite A/B back into the final expanded buffer using the same mask.

Expanded buffer layout (in memory):

  • S_tnm_database_header at 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.

Structsยง

DbsColumnHeader
DbsDatabase
DbsRowHeader