L L4D2node

CUtlRBTree<CUtlMap<unsigned_int,Criteria,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,Criteria,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,Criteria,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>::Insert

0x005cdba0 · 908 bytes · __thiscall

_ZN10CUtlRBTreeIN7CUtlMapIj8CriteriatE6Node_tEtNS2_8CKeyLessE10CUtlMemoryI15UtlRBTreeNode_tIS3_tEtEE6InsertERKS3_

Decompiled

undefined (2 params)

/* CUtlRBTree<CUtlMap<unsigned int, Criteria, unsigned short>::Node_t, unsigned short,
   CUtlMap<unsigned int, Criteria, unsigned short>::CKeyLess,
   CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned int, Criteria, unsigned short>::Node_t, unsigned
   short>, unsigned short> >::Insert(CUtlMap<unsigned int, Criteria, unsigned short>::Node_t const&)
    */

ushort __thiscall
CUtlRBTree<CUtlMap<unsigned_int,Criteria,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,Criteria,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,Criteria,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Insert(CUtlRBTree<CUtlMap<unsigned_int,Criteria,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_int,Criteria,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_int,Criteria,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
         *this,Node_t *param_1)

{
  byte bVar1;
  Node_t NVar2;
  ushort uVar3;
  uint uVar4;
  bool bVar5;
  char cVar6;
  undefined4 uVar7;
  uint uVar8;
  void *pvVar9;
  int iVar10;
  undefined2 *puVar11;
  byte bVar12;
  byte bVar13;
  byte bVar14;
  byte bVar15;
  byte bVar16;
  ushort uVar17;
  int iVar18;
  ushort local_22;
  int local_20;
  
  uVar3 = *(ushort *)(this + 0x10);
  if (*(ushort *)(this + 0x10) == 0xffff) {
    local_22 = NewNode(this);
    local_20 = (uint)local_22 * 0x34;
    puVar11 = (undefined2 *)(local_20 + *(int *)(this + 4));
    puVar11[2] = 0xffff;
    puVar11[1] = 0xffff;
    *puVar11 = 0xffff;
    puVar11[3] = 0;
  }
  else {
    do {
      uVar17 = uVar3;
      iVar18 = (uint)uVar17 * 0x34;
      cVar6 = (**(code **)this)(param_1,*(int *)(this + 4) + iVar18 + 8);
      if (cVar6 == '\0') {
        if ((Links(unsigned_short)::s_Sentinel == '\0') &&
           (iVar10 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar10 != 0)) {
          DAT_00f21cd2 = 0xffff;
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00f21cd4 = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        }
        bVar5 = false;
        uVar3 = *(ushort *)(*(int *)(this + 4) + 2 + iVar18);
      }
      else {
        if ((Links(unsigned_short)::s_Sentinel == '\0') &&
           (iVar10 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar10 != 0)) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00f21cd2 = 0xffff;
          DAT_00f21cd4 = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        }
        bVar5 = true;
        uVar3 = *(ushort *)(*(int *)(this + 4) + iVar18);
      }
    } while (uVar3 != 0xffff);
    local_22 = NewNode(this);
    local_20 = (uint)local_22 * 0x34;
    puVar11 = (undefined2 *)(local_20 + *(int *)(this + 4));
    puVar11[1] = 0xffff;
    *puVar11 = 0xffff;
    puVar11[2] = uVar17;
    puVar11[3] = 0;
    if (uVar17 != 0xffff) {
      if (bVar5) {
        *(ushort *)(*(int *)(this + 4) + iVar18) = local_22;
      }
      else {
        *(ushort *)(*(int *)(this + 4) + 2 + iVar18) = local_22;
      }
      goto LAB_005cdc81;
    }
  }
  *(ushort *)(this + 0x10) = local_22;
