L L4D2node

CDataManagerBase::DestroyResource

0x00bdbda0 · 264 bytes · __thiscall

_ZN16CDataManagerBase15DestroyResourceEP13memhandle_t__

Decompiled

undefined (2 params)

/* CDataManagerBase::DestroyResource(memhandle_t__*) */

void __thiscall CDataManagerBase::DestroyResource(CDataManagerBase *this,memhandle_t__ *param_1)

{
  short sVar1;
  short *psVar2;
  short sVar3;
  uint uVar4;
  
  (*(code *)**(undefined4 **)this)(this);
  uVar4 = (uint)(param_1 + -1) & 0xffff;
  if ((int)uVar4 < *(int *)(this + 0x3c)) {
    psVar2 = (short *)(*(int *)(this + 0xc) + uVar4 * 0xc);
    sVar1 = psVar2[4];
    sVar3 = (short)(param_1 + -1);
    if (((sVar3 == sVar1) && (sVar3 != psVar2[5])) || (psVar2[1] != (short)((uint)param_1 >> 0x10)))
    goto LAB_00bdbdf4;
    if (sVar1 != sVar3) goto LAB_00bdbe2f;
  }
  else {
LAB_00bdbdf4:
    if (*(int *)(this + 0x3c) < 0x10000) goto LAB_00bdbdfb;
    uVar4 = 0xffff;
    psVar2 = (short *)((int)&__DT_REL[0x15c3e].r_info + *(int *)(this + 0xc));
    sVar1 = *(short *)((int)&__DT_REL[0x15c3f].r_info + *(int *)(this + 0xc));
    if (sVar1 != -1) goto LAB_00bdbe2f;
  }
  if (psVar2[5] == sVar1) {
LAB_00bdbe2f:
    if (*psVar2 != 0) {
      BreakLock(this,param_1);
    }
    CUtlMultiList<CDataManagerBase::resource_lru_element_t,unsigned_short>::Unlink
              ((CUtlMultiList<CDataManagerBase::resource_lru_element_t,unsigned_short> *)
               (this + 0xc),*(ushort *)(this + 0x44),(ushort)uVar4);
    GetForFreeByIndex(this,(ushort)uVar4);
    (**(code **)(*(int *)this + 8))(this);
                    /* WARNING: Could not recover jumptable at 0x00bdbe83. Too many branches */
                    /* WARNING: Treating indirect jump as call */
    (**(code **)(*(int *)this + 0x14))();
    return;
  }
LAB_00bdbdfb:
                    /* WARNING: Could not recover jumptable at 0x00bdbe0a. Too many branches */
                    /* WARNING: Treating indirect jump as call */
  (**(code **)(*(int *)this + 8))();
  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)