benilla-re systems structs docs

SFile::Load

function · storm · boundary

Address
0x648620 · 210 bytes, up to 0x6486f1
Signature
uint32_t __stdcall (void *archive, const char *name, void **buffer, uint32_t *size, uint32_t extra, uint32_t flags, void *overlapped)
Meaning
Reads a whole file into a new buffer with extra zero bytes after it, closing it unless overlapped
Confidence
verified, proof two
Name from
the community database (idb)
Finding
storm/format#loading-a-whole-file

Finding: Loading a whole file in storm: the archive format

SFile::Load(archive, name, &buffer, &size, extra, flags, overlapped) opens the file with SFile::OpenEx(archive, name, flags), allocates its size plus extra bytes, reads the whole file, zeroes the extra bytes after it, and stores the buffer and, when asked, the size. A failed open returns 0; a failed read frees the buffer, closes the file and returns 0. The file is closed unless overlapped is given, in which case it is marked at +0x58 and left open. 0x6485f0(name, &buffer, &size, extra, overlapped) is SFile::Load with no archive and flags 0.

The derivation is in the doc.

Callers 21

Callees 6

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