L L4D2node

FreeCircularBuffer

0x00b698d0 · 291 bytes · __cdecl

_Z18FreeCircularBufferP15CCircularBuffer

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* FreeCircularBuffer(CCircularBuffer*) */

void FreeCircularBuffer(CCircularBuffer *param_1)

{
  int iVar1;
  undefined4 uVar2;
  char cVar3;
  int iVar4;
  
  iVar1 = *(int *)(param_1 + 0xc);
  if (iVar1 < 0x2275) {
    if ((DAT_01045410 <= param_1) && (param_1 < _DAT_01045414)) {
      do {
        iVar1 = DAT_0104540c;
        uVar2 = g_SmallBuffers;
        iVar4 = DAT_0104540c + 0x10001;
        *(undefined4 *)param_1 = g_SmallBuffers;
        cVar3 = ThreadInterlockedAssignIf64(&g_SmallBuffers,param_1,iVar4,uVar2,iVar1);
      } while (cVar3 == '\0');
      return;
    }
  }
  else if (iVar1 < 0x44e9) {
    if ((DAT_01045400 <= param_1) && (param_1 < _DAT_01045404)) {
      do {
        iVar1 = DAT_010453fc;
        uVar2 = g_MediumBuffers;
        iVar4 = DAT_010453fc + 0x10001;
        *(undefined4 *)param_1 = g_MediumBuffers;
        cVar3 = ThreadInterlockedAssignIf64(&g_MediumBuffers,param_1,iVar4,uVar2,iVar1);
      } while (cVar3 == '\0');
      return;
    }
  }
  else if (((iVar1 < 0x89d1) && (DAT_010453f0 <= param_1)) && (param_1 < _DAT_010453f4)) {
    do {
      iVar1 = DAT_010453ec;
      uVar2 = g_LargeBuffers;
      iVar4 = DAT_010453ec + 0x10001;
      *(undefined4 *)param_1 = g_LargeBuffers;
      cVar3 = ThreadInterlockedAssignIf64(&g_LargeBuffers,param_1,iVar4,uVar2,iVar1);
    } while (cVar3 == '\0');
    return;
  }
  free(param_1);
  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)