ParseStringToIntArray
0x0051fda0 · 236 bytes · __cdecl
_Z21ParseStringToIntArrayPKcPii
Decompiled
undefined (3 params)
/* ParseStringToIntArray(char const*, int*, int) */
int ParseStringToIntArray(char *param_1,int *param_2,int param_3)
{
undefined1 *puVar1;
int iVar2;
int iVar3;
int iVar4;
char *pcVar5;
char *pcVar6;
int in_GS_OFFSET;
char local_420 [1024];
int local_20;
pcVar6 = local_420;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
V_strncpy(pcVar6,param_1,0x400);
puVar1 = (undefined1 *)V_stristr(pcVar6," ");
if ((puVar1 == (undefined1 *)0x0) || (param_3 < 2)) {
iVar4 = 0;
}
else {
iVar3 = 0;
pcVar5 = pcVar6;
do {
*puVar1 = 0;
iVar4 = iVar3 + 1;
pcVar6 = puVar1 + 1;
iVar2 = V_atoi(pcVar5);
param_2[iVar3] = iVar2;
puVar1 = (undefined1 *)V_stristr(pcVar6," ");
if (puVar1 == (undefined1 *)0x0) break;
iVar3 = iVar4;
pcVar5 = pcVar6;
} while (iVar4 != param_3 + -1);
}
iVar3 = iVar4;
if (*pcVar6 != '\0') {
iVar3 = iVar4 + 1;
iVar2 = V_atoi(pcVar6);
param_2[iVar4] = iVar2;
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return iVar3;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.