benilla-re systems structs docs

FindSwitchByPrefix

function · storm · boundary

Address
0x64fac0 · 126 bytes, up to 0x64fb3d
Signature
void * __fastcall (const char *text, void *node, uint32_t minimum)
Meaning
Returns the switch whose name is the longest prefix of a text, of at least a minimum length, or 0
Confidence
verified, proof one
Finding
storm/scmd#switch-name-and-number-parsing

Finding: Switch name and number parsing in storm: command-line switches

0x64fac0(text, node, minimum) walks a switch list from node and returns the node whose name is the longest prefix of text, of at least minimum and at most strlen(text) characters, or 0. A node with flag bit 0x100 compares case-sensitively (strncmp), any other ignoring case (_strnicmp); of two names of equal length the first in the list wins. 0x64f940(node, text, &length) converts text to the node's value +0x3c with strtol when the node's flag bit 0 is set and strtoul otherwise, both in base 0, stores the number of characters the conversion used in length, and copies the low min(size, 4) bytes of the value to the node's output +0x2c when it has one, size being +0x30.

The derivation is in the doc.

Callers 2

Callees 3

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