CCvarUtilities::SetDirect
0x001284b0 · 437 bytes · __thiscall
_ZN14CCvarUtilities9SetDirectEP6ConVarPKc
Decompiled
undefined (3 params)
/* CCvarUtilities::SetDirect(ConVar*, char const*) */
void __thiscall CCvarUtilities::SetDirect(CCvarUtilities *this,ConVar *param_1,char *param_2)
{
code *pcVar1;
char cVar2;
int iVar3;
wchar_t *pwVar4;
wchar_t __wc;
wchar_t *pwVar5;
int in_GS_OFFSET;
double dVar6;
wchar_t *local_1434;
wchar_t local_1420;
wchar_t local_141c [511];
wchar_t local_c20 [511];
undefined4 local_424;
char local_420 [1024];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
cVar2 = (**(code **)(*(int *)param_1 + 0xc))(param_1,0x200);
if ((cVar2 == '\0') || (DAT_003b8088 == '\0')) {
cVar2 = (**(code **)(*(int *)param_1 + 0xc))(param_1,0x400);
if (cVar2 != '\0') {
pwVar5 = &local_1420;
V_UTF8ToUnicode(param_2,pwVar5,0x800);
local_1434 = local_c20;
local_c20[0] = L'\0';
while (__wc = *pwVar5, __wc != L'\0') {
while( true ) {
pwVar5 = pwVar5 + 1;
iVar3 = iswcntrl(__wc);
if ((iVar3 != 0) || (__wc == L'~')) break;
*local_1434 = __wc;
__wc = *pwVar5;
local_1434 = local_1434 + 1;
if (__wc == L'\0') goto LAB_001285e1;
}
}
LAB_001285e1:
*local_1434 = L'\0';
pwVar4 = (wchar_t *)wcslen(local_c20);
pwVar5 = local_c20;
while ((pwVar4 != (wchar_t *)0x0 && (*pwVar5 != L'\0'))) {
iVar3 = iswspace(*pwVar5);
if (iVar3 == 0) goto LAB_0012862d;
pwVar5 = pwVar5 + 1;
pwVar4 = pwVar5;
}
wcsncpy(local_c20,L"#empty",0x1ff);
local_424 = 0;
LAB_0012862d:
param_2 = local_420;
V_UnicodeToUTF8(local_c20,param_2,0x400);
}
cVar2 = (**(code **)(*(int *)param_1 + 0xc))(param_1,0x1000);
if (cVar2 == '\0') {
(**(code **)(*(int *)param_1 + 0x3c))(param_1,param_2);
}
else {
pcVar1 = *(code **)(*(int *)param_1 + 0x40);
dVar6 = strtod(param_2,(char **)0x0);
(*pcVar1)(param_1,(float)dVar6);
}
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.