Serialize
0x00bf1810 · 377 bytes · __cdecl
_Z9SerializeR10CUtlBufferRK9DmeTime_t
Decompiled
undefined (2 params)
/* Serialize(CUtlBuffer&, DmeTime_t const&) */
bool Serialize(CUtlBuffer *param_1,DmeTime_t *param_2)
{
char cVar1;
void *pvVar2;
int iVar3;
int iVar4;
undefined1 local_24;
undefined1 uStack_23;
undefined1 uStack_22;
undefined1 uStack_21;
undefined1 local_20;
undefined1 local_1f;
undefined1 local_1e;
undefined1 local_1d;
iVar3 = *(int *)param_2;
if (((byte)param_1[0x15] & 1) == 0) {
cVar1 = CUtlBuffer::CheckPut(param_1,4);
if (cVar1 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
*(int *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) = iVar3;
iVar4 = *(int *)(param_1 + 0x10);
}
else {
iVar4 = *(int *)(param_1 + 0x10);
pvVar2 = (void *)((iVar4 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar2 != (void *)0x0) {
uStack_21 = (undefined1)((uint)iVar3 >> 0x18);
local_20 = uStack_21;
uStack_22 = (undefined1)((uint)iVar3 >> 0x10);
local_1f = uStack_22;
uStack_23 = (undefined1)((uint)iVar3 >> 8);
local_1e = uStack_23;
local_24 = (undefined1)iVar3;
local_1d = local_24;
_V_memcpy(pvVar2,&local_20,4);
iVar4 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar4 + 4;
CUtlBuffer::AddNullTermination(param_1);
}
}
else {
if (iVar3 < 0) {
if ((*(int *)(param_1 + 0x10) != 0) &&
(*(char *)(*(int *)param_1 + ((*(int *)(param_1 + 0x10) + -1) - *(int *)(param_1 + 0x20)))
== '\n')) {
iVar4 = 0;
if (((byte)param_1[0x15] & 0x10) == 0) {
iVar4 = *(int *)(param_1 + 0x18);
}
while (iVar4 = iVar4 + -1, -1 < iVar4) {
cVar1 = CUtlBuffer::CheckPut(param_1,1);
if (cVar1 != '\0') {
*(undefined1 *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20)))
= 9;
*(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
CUtlBuffer::AddNullTermination(param_1);
}
}
}
cVar1 = CUtlBuffer::CheckPut(param_1,1);
if (cVar1 == '\0') {
iVar3 = -iVar3;
}
else {
iVar3 = -iVar3;
*(undefined1 *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) =
0x2d;
*(int *)(param_1 + 0x10) = *(int *)(param_1 + 0x10) + 1;
CUtlBuffer::AddNullTermination(param_1);
}
}
CUtlBuffer::Printf(param_1,"%d.%04d",iVar3 / 10000,iVar3 % 10000);
}
return param_1[0x14] == (CUtlBuffer)0x0;
}
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.