CDmxSerializerKeyValues2::UnserializeElement
0x00bee040 · 294 bytes · __thiscall
_ZN24CDmxSerializerKeyValues218UnserializeElementER10CUtlBufferPi
Decompiled
undefined (3 params)
/* CDmxSerializerKeyValues2::UnserializeElement(CUtlBuffer&, int*) */
undefined4 __thiscall
CDmxSerializerKeyValues2::UnserializeElement
(CDmxSerializerKeyValues2 *this,CUtlBuffer *param_1,int *param_2)
{
CDmxSerializerKeyValues2 *pCVar1;
int iVar2;
CUtlCharConversion *pCVar3;
int iVar4;
undefined4 *puVar5;
undefined4 uVar6;
int in_GS_OFFSET;
undefined4 uStackY_80;
CDmxSerializerKeyValues2 *local_60 [2];
CUtlBuffer local_58 [56];
int local_20;
puVar5 = (undefined4 *)&stack0xffffff84;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
*param_2 = -1;
local_60[0] = this;
uStackY_80 = 0xbee08a;
CUtlBuffer::CUtlBuffer(local_58,0,0,0);
/* try { // try from 00bee098 to 00bee155 has its CatchHandler @ 00bee16f */
uStackY_80 = 0xbee09d;
iVar2 = ReadToken(local_60[0],param_1,local_58);
if (iVar2 != -1) {
if (iVar2 == 7) {
uVar6 = 1;
goto LAB_00bee0c8;
}
if (iVar2 == 5) {
uStackY_80 = 0xbee0f5;
pCVar3 = (CUtlCharConversion *)GetCStringCharConversion();
uStackY_80 = 0xbee10c;
iVar4 = CUtlBuffer::PeekDelimitedStringLength(local_58,pCVar3,true);
iVar2 = -((iVar4 + 0xfU & 0xfffffff0) + 0x10);
puVar5 = (undefined4 *)((int)local_60 + iVar2 + -0x1c);
*(int *)(local_58 + iVar2 + -0x18) = iVar4;
*(CUtlBuffer **)((int)local_60 + iVar2 + -0x1c) = local_58;
*(CUtlCharConversion **)(local_58 + iVar2 + -0x20) = pCVar3;
*(int *)(local_58 + iVar2 + -0x1c) = (int)local_60 + iVar2;
*(undefined4 *)((int)&uStackY_80 + iVar2) = 0xbee13c;
CUtlBuffer::GetDelimitedString
(*(CUtlBuffer **)((int)local_60 + iVar2 + -0x1c),
*(CUtlCharConversion **)(local_58 + iVar2 + -0x20),
*(char **)(local_58 + iVar2 + -0x1c),*(int *)(local_58 + iVar2 + -0x18));
*(int **)(local_58 + iVar2 + -0x18) = param_2;
pCVar1 = local_60[0];
*(CUtlBuffer **)(local_58 + iVar2 + -0x20) = param_1;
*(int *)(local_58 + iVar2 + -0x1c) = (int)local_60 + iVar2;
*(CDmxSerializerKeyValues2 **)((int)local_60 + iVar2 + -0x1c) = pCVar1;
*(undefined4 *)((int)&uStackY_80 + iVar2) = 0xbee156;
uVar6 = UnserializeElement(*(CDmxSerializerKeyValues2 **)((int)local_60 + iVar2 + -0x1c),
*(CUtlBuffer **)(local_58 + iVar2 + -0x20),
*(char **)(local_58 + iVar2 + -0x1c),
*(int **)(local_58 + iVar2 + -0x18));
goto LAB_00bee0c8;
}
uStackY_80 = 0xbee0c6;
CDmxKeyValues2ErrorStack::ReportError
((CDmxKeyValues2ErrorStack *)&g_KeyValues2ErrorStack,
"Expecting element type name, didn\'t find it!");
}
uVar6 = 0;
puVar5 = (undefined4 *)&stack0xffffff84;
LAB_00bee0c8:
*puVar5 = local_58;
puVar5[-1] = 0xbee0d0;
CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)*puVar5);
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return uVar6;
}
/* WARNING: Subroutine does not return */
puVar5[-1] = &LAB_00bee16f;
__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.