L L4D2node

CSplitString::Construct

0x000a0560 · 325 bytes · __thiscall

_ZN12CSplitString9ConstructEPKcPS1_i

Decompiled

undefined (4 params)

/* CSplitString::Construct(char const*, char const**, int) */

void __thiscall CSplitString::Construct(CSplitString *this,char *param_1,char **param_2,int param_3)

{
  int iVar1;
  void *__dest;
  size_t sVar2;
  char *pcVar3;
  char *pcVar4;
  int local_34;
  char *local_30;
  char *local_20 [4];
  
  iVar1 = _V_strlen(param_1);
  __dest = operator_new__(iVar1 + 1U);
  *(void **)(this + 0x14) = __dest;
  memcpy(__dest,param_1,iVar1 + 1U);
  *(undefined4 *)(this + 0xc) = 0;
  CUtlMemory<char*,int>::Purge((CUtlMemory<char*,int> *)this);
  *(undefined4 *)(this + 0x10) = *(undefined4 *)this;
  local_30 = param_1;
  if (0 < param_3) {
    while( true ) {
      pcVar4 = (char *)0x0;
      local_34 = -1;
      iVar1 = 0;
      do {
        pcVar3 = (char *)V_stristr(local_30,param_2[iVar1]);
        if ((pcVar3 != (char *)0x0) && ((pcVar3 < pcVar4 || (pcVar4 == (char *)0x0)))) {
          pcVar4 = pcVar3;
          local_34 = iVar1;
        }
        iVar1 = iVar1 + 1;
      } while (iVar1 != param_3);
      if (pcVar4 == (char *)0x0) break;
      sVar2 = strlen(param_2[local_34]);
      if (local_30 < pcVar4) {
        local_20[0] = local_30 + (*(int *)(this + 0x14) - (int)param_1);
        local_20[0][(int)pcVar4 - (int)local_30] = '\0';
        CUtlVector<char*,CUtlMemory<char*,int>>::InsertBefore
                  ((CUtlVector<char*,CUtlMemory<char*,int>> *)this,*(int *)(this + 0xc),local_20);
      }
      local_30 = pcVar4 + sVar2;
    }
  }
  sVar2 = strlen(local_30);
  if (sVar2 != 0) {
    local_20[0] = local_30 + (*(int *)(this + 0x14) - (int)param_1);
    CUtlVector<char*,CUtlMemory<char*,int>>::InsertBefore
              ((CUtlVector<char*,CUtlMemory<char*,int>> *)this,*(int *)(this + 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)