Host_CountVariablesWithFlags
0x00176480 · 194 bytes · __cdecl
_Z28Host_CountVariablesWithFlagsib
Decompiled
undefined (2 params)
/* Host_CountVariablesWithFlags(int, bool) */
int Host_CountVariablesWithFlags(int param_1,bool param_2)
{
char cVar1;
int *piVar2;
ConVar *this;
char *pcVar3;
int iVar4;
char *pcVar5;
int local_24;
piVar2 = (int *)(**(code **)(*g_pCVar + 0x98))(g_pCVar);
/* try { // try from 001764a7 to 0017652f has its CatchHandler @ 00176547 */
(**(code **)(*piVar2 + 8))(piVar2);
local_24 = 0;
do {
cVar1 = (**(code **)(*piVar2 + 0x10))(piVar2);
if (cVar1 == '\0') {
(**(code **)(*piVar2 + 4))(piVar2);
return local_24;
}
this = (ConVar *)(**(code **)(*piVar2 + 0x14))(piVar2);
cVar1 = (**(code **)(*(int *)this + 8))(this);
if (cVar1 == '\0') {
cVar1 = (**(code **)(*(int *)this + 0xc))(this,param_1);
if (cVar1 != '\0') {
if (param_2) {
pcVar5 = "FCVAR_NEVER_AS_STRING";
if ((((byte)this[0x15] & 0x10) == 0) &&
(pcVar5 = *(char **)(*(int *)(this + 0x1c) + 0x24), pcVar5 == (char *)0x0)) {
pcVar5 = "";
}
pcVar3 = (char *)ConVar::GetDefault(this);
iVar4 = V_strcasecmp(pcVar3,pcVar5);
if (iVar4 == 0) goto LAB_00176520;
}
local_24 = local_24 + 1;
}
}
LAB_00176520:
(**(code **)(*piVar2 + 0xc))(piVar2);
} 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.