V_SplitWString2
0x0004bca0 · 333 bytes · __cdecl
_Z15V_SplitWString2PKwPS0_iR10CUtlVectorIPw10CUtlMemoryIS3_iEE
Decompiled
undefined (4 params)
/* V_SplitWString2(wchar_t const*, wchar_t const**, int, CUtlVector<wchar_t*, CUtlMemory<wchar_t*,
int> >&) */
void V_SplitWString2(wchar_t *param_1,wchar_t **param_2,int param_3,CUtlVector *param_4)
{
undefined4 uVar1;
size_t sVar2;
wchar_t *pwVar3;
wchar_t *pwVar4;
int iVar5;
int local_30;
wchar_t *local_20 [4];
*(undefined4 *)(param_4 + 0xc) = 0;
if (*(int *)(param_4 + 8) < 0) {
uVar1 = *(undefined4 *)param_4;
}
else {
if (*(void **)param_4 != (void *)0x0) {
free(*(void **)param_4);
*(undefined4 *)param_4 = 0;
}
*(undefined4 *)(param_4 + 4) = 0;
uVar1 = 0;
}
*(undefined4 *)(param_4 + 0x10) = uVar1;
if (0 < param_3) {
while( true ) {
pwVar4 = (wchar_t *)0x0;
local_30 = -1;
iVar5 = 0;
do {
pwVar3 = (wchar_t *)V_wcsistr(param_1,param_2[iVar5]);
if ((pwVar3 != (wchar_t *)0x0) && ((pwVar3 < pwVar4 || (pwVar4 == (wchar_t *)0x0)))) {
pwVar4 = pwVar3;
local_30 = iVar5;
}
iVar5 = iVar5 + 1;
} while (iVar5 != param_3);
if (pwVar4 == (wchar_t *)0x0) break;
sVar2 = wcslen(param_2[local_30]);
if (param_1 < pwVar4) {
local_20[0] = (wchar_t *)AllocWString(param_1,(int)pwVar4 - (int)param_1 >> 2);
CUtlVector<wchar_t*,CUtlMemory<wchar_t*,int>>::InsertBefore
((CUtlVector<wchar_t*,CUtlMemory<wchar_t*,int>> *)param_4,*(int *)(param_4 + 0xc),
local_20);
}
param_1 = pwVar4 + sVar2;
}
}
sVar2 = wcslen(param_1);
if (sVar2 != 0) {
local_20[0] = (wchar_t *)AllocWString(param_1,-1);
CUtlVector<wchar_t*,CUtlMemory<wchar_t*,int>>::InsertBefore
((CUtlVector<wchar_t*,CUtlMemory<wchar_t*,int>> *)param_4,*(int *)(param_4 + 0xc),
local_20);
}
return;
}
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.