UTIL_FunctionFromName
0x004a7460 · 132 bytes · __cdecl
_Z21UTIL_FunctionFromNameP9datamap_tPKc
Decompiled
undefined (2 params)
/* UTIL_FunctionFromName(datamap_t*, char const*) */
undefined4 UTIL_FunctionFromName(datamap_t *param_1,char *param_2)
{
int iVar1;
int iVar2;
do {
if (param_1 == (datamap_t *)0x0) {
Msg("Failed to find function %s\n",param_2);
return 0;
}
if (0 < *(int *)(param_1 + 4)) {
iVar2 = 0;
do {
iVar1 = *(int *)param_1 + iVar2 * 0x40;
if ((*(byte *)(iVar1 + 0xe) & 0x20) != 0) {
if (*(char **)(iVar1 + 4) == param_2) {
LAB_004a74b0:
return *(undefined4 *)(iVar1 + 0x18);
}
iVar1 = _V_stricmp(param_2,*(char **)(iVar1 + 4));
if (iVar1 == 0) {
iVar1 = *(int *)param_1 + iVar2 * 0x40;
goto LAB_004a74b0;
}
}
iVar2 = iVar2 + 1;
} while (iVar2 < *(int *)(param_1 + 4));
}
param_1 = *(datamap_t **)(param_1 + 0xc);
} 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.