CUtlRBTree<CUtlMap<studiohdr_t_const*,StudioHdrToActivityMapEntry_t,unsigned_short>::Node_t,unsigned_short,CUtlMap<studiohdr_t_const*,StudioHdrToActivityMapEntry_t,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<studiohdr_t_const*,StudioHdrToActivityMapEntry_t,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>::Insert
0x005a5240 · 737 bytes · __thiscall
_ZN10CUtlRBTreeIN7CUtlMapIPK11studiohdr_t29StudioHdrToActivityMapEntry_ttE6Node_tEtNS5_8CKeyLessE10CUtlMemoryI15UtlRBTreeNode_tIS6_tEtEE6InsertERKS6_
Decompiled
undefined (2 params)
/* CUtlRBTree<CUtlMap<studiohdr_t const*, StudioHdrToActivityMapEntry_t, unsigned short>::Node_t,
unsigned short, CUtlMap<studiohdr_t const*, StudioHdrToActivityMapEntry_t, unsigned
short>::CKeyLess, CUtlMemory<UtlRBTreeNode_t<CUtlMap<studiohdr_t const*,
StudioHdrToActivityMapEntry_t, unsigned short>::Node_t, unsigned short>, unsigned short>
>::Insert(CUtlMap<studiohdr_t const*, StudioHdrToActivityMapEntry_t, unsigned short>::Node_t
const&) */
ushort __thiscall
CUtlRBTree<CUtlMap<studiohdr_t_const*,StudioHdrToActivityMapEntry_t,unsigned_short>::Node_t,unsigned_short,CUtlMap<studiohdr_t_const*,StudioHdrToActivityMapEntry_t,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<studiohdr_t_const*,StudioHdrToActivityMapEntry_t,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Insert(CUtlRBTree<CUtlMap<studiohdr_t_const*,StudioHdrToActivityMapEntry_t,unsigned_short>::Node_t,unsigned_short,CUtlMap<studiohdr_t_const*,StudioHdrToActivityMapEntry_t,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<studiohdr_t_const*,StudioHdrToActivityMapEntry_t,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*this,Node_t *param_1)
{
bool bVar1;
char cVar2;
int iVar3;
uint uVar4;
int iVar5;
undefined2 *puVar6;
ushort uVar7;
Node_t *pNVar8;
uint uVar9;
ushort *puVar10;
undefined4 *puVar11;
byte bVar12;
uint local_28;
int local_24;
ushort local_1e;
bVar12 = 0;
uVar9 = (uint)*(ushort *)(this + 0x10);
if (*(ushort *)(this + 0x10) == 0xffff) {
bVar1 = false;
}
else {
while( true ) {
iVar5 = uVar9 * 0x58;
cVar2 = (**(code **)this)(param_1,*(int *)(this + 4) + iVar5 + 8);
if (cVar2 == '\0') {
if ((Links(unsigned_short)::s_Sentinel == '\0') &&
(iVar3 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar3 != 0)) {
DAT_00f21322 = 0xffff;
Links(unsigned_short)::s_Sentinel = 0xffff;
DAT_00f21324 = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
}
bVar1 = false;
uVar7 = *(ushort *)(*(int *)(this + 4) + 2 + iVar5);
}
else {
if ((Links(unsigned_short)::s_Sentinel == '\0') &&
(iVar3 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar3 != 0)) {
Links(unsigned_short)::s_Sentinel = 0xffff;
DAT_00f21322 = 0xffff;
DAT_00f21324 = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
}
bVar1 = true;
uVar7 = *(ushort *)(*(int *)(this + 4) + iVar5);
}
if (uVar7 == 0xffff) break;
uVar9 = (uint)uVar7;
}
}
uVar7 = *(ushort *)(this + 0x14);
if (uVar7 != 0xffff) {
iVar5 = *(int *)(this + 4);
local_24 = (uint)uVar7 * 0x58;
puVar6 = (undefined2 *)(local_24 + iVar5);
*(undefined2 *)(this + 0x14) = puVar6[1];
local_1e = uVar7;
goto LAB_005a52f7;
}
iVar5 = *(int *)(this + 8);
if ((int)(uint)*(ushort *)(this + 0x16) < iVar5) {
uVar4 = *(ushort *)(this + 0x16) + 1;
local_28 = uVar4 & 0xffff;
if (iVar5 <= (int)local_28) {
local_28 = 0xffff;
uVar4 = 0xffff;
}
if (iVar5 <= (int)local_28) goto LAB_005a54b1;
LAB_005a5469:
local_1e = (ushort)uVar4;
local_24 = (uVar4 & 0xffff) * 0x58;
}
else {
local_28 = 0xffff;
if (0 < iVar5) {
local_28 = 0;
}
uVar4 = (0 < iVar5) - 1;
if ((int)local_28 < iVar5) goto LAB_005a5469;
LAB_005a54b1:
CUtlMemory<UtlRBTreeNode_t<CUtlMap<studiohdr_t_const*,StudioHdrToActivityMapEntry_t,unsigned_short>::Node_t,unsigned_short>,unsigned_short>
::Grow((CUtlMemory<UtlRBTreeNode_t<CUtlMap<studiohdr_t_const*,StudioHdrToActivityMapEntry_t,unsigned_short>::Node_t,unsigned_short>,unsigned_short>
*)(this + 4),1);
iVar5 = *(int *)(this + 8);
if ((int)(uint)*(ushort *)(this + 0x16) < iVar5) {
local_1e = *(ushort *)(this + 0x16) + 1;
local_28 = (uint)local_1e;
if ((int)local_28 < iVar5) {
local_24 = local_28 * 0x58;
}
else {
local_24 = 0x57ffa8;
local_28 = 0xffff;
local_1e = uVar7;
}
}
else {
local_28 = 0;
local_24 = 0x57ffa8;
if (iVar5 < 1) {
local_28 = 0xffff;
}
else {
local_24 = 0;
}
local_1e = 0;
if (iVar5 < 1) {
local_1e = uVar7;
}
}
if (iVar5 <= (int)local_28) {
Error("CUtlRBTree overflow!\n");
}
}
uVar7 = (ushort)local_28;
*(ushort *)(this + 0x16) = local_1e;
iVar5 = *(int *)(this + 4);
puVar6 = (undefined2 *)(iVar5 + local_24);
LAB_005a52f7:
*(int *)(this + 0x18) = iVar5;
*puVar6 = 0xffff;
puVar6[2] = (short)uVar9;
puVar6[1] = 0xffff;
puVar6[3] = 0;
if ((short)uVar9 == -1) {
*(ushort *)(this + 0x10) = local_1e;
}
else {
puVar10 = (ushort *)(uVar9 * 0x58 + *(int *)(this + 4));
if (bVar1) {
*puVar10 = local_1e;
}
else {
puVar10[1] = local_1e;
}
}
InsertRebalance(this,uVar7);
*(short *)(this + 0x12) = *(short *)(this + 0x12) + 1;
local_24 = local_24 + *(int *)(this + 4);
if (local_24 != -8) {
*(undefined4 *)(local_24 + 8) = *(undefined4 *)param_1;
pNVar8 = param_1 + 4;
puVar11 = (undefined4 *)(local_24 + 0xc);
for (iVar5 = 0x13; iVar5 != 0; iVar5 = iVar5 + -1) {
*puVar11 = *(undefined4 *)pNVar8;
pNVar8 = pNVar8 + (uint)bVar12 * -8 + 4;
puVar11 = puVar11 + (uint)bVar12 * -2 + 1;
}
}
return local_1e;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.