KeyValues::MakeCopy
0x0024f020 · 336 bytes · __thiscall
_ZNK9KeyValues8MakeCopyEv
Decompiled
undefined (1 param)
/* KeyValues::MakeCopy() const */
KeyValues * __thiscall KeyValues::MakeCopy(KeyValues *this)
{
uint uVar1;
char *pcVar2;
KeyValues *this_00;
int iVar3;
size_t sVar4;
void *pvVar5;
uint uVar6;
uint in_stack_ffffffd8;
pcVar2 = (char *)GetName(this);
this_00 = operator_new((KeyValues *)0x2c,in_stack_ffffffd8);
Init(this_00,(IKeyValuesSystem *)0x0,false);
/* try { // try from 0024f063 to 0024f067 has its CatchHandler @ 0024f193 */
SetName(this_00,pcVar2);
this_00[0x10] = this[0x10];
switch(this[0x10]) {
case (KeyValues)0x1:
if (*(char **)(this + 4) != (char *)0x0) {
iVar3 = _V_strlen(*(char **)(this + 4));
pvVar5 = operator_new__(iVar3 + 1U);
*(void **)(this_00 + 4) = pvVar5;
_V_memcpy(pvVar5,*(void **)(this + 4),iVar3 + 1U);
}
break;
case (KeyValues)0x2:
case (KeyValues)0x4:
*(undefined4 *)(this_00 + 0xc) = *(undefined4 *)(this + 0xc);
break;
case (KeyValues)0x3:
*(undefined4 *)(this_00 + 0xc) = *(undefined4 *)(this + 0xc);
break;
case (KeyValues)0x5:
if (*(wchar_t **)(this + 8) != (wchar_t *)0x0) {
sVar4 = wcslen(*(wchar_t **)(this + 8));
uVar1 = (sVar4 + 1) * 4;
uVar6 = uVar1;
if (0x1fc00000 < sVar4 + 1) {
uVar6 = 0xffffffff;
}
pvVar5 = operator_new__(uVar6);
*(void **)(this_00 + 8) = pvVar5;
_V_memcpy(pvVar5,*(void **)(this + 8),uVar1);
}
break;
case (KeyValues)0x6:
this_00[0xc] = this[0xc];
this_00[0xd] = this[0xd];
this_00[0xe] = this[0xe];
this_00[0xf] = this[0xf];
break;
case (KeyValues)0x7:
pvVar5 = operator_new__(8);
*(void **)(this_00 + 4) = pvVar5;
_V_memcpy(pvVar5,*(void **)(this + 4),8);
}
CopySubkeys(this,this_00);
return this_00;
}
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.