ConVar_PrintDescription
0x00b6b7e0 · 766 bytes · __cdecl
_Z23ConVar_PrintDescriptionPK14ConCommandBase
Decompiled
undefined (1 param)
/* ConVar_PrintDescription(ConCommandBase const*) */
void ConVar_PrintDescription(ConCommandBase *param_1)
{
float fVar1;
float fVar2;
char cVar3;
char cVar4;
char cVar5;
int *piVar6;
int iVar7;
undefined4 uVar8;
char *pcVar9;
int in_GS_OFFSET;
longdouble lVar10;
Color local_44;
undefined1 local_43;
undefined1 local_42;
undefined1 local_41;
char local_40 [32];
int local_20;
local_44 = 0xff;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
local_43 = 100;
local_42 = 100;
local_41 = 0xff;
cVar4 = (**(code **)(*(int *)param_1 + 8))(param_1);
if (cVar4 != '\0') {
uVar8 = (**(code **)(*(int *)param_1 + 0x1c))(param_1);
ConColorMsg(&local_44,"\"%s\"\n",uVar8);
goto LAB_00b6b9d7;
}
piVar6 = (int *)__dynamic_cast(param_1,&ConVar::typeinfo,&ConVar_ServerBounded::typeinfo,0);
iVar7 = *(int *)(param_1 + 0x1c);
fVar1 = *(float *)(iVar7 + 0x38);
cVar4 = *(char *)(iVar7 + 0x34);
fVar2 = *(float *)(iVar7 + 0x40);
cVar3 = *(char *)(iVar7 + 0x3c);
if (piVar6 == (int *)0x0) {
cVar5 = (**(code **)(*(int *)param_1 + 0xc))(param_1,0x1000);
if (cVar5 != '\0') {
iVar7 = *(int *)(*(int *)(param_1 + 0x1c) + 0x30);
lVar10 = (longdouble)*(float *)(*(int *)(param_1 + 0x1c) + 0x2c);
goto LAB_00b6b878;
}
pcVar9 = "FCVAR_NEVER_AS_STRING";
if ((((byte)param_1[0x15] & 0x10) == 0) &&
(pcVar9 = *(char **)(*(int *)(param_1 + 0x1c) + 0x24), pcVar9 == (char *)0x0)) {
pcVar9 = "";
}
}
else {
iVar7 = (**(code **)(*piVar6 + 0x6c))(piVar6);
lVar10 = (longdouble)(**(code **)(*piVar6 + 0x68))(piVar6);
LAB_00b6b878:
if (ABS((float)iVar7 - (float)lVar10) < 1e-06) {
pcVar9 = local_40;
V_snprintf(pcVar9,0x20,"%d",iVar7);
}
else {
pcVar9 = local_40;
V_snprintf(pcVar9,0x20,"%f",SUB84((double)(float)lVar10,0),
(int)((ulonglong)(double)(float)lVar10 >> 0x20));
}
}
uVar8 = (**(code **)(*(int *)param_1 + 0x1c))(param_1);
ConColorMsg(&local_44,"\"%s\" = \"%s\"",uVar8,pcVar9);
iVar7 = _V_stricmp(pcVar9,*(char **)(*(int *)(param_1 + 0x1c) + 0x20));
if (iVar7 != 0) {
ConMsg(" ( def. \"%s\" )",*(undefined4 *)(*(int *)(param_1 + 0x1c) + 0x20));
}
if (cVar4 != '\0') {
ConMsg(" min. %f",SUB84((double)fVar1,0),(int)((ulonglong)(double)fVar1 >> 0x20));
}
if (cVar3 != '\0') {
ConMsg(" max. %f",SUB84((double)fVar2,0),(int)((ulonglong)(double)fVar2 >> 0x20));
}
ConColorMsg(&local_44,"\n");
if ((piVar6 != (int *)0x0) &&
(lVar10 = (longdouble)(**(code **)(*piVar6 + 0x68))(piVar6),
0.0001 < ABS((float)lVar10 - *(float *)(*(int *)(param_1 + 0x1c) + 0x2c)))) {
lVar10 = (longdouble)(**(code **)(*piVar6 + 0x68))(piVar6);
ConColorMsg(&local_44,
"** NOTE: The real value is %.3f but the server has temporarily restricted it to %.3f **\n"
,SUB84((double)*(float *)(*(int *)(param_1 + 0x1c) + 0x2c),0),
(int)((ulonglong)(double)*(float *)(*(int *)(param_1 + 0x1c) + 0x2c) >> 0x20),
SUB84((double)(float)lVar10,0),(int)((ulonglong)(double)(float)lVar10 >> 0x20));
}
LAB_00b6b9d7:
ConVar_PrintFlags(param_1);
pcVar9 = (char *)(**(code **)(*(int *)param_1 + 0x20))(param_1);
if ((pcVar9 != (char *)0x0) && (*pcVar9 != '\0')) {
ConMsg(" - %s\n",pcVar9);
}
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.