L L4D2node

CFrameSnapshot::ReleaseReference

0x001f21f0 · 127 bytes · __thiscall

_ZN14CFrameSnapshot16ReleaseReferenceEv

Decompiled

undefined (1 param)

/* CFrameSnapshot::ReleaseReference() */

uint __thiscall CFrameSnapshot::ReleaseReference(CFrameSnapshot *this)

{
  uint *puVar1;
  CFrameSnapshot *pCVar2;
  uint uVar3;
  undefined *puVar4;
  uint uVar5;
  
  puVar4 = framesnapshotmanager;
  uVar5 = ThreadGetCurrentId();
  puVar1 = (uint *)(puVar4 + 4);
  if (uVar5 != *(uint *)(puVar4 + 4)) {
    LOCK();
    uVar3 = *puVar1;
    if (uVar3 == 0) {
      *puVar1 = uVar5;
    }
    UNLOCK();
    if (uVar3 != 0) {
      CThreadFastMutex::Lock((uint)puVar1,uVar5);
      goto LAB_001f2224;
    }
  }
  *(int *)(puVar4 + 8) = *(int *)(puVar4 + 8) + 1;
LAB_001f2224:
  LOCK();
  pCVar2 = this + 0x38;
  *(int *)pCVar2 = *(int *)pCVar2 + -1;
  UNLOCK();
  if (*(int *)pCVar2 == 0) {
                    /* try { // try from 001f226b to 001f226f has its CatchHandler @ 001f2272 */
    CFrameSnapshotManager::DeleteFrameSnapshot
              ((CFrameSnapshotManager *)&g_FrameSnapshotManager,this);
  }
  *(int *)(puVar4 + 8) = *(int *)(puVar4 + 8) + -1;
  uVar5 = *(uint *)(puVar4 + 8);
  if (uVar5 == 0) {
    LOCK();
    uVar5 = *puVar1;
    *puVar1 = 0;
    UNLOCK();
  }
  return uVar5;
}

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)