IKeyValuesDumpContextAsText::KvWriteValue
0x00045610 · 668 bytes · __cdecl
_ZN27IKeyValuesDumpContextAsText12KvWriteValueEP9KeyValuesi
Decompiled
undefined (2 params)
/* IKeyValuesDumpContextAsText::KvWriteValue(KeyValues*, int) */
undefined4 IKeyValuesDumpContextAsText::KvWriteValue(KeyValues *param_1,int param_2)
{
code *pcVar1;
int iVar2;
char cVar3;
undefined4 uVar4;
wchar_t *pwVar5;
int iVar6;
undefined1 *puVar7;
undefined4 *puVar8;
undefined4 *puVar9;
undefined4 *puVar10;
char *pcVar11;
int in_GS_OFFSET;
longdouble lVar12;
char acStack_c0 [112];
undefined4 uStack_50;
int local_40 [4];
float local_30 [4];
int local_20;
puVar10 = (undefined4 *)&stack0xffffffb4;
puVar8 = (undefined4 *)&stack0xffffffb4;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (param_2 == 0) {
uStack_50 = 0x456ab;
cVar3 = (**(code **)(*(int *)param_1 + 0xc))();
puVar7 = &stack0xffffffb4;
if (cVar3 != '\0') {
uStack_50 = 0x456bf;
uVar4 = (**(code **)(*(int *)param_1 + 0x10))();
goto LAB_00045644;
}
}
else {
uStack_50 = 0x4563e;
cVar3 = (**(code **)(*(int *)param_1 + 0xc))();
puVar7 = &stack0xffffffb4;
if (cVar3 == '\0') goto LAB_00045642;
pcVar1 = *(code **)(*(int *)param_1 + 0x10);
uStack_50 = 0x4566d;
KeyValues::GetName((KeyValues *)param_2);
uStack_50 = 0x45676;
cVar3 = (*pcVar1)();
puVar7 = &stack0xffffffb4;
if (cVar3 == '\0') goto LAB_00045642;
uStack_50 = 0x4568a;
cVar3 = (**(code **)(*(int *)param_1 + 0x10))();
puVar7 = &stack0xffffffb4;
if (cVar3 == '\0') goto LAB_00045642;
switch(*(undefined1 *)(param_2 + 0x10)) {
default:
goto switchD_0004569c_caseD_0;
case 1:
pcVar1 = *(code **)(*(int *)param_1 + 0x10);
uStack_50 = 0x457a3;
KeyValues::GetString((KeyValues *)param_2,(char *)0x0,"");
uStack_50 = 0x457ac;
cVar3 = (*pcVar1)();
puVar10 = (undefined4 *)&stack0xffffffb4;
goto joined_r0x00045724;
case 2:
uStack_50 = 0x45757;
KeyValues::GetInt((KeyValues *)param_2,(char *)0x0,0);
puVar9 = (undefined4 *)&stack0xffffff24;
pcVar11 = acStack_c0;
V_snprintf(pcVar11,0x80,"int( %d = 0x%X )");
break;
case 3:
uStack_50 = 0x45817;
lVar12 = (longdouble)KeyValues::GetFloat((KeyValues *)param_2,(char *)0x0,0.0);
puVar9 = (undefined4 *)&stack0xffffff24;
local_30[0] = (float)lVar12;
pcVar11 = acStack_c0;
V_snprintf(pcVar11,0x80,"float( %f )");
break;
case 4:
uStack_50 = 0x457d1;
KeyValues::GetPtr((KeyValues *)param_2,(char *)0x0,(void *)0x0);
puVar9 = (undefined4 *)&stack0xffffff24;
pcVar11 = acStack_c0;
V_snprintf(pcVar11,0x80,"ptr( 0x%p )");
break;
case 5:
uStack_50 = 0x4586d;
pwVar5 = (wchar_t *)KeyValues::GetWString((KeyValues *)param_2,(char *)0x0,L"");
uStack_50 = 0x45877;
iVar6 = _V_wcslen(pwVar5);
iVar2 = -((iVar6 * 2 + 0x4fU & 0xfffffff0) + 0x10);
puVar9 = (undefined4 *)((int)local_30 + iVar2 + -0x1c);
pcVar11 = (char *)((int)local_30 + iVar2);
*(int *)((int)local_40 + iVar2 + 4) = iVar6;
*(wchar_t **)((int)local_40 + iVar2) = pwVar5;
*(char **)((int)local_30 + iVar2 + -0x14) = "%ls [wstring, len = %d]";
*(int *)((int)local_30 + iVar2 + -0x18) = iVar6 * 2 + 0x40;
*(char **)((int)local_30 + iVar2 + -0x1c) = pcVar11;
*(undefined4 *)((int)&uStack_50 + iVar2) = 0x458a9;
V_snprintf(*(char **)((int)local_30 + iVar2 + -0x1c),*(int *)((int)local_30 + iVar2 + -0x18),
*(char **)((int)local_30 + iVar2 + -0x14));
break;
case 7:
local_40[0] = 0;
uStack_50 = 0x456e1;
KeyValues::GetUint64((char *)param_2,0);
puVar9 = (undefined4 *)&stack0xffffff24;
pcVar11 = acStack_c0;
V_snprintf(pcVar11,0x80,"u64( %lld = 0x%llX )");
}
iVar2 = *(int *)param_1;
puVar9[1] = pcVar11;
*puVar9 = param_1;
pcVar1 = *(code **)(iVar2 + 0x10);
puVar9[-1] = 0x45722;
cVar3 = (*pcVar1)();
puVar10 = puVar9;
joined_r0x00045724:
puVar7 = (undefined1 *)puVar10;
if (cVar3 != '\0') {
switchD_0004569c_caseD_0:
iVar2 = *(int *)param_1;
puVar10[1] = &DAT_000b32c1;
*puVar10 = param_1;
pcVar1 = *(code **)(iVar2 + 0x10);
puVar10[-1] = 0x4573a;
uVar4 = (*pcVar1)();
puVar8 = puVar10;
goto LAB_00045644;
}
}
LAB_00045642:
uVar4 = 0;
puVar8 = (undefined4 *)puVar7;
LAB_00045644:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return uVar4;
}
/* WARNING: Subroutine does not return */
*(undefined **)((int)puVar8 + -4) = &UNK_000458b3;
__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.