L L4D2node

CUtlRBTree<CUtlString,unsigned_short,bool(*)(CUtlString_const&,CUtlString_const&),CUtlMemory<UtlRBTreeNode_t<CUtlString,unsigned_short>,unsigned_short>>::Insert

0x0061dc50 · 485 bytes · __thiscall

_ZN10CUtlRBTreeI10CUtlStringtPFbRKS0_S2_E10CUtlMemoryI15UtlRBTreeNode_tIS0_tEtEE6InsertES2_

Decompiled

undefined (2 params)

/* CUtlRBTree<CUtlString, unsigned short, bool (*)(CUtlString const&, CUtlString const&),
   CUtlMemory<UtlRBTreeNode_t<CUtlString, unsigned short>, unsigned short> >::Insert(CUtlString
   const&) */

uint __thiscall
CUtlRBTree<CUtlString,unsigned_short,bool(*)(CUtlString_const&,CUtlString_const&),CUtlMemory<UtlRBTreeNode_t<CUtlString,unsigned_short>,unsigned_short>>
::Insert(CUtlRBTree<CUtlString,unsigned_short,bool(*)(CUtlString_const&,CUtlString_const&),CUtlMemory<UtlRBTreeNode_t<CUtlString,unsigned_short>,unsigned_short>>
         *this,CUtlString *param_1)

{
  int iVar1;
  ushort uVar2;
  bool bVar3;
  char cVar4;
  CUtlString *this_00;
  int iVar5;
  uint uVar6;
  undefined2 *puVar7;
  uint uVar8;
  int local_24;
  ushort local_1e;
  
  uVar2 = *(ushort *)(this + 0x10);
  if (*(ushort *)(this + 0x10) == 0xffff) {
    uVar6 = NewNode(this);
    uVar8 = uVar6 & 0xffff;
    local_24 = uVar8 * 0x18;
    puVar7 = (undefined2 *)(local_24 + *(int *)(this + 4));
    puVar7[2] = 0xffff;
    puVar7[1] = 0xffff;
    *puVar7 = 0xffff;
    puVar7[3] = 0;
  }
  else {
    do {
      local_1e = uVar2;
      iVar1 = (uint)local_1e * 0x18;
      cVar4 = (**(code **)this)(param_1,*(int *)(this + 4) + iVar1 + 8);
      if (cVar4 == '\0') {
        if ((Links(unsigned_short)::s_Sentinel == '\0') &&
           (iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar5 != 0)) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00f26b8e = 0xffff;
          DAT_00f26b90 = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        }
        bVar3 = false;
        uVar2 = *(ushort *)(*(int *)(this + 4) + 2 + iVar1);
      }
      else {
        if ((Links(unsigned_short)::s_Sentinel == '\0') &&
           (iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar5 != 0)) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00f26b8e = 0xffff;
          DAT_00f26b90 = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        }
        bVar3 = true;
        uVar2 = *(ushort *)(*(int *)(this + 4) + (uint)local_1e * 0x18);
      }
    } while (uVar2 != 0xffff);
    uVar6 = NewNode(this);
    uVar8 = uVar6 & 0xffff;
    local_24 = uVar8 * 0x18;
    puVar7 = (undefined2 *)(local_24 + *(int *)(this + 4));
    puVar7[2] = local_1e;
    puVar7[1] = 0xffff;
    *puVar7 = 0xffff;
    puVar7[3] = 0;
    if (local_1e != 0xffff) {
      if (bVar3) {
        *(short *)(*(int *)(this + 4) + iVar1) = (short)uVar6;
      }
      else {
        *(short *)(*(int *)(this + 4) + 2 + iVar1) = (short)uVar6;
      }
      goto LAB_0061dd28;
    }
  }
  *(short *)(this + 0x10) = (short)uVar6;
LAB_0061dd28:
  InsertRebalance(this,(ushort)uVar8);
  *(short *)(this + 0x12) = *(short *)(this + 0x12) + 1;
  this_00 = (CUtlString *)(local_24 + *(int *)(this + 4) + 8);
  if (this_00 != (CUtlString *)0x0) {
    CUtlString::CUtlString(this_00,param_1);
  }
  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)