benilla-re systems structs docs

SStrPack

function · storm · primitive

Address
0x64a760 · 142 bytes, up to 0x64a7ed
Signature
uint32_t __stdcall (char *dest, const char *src, uint32_t size)
Meaning
Appends a string to another below a buffer size, terminates it and returns the new length
Confidence
verified, proof two
Finding
storm/strings#string-length-and-append
Test
storm::sstrpack_whole

Finding: String length and append in storm: string conversions

SStrLen(s) (0x64a6f0) returns the count of bytes before the first NUL. SStrPack(dest, src, size) (0x64a760) appends src to the string in dest and returns the new length of dest. A size of 0 returns 0 and writes nothing. Otherwise bytes of src are copied to the end of dest while the write address is below dest + size - 1 (unsigned 32-bit address arithmetic), and a NUL follows the last byte copied; a dest already at the limit gets no byte and its NUL is rewritten at its old end. size 0x7fffffff has no limit. A null s, dest or src sets error 0x57 and gives 0, SStrPack writing nothing even for a size of 0.

The derivation is in the doc.

Callers 88

Callees 1

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