L L4D2node

CUtlRBTree<char_const*,unsigned_short,bool(*)(char_const*const&,char_const*const&),CUtlMemory<UtlRBTreeNode_t<char_const*,unsigned_short>,unsigned_short>>::InsertRebalance

0x005c1e90 · 1935 bytes · __thiscall

_ZN10CUtlRBTreeIPKctPFbRKS1_S3_E10CUtlMemoryI15UtlRBTreeNode_tIS1_tEtEE15InsertRebalanceEt

Decompiled

undefined (2 params)

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

void __thiscall
CUtlRBTree<char_const*,unsigned_short,bool(*)(char_const*const&,char_const*const&),CUtlMemory<UtlRBTreeNode_t<char_const*,unsigned_short>,unsigned_short>>
::InsertRebalance(CUtlRBTree<char_const*,unsigned_short,bool(*)(char_const*const&,char_const*const&),CUtlMemory<UtlRBTreeNode_t<char_const*,unsigned_short>,unsigned_short>>
                  *this,ushort param_1)

{
  ushort uVar1;
  ushort uVar2;
  short sVar3;
  ushort *puVar4;
  int iVar5;
  undefined2 *puVar6;
  uint uVar7;
  ushort local_20;
  ushort local_1e;
  
  local_1e = param_1;
  do {
    uVar1 = *(ushort *)(this + 0x10);
    if (local_1e == uVar1) {
LAB_005c1f05:
      *(undefined2 *)(*(int *)(this + 4) + (uint)uVar1 * 0xc + 6) = 1;
      return;
    }
    if (Links(unsigned_short)::s_Sentinel == '\0') {
      iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
      if (iVar5 != 0) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f15fca = 0xffff;
        DAT_00f15fcc = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      if (local_1e == 0xffff) goto LAB_005c2251;
LAB_005c1ecf:
      puVar6 = (undefined2 *)(*(int *)(this + 4) + (uint)local_1e * 0xc);
    }
    else {
      if (local_1e != 0xffff) goto LAB_005c1ecf;
LAB_005c2251:
      puVar6 = &Links(unsigned_short)::s_Sentinel;
    }
    uVar1 = puVar6[2];
    if ((Links(unsigned_short)::s_Sentinel == '\0') &&
       (iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar5 != 0)) {
      DAT_00f15fca = 0xffff;
      Links(unsigned_short)::s_Sentinel = 0xffff;
      DAT_00f15fcc = 0xffff;
      __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      if (uVar1 == 0xffff) goto LAB_005c2218;
LAB_005c1ef1:
      puVar6 = (undefined2 *)(*(int *)(this + 4) + (uint)uVar1 * 0xc);
    }
    else {
      if (uVar1 != 0xffff) goto LAB_005c1ef1;
LAB_005c2218:
      puVar6 = &Links(unsigned_short)::s_Sentinel;
    }
    if (puVar6[3] != 0) {
      uVar1 = *(ushort *)(this + 0x10);
      goto LAB_005c1f05;
    }
    if (Links(unsigned_short)::s_Sentinel == '\0') {
      iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
      if (iVar5 != 0) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f15fca = 0xffff;
        DAT_00f15fcc = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      if (local_1e == 0xffff) goto LAB_005c21b9;
LAB_005c1f3d:
      puVar6 = (undefined2 *)(*(int *)(this + 4) + (uint)local_1e * 0xc);
    }
    else {
      if (local_1e != 0xffff) goto LAB_005c1f3d;
LAB_005c21b9:
      puVar6 = &Links(unsigned_short)::s_Sentinel;
    }
    uVar1 = puVar6[2];
    uVar7 = (uint)uVar1;
    if (Links(unsigned_short)::s_Sentinel == '\0') {
      iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
      if (iVar5 != 0) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f15fca = 0xffff;
        DAT_00f15fcc = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      if (uVar1 == 0xffff) goto LAB_005c2145;
LAB_005c1f62:
      local_20 = *(ushort *)(*(int *)(this + 4) + uVar7 * 0xc + 4);
      if (Links(unsigned_short)::s_Sentinel != '\0') goto LAB_005c1f7b;
LAB_005c2160:
      iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
      if (iVar5 != 0) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f15fca = 0xffff;
        DAT_00f15fcc = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      if (uVar1 == 0xffff) goto LAB_005c2185;
LAB_005c1f85:
      puVar6 = (undefined2 *)(*(int *)(this + 4) + uVar7 * 0xc);
    }
    else {
      if (uVar1 != 0xffff) goto LAB_005c1f62;
LAB_005c2145:
      local_20 = DAT_00f15fcc;
      if (Links(unsigned_short)::s_Sentinel == '\0') goto LAB_005c2160;
LAB_005c1f7b:
      if (uVar1 != 0xffff) goto LAB_005c1f85;
LAB_005c2185:
      puVar6 = &Links(unsigned_short)::s_Sentinel;
    }
    uVar2 = puVar6[2];
    if (Links(unsigned_short)::s_Sentinel == '\0') {
      iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
      if (iVar5 != 0) {
        Links(unsigned_short)::s_Sentinel = 0xffff;
        DAT_00f15fcc = 0xffff;
        DAT_00f15fca = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        goto LAB_005c1f9a;
      }
      if (uVar2 == 0xffff) goto LAB_005c2113;
LAB_005c1fa4:
      puVar4 = (ushort *)(*(int *)(this + 4) + (uint)uVar2 * 0xc);
    }
    else {
LAB_005c1f9a:
      if (uVar2 != 0xffff) goto LAB_005c1fa4;
LAB_005c2113:
      puVar4 = &Links(unsigned_short)::s_Sentinel;
    }
    if (uVar1 == *puVar4) {
      if (Links(unsigned_short)::s_Sentinel == '\0') {
        iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
        if (iVar5 != 0) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00f15fca = 0xffff;
          DAT_00f15fcc = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        }
        if (local_20 == 0xffff) goto LAB_005c23c1;
LAB_005c1fcf:
        puVar6 = (undefined2 *)(*(int *)(this + 4) + (uint)local_20 * 0xc);
      }
      else {
        if (local_20 != 0xffff) goto LAB_005c1fcf;
LAB_005c23c1:
        puVar6 = &Links(unsigned_short)::s_Sentinel;
      }
      uVar2 = puVar6[1];
      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_00f15fca = 0xffff;
        DAT_00f15fcc = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
      }
      sVar3 = DAT_00f15fce;
      if (uVar2 != 0xffff) {
        sVar3 = *(short *)(*(int *)(this + 4) + (uint)uVar2 * 0xc + 6);
      }
      if (sVar3 == 0) {
        *(undefined2 *)(*(int *)(this + 4) + uVar7 * 0xc + 6) = 1;
        local_1e = local_20;
        *(undefined2 *)(*(int *)(this + 4) + (uint)uVar2 * 0xc + 6) = 1;
        *(undefined2 *)(*(int *)(this + 4) + (uint)local_20 * 0xc + 6) = 0;
      }
      else {
        iVar5 = Links(this,local_1e);
        iVar5 = Links(this,*(ushort *)(iVar5 + 4));
        if (local_1e == *(ushort *)(iVar5 + 2)) {
          RotateLeft(this,uVar1);
          iVar5 = Links(this,uVar1);
          uVar7 = (uint)*(ushort *)(iVar5 + 4);
          iVar5 = Links(this,*(ushort *)(iVar5 + 4));
          local_20 = *(ushort *)(iVar5 + 4);
          local_1e = uVar1;
        }
        *(undefined2 *)(*(int *)(this + 4) + uVar7 * 0xc + 6) = 1;
        *(undefined2 *)(*(int *)(this + 4) + (uint)local_20 * 0xc + 6) = 0;
        RotateRight(this,local_20);
      }
    }
    else {
      if (Links(unsigned_short)::s_Sentinel == '\0') {
        iVar5 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel);
        if (iVar5 != 0) {
          Links(unsigned_short)::s_Sentinel = 0xffff;
          DAT_00f15fca = 0xffff;
          DAT_00f15fcc = 0xffff;
          __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        }
        if (local_20 == 0xffff) goto LAB_005c2461;
LAB_005c2066:
        puVar4 = (ushort *)(*(int *)(this + 4) + (uint)local_20 * 0xc);
      }
      else {
        if (local_20 != 0xffff) goto LAB_005c2066;
LAB_005c2461:
        puVar4 = &Links(unsigned_short)::s_Sentinel;
      }
      uVar2 = *puVar4;
      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_00f15fca = 0xffff;
        DAT_00f15fcc = 0xffff;
        __cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
        if (uVar2 == 0xffff) goto LAB_005c2428;
