CBaseClientState::ProcessSetConVar
0x001005a0 · 671 bytes · __thiscall
_ZN16CBaseClientState16ProcessSetConVarEP13NET_SetConVar
Decompiled
undefined (2 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CBaseClientState::ProcessSetConVar(NET_SetConVar*) */
undefined4 __thiscall
CBaseClientState::ProcessSetConVar(CBaseClientState *this,NET_SetConVar *param_1)
{
char *pcVar1;
char cVar2;
char *pcVar3;
int iVar4;
int iVar5;
undefined4 local_3c;
undefined4 local_38;
int *local_30 [2];
undefined4 local_28;
undefined4 local_24;
int local_20;
local_3c = 0;
local_38 = 0;
if (_exit == 0) {
local_20 = 0;
}
else {
(**(code **)(_exit + 0x50))
(_exit,&local_3c,0,0,0,0,"/data/src/engine/./baseclientstate.cpp",0x604,
&ProcessSetConVar(NET_SetConVar*)::tm_fmt,"(%s)%s","Unaccounted","ProcessSetConVar");
local_20 = _exit;
}
iVar4 = _DAT_0040b9d4;
local_28 = local_3c;
local_24 = local_38;
if ((_DAT_0040b028 != 0) || (DAT_0040b02c == '\0')) {
/* try { // try from 00100736 to 00100784 has its CatchHandler @ 0010087a */
iVar5 = ThreadGetCurrentId();
if (iVar4 == iVar5) {
if ((char *)*_DAT_0040b030 != "ProcessSetConVar") {
_DAT_0040b030 =
(int *)CVProfNode::GetSubNode((char *)_DAT_0040b030,0x2a6dca,&DAT_00000001,0x2a054b);
}
CVProfNode::EnterScope();
DAT_0040b02c = '\0';
}
}
/* try { // try from 0010065c to 00100726 has its CatchHandler @ 00100859 */
cVar2 = (**(code **)(**(int **)(this + 0x10) + 0x18))(*(int **)(this + 0x10));
if ((cVar2 == '\0') && (0 < *(int *)(param_1 + 0x58))) {
iVar5 = 0;
iVar4 = 0;
do {
pcVar3 = (char *)(*(int *)(param_1 + 0x4c) + iVar5);
pcVar1 = pcVar3 + 0x104;
ConVarRef::ConVarRef((ConVarRef *)local_30,pcVar3);
cVar2 = ConVarRef::IsValid((ConVarRef *)local_30);
if (cVar2 == '\0') {
ConMsg("SetConVar: No such cvar ( %s set to %s), skipping\n",pcVar3,pcVar1);
}
else {
cVar2 = (**(code **)(*local_30[0] + 0x18))(local_30[0],0x2000);
if (cVar2 == '\0') {
/* try { // try from 001007aa to 001007ae has its CatchHandler @ 00100859 */
ConMsg("SetConVar: Can\'t set server cvar %s to %s, not marked as FCVAR_REPLICATED on client\n"
,pcVar3,pcVar1);
}
else if (DAT_003b7f64 < 2) {
(**(code **)*local_30[0])(local_30[0],pcVar1);
DevMsg("SetConVar: %s = \"%s\"\n",pcVar3,pcVar1);
}
}
iVar4 = iVar4 + 1;
iVar5 = iVar5 + 0x208;
} while (iVar4 < *(int *)(param_1 + 0x58));
}
iVar4 = _DAT_0040b9d4;
if ((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) {
iVar5 = ThreadGetCurrentId();
if (iVar4 == iVar5) {
cVar2 = CVProfNode::ExitScope();
if (cVar2 != '\0') {
_DAT_0040b030 = (int *)_DAT_0040b030[0x19];
}
DAT_0040b02c = _DAT_0040b030 == (int *)0x40b034;
}
}
if (local_20 != 0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
}
return 1;
}
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.