GCSDK::CSharedObject::Create
0x00086d40 · 188 bytes · __cdecl
_ZN5GCSDK13CSharedObject6CreateEi
Decompiled
undefined (1 param)
/* GCSDK::CSharedObject::Create(int) */
undefined4 GCSDK::CSharedObject::Create(int param_1)
{
ushort uVar1;
ushort *puVar2;
undefined4 uVar3;
int iVar4;
uint uVar5;
int local_14 [2];
local_14[0] = param_1;
uVar1 = CUtlRBTree<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Find((CUtlRBTree<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)sm_mapFactories,(Node_t *)local_14);
uVar5 = (uint)uVar1;
if (((int)uVar5 < (int)sm_mapFactories._8_4_) && (uVar1 <= (ushort)sm_mapFactories._22_2_)) {
if (CUtlRBTree<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel == '\0') {
iVar4 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel);
if (iVar4 != 0) {
CUtlRBTree<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel = 0xffff;
DAT_000d28ca = 0xffff;
DAT_000d28cc = 0xffff;
__cxa_guard_release(&CUtlRBTree<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel);
}
}
if (uVar1 == 0xffff) {
puVar2 = &CUtlRBTree<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short,CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<int,GCSDK::CSharedObject*(*)(),unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel;
}
else {
puVar2 = (ushort *)(uVar5 * 0x10 + sm_mapFactories._4_4_);
}
if (uVar1 != *puVar2) {
uVar3 = (**(code **)(uVar5 * 0x10 + sm_mapFactories._4_4_ + 0xc))();
return uVar3;
}
}
return 0;
}
SourceMod gamedata
paste intoaddons/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.
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.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.