ParseStringToEffectArray
0x00520120 · 318 bytes · __cdecl
_Z24ParseStringToEffectArrayPKcPA128_cPii
Decompiled
undefined (4 params)
/* ParseStringToEffectArray(char const*, char (*) [128], int*, int) */
int ParseStringToEffectArray(char *param_1,char *param_2,int *param_3,int param_4)
{
int *piVar1;
int iVar2;
undefined1 *puVar3;
int iVar4;
char *pcVar5;
int in_GS_OFFSET;
char local_420 [1024];
int local_20;
iVar4 = 0;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
iVar2 = _V_strlen(param_1);
if (iVar2 != 0) {
pcVar5 = local_420;
V_strncpy(pcVar5,param_1,0x400);
puVar3 = (undefined1 *)V_stristr(pcVar5," ");
if ((puVar3 != (undefined1 *)0x0) && (1 < param_4)) {
while( true ) {
*puVar3 = 0;
V_strncpy(param_2,pcVar5,0x80);
pcVar5 = puVar3 + 1;
puVar3 = (undefined1 *)V_stristr(pcVar5," ");
if (puVar3 == (undefined1 *)0x0) break;
*puVar3 = 0;
iVar2 = V_atoi(pcVar5);
pcVar5 = puVar3 + 1;
param_3[iVar4] = iVar2;
iVar4 = iVar4 + 1;
puVar3 = (undefined1 *)V_stristr(pcVar5," ");
if ((puVar3 == (undefined1 *)0x0) || (param_2 = param_2 + 0x80, iVar4 == param_4 + -1))
goto LAB_00520154;
}
piVar1 = param_3 + iVar4;
iVar4 = iVar4 + 1;
iVar2 = V_atoi(pcVar5);
*piVar1 = iVar2;
}
}
LAB_00520154:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return iVar4;
}
/* 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.