CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>::Insert
0x0059be20 · 706 bytes · __thiscall
_ZN10CUtlRBTreeIN7CUtlMapIPKcitE6Node_tEtNS3_8CKeyLessE10CUtlMemoryI15UtlRBTreeNode_tIS4_tEtEE6InsertERKS4_
Decompiled
undefined (2 params)
/* CUtlRBTree<CUtlMap<char const*, int, unsigned short>::Node_t, unsigned short, CUtlMap<char
const*, int, unsigned short>::CKeyLess, CUtlMemory<UtlRBTreeNode_t<CUtlMap<char const*, int,
unsigned short>::Node_t, unsigned short>, unsigned short> >::Insert(CUtlMap<char const*, int,
unsigned short>::Node_t const&) */
ushort __thiscall
CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Insert(CUtlRBTree<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*this,Node_t *param_1)
{
bool bVar1;
char cVar2;
int iVar3;
uint uVar4;
undefined2 *puVar5;
uint uVar6;
ushort *puVar7;
ushort uVar8;
int iVar9;
uint local_28;
int local_24;
ushort local_1e;
uVar6 = (uint)*(ushort *)(this + 0x10);
if (*(ushort *)(this + 0x10) == 0xffff) {
bVar1 = false;
}
else {
while( true ) {
iVar9 = uVar6 * 0x10;
cVar2 = (**(code **)this)(param_1,*(int *)(this + 4) + iVar9 + 8);
if (cVar2 == '\0') {
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_00f2131a = 0xffff;
DAT_00f2131c = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
}
bVar1 = false;
uVar8 = *(ushort *)(*(int *)(this + 4) + 2 + iVar9);
}
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_00f2131a = 0xffff;
DAT_00f2131c = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
}
bVar1 = true;
uVar8 = *(ushort *)(*(int *)(this + 4) + iVar9);
}
if (uVar8 == 0xffff) break;
uVar6 = (uint)uVar8;
}
}
uVar8 = *(ushort *)(this + 0x14);
if (uVar8 != 0xffff) {
iVar9 = *(int *)(this + 4);
local_24 = (uint)uVar8 * 0x10;
puVar5 = (undefined2 *)(local_24 + iVar9);
*(undefined2 *)(this + 0x14) = puVar5[1];
local_1e = uVar8;
goto LAB_0059becb;
}
iVar9 = *(int *)(this + 8);
if ((int)(uint)*(ushort *)(this + 0x16) < iVar9) {
uVar4 = *(ushort *)(this + 0x16) + 1;
local_28 = uVar4 & 0xffff;
if (iVar9 <= (int)local_28) {
local_28 = 0xffff;
uVar4 = 0xffff;
}
if (iVar9 <= (int)local_28) goto LAB_0059c069;
LAB_0059c029:
local_1e = (ushort)uVar4;
local_24 = (uVar4 & 0xffff) << 4;
}
else {
local_28 = 0xffff;
if (0 < iVar9) {
local_28 = 0;
}
uVar4 = (0 < iVar9) - 1;
if ((int)local_28 < iVar9) goto LAB_0059c029;
LAB_0059c069:
CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>
::Grow((CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>
*)(this + 4),1);
iVar9 = *(int *)(this + 8);
if ((int)(uint)*(ushort *)(this + 0x16) < iVar9) {
local_1e = *(ushort *)(this + 0x16) + 1;
local_28 = (uint)local_1e;
if ((int)local_28 < iVar9) {
local_24 = local_28 << 4;
}
else {
local_24 = 0xffff0;
local_28 = 0xffff;
local_1e = uVar8;
}
}
else {
local_28 = 0;
local_24 = 0xffff0;
if (iVar9 < 1) {
local_28 = 0xffff;
}
else {
local_24 = 0;
}
local_1e = 0;
if (iVar9 < 1) {
local_1e = uVar8;
}
}
if (iVar9 <= (int)local_28) {
Error("CUtlRBTree overflow!\n");
}
}
uVar8 = (ushort)local_28;
*(ushort *)(this + 0x16) = local_1e;
iVar9 = *(int *)(this + 4);
puVar5 = (undefined2 *)(iVar9 + local_24);
LAB_0059becb:
*(int *)(this + 0x18) = iVar9;
puVar5[1] = 0xffff;
puVar5[2] = (short)uVar6;
*puVar5 = 0xffff;
puVar5[3] = 0;
if ((short)uVar6 == -1) {
*(ushort *)(this + 0x10) = local_1e;
}
else {
puVar7 = (ushort *)(uVar6 * 0x10 + *(int *)(this + 4));
if (bVar1) {
*puVar7 = local_1e;
}
else {
puVar7[1] = local_1e;
}
}
InsertRebalance(this,uVar8);
*(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;
*(undefined4 *)(local_24 + 0xc) = *(undefined4 *)(param_1 + 4);
}
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.