ConVar::ChangeStringValue
0x00247690 · 230 bytes · __thiscall
_ZN6ConVar17ChangeStringValueEPKcf
Decompiled
undefined (3 params)
/* ConVar::ChangeStringValue(char const*, float) */
void __thiscall ConVar::ChangeStringValue(ConVar *this,char *param_1,float param_2)
{
int iVar1;
undefined4 uVar2;
code *pcVar3;
int iVar4;
int iVar5;
void *pvVar6;
int in_GS_OFFSET;
uint auStack_50 [3];
float afStack_44 [5];
int local_30 [4];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
iVar4 = -((*(int *)(this + 0x28) + 0xfU & 0xfffffff0) + 0x10);
uVar2 = *(undefined4 *)(this + 0x24);
iVar1 = (int)local_30 + iVar4;
*(int *)((int)afStack_44 + iVar4) = *(int *)(this + 0x28);
*(int *)((int)auStack_50 + iVar4 + 4) = iVar1;
*(undefined4 *)((int)auStack_50 + iVar4 + 8) = uVar2;
*(undefined4 *)((int)auStack_50 + iVar4) = 0x2476d2;
memcpy(*(void **)((int)auStack_50 + iVar4 + 4),*(void **)((int)auStack_50 + iVar4 + 8),
*(size_t *)((int)afStack_44 + iVar4));
*(char **)((int)auStack_50 + iVar4 + 4) = param_1;
*(undefined4 *)((int)auStack_50 + iVar4) = 0x2476da;
iVar5 = _V_strlen(*(char **)((int)auStack_50 + iVar4 + 4));
iVar5 = iVar5 + 1;
pvVar6 = *(void **)(this + 0x24);
if (*(int *)(this + 0x28) < iVar5) {
if (pvVar6 != (void *)0x0) {
*(void **)((int)auStack_50 + iVar4 + 4) = pvVar6;
local_30[0] = iVar5;
*(undefined4 *)((int)auStack_50 + iVar4) = 0x2476f4;
operator_delete__(*(void **)((int)auStack_50 + iVar4 + 4));
iVar5 = local_30[0];
}
*(int *)((int)auStack_50 + iVar4 + 4) = iVar5;
local_30[0] = iVar5;
*(undefined4 *)((int)auStack_50 + iVar4) = 0x247702;
pvVar6 = operator_new__(*(uint *)((int)auStack_50 + iVar4 + 4));
*(void **)(this + 0x24) = pvVar6;
*(int *)(this + 0x28) = local_30[0];
iVar5 = local_30[0];
}
*(int *)((int)afStack_44 + iVar4) = iVar5;
*(char **)((int)auStack_50 + iVar4 + 8) = param_1;
*(void **)((int)auStack_50 + iVar4 + 4) = pvVar6;
*(undefined4 *)((int)auStack_50 + iVar4) = 0x24771b;
memcpy(*(void **)((int)auStack_50 + iVar4 + 4),*(void **)((int)auStack_50 + iVar4 + 8),
*(size_t *)((int)afStack_44 + iVar4));
pcVar3 = *(code **)(this + 0x44);
if (pcVar3 != (code *)0x0) {
*(int *)((int)auStack_50 + iVar4 + 8) = iVar1;
*(ConVar **)((int)auStack_50 + iVar4 + 4) = this + 0x18;
*(float *)((int)afStack_44 + iVar4) = param_2;
*(undefined4 *)((int)auStack_50 + iVar4) = 0x247739;
(*pcVar3)();
}
if (g_pCVar != (int *)0x0) {
iVar5 = *g_pCVar;
*(int *)((int)afStack_44 + iVar4) = iVar1;
*(ConVar **)((int)auStack_50 + iVar4 + 8) = this;
*(int **)((int)auStack_50 + iVar4 + 4) = g_pCVar;
*(float *)((int)afStack_44 + iVar4 + 4) = param_2;
pcVar3 = *(code **)(iVar5 + 0x48);
*(undefined4 *)((int)auStack_50 + iVar4) = 0x24775d;
(*pcVar3)();
}
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
*(undefined **)((int)auStack_50 + iVar4) = &UNK_00247776;
__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.