L L4D2node

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

0x005cc740 · 761 bytes · __thiscall

_ZN10CUtlRBTreeIN7CUtlMapIj13ResponseGrouptE6Node_tEtNS2_8CKeyLessE10CUtlMemoryI15UtlRBTreeNode_tIS3_tEtEE6InsertERKS3_

Decompiled

undefined (2 params)

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

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

{
  byte bVar1;
  Node_t NVar2;
  ushort uVar3;
  undefined4 uVar4;
  bool bVar5;
  char cVar6;
  ushort uVar7;
  void *pvVar8;
  undefined2 *puVar9;
  byte bVar10;
  byte bVar11;
  byte bVar12;
  int iVar13;
  int iVar14;
  ushort local_26;
  int local_20;
  
  uVar3 = *(ushort *)(this + 0x10);
  if (*(ushort *)(this + 0x10) == 0xffff) {
    local_26 = NewNode(this);
    local_20 = (uint)local_26 * 0x20;
    puVar9 = (undefined2 *)(local_20 + *(int *)(this + 4));
    puVar9[2] = 0xffff;
    puVar9[1] = 0xffff;
    *puVar9 = 0xffff;
    puVar9[3] = 0;
  }
  else {
    do {
      while( true ) {
        uVar7 = uVar3;
        iVar13 = (uint)uVar7 * 0x20;
        cVar6 = (**(code **)this)(param_1,*(int *)(this + 4) + iVar13 + 8);
        if (cVar6 != '\0') break;
        if (Links(unsigned_short)::s_Sentinel == '\0') {
          iVar14 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
          if (iVar14 != 0) {
            Links(unsigned_short)::s_Sentinel = 0xffff;
            DAT_00f21cda = 0xffff;
            DAT_00f21cdc = 0xffff;
            __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
          }
        }
        bVar5 = false;
        uVar3 = *(ushort *)(*(int *)(this + 4) + 2 + iVar13);
        if (uVar3 == 0xffff) goto LAB_005cc7bc;
      }
      if (Links(unsigned_short)::s_Sentinel == '\0') {
        iVar14 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
        if (iVar14 != 0) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00f21cda = 0xffff;
          DAT_00f21cdc = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        }
      }
      bVar5 = true;
      uVar3 = *(ushort *)(*(int *)(this + 4) + iVar13);
    } while (*(ushort *)(*(int *)(this + 4) + iVar13) != 0xffff);
LAB_005cc7bc:
    local_26 = NewNode(this);
    local_20 = (uint)local_26 * 0x20;
    puVar9 = (undefined2 *)(local_20 + *(int *)(this + 4));
    puVar9[2] = uVar7;
    puVar9[1] = 0xffff;
    *puVar9 = 0xffff;
    puVar9[3] = 0;
    if (uVar7 != 0xffff) {
      if (bVar5) {
        *(ushort *)(*(int *)(this + 4) + iVar13) = local_26;
      }
      else {
        *(ushort *)(*(int *)(this + 4) + 2 + iVar13) = local_26;
      }
      goto LAB_005cc81a;
    }
  }
  *(ushort *)(this + 0x10) = local_26;
LAB_005cc81a:
  InsertRebalance(this,local_26);
  *(short *)(this + 0x12) = *(short *)(this + 0x12) + 1;
  local_20 = local_20 + *(int *)(this + 4);
  if (local_20 != -8) {
    uVar4 = *(undefined4 *)param_1;
    *(undefined4 *)(local_20 + 0xc) = 0;
    *(undefined4 *)(local_20 + 0x10) = 0;
    *(undefined4 *)(local_20 + 0x14) = 0;
    *(undefined4 *)(local_20 + 0x18) = 0;
    *(undefined4 *)(local_20 + 8) = uVar4;
    if ((CUtlVector<Response,CUtlMemoryConservative<Response>> *)(local_20 + 0xc) !=
        (CUtlVector<Response,CUtlMemoryConservative<Response>> *)(param_1 + 4)) {
      iVar13 = *(int *)(param_1 + 0xc);
      if (iVar13 < 1) {
        pvVar8 = realloc((void *)0x0,0);
        *(undefined4 *)(local_20 + 0x10) = 0;
        *(void **)(local_20 + 0xc) = pvVar8;
        *(void **)(local_20 + 0x18) = pvVar8;
      }
      else {
        pvVar8 = realloc((void *)0x0,iVar13 * 0x50);
        *(int *)(local_20 + 0x10) = iVar13 * 0x50;
        iVar14 = 0;
        *(void **)(local_20 + 0xc) = pvVar8;
        *(void **)(local_20 + 0x18) = pvVar8;
        do {
                    /* try { // try from 005cc8ba to 005cc8be has its CatchHandler @ 005cca56 */
          CUtlVector<Response,CUtlMemoryConservative<Response>>::InsertBefore
                    ((CUtlVector<Response,CUtlMemoryConservative<Response>> *)(local_20 + 0xc),
                     *(int *)(local_20 + 0x14),(Response *)(iVar14 * 0x50 + *(int *)(param_1 + 4)));
          iVar14 = iVar14 + 1;
        } while (iVar14 != iVar13);
      }
      bVar1 = *(byte *)(local_20 + 0x1f);
      bVar10 = (byte)param_1[0x17] & 1;
      *(byte *)(local_20 + 0x1f) = bVar1 & 0xfe | bVar10;
      *(Node_t *)(local_20 + 0x1e) = param_1[0x16];
      bVar11 = (byte)param_1[0x17] & 2;
      *(byte *)(local_20 + 0x1f) = bVar1 & 0xfc | bVar10 | bVar11;
      bVar12 = (byte)param_1[0x17] & 4;
      *(byte *)(local_20 + 0x1f) = bVar1 & 0xf8 | bVar10 | bVar11 | bVar12;
      NVar2 = param_1[0x17];
      *(byte *)(local_20 + 0x1f) = bVar1 & 0xf0 | bVar10 | bVar11 | bVar12 | (byte)NVar2 & 8;
      *(byte *)(local_20 + 0x1f) =
           bVar1 & 0xe0 | bVar10 | bVar11 | bVar12 | (byte)NVar2 & 8 | (byte)param_1[0x17] & 0x10;
      *(Node_t *)(local_20 + 0x1c) = param_1[0x14];
      *(Node_t *)(local_20 + 0x1d) = param_1[0x15];
    }
  }
  return local_26;
}

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)