benilla-re systems structs docs

SFile::Read

function · storm · orchestration

Address
0x648460 · 373 bytes, up to 0x6485d4
Signature
uint32_t __stdcall (SFileObject *file, void *buffer, uint32_t size, uint32_t *read, void *overlapped, uint32_t unused)
Meaning
Reads from an open file by its kind, the .bz inflater for kind 1, or queues an overlapped read
Confidence
verified, proof one
Name from
the community database (idb)
Finding
storm/bz#reading-a-bz-file

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

0x6476e0(file, out, size, &read) sets the stream's output to out and size, then loops: with no input left it points the input at the buffer and freads up to 0x1000 bytes into it, storing the count when it is above 0; it calls inflate(stream, Z_SYNC_FLUSH) (0x730ea0, "The zlib it links"). A full output stores size, adds it to the position and returns 1. Otherwise Z_STREAM_END stores the bytes produced, adds them and returns 1 when there are any, else 0; Z_OK loops; any other result returns 0 with read and the position untouched. So a stream that ends early, or damage the output reaches, fails the read in which it shows.

The derivation is in the doc.

Callers 317

Callees 8

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