benilla-re systems structs docs

SFile::OpenEx

function · storm · orchestration

Address
0x6477c0 · 1498 bytes, up to 0x647d99
Meaning
Opens a name by its resolved kind; a .bz file is checked for BZ00 and set up to inflate
Confidence
verified, proof two
Name from
the community database (idb)
Finding
storm/bz#opening-a-bz-file
Test
storm::bz_open_header_difftest

Finding: Opening a .bz file in storm: compressed loose files

For kind 1, SFile::OpenEx opens the full path with mode rb; a null FILE * frees the object and returns 0. It copies the path, cut at its last . when the rest is .bz in any case, and the name, then reads 24 bytes without checking the count. Unless the dword at header offset 4 is BZ00 it frees the object and returns 0, leaving the file open. Otherwise it keeps the size and the 16 bytes, sets the position to 0, allocates the 0x1000-byte input and the 0x38-byte stream, calls inflateInit_(stream, "1.1.3", 0x38) without testing it, and returns 3.

offsetbytescontent
04the inflated size, little-endian; SFile::GetFileSize answers it
44BZ00
816kept at +0x44; no live code reads them for a .bz file
24to the enda zlib stream: a 2-byte header, deflate data, an Adler-32

The derivation is in the doc.

Callers 10

Callees 21

Calls and jumps by a bare address, from tables/calls.tsv.