Unserialize<DmeTime_t>
0x00be5590 · 430 bytes · __cdecl
_Z11UnserializeI9DmeTime_tEbR10CUtlBufferR10CUtlVectorIT_10CUtlMemoryIS4_iEE
Decompiled
bool (2 params)
/* bool Unserialize<DmeTime_t>(CUtlBuffer&, CUtlVector<DmeTime_t, CUtlMemory<DmeTime_t, int> >&) */
bool Unserialize<DmeTime_t>(CUtlBuffer *param_1,CUtlVector *param_2)
{
char cVar1;
int *piVar2;
void *pvVar3;
int iVar4;
int local_30;
int local_24;
undefined4 local_20;
*(undefined4 *)(param_2 + 0xc) = 0;
if (((byte)param_1[0x15] & 1) == 0) {
cVar1 = CUtlBuffer::CheckGet(param_1,4);
if (cVar1 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
iVar4 = *(int *)(param_1 + 0xc);
local_30 = *(int *)(*(int *)param_1 + (iVar4 - *(int *)(param_1 + 0x20)));
}
else {
piVar2 = (int *)((*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (piVar2 == (int *)0x0) {
piVar2 = &local_24;
}
local_20 = local_24;
local_20 = CONCAT31((int3)((uint)local_24 >> 8),*(undefined1 *)((int)piVar2 + 3));
local_20._2_2_ = (undefined2)((uint)local_24 >> 0x10);
local_20._0_2_ = CONCAT11(*(undefined1 *)((int)piVar2 + 2),*(undefined1 *)((int)piVar2 + 3))
;
local_20._3_1_ = (undefined1)((uint)local_24 >> 0x18);
local_20._0_3_ = CONCAT12(*(undefined1 *)((int)piVar2 + 1),(undefined2)local_20);
local_20 = CONCAT13((char)*piVar2,(undefined3)local_20);
_V_memcpy(&local_24,&local_20,4);
local_30 = local_24;
iVar4 = *(int *)(param_1 + 0xc);
}
*(int *)(param_1 + 0xc) = iVar4 + 4;
if (local_30 != 0) {
if ((*(int *)(param_2 + 4) < local_30) && (-1 < *(int *)(param_2 + 8))) {
*(int *)(param_2 + 4) = local_30;
if (*(void **)param_2 == (void *)0x0) {
pvVar3 = malloc(local_30 << 2);
*(void **)param_2 = pvVar3;
}
else {
pvVar3 = realloc(*(void **)param_2,local_30 * 4);
*(void **)param_2 = pvVar3;
}
}
else {
pvVar3 = *(void **)param_2;
}
*(void **)(param_2 + 0x10) = pvVar3;
if (0 < local_30) {
iVar4 = 0;
do {
CUtlVector<DmeTime_t,CUtlMemory<DmeTime_t,int>>::InsertBefore
((CUtlVector<DmeTime_t,CUtlMemory<DmeTime_t,int>> *)param_2,
*(int *)(param_2 + 0xc));
cVar1 = Unserialize(param_1,(DmeTime_t *)(*(int *)param_2 + iVar4 * 4));
if (cVar1 == '\0') {
return false;
}
iVar4 = iVar4 + 1;
} while (iVar4 != local_30);
}
}
}
return param_1[0x14] == (CUtlBuffer)0x0;
}
do {
CUtlBuffer::EatWhiteSpace(param_1);
if (param_1[0x14] != (CUtlBuffer)0x0) {
return true;
}
iVar4 = CUtlVector<DmeTime_t,CUtlMemory<DmeTime_t,int>>::InsertBefore
((CUtlVector<DmeTime_t,CUtlMemory<DmeTime_t,int>> *)param_2,
*(int *)(param_2 + 0xc));
cVar1 = Unserialize(param_1,(DmeTime_t *)(*(int *)param_2 + iVar4 * 4));
} while (cVar1 != '\0');
return false;
}
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.