benilla-re systems structs docs

SFile::GetFileSize

function · storm · orchestration

Address
0x6487f0 · 129 bytes, up to 0x648870
Signature
uint32_t __stdcall (SFileObject *file, uint32_t *sizeHigh)
Meaning
Returns an open file's size by its kind: fstat, a .bz header's size, or the archive or kind-4 size
Confidence
verified, proof one
Name from
the community database (idb)
Finding
storm/bz#size-and-seeking
Test
storm::bz_read_difftest

Finding: Size and seeking in storm: compressed loose files

SFile::GetFileSize answers kind 1 with the header's size and leaves the high word unwritten. SetFilePointer's &high is neither read nor written for kind 1. SFile::SetFilePointer(file, distance, &high, method) for kind 1: method 0 below the position ends the inflate, starts it again, empties the input, seeks the file to offset 24 and skips distance bytes, and at or above it skips distance - position; method 1 skips distance; any other method moves nothing. A skip of 0 or less does nothing. Skipping reads through a 4 KiB stack buffer, at most 0x1000 bytes a read; a failed read returns 0, else the function returns the position.

The derivation is in the doc.

Callers 10

Callees 3

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