L L4D2node

CPortalTouchScope::~CPortalTouchScope

0x00474f40 · 484 bytes · __thiscall

_ZN17CPortalTouchScopeD2Ev

Decompiled

undefined (1 param)

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

void __thiscall CPortalTouchScope::~CPortalTouchScope(CPortalTouchScope *this)

{
  int *piVar1;
  undefined4 *puVar2;
  int iVar3;
  char cVar4;
  undefined4 *puVar5;
  undefined4 *puVar6;
  int iVar7;
  
  m_nDepth = m_nDepth + -1;
  if ((m_nDepth != 0) || (_DAT_00f7e5d0 == 0)) {
    return;
  }
  do {
    puVar5 = DAT_00f7e5d8;
    if (DAT_00f7e5d8 == (undefined4 *)0x0) {
      puVar5 = ::operator_new(8);
      break;
    }
    cVar4 = ThreadInterlockedAssignIf64
                      (&DAT_00f7e5d8,*DAT_00f7e5d8,DAT_00f7e5dc + -1,DAT_00f7e5d8,DAT_00f7e5dc);
  } while (cVar4 == '\0');
  puVar5[1] = 0;
  *puVar5 = &m_CallQueue;
  while( true ) {
    iVar3 = DAT_00f7e5cc;
    puVar2 = DAT_00f7e5c8;
    LOCK();
    puVar6 = (undefined4 *)*DAT_00f7e5c8;
    if ((undefined4 **)puVar6 == &m_CallQueue) {
      *DAT_00f7e5c8 = puVar5;
      puVar6 = &m_CallQueue;
    }
    UNLOCK();
    if ((undefined4 **)puVar6 == &m_CallQueue) break;
    ThreadInterlockedAssignIf64(&DAT_00f7e5c8,*puVar2,iVar3 + 1,puVar2,iVar3);
  }
  ThreadInterlockedAssignIf64(&DAT_00f7e5c8,puVar5,iVar3 + 1,puVar2,iVar3);
  LOCK();
  _DAT_00f7e5d0 = _DAT_00f7e5d0 + 1;
  UNLOCK();
  while( true ) {
    do {
      do {
        while( true ) {
          do {
            puVar6 = m_CallQueue;
            puVar5 = (undefined4 *)*m_CallQueue;
          } while (puVar5 == (undefined4 *)0x0);
          if (m_CallQueue != DAT_00f7e5c8) break;
          if ((undefined4 **)puVar5 == &m_CallQueue) {
            return;
          }
          ThreadInterlockedAssignIf64
                    (&DAT_00f7e5c8,puVar5,DAT_00f7e5cc + 1,m_CallQueue,DAT_00f7e5cc);
        }
      } while ((undefined4 **)puVar5 == &m_CallQueue);
      piVar1 = (int *)puVar5[1];
      cVar4 = ThreadInterlockedAssignIf64
                        (&m_CallQueue,puVar5,DAT_00f7e5c4 + 1,m_CallQueue,DAT_00f7e5c4);
    } while (cVar4 == '\0');
    LOCK();
    _DAT_00f7e5d0 = _DAT_00f7e5d0 + -1;
    UNLOCK();
    puVar6[1] = piVar1;
    do {
      iVar3 = DAT_00f7e5dc;
      puVar5 = DAT_00f7e5d8;
      iVar7 = DAT_00f7e5dc + 0x10001;
      *puVar6 = DAT_00f7e5d8;
      cVar4 = ThreadInterlockedAssignIf64(&DAT_00f7e5d8,puVar6,iVar7,puVar5,iVar3);
    } while (cVar4 == '\0');
    if (piVar1 == (int *)0x0) break;
    (**(code **)(*piVar1 + 0x10))(piVar1);
    (**(code **)(*piVar1 + 4))(piVar1);
  }
  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)