L L4D2node

CSPSharedMemory::Release

0x001db250 · 102 bytes · __thiscall

_ZN15CSPSharedMemory7ReleaseEv

Decompiled

undefined (1 param)

/* CSPSharedMemory::Release() */

void __thiscall CSPSharedMemory::Release(CSPSharedMemory *this)

{
  CSPSharedMemory *pCVar1;
  int *piVar2;
  int *piVar3;
  int *piVar4;
  int iVar5;
  int iVar6;
  
  pCVar1 = this + 0x20;
  *(int *)pCVar1 = *(int *)pCVar1 + -1;
  if (*(int *)pCVar1 == 0) {
    iVar6 = DAT_003b0c94 + -1;
    piVar2 = (int *)(s_SinglePlayerSharedMemoryManager + iVar6 * 4);
    piVar3 = piVar2;
    iVar5 = DAT_003b0c94;
    do {
      piVar4 = piVar3;
      iVar5 = iVar5 + -1;
      if (iVar5 < 0) {
        return;
      }
      piVar3 = piVar4 + -1;
    } while (this != (CSPSharedMemory *)*piVar4);
    if (0 < DAT_003b0c94) {
      if (iVar5 != iVar6) {
        *piVar4 = *piVar2;
        iVar6 = DAT_003b0c94 + -1;
      }
      DAT_003b0c94 = iVar6;
      return;
    }
  }
  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)