L L4D2node

CBaseServer::Clear

0x00108010 · 511 bytes · __thiscall

_ZN11CBaseServer5ClearEv

Decompiled

undefined (1 param)

/* CBaseServer::Clear() */

void __thiscall CBaseServer::Clear(CBaseServer *this)

{
  int *piVar1;
  char cVar2;
  void *pvVar3;
  int iVar4;
  
  piVar1 = *(int **)(this + 0xbc);
  if (piVar1 != (int *)0x0) {
    (**(code **)(*piVar1 + 0xc))(piVar1);
    *(undefined4 *)(this + 0xbc) = 0;
  }
  *(undefined4 *)(this + 0xc0) = 0;
  *(undefined4 *)(this + 0xc4) = 0;
  *(undefined4 *)(this + 200) = 0;
  *(undefined4 *)(this + 0xcc) = 0;
  *(undefined4 *)(this + 4) = 0;
  *(undefined4 *)(this + 0xc) = 0;
  _V_memset(this + 0x10,0,0x40);
  _V_memset(this + 0x50,0,0x40);
  *(undefined4 *)(this + 0xb4) = 0;
  *(undefined4 *)(this + 0xb0) = 0;
  *(undefined4 *)(this + 0xb8) = 0;
  cVar2 = (**(code **)(*(int *)this + 0x68))(this);
  if (cVar2 == '\0') {
    cVar2 = (**(code **)(*(int *)this + 0x60))(this);
    if (cVar2 != '\0') goto LAB_001080d1;
    iVar4 = *(int *)(this + 0xf0);
    if ((iVar4 < 0x4000) && (-1 < *(int *)(this + 0xf4))) {
      *(undefined4 *)(this + 0xf0) = 0x4000;
      if (*(void **)(this + 0xec) == (void *)0x0) {
        pvVar3 = malloc(0x4000);
        iVar4 = 0x4000;
        *(void **)(this + 0xec) = pvVar3;
      }
      else {
        pvVar3 = realloc(*(void **)(this + 0xec),0x4000);
        iVar4 = *(int *)(this + 0xf0);
        *(void **)(this + 0xec) = pvVar3;
      }
      goto LAB_00108126;
    }
  }
  else {
LAB_001080d1:
    iVar4 = *(int *)(this + 0xf0);
    if ((iVar4 < 0x37aa0) && (-1 < *(int *)(this + 0xf4))) {
      *(undefined4 *)(this + 0xf0) = 0x37aa0;
      if (*(void **)(this + 0xec) == (void *)0x0) {
        pvVar3 = malloc(0x37aa0);
        iVar4 = 0x37aa0;
        *(void **)(this + 0xec) = pvVar3;
      }
      else {
        pvVar3 = realloc(*(void **)(this + 0xec),0x37aa0);
        iVar4 = *(int *)(this + 0xf0);
        *(void **)(this + 0xec) = pvVar3;
      }
      goto LAB_00108126;
    }
  }
  pvVar3 = *(void **)(this + 0xec);
LAB_00108126:
  bf_write::StartWriting((bf_write *)(this + 0xd4),pvVar3,iVar4,0,-1);
  bf_write::SetDebugName((bf_write *)(this + 0xd4),"m_Signon");
  *(undefined4 *)(this + 0xf8) = 0;
  *(undefined4 *)(this + 0xfc) = 0;
  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)