L L4D2node

V_SplitString2

0x00b7db50 · 326 bytes · __cdecl

_Z14V_SplitString2PKcPS0_iR10CUtlVectorIPc10CUtlMemoryIS3_iEE

Decompiled

undefined (4 params)

/* V_SplitString2(char const*, char const**, int, CUtlVector<char*, CUtlMemory<char*, int> >&) */

void V_SplitString2(char *param_1,char **param_2,int param_3,CUtlVector *param_4)

{
  undefined4 uVar1;
  size_t sVar2;
  char *pcVar3;
  char *pcVar4;
  int iVar5;
  int local_30;
  char *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 ) {
      pcVar4 = (char *)0x0;
      local_30 = -1;
      iVar5 = 0;
      do {
        pcVar3 = (char *)V_stristr(param_1,param_2[iVar5]);
        if ((pcVar3 != (char *)0x0) && ((pcVar3 < pcVar4 || (pcVar4 == (char *)0x0)))) {
          pcVar4 = pcVar3;
          local_30 = iVar5;
        }
        iVar5 = iVar5 + 1;
      } while (iVar5 != param_3);
      if (pcVar4 == (char *)0x0) break;
      sVar2 = strlen(param_2[local_30]);
      if (param_1 < pcVar4) {
        local_20[0] = (char *)AllocString(param_1,(int)pcVar4 - (int)param_1);
        CUtlVector<char*,CUtlMemory<char*,int>>::InsertBefore
                  ((CUtlVector<char*,CUtlMemory<char*,int>> *)param_4,*(int *)(param_4 + 0xc),
                   local_20);
      }
      param_1 = pcVar4 + sVar2;
    }
  }
  if (*param_1 != '\0') {
    local_20[0] = (char *)AllocString(param_1,-1);
    CUtlVector<char*,CUtlMemory<char*,int>>::InsertBefore
              ((CUtlVector<char*,CUtlMemory<char*,int>> *)param_4,*(int *)(param_4 + 0xc),local_20);
  }
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)