L L4D2node

GCSDK::CSchema::AddDeleteField

0x0008db50 · 283 bytes · __thiscall

_ZN5GCSDK7CSchema14AddDeleteFieldEPKc

Decompiled

undefined (2 params)

/* GCSDK::CSchema::AddDeleteField(char const*) */

void __thiscall GCSDK::CSchema::AddDeleteField(CSchema *this,char *param_1)

{
  int iVar1;
  int iVar2;
  void *pvVar3;
  int iVar4;
  int iVar5;
  
  iVar1 = *(int *)(this + 0x10c);
  iVar5 = *(int *)(this + 0x104);
  iVar4 = iVar1 + 1;
  if (iVar5 < iVar4) {
    iVar2 = *(int *)(this + 0x108);
    if (-1 < iVar2) {
      if (iVar2 == 0) {
        if (iVar5 == 0) {
          if (iVar4 < 2) {
            iVar2 = 1;
            goto LAB_0008dc07;
          }
          iVar5 = 1;
        }
        do {
          iVar2 = iVar5 * 2;
          if (iVar4 <= iVar2) break;
          iVar2 = iVar5 * 4;
          iVar5 = iVar2;
        } while (iVar2 < iVar4);
      }
      else {
        for (iVar2 = (iVar1 / iVar2 + 1) * iVar2; iVar2 < iVar4; iVar2 = (iVar2 + iVar4) / 2) {
        }
      }
LAB_0008dc07:
      *(int *)(this + 0x104) = iVar2;
      if (*(void **)(this + 0x100) == (void *)0x0) {
        pvVar3 = malloc(iVar2 << 7);
        *(void **)(this + 0x100) = pvVar3;
      }
      else {
        pvVar3 = realloc(*(void **)(this + 0x100),iVar2 << 7);
        *(void **)(this + 0x100) = pvVar3;
        iVar4 = *(int *)(this + 0x10c) + 1;
      }
      goto LAB_0008db75;
    }
  }
  pvVar3 = *(void **)(this + 0x100);
LAB_0008db75:
  *(int *)(this + 0x10c) = iVar4;
  iVar5 = iVar1 * 0x80;
  iVar4 = (iVar4 - iVar1) + -1;
  *(void **)(this + 0x110) = pvVar3;
  if (0 < iVar4) {
    _V_memmove((void *)((int)pvVar3 + iVar5 + 0x80),(void *)((int)pvVar3 + iVar5),iVar4 * 0x80);
    pvVar3 = *(void **)(this + 0x100);
  }
  V_strncpy((char *)(iVar5 + (int)pvVar3),param_1,0x80);
  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)