ParseString
0x0021ad30 · 206 bytes · __cdecl
_Z11ParseStringPKcPcj
Decompiled
undefined (3 params)
/* ParseString(char const*, char*, unsigned int) */
undefined4 ParseString(char *param_1,char *param_2,uint param_3)
{
char cVar1;
char *pcVar2;
char *pcVar3;
if (param_1 == (char *)0x0) {
return 0;
}
if (*param_1 == '\0') {
LAB_0021ad75:
pcVar2 = (char *)0x1;
}
else {
cVar1 = g_WhiteSpace[*param_1];
while (cVar1 == '\0') {
param_1 = param_1 + 1;
if (*param_1 == '\0') goto LAB_0021ad75;
cVar1 = g_WhiteSpace[*param_1];
}
pcVar2 = param_1 + 1;
do {
param_1 = pcVar2;
if (*param_1 == '\0') goto LAB_0021ad75;
pcVar3 = param_1 + 1;
pcVar2 = param_1 + 1;
} while (g_WhiteSpace[*param_1] != '\0');
do {
pcVar2 = pcVar3;
if (*pcVar2 == '\0') {
pcVar2 = pcVar2 + (1 - (int)param_1);
goto LAB_0021ad7a;
}
pcVar3 = pcVar2 + 1;
} while (g_WhiteSpace[*pcVar2] == '\0');
pcVar2 = pcVar2 + (1 - (int)param_1);
}
LAB_0021ad7a:
pcVar3 = (char *)(param_3 - 1);
if ((int)pcVar2 <= (int)(param_3 - 1)) {
pcVar3 = pcVar2;
}
V_strncpy(param_2,param_1,(int)pcVar3);
param_2[(int)pcVar3] = '\0';
return 1;
}
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.