L L4D2node

ParseStringToGibArray

0x0051ffd0 · 321 bytes · __cdecl

_Z21ParseStringToGibArrayPKcPA128_ci

Decompiled

undefined (3 params)

/* ParseStringToGibArray(char const*, char (*) [128], int) */

int ParseStringToGibArray(char *param_1,char *param_2,int param_3)

{
  int iVar1;
  undefined1 *puVar2;
  char *pcVar3;
  int iVar4;
  char *pcVar5;
  char *pcVar6;
  int in_GS_OFFSET;
  char local_420 [1024];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar1 = _V_strlen(param_1);
  iVar4 = 0;
  if (iVar1 != 0) {
    pcVar6 = local_420;
    V_strncpy(pcVar6,param_1,0x400);
    puVar2 = (undefined1 *)V_stristr(pcVar6," ");
    if ((puVar2 == (undefined1 *)0x0) || (param_3 < 2)) {
      iVar1 = 0;
      iVar4 = 1;
    }
    else {
      pcVar3 = param_2;
      iVar1 = 0;
      pcVar5 = pcVar6;
      do {
        iVar4 = iVar1;
        *puVar2 = 0;
        iVar1 = iVar4 + 1;
        pcVar6 = puVar2 + 1;
        V_snprintf(pcVar3,0x80,"models/infected/limbs/%s.mdl",pcVar5);
        puVar2 = (undefined1 *)V_stristr(pcVar6," ");
        if (puVar2 == (undefined1 *)0x0) break;
        pcVar3 = pcVar3 + 0x80;
        pcVar5 = pcVar6;
      } while (iVar1 != param_3 + -1);
      iVar4 = iVar4 + 2;
      iVar1 = iVar1 * 0x80;
    }
    V_snprintf(param_2 + iVar1,0x80,"models/infected/limbs/%s.mdl",pcVar6);
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return iVar4;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)