GetSceneManager
0x00811420 · 323 bytes · unknown
_Z15GetSceneManagerv
Decompiled
undefined (0 params)
/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* GetSceneManager() */
undefined4 GetSceneManager(void)
{
int *piVar1;
uint *puVar2;
int iVar3;
undefined4 *puVar4;
uint uVar5;
if ((GetSceneManager()::s_SceneManager == '\0') &&
(iVar3 = __cxa_guard_acquire(&GetSceneManager()::s_SceneManager), iVar3 != 0)) {
GetSceneManager()::s_SceneManager = 0xffffffff;
__cxa_guard_release(&GetSceneManager()::s_SceneManager);
}
if (GetSceneManager()::s_SceneManager != 0xffffffff) {
uVar5 = GetSceneManager()::s_SceneManager & 0xfff;
puVar4 = (undefined4 *)(g_pEntityList + uVar5 * 0x10 + 4);
if (((puVar4 != (undefined4 *)0x0) &&
(*(uint *)(g_pEntityList + uVar5 * 0x10 + 8) == GetSceneManager()::s_SceneManager >> 0xc))
&& (*(int *)(g_pEntityList + uVar5 * 0x10 + 4) != 0)) goto LAB_0081153d;
}
piVar1 = (int *)CreateEntityByName("scene_manager",-1,true);
if (piVar1 == (int *)0x0) {
GetSceneManager()::s_SceneManager = 0xffffffff;
return 0;
}
puVar2 = (uint *)(**(code **)(*piVar1 + 0xc))(piVar1);
GetSceneManager()::s_SceneManager = *puVar2;
if (GetSceneManager()::s_SceneManager == 0xffffffff) {
return 0;
}
uVar5 = GetSceneManager()::s_SceneManager & 0xfff;
puVar4 = (undefined4 *)(g_pEntityList + uVar5 * 0x10 + 4);
if (puVar4 == (undefined4 *)0x0) {
puVar4 = (undefined4 *)0x0;
}
else if ((*(uint *)(g_pEntityList + uVar5 * 0x10 + 8) == GetSceneManager()::s_SceneManager >> 0xc)
&& (piVar1 = *(int **)(g_pEntityList + uVar5 * 0x10 + 4), piVar1 != (int *)0x0)) {
(**(code **)(*piVar1 + 100))(piVar1);
if (GetSceneManager()::s_SceneManager == 0xffffffff) {
return 0;
}
puVar4 = (undefined4 *)(g_pEntityList + (GetSceneManager()::s_SceneManager & 0xfff) * 0x10 + 4);
}
LAB_0081153d:
if ((puVar4 != (undefined4 *)0x0) && (puVar4[1] == GetSceneManager()::s_SceneManager >> 0xc)) {
return *puVar4;
}
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.