CVScriptSaveRestoreBlockHandler::PostRestore
0x00b5b860 · 563 bytes · __thiscall
_ZN31CVScriptSaveRestoreBlockHandler11PostRestoreEv
Decompiled
undefined (1 param)
/* CVScriptSaveRestoreBlockHandler::PostRestore() */
void __thiscall CVScriptSaveRestoreBlockHandler::PostRestore(CVScriptSaveRestoreBlockHandler *this)
{
ushort uVar1;
short sVar2;
char cVar3;
int iVar4;
undefined1 *puVar5;
ushort *puVar6;
uint uVar7;
void *local_28 [2];
short local_20;
ushort local_1e;
uVar1 = *(ushort *)(this + 0x14);
do {
uVar7 = (uint)uVar1;
if ((CUtlRBTree<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,CBaseEntity*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel == '\0') &&
(iVar4 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,CBaseEntity*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel), iVar4 != 0)) {
CUtlRBTree<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,CBaseEntity*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel = -1;
DAT_00f6bf9e = 0xffff;
DAT_00f6bfa0 = 0xffff;
__cxa_guard_release(&CUtlRBTree<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,CBaseEntity*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel);
}
sVar2 = CUtlRBTree<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,CBaseEntity*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel;
if (uVar1 != 0xffff) {
sVar2 = *(short *)(uVar7 * 0x10 + *(int *)(this + 8));
}
if (sVar2 == -1) {
for (; uVar7 != 0xffff; uVar7 = uVar7 & 0xffff) {
iVar4 = *(int *)(uVar7 * 0x10 + *(int *)(this + 8) + 0xc);
if (*(int *)(iVar4 + 0x3f4) == 0) {
*(undefined4 *)(iVar4 + 0x3f8) = 0;
}
else {
local_20 = 0;
local_1e = 0;
local_28[0] = (void *)0x0;
puVar5 = &DAT_00d539c2;
if (*(undefined1 **)(iVar4 + 0x3f8) != (undefined1 *)0x0) {
puVar5 = *(undefined1 **)(iVar4 + 0x3f8);
}
/* try { // try from 00b5b970 to 00b5b975 has its CatchHandler @ 00b5baa2 */
cVar3 = (**(code **)(*g_pScriptVM + 0x90))(g_pScriptVM,0,puVar5,local_28);
if (((cVar3 != '\0') && (local_20 == 0x20)) && ((int)local_28[0] - 1U < 0xfffffffe)) {
*(undefined4 *)(iVar4 + 0x3ec) = 2;
*(void **)(iVar4 + 1000) = local_28[0];
}
if ((local_1e & 1) != 0) {
free(local_28[0]);
}
}
uVar7 = CUtlRBTree<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,CBaseEntity*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::NextInorder((CUtlRBTree<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,CBaseEntity*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)(this + 4),(ushort)uVar7);
}
CUtlRBTree<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,CBaseEntity*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::RemoveAll((CUtlRBTree<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,CBaseEntity*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
*)(this + 4));
*(undefined2 *)(this + 0x18) = 0xffff;
CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>
::Purge((CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>
*)(this + 8));
*(undefined2 *)(this + 0x1a) = 0xffff;
return;
}
if (CUtlRBTree<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,CBaseEntity*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel == '\0') {
iVar4 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,CBaseEntity*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel);
if (iVar4 != 0) {
CUtlRBTree<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,CBaseEntity*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel = -1;
DAT_00f6bf9e = 0xffff;
DAT_00f6bfa0 = 0xffff;
__cxa_guard_release(&CUtlRBTree<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,CBaseEntity*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel);
}
if (uVar1 != 0xffff) goto LAB_00b5b8ba;
LAB_00b5ba05:
puVar6 = (ushort *)
&CUtlRBTree<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short,CUtlMap<char_const*,CBaseEntity*,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CBaseEntity*,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
::Links(unsigned_short)::s_Sentinel;
}
else {
if (uVar1 == 0xffff) goto LAB_00b5ba05;
LAB_00b5b8ba:
puVar6 = (ushort *)(uVar7 * 0x10 + *(int *)(this + 8));
}
uVar1 = *puVar6;
} while( true );
}
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.