ccs_write_convars
0x001140e0 · 463 bytes · __cdecl
_ZL17ccs_write_convarsRK8CCommand
Decompiled
undefined (1 param)
/* ccs_write_convars(CCommand const&) */
void ccs_write_convars(CCommand *param_1)
{
char cVar1;
int iVar2;
int *piVar3;
int iVar4;
int *piVar5;
uint uVar6;
uint uVar7;
char *pcVar8;
uint *puVar9;
uint *puVar10;
int in_GS_OFFSET;
uint local_320 [64];
char local_220 [512];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
V_snprintf(local_220,0x200,"convars.txt");
iVar2 = (**(code **)(*(int *)(g_pFullFileSystem + 4) + 8))
(g_pFullFileSystem + 4,local_220,&DAT_002a5c80,0);
if (iVar2 == 0) {
ConMsg("Unable to open convars.txt\n");
}
else {
piVar3 = (int *)(**(code **)(*g_pCVar + 0x98))(g_pCVar);
/* try { // try from 0011415f to 00114286 has its CatchHandler @ 001142b4 */
(**(code **)(*piVar3 + 8))(piVar3);
while (cVar1 = (**(code **)(*piVar3 + 0x10))(piVar3), cVar1 != '\0') {
iVar4 = (**(code **)(*piVar3 + 0x14))(piVar3);
if (iVar4 != 0) {
piVar5 = (int *)__dynamic_cast(iVar4,&ConCommandBase::typeinfo,&ConVar::typeinfo,0);
if (piVar5 != (int *)0x0) {
iVar4 = (**(code **)(*piVar5 + 0x1c))(piVar5);
pcVar8 = "FCVAR_NEVER_AS_STRING";
if (((*(byte *)((int)piVar5 + 0x15) & 0x10) == 0) &&
(pcVar8 = *(char **)(piVar5[7] + 0x24), pcVar8 == (char *)0x0)) {
pcVar8 = "";
}
if (iVar4 != 0) {
V_snprintf((char *)local_320,0x100,"%s=%s\n",iVar4,pcVar8);
puVar10 = local_320;
do {
puVar9 = puVar10;
uVar6 = *puVar9 + 0xfefefeff & ~*puVar9;
uVar7 = uVar6 & 0x80808080;
puVar10 = puVar9 + 1;
} while (uVar7 == 0);
if ((uVar6 & 0x8080) == 0) {
puVar10 = (uint *)((int)puVar9 + 6);
uVar7 = uVar7 >> 0x10;
}
(**(code **)(*(int *)(g_pFullFileSystem + 4) + 4))
(g_pFullFileSystem + 4,local_320,
(char *)((int)puVar10 +
((-3 - (uint)CARRY1((byte)uVar7,(byte)uVar7)) - (int)local_320)),
iVar2);
}
}
}
(**(code **)(*piVar3 + 0xc))(piVar3);
}
(**(code **)(*(int *)(g_pFullFileSystem + 4) + 0xc))(g_pFullFileSystem + 4,iVar2);
ConMsg("Wrote all convars to convars.txt\n");
(**(code **)(*piVar3 + 4))(piVar3);
}
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return;
}
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.