SFile::SetFilePointer
function · storm · orchestration
- Address
0x648a60· 359 bytes, up to0x648bc6- Signature
uint32_t __stdcall (SFileObject *file, int32_t distance, int32_t *distanceHigh, uint32_t method)- Meaning
- Moves an open file's position by its kind; a .bz file skips by reading and restarts its stream to go back
- Confidence
- verified, proof one
- Finding
- storm/bz#size-and-seeking
- Test
storm::bz_seek_difftest,storm::bz_damaged_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 7
- CGxDevice::LoadShaderFile gx
- TgaReadPixels image
- TgaReadRle image
- 0x647350 storm
- CMap::LoadWdl terrain
- ReadMovieAvi ui
- 0x7a8ab0 os
Callees 10
- __alloca_probe crt
- ReadBzFile storm
- 0x6572d0 storm
- SCritSect::Enter storm
- SCritSect::Leave storm
- 0x668650 storm
- inflateInit_ zlib
- inflateEnd zlib
- _fseek crt
- _ftell crt
Calls and jumps by a bare address, from tables/calls.tsv.