CUtlRBTree<CBreakModelsPrecached::breakable_precache_t,unsigned_short,bool(*)(CBreakModelsPrecached::breakable_precache_t_const&,CBreakModelsPrecached::breakable_precache_t_const&),CUtlMemory<UtlRBTreeNode_t<CBreakModelsPrecached::breakable_precache_t,unsigned_short>,unsigned_short>>::Insert
0x008027a0 · 684 bytes · __thiscall
_ZN10CUtlRBTreeIN21CBreakModelsPrecached20breakable_precache_tEtPFbRKS1_S3_E10CUtlMemoryI15UtlRBTreeNode_tIS1_tEtEE6InsertES3_
Decompiled
undefined (2 params)
/* CUtlRBTree<CBreakModelsPrecached::breakable_precache_t, unsigned short, bool
(*)(CBreakModelsPrecached::breakable_precache_t const&,
CBreakModelsPrecached::breakable_precache_t const&),
CUtlMemory<UtlRBTreeNode_t<CBreakModelsPrecached::breakable_precache_t, unsigned short>, unsigned
short> >::Insert(CBreakModelsPrecached::breakable_precache_t const&) */
uint __thiscall
CUtlRBTree<CBreakModelsPrecached::breakable_precache_t,unsigned_short,bool(*)(CBreakModelsPrecached::breakable_precache_t_const&,CBreakModelsPrecached::breakable_precache_t_const&),CUtlMemory<UtlRBTreeNode_t<CBreakModelsPrecached::breakable_precache_t,unsigned_short>,unsigned_short>>
::Insert(CUtlRBTree<CBreakModelsPrecached::breakable_precache_t,unsigned_short,bool(*)(CBreakModelsPrecached::breakable_precache_t_const&,CBreakModelsPrecached::breakable_precache_t_const&),CUtlMemory<UtlRBTreeNode_t<CBreakModelsPrecached::breakable_precache_t,unsigned_short>,unsigned_short>>
*this,breakable_precache_t *param_1)
{
undefined4 uVar1;
bool bVar2;
char cVar3;
int iVar4;
undefined2 *puVar5;
ushort uVar6;
uint uVar8;
undefined2 uVar9;
int iVar10;
uint uVar11;
uint local_24;
int local_20;
uint uVar7;
uVar8 = (uint)*(ushort *)(this + 0x10);
if (*(ushort *)(this + 0x10) == 0xffff) {
bVar2 = false;
}
else {
while( true ) {
iVar10 = uVar8 * 0x10;
cVar3 = (**(code **)this)(param_1,*(int *)(this + 4) + iVar10 + 8);
if (cVar3 == '\0') {
if ((Links(unsigned_short)::s_Sentinel == '\0') &&
(iVar4 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar4 != 0)) {
Links(unsigned_short)::s_Sentinel = 0xffff;
DAT_00f5515a = 0xffff;
DAT_00f5515c = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
}
uVar6 = *(ushort *)(*(int *)(this + 4) + 2 + iVar10);
bVar2 = false;
}
else {
if ((Links(unsigned_short)::s_Sentinel == '\0') &&
(iVar4 = __cxa_guard_acquire(&Links(unsigned_short)::s_Sentinel), iVar4 != 0)) {
Links(unsigned_short)::s_Sentinel = 0xffff;
DAT_00f5515a = 0xffff;
DAT_00f5515c = 0xffff;
__cxa_guard_release(&Links(unsigned_short)::s_Sentinel);
}
uVar6 = *(ushort *)(*(int *)(this + 4) + iVar10);
bVar2 = true;
}
if (uVar6 == 0xffff) break;
uVar8 = (uint)uVar6;
}
}
local_24._0_2_ = *(ushort *)(this + 0x14);
uVar11 = (uint)(ushort)local_24;
if ((ushort)local_24 != 0xffff) {
iVar10 = *(int *)(this + 4);
local_20 = (uint)(ushort)local_24 * 0x10;
puVar5 = (undefined2 *)(local_20 + iVar10);
*(undefined2 *)(this + 0x14) = puVar5[1];
goto LAB_00802847;
}
iVar10 = *(int *)(this + 8);
if ((int)(uint)*(ushort *)(this + 0x16) < iVar10) {
uVar7 = *(ushort *)(this + 0x16) + 1;
uVar6 = (ushort)uVar7;
uVar7 = uVar7 & 0xffff;
if (iVar10 <= (int)uVar7) {
uVar6 = 0xffff;
}
local_24 = 0xffff;
if ((int)uVar7 < iVar10) {
local_24 = uVar7;
}
if ((int)local_24 < iVar10) goto LAB_008029b1;
LAB_008029f7:
CUtlMemory<UtlRBTreeNode_t<CBreakModelsPrecached::breakable_precache_t,unsigned_short>,unsigned_short>
::Grow((CUtlMemory<UtlRBTreeNode_t<CBreakModelsPrecached::breakable_precache_t,unsigned_short>,unsigned_short>
*)(this + 4),1);
iVar10 = *(int *)(this + 8);
if ((int)(uint)*(ushort *)(this + 0x16) < iVar10) {
uVar6 = *(ushort *)(this + 0x16) + 1;
local_24 = (uint)uVar6;
if ((int)local_24 < iVar10) {
uVar11 = (uint)uVar6;
local_20 = local_24 << 4;
}
else {
local_20 = 0xffff0;
local_24 = 0xffff;
}
}
else {
local_20 = 0xffff0;
if (0 < iVar10) {
local_20 = 0;
uVar11 = 0;
}
local_24 = 0xffff;
if (0 < iVar10) {
local_24 = 0;
}
}
if (iVar10 <= (int)local_24) {
Error("CUtlRBTree overflow!\n");
}
}
else {
local_24 = 0xffff;
if (0 < iVar10) {
local_24 = 0;
}
uVar6 = (0 < iVar10) - 1;
if (iVar10 <= (int)local_24) goto LAB_008029f7;
LAB_008029b1:
uVar11 = (uint)uVar6;
local_20 = uVar11 << 4;
}
iVar10 = *(int *)(this + 4);
*(short *)(this + 0x16) = (short)uVar11;
puVar5 = (undefined2 *)(iVar10 + local_20);
LAB_00802847:
*(int *)(this + 0x18) = iVar10;
puVar5[1] = 0xffff;
puVar5[2] = (short)uVar8;
*puVar5 = 0xffff;
puVar5[3] = 0;
uVar9 = (undefined2)uVar11;
if ((short)uVar8 == -1) {
*(undefined2 *)(this + 0x10) = uVar9;
}
else {
puVar5 = (undefined2 *)(uVar8 * 0x10 + *(int *)(this + 4));
if (bVar2) {
*puVar5 = uVar9;
}
else {
puVar5[1] = uVar9;
}
}
InsertRebalance(this,(ushort)local_24);
*(short *)(this + 0x12) = *(short *)(this + 0x12) + 1;
local_20 = local_20 + *(int *)(this + 4);
if (local_20 != -8) {
uVar1 = *(undefined4 *)param_1;
*(undefined4 *)(local_20 + 0xc) = *(undefined4 *)(param_1 + 4);
*(undefined4 *)(local_20 + 8) = uVar1;
}
return uVar11;
}
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.