COM_Parse
0x00126120 · 305 bytes · __cdecl
_Z9COM_ParsePKc
Decompiled
undefined (1 param)
/* COM_Parse(char const*) */
byte * COM_Parse(char *param_1)
{
char cVar1;
byte bVar2;
uint uVar3;
byte *pbVar4;
char *pcVar5;
int iVar6;
undefined1 *puVar7;
byte *pbVar8;
puVar7 = g_BreakSetIncludingColons;
if (com_ignorecolons != '\0') {
puVar7 = g_BreakSet;
}
com_token = 0;
if (param_1 == (char *)0x0) {
com_token = 0;
return (byte *)0x0;
}
uVar3 = (uint)(byte)*param_1;
while( true ) {
while (bVar2 = (byte)uVar3, bVar2 < 0x21) {
if (bVar2 == 0) {
com_token = 0;
return (byte *)0x0;
}
pbVar4 = (byte *)(param_1 + 1);
param_1 = param_1 + 1;
uVar3 = (uint)*pbVar4;
}
if (bVar2 != 0x2f) break;
pcVar5 = param_1;
if (param_1[1] != '/') {
uVar3 = 0x2f;
cVar1 = puVar7[0x2f];
goto joined_r0x001261a6;
}
while( true ) {
param_1 = pcVar5 + 1;
if (((char)uVar3 == '\n') || ((char)uVar3 == '\0')) break;
uVar3 = (uint)(byte)pcVar5[2];
pcVar5 = param_1;
}
}
iVar6 = 0;
pbVar4 = (byte *)(param_1 + 1);
if (bVar2 == 0x22) {
while( true ) {
pbVar8 = pbVar4 + 1;
bVar2 = *pbVar4;
if ((bVar2 == 0) || (bVar2 == 0x22)) break;
(&com_token)[iVar6] = bVar2;
iVar6 = iVar6 + 1;
pbVar4 = pbVar8;
if (iVar6 == 0x3ff) {
DAT_00396e1f = 0;
return pbVar8;
}
}
(&com_token)[iVar6] = 0;
return pbVar8;
}
cVar1 = puVar7[uVar3];
joined_r0x001261a6:
if (cVar1 != '\0') {
DAT_00396a21 = 0;
com_token = (char)uVar3;
return (byte *)(param_1 + 1);
}
pbVar4 = (byte *)(param_1 + 1);
iVar6 = 1;
com_token = bVar2;
while ((bVar2 = *pbVar4, puVar7[bVar2] == '\0' && (0x20 < bVar2))) {
pbVar4 = pbVar4 + 1;
(&com_token)[iVar6] = bVar2;
iVar6 = iVar6 + 1;
if (pbVar4 == (byte *)(param_1 + 0x3ff)) {
DAT_00396e1f = 0;
return pbVar4;
}
}
(&com_token)[iVar6] = 0;
return pbVar4;
}
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.