VScriptServerReplaceClosures
0x00b47990 · 343 bytes · __cdecl
_Z28VScriptServerReplaceClosuresPKcP9HSCRIPT__b
Decompiled
undefined (3 params)
/* VScriptServerReplaceClosures(char const*, HSCRIPT__*, bool) */
undefined4 VScriptServerReplaceClosures(char *param_1,HSCRIPT__ *param_2,bool param_3)
{
int iVar1;
void *pvVar2;
void *local_34;
undefined4 local_30;
undefined2 local_2c;
ushort local_2a;
HSCRIPT__ *local_28;
undefined4 local_24;
undefined2 local_20;
ushort local_1e;
if (g_pScriptVM != (int *)0x0) {
iVar1 = (**(code **)(*g_pScriptVM + 0x48))(g_pScriptVM,"__ReplaceClosures",0,0);
if (iVar1 != 0) {
pvVar2 = (void *)VScriptServerCompileScript(param_1,param_3);
if (pvVar2 != (void *)0x0) {
local_2a = 0;
local_20 = 0x20;
local_2c = 0x20;
local_1e = 0;
local_30 = 0;
local_24 = 0;
local_28 = param_2;
/* try { // try from 00b47a5b to 00b47a5d has its CatchHandler @ 00b47af5 */
local_34 = pvVar2;
(**(code **)(*g_pScriptVM + 0x50))(g_pScriptVM,iVar1,&local_34,2,0,0,1);
if ((local_1e & 1) != 0) {
free(local_28);
local_1e = local_1e & 0xfffe;
}
local_28 = (HSCRIPT__ *)0x0;
local_24 = 0;
local_20 = 0;
if ((local_2a & 1) != 0) {
free(local_34);
}
(**(code **)(*g_pScriptVM + 0x4c))(g_pScriptVM,iVar1);
(**(code **)(*g_pScriptVM + 0x30))(g_pScriptVM,pvVar2);
return 1;
}
(**(code **)(*g_pScriptVM + 0x4c))(g_pScriptVM,iVar1);
}
}
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.