IKeyValuesDumpContextAsText::KvWriteValue
0x00250800 · 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 = 0x25089b;
cVar3 = (**(code **)(*(int *)param_1 + 0xc))();
puVar7 = &stack0xffffffb4;
if (cVar3 != '\0') {
uStack_50 = 0x2508af;
uVar4 = (**(code **)(*(int *)param_1 + 0x10))();
goto LAB_00250834;
}
}
else {
uStack_50 = 0x25082e;
cVar3 = (**(code **)(*(int *)param_1 + 0xc))();
puVar7 = &stack0xffffffb4;
if (cVar3 == '\0') goto LAB_00250832;
pcVar1 = *(code **)(*(int *)param_1 + 0x10);
uStack_50 = 0x25085d;
KeyValues::GetName((KeyValues *)param_2);
uStack_50 = 0x250866;
cVar3 = (*pcVar1)();
puVar7 = &stack0xffffffb4;
if (cVar3 == '\0') goto LAB_00250832;
uStack_50 = 0x25087a;
cVar3 = (**(code **)(*(int *)param_1 + 0x10))();
puVar7 = &stack0xffffffb4;
if (cVar3 == '\0') goto LAB_00250832;
switch(*(undefined1 *)(param_2 + 0x10)) {
default:
goto switchD_0025088c_caseD_0;
case 1:
pcVar1 = *(code **)(*(int *)param_1 + 0x10);
uStack_50 = 0x250993;
KeyValues::GetString((KeyValues *)param_2,(char *)0x0,"");
uStack_50 = 0x25099c;
cVar3 = (*pcVar1)();
puVar10 = (undefined4 *)&stack0xffffffb4;
goto joined_r0x00250914;
case 2:
uStack_50 = 0x250947;
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 = 0x250a07;
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 = 0x2509c1;
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 = 0x250a5d;
pwVar5 = (wchar_t *)KeyValues::GetWString((KeyValues *)param_2,(char *)0x0,L"");
uStack_50 = 0x250a67;
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) = 0x250a99;
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 = 0x2508d1;
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] = 0x250912;
cVar3 = (*pcVar1)();
puVar10 = puVar9;
joined_r0x00250914:
puVar7 = (undefined1 *)puVar10;
if (cVar3 != '\0') {
switchD_0025088c_caseD_0:
iVar2 = *(int *)param_1;
puVar10[1] = "\n";
*puVar10 = param_1;
pcVar1 = *(code **)(iVar2 + 0x10);
puVar10[-1] = 0x25092a;
uVar4 = (*pcVar1)();
puVar8 = puVar10;
goto LAB_00250834;
}
}
LAB_00250832:
uVar4 = 0;
puVar8 = (undefined4 *)puVar7;
LAB_00250834:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return uVar4;
}
/* WARNING: Subroutine does not return */
*(undefined **)((int)puVar8 + -4) = &UNK_00250aa3;
__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.