Serialize
0x00bf31b0 · 635 bytes · __cdecl
_Z9SerializeR10CUtlBufferRK6QAngle
Decompiled
undefined (2 params)
/* Serialize(CUtlBuffer&, QAngle const&) */
bool Serialize(CUtlBuffer *param_1,QAngle *param_2)
{
undefined4 uVar1;
float fVar2;
CUtlBuffer CVar3;
char cVar4;
int iVar5;
void *pvVar6;
undefined1 local_1c;
undefined1 uStack_1b;
undefined1 uStack_1a;
undefined1 uStack_19;
undefined1 local_18;
undefined1 uStack_17;
undefined1 uStack_16;
undefined1 uStack_15;
undefined1 local_14;
undefined1 uStack_13;
undefined1 uStack_12;
undefined1 uStack_11;
undefined1 local_10;
undefined1 local_f;
undefined1 local_e;
undefined1 local_d;
if (((byte)param_1[0x15] & 1) != 0) {
SerializeFloats(param_1,3,(float *)param_2);
return param_1[0x14] == (CUtlBuffer)0x0;
}
uVar1 = *(undefined4 *)param_2;
cVar4 = CUtlBuffer::CheckPut(param_1,4);
if (cVar4 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
*(undefined4 *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) =
uVar1;
iVar5 = *(int *)(param_1 + 0x10);
}
else {
iVar5 = *(int *)(param_1 + 0x10);
pvVar6 = (void *)((iVar5 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar6 != (void *)0x0) {
uStack_19 = (undefined1)((uint)uVar1 >> 0x18);
local_10 = uStack_19;
uStack_1a = (undefined1)((uint)uVar1 >> 0x10);
local_f = uStack_1a;
uStack_1b = (undefined1)((uint)uVar1 >> 8);
local_e = uStack_1b;
local_1c = (undefined1)uVar1;
local_d = local_1c;
_V_memcpy(pvVar6,&local_10,4);
iVar5 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar5 + 4;
CUtlBuffer::AddNullTermination(param_1);
}
fVar2 = *(float *)(param_2 + 4);
if (((byte)param_1[0x15] & 1) == 0) {
cVar4 = CUtlBuffer::CheckPut(param_1,4);
if (cVar4 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
*(float *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) = fVar2;
iVar5 = *(int *)(param_1 + 0x10);
}
else {
iVar5 = *(int *)(param_1 + 0x10);
pvVar6 = (void *)((iVar5 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar6 != (void *)0x0) {
uStack_15 = (undefined1)((uint)fVar2 >> 0x18);
local_10 = uStack_15;
uStack_16 = (undefined1)((uint)fVar2 >> 0x10);
local_f = uStack_16;
uStack_17 = (undefined1)((uint)fVar2 >> 8);
local_e = uStack_17;
local_18 = SUB41(fVar2,0);
local_d = local_18;
_V_memcpy(pvVar6,&local_10,4);
iVar5 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar5 + 4;
CUtlBuffer::AddNullTermination(param_1);
CVar3 = param_1[0x15];
fVar2 = *(float *)(param_2 + 8);
goto joined_r0x00bf32d4;
}
}
else {
CUtlBuffer::Printf(param_1,"%f",(double)fVar2);
}
CVar3 = param_1[0x15];
fVar2 = *(float *)(param_2 + 8);
joined_r0x00bf32d4:
if (((byte)CVar3 & 1) == 0) {
cVar4 = CUtlBuffer::CheckPut(param_1,4);
if (cVar4 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
*(float *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) = fVar2;
iVar5 = *(int *)(param_1 + 0x10);
}
else {
iVar5 = *(int *)(param_1 + 0x10);
pvVar6 = (void *)((iVar5 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar6 != (void *)0x0) {
uStack_11 = (undefined1)((uint)fVar2 >> 0x18);
local_10 = uStack_11;
uStack_12 = (undefined1)((uint)fVar2 >> 0x10);
local_f = uStack_12;
uStack_13 = (undefined1)((uint)fVar2 >> 8);
local_e = uStack_13;
local_14 = SUB41(fVar2,0);
local_d = local_14;
_V_memcpy(pvVar6,&local_10,4);
iVar5 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar5 + 4;
CUtlBuffer::AddNullTermination(param_1);
return param_1[0x14] == (CUtlBuffer)0x0;
}
}
else {
CUtlBuffer::Printf(param_1,"%f",(double)fVar2);
}
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.