LAB_005c2087:
        puVar6 = (undefined2 *)(*(int *)(this + 4) + (uint)uVar2 * 0xc);
      }
      else {
        if (uVar2 != 0xffff) goto LAB_005c2087;
LAB_005c2428:
        puVar6 = &Links(unsigned_short)::s_Sentinel;
      }
      if (puVar6[3] == 0) {
        *(undefined2 *)(*(int *)(this + 4) + uVar7 * 0xc + 6) = 1;
        *(undefined2 *)(*(int *)(this + 4) + (uint)uVar2 * 0xc + 6) = 1;
        local_1e = local_20;
        *(undefined2 *)(*(int *)(this + 4) + (uint)local_20 * 0xc + 6) = 0;
      }
      else {
        iVar5 = Links(this,local_1e);
        puVar4 = (ushort *)Links(this,*(ushort *)(iVar5 + 4));
        if (local_1e == *puVar4) {
          RotateRight(this,uVar1);
          iVar5 = Links(this,uVar1);
          uVar7 = (uint)*(ushort *)(iVar5 + 4);
          iVar5 = Links(this,*(ushort *)(iVar5 + 4));
          local_20 = *(ushort *)(iVar5 + 4);
          local_1e = uVar1;
        }
        *(undefined2 *)(*(int *)(this + 4) + uVar7 * 0xc + 6) = 1;
        *(undefined2 *)(*(int *)(this + 4) + (uint)local_20 * 0xc + 6) = 0;
        RotateLeft(this,local_20);
      }
    }
  } while( true );
}

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)