scripted_user_func
0x0089fc60 · 243 bytes · __cdecl
_ZL18scripted_user_funcRK8CCommand
Decompiled
undefined (1 param)
/* WARNING: Removing unreachable block (ram,0x0089fd25) */
/* scripted_user_func(CCommand const&) */
void scripted_user_func(CCommand *param_1)
{
char *__src;
undefined4 uVar1;
int iVar2;
undefined4 local_30;
void *local_28;
undefined4 local_24;
undefined2 local_20;
ushort local_1e;
uVar1 = UTIL_GetCommandClient();
if (*(int *)param_1 < 2) {
local_28 = (void *)0x0;
local_1e = 0;
local_24 = local_30;
local_20 = 0;
}
else {
__src = *(char **)(param_1 + 0x40c);
local_1e = 0;
local_28 = (void *)0x0;
local_24 = 0;
local_20 = 0x1f;
/* try { // try from 0089fcc8 to 0089fccc has its CatchHandler @ 0089fd5b */
iVar2 = _V_strlen(__src);
local_28 = malloc(iVar2 + 1U);
memcpy(local_28,__src,iVar2 + 1U);
local_1e = local_1e | 1;
}
/* try { // try from 0089fd09 to 0089fd0d has its CatchHandler @ 0089fd70 */
CDirectorChallengeMode::DoUserConsoleFunc
(*(CDirectorChallengeMode **)(TheDirector + 0x648),uVar1,&local_28);
if ((local_1e & 1) != 0) {
free(local_28);
}
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.