LAB_005cdc81:
  InsertRebalance(this,local_22);
  *(short *)(this + 0x12) = *(short *)(this + 0x12) + 1;
  local_20 = local_20 + *(int *)(this + 4);
  if (local_20 != -8) {
    uVar7 = *(undefined4 *)param_1;
    *(undefined2 *)(local_20 + 0xc) = 0xffff;
    *(byte *)(local_20 + 0x1d) = *(byte *)(local_20 + 0x1d) & 0x80;
    *(undefined4 *)(local_20 + 0x15) = 0;
    *(undefined4 *)(local_20 + 0x19) = 0;
    *(undefined4 *)(local_20 + 8) = uVar7;
    *(undefined2 *)(local_20 + 0x1e) = 0xffff;
    *(undefined2 *)(local_20 + 0x20) = 0xffff;
    *(undefined4 *)(local_20 + 0x22) = 0;
    *(undefined4 *)(local_20 + 0x26) = 0;
    *(undefined4 *)(local_20 + 0x2a) = 0;
    *(undefined4 *)(local_20 + 0x2e) = 0;
    if (param_1 + 4 != (Node_t *)(local_20 + 0xc)) {
      *(undefined2 *)(local_20 + 0xc) = *(undefined2 *)(param_1 + 4);
                    /* try { // try from 005cdd16 to 005cde3a has its CatchHandler @ 005cdf45 */
      uVar7 = ResponseCopyString(*(char **)(param_1 + 6));
      *(undefined4 *)(local_20 + 0xe) = uVar7;
      *(undefined2 *)(local_20 + 0x12) = *(undefined2 *)(param_1 + 10);
      *(Node_t *)(local_20 + 0x14) = param_1[0xc];
      *(undefined4 *)(local_20 + 0x15) = *(undefined4 *)(param_1 + 0xd);
      *(undefined4 *)(local_20 + 0x19) = *(undefined4 *)(param_1 + 0x11);
      bVar1 = *(byte *)(local_20 + 0x1d);
      bVar12 = (byte)param_1[0x15] & 1;
      *(byte *)(local_20 + 0x1d) = bVar1 & 0xfe | bVar12;
      bVar13 = (byte)param_1[0x15] & 2;
      *(byte *)(local_20 + 0x1d) = bVar1 & 0xfc | bVar12 | bVar13;
      bVar14 = (byte)param_1[0x15] & 4;
      *(byte *)(local_20 + 0x1d) = bVar1 & 0xf8 | bVar12 | bVar13 | bVar14;
      bVar15 = (byte)param_1[0x15] & 8;
      *(byte *)(local_20 + 0x1d) = bVar1 & 0xf0 | bVar12 | bVar13 | bVar14 | bVar15;
      bVar16 = (byte)param_1[0x15] & 0x10;
      *(byte *)(local_20 + 0x1d) = bVar1 & 0xe0 | bVar12 | bVar13 | bVar14 | bVar15 | bVar16;
      NVar2 = param_1[0x15];
      *(byte *)(local_20 + 0x1d) =
           bVar1 & 0xc0 | bVar12 | bVar13 | bVar14 | bVar15 | bVar16 | (byte)NVar2 & 0x20;
      *(byte *)(local_20 + 0x1d) =
           bVar1 & 0x80 | bVar12 | bVar13 | bVar14 | bVar15 | bVar16 | (byte)NVar2 & 0x20 |
           (byte)param_1[0x15] & 0x40;
      *(undefined2 *)(local_20 + 0x1e) = *(undefined2 *)(param_1 + 0x16);
      *(undefined2 *)(local_20 + 0x20) = *(undefined2 *)(param_1 + 0x18);
      uVar4 = *(uint *)(param_1 + 0x22);
      uVar8 = *(uint *)(local_20 + 0x26) >> 1;
      if ((int)uVar8 < (int)uVar4) {
        uVar8 = uVar4;
      }
      pvVar9 = realloc(*(void **)(local_20 + 0x22),uVar8 * 2);
      *(uint *)(local_20 + 0x26) = uVar8 * 2;
      *(void **)(local_20 + 0x22) = pvVar9;
      *(void **)(local_20 + 0x2e) = pvVar9;
      if (0 < (int)uVar4) {
        iVar18 = 0;
        do {
          CUtlVector<unsigned_short,CUtlMemoryConservative<unsigned_short>>::InsertBefore
                    ((CUtlVector<unsigned_short,CUtlMemoryConservative<unsigned_short>> *)
                     (local_20 + 0x22),*(int *)(local_20 + 0x2a),
                     (ushort *)(*(int *)(param_1 + 0x1a) + iVar18));
          iVar18 = iVar18 + 2;
        } while (iVar18 != uVar4 * 2);
      }
    }
  }
  return local_22;
}

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)