L L4D2node

Filter_ConvertString

0x001efa80 · 287 bytes · __cdecl

_Z20Filter_ConvertStringPKcP10ipfilter_t

Decompiled

undefined (2 params)

/* Filter_ConvertString(char const*, ipfilter_t*) */

undefined4 Filter_ConvertString(char *param_1,ipfilter_t *param_2)

{
  char cVar1;
  int iVar2;
  long lVar3;
  undefined4 uVar4;
  int iVar5;
  char *pcVar6;
  int iVar7;
  int in_GS_OFFSET;
  undefined4 local_a8;
  undefined4 local_a4;
  char local_a0 [128];
  int local_20;
  
  iVar7 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  local_a8 = 0;
  local_a4 = 0;
  do {
    cVar1 = *param_1;
    if (9 < (byte)(cVar1 - 0x30U)) {
      ConMsg("Bad filter address: %s\n",param_1);
      uVar4 = 0;
      goto LAB_001efb6f;
    }
    iVar2 = 0;
    do {
      pcVar6 = param_1;
      iVar5 = iVar2;
      param_1 = pcVar6 + 1;
      local_a0[iVar5] = cVar1;
      cVar1 = *param_1;
      iVar2 = iVar5 + 1;
    } while ((byte)(cVar1 - 0x30U) < 10);
    local_a0[iVar5 + 1] = '\0';
    lVar3 = strtol(local_a0,(char **)0x0,10);
    *(char *)((int)&local_a8 + iVar7) = (char)lVar3;
    if ((char)lVar3 != '\0') {
      local_a0[iVar7 + -4] = -1;
    }
    if (*param_1 == '\0') break;
    iVar7 = iVar7 + 1;
    param_1 = pcVar6 + 2;
  } while (iVar7 != 4);
  *(undefined4 *)param_2 = local_a4;
  *(undefined4 *)(param_2 + 4) = local_a8;
  uVar4 = 1;
LAB_001efb6f:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return uVar4;
  }
                    /* 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)