L L4D2node

CDataManagerBase::LockResourceReturnCount

0x00bdbb30 · 212 bytes · __thiscall

_ZN16CDataManagerBase23LockResourceReturnCountEPiP13memhandle_t__

Decompiled

undefined (3 params)

/* CDataManagerBase::LockResourceReturnCount(int*, memhandle_t__*) */

undefined4 __thiscall
CDataManagerBase::LockResourceReturnCount
          (CDataManagerBase *this,int *param_1,memhandle_t__ *param_2)

{
  ushort *puVar1;
  int iVar2;
  ushort uVar3;
  ushort uVar4;
  uint uVar5;
  undefined4 uVar6;
  
  (*(code *)**(undefined4 **)this)(this);
  uVar5 = (uint)(param_2 + -1) & 0xffff;
  if ((int)uVar5 < *(int *)(this + 0x3c)) {
    iVar2 = uVar5 * 0xc;
    puVar1 = (ushort *)(*(int *)(this + 0xc) + iVar2);
    uVar3 = (ushort)(param_2 + -1);
    if ((((uVar3 != puVar1[4]) || (uVar3 == puVar1[5])) &&
        (puVar1[1] == (ushort)((uint)param_2 >> 0x10))) && (uVar3 != 0xffff)) {
      uVar4 = *puVar1;
      if (uVar4 == 0) {
        CUtlMultiList<CDataManagerBase::resource_lru_element_t,unsigned_short>::Unlink
                  ((CUtlMultiList<CDataManagerBase::resource_lru_element_t,unsigned_short> *)
                   (this + 0xc),*(ushort *)(this + 0x44),uVar3);
        CUtlMultiList<CDataManagerBase::resource_lru_element_t,unsigned_short>::LinkBefore
                  ((CUtlMultiList<CDataManagerBase::resource_lru_element_t,unsigned_short> *)
                   (this + 0xc),*(ushort *)(this + 0x46),0xffff,uVar3);
        puVar1 = (ushort *)(*(int *)(this + 0xc) + iVar2);
        uVar4 = *puVar1;
      }
      *puVar1 = uVar4 + 1;
      *param_1 = (uint)(ushort)(uVar4 + 1);
      uVar6 = *(undefined4 *)(*(int *)(this + 0xc) + 4 + iVar2);
      goto LAB_00bdbb60;
    }
  }
  *param_1 = 0;
  uVar6 = 0;
LAB_00bdbb60:
  (**(code **)(*(int *)this + 8))(this);
  return uVar6;
}

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)