CSPSharedMemory::Release
0x001db250 · 102 bytes · __thiscall
_ZN15CSPSharedMemory7ReleaseEv
Decompiled
undefined (1 param)
/* CSPSharedMemory::Release() */
void __thiscall CSPSharedMemory::Release(CSPSharedMemory *this)
{
CSPSharedMemory *pCVar1;
int *piVar2;
int *piVar3;
int *piVar4;
int iVar5;
int iVar6;
pCVar1 = this + 0x20;
*(int *)pCVar1 = *(int *)pCVar1 + -1;
if (*(int *)pCVar1 == 0) {
iVar6 = DAT_003b0c94 + -1;
piVar2 = (int *)(s_SinglePlayerSharedMemoryManager + iVar6 * 4);
piVar3 = piVar2;
iVar5 = DAT_003b0c94;
do {
piVar4 = piVar3;
iVar5 = iVar5 + -1;
if (iVar5 < 0) {
return;
}
piVar3 = piVar4 + -1;
} while (this != (CSPSharedMemory *)*piVar4);
if (0 < DAT_003b0c94) {
if (iVar5 != iVar6) {
*piVar4 = *piVar2;
iVar6 = DAT_003b0c94 + -1;
}
DAT_003b0c94 = iVar6;
return;
}
}
return;
}
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.