Serialize
0x00bf3690 · 855 bytes · __cdecl
_Z9SerializeR10CUtlBufferRK10Quaternion
Decompiled
undefined (2 params)
/* Serialize(CUtlBuffer&, Quaternion const&) */
bool Serialize(CUtlBuffer *param_1,Quaternion *param_2)
{
undefined4 uVar1;
CUtlBuffer CVar2;
char cVar3;
int iVar4;
void *pvVar5;
float fVar6;
undefined1 local_20;
undefined1 uStack_1f;
undefined1 uStack_1e;
undefined1 uStack_1d;
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,4,(float *)param_2);
return param_1[0x14] == (CUtlBuffer)0x0;
}
uVar1 = *(undefined4 *)param_2;
cVar3 = CUtlBuffer::CheckPut(param_1,4);
if (cVar3 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
*(undefined4 *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) =
uVar1;
iVar4 = *(int *)(param_1 + 0x10);
}
else {
iVar4 = *(int *)(param_1 + 0x10);
pvVar5 = (void *)((iVar4 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar5 != (void *)0x0) {
uStack_1d = (undefined1)((uint)uVar1 >> 0x18);
local_10 = uStack_1d;
uStack_1e = (undefined1)((uint)uVar1 >> 0x10);
local_f = uStack_1e;
uStack_1f = (undefined1)((uint)uVar1 >> 8);
local_e = uStack_1f;
local_20 = (undefined1)uVar1;
local_d = local_20;
_V_memcpy(pvVar5,&local_10,4);
iVar4 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar4 + 4;
CUtlBuffer::AddNullTermination(param_1);
}
fVar6 = *(float *)(param_2 + 4);
if (((byte)param_1[0x15] & 1) == 0) {
cVar3 = CUtlBuffer::CheckPut(param_1,4);
if (cVar3 == '\0') goto LAB_00bf3722;
if (((byte)param_1[0x34] & 1) == 0) {
*(float *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) = fVar6;
iVar4 = *(int *)(param_1 + 0x10);
}
else {
iVar4 = *(int *)(param_1 + 0x10);
pvVar5 = (void *)((iVar4 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar5 != (void *)0x0) {
uStack_19 = (undefined1)((uint)fVar6 >> 0x18);
local_10 = uStack_19;
uStack_1a = (undefined1)((uint)fVar6 >> 0x10);
local_f = uStack_1a;
uStack_1b = (undefined1)((uint)fVar6 >> 8);
local_e = uStack_1b;
local_1c = SUB41(fVar6,0);
local_d = local_1c;
_V_memcpy(pvVar5,&local_10,4);
iVar4 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar4 + 4;
CUtlBuffer::AddNullTermination(param_1);
fVar6 = *(float *)(param_2 + 8);
if (((byte)param_1[0x15] & 1) != 0) goto LAB_00bf3731;
LAB_00bf37ee:
cVar3 = CUtlBuffer::CheckPut(param_1,4);
if (cVar3 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
*(float *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) = fVar6;
iVar4 = *(int *)(param_1 + 0x10);
}
else {
iVar4 = *(int *)(param_1 + 0x10);
pvVar5 = (void *)((iVar4 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar5 != (void *)0x0) {
uStack_15 = (undefined1)((uint)fVar6 >> 0x18);
local_10 = uStack_15;
uStack_16 = (undefined1)((uint)fVar6 >> 0x10);
local_f = uStack_16;
uStack_17 = (undefined1)((uint)fVar6 >> 8);
local_e = uStack_17;
local_18 = SUB41(fVar6,0);
local_d = local_18;
_V_memcpy(pvVar5,&local_10,4);
iVar4 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar4 + 4;
CUtlBuffer::AddNullTermination(param_1);
CVar2 = param_1[0x15];
fVar6 = *(float *)(param_2 + 0xc);
goto joined_r0x00bf3846;
}
}
else {
CUtlBuffer::Printf(param_1,"%f",(double)fVar6);
LAB_00bf3722:
fVar6 = *(float *)(param_2 + 8);
if (((byte)param_1[0x15] & 1) == 0) goto LAB_00bf37ee;
LAB_00bf3731:
CUtlBuffer::Printf(param_1,"%f",(double)fVar6);
}
CVar2 = param_1[0x15];
fVar6 = *(float *)(param_2 + 0xc);
joined_r0x00bf3846:
if (((byte)CVar2 & 1) == 0) {
cVar3 = CUtlBuffer::CheckPut(param_1,4);
if (cVar3 != '\0') {
if (((byte)param_1[0x34] & 1) == 0) {
*(float *)(*(int *)param_1 + (*(int *)(param_1 + 0x10) - *(int *)(param_1 + 0x20))) = fVar6;
iVar4 = *(int *)(param_1 + 0x10);
}
else {
iVar4 = *(int *)(param_1 + 0x10);
pvVar5 = (void *)((iVar4 - *(int *)(param_1 + 0x20)) + *(int *)param_1);
if (pvVar5 != (void *)0x0) {
uStack_11 = (undefined1)((uint)fVar6 >> 0x18);
local_10 = uStack_11;
uStack_12 = (undefined1)((uint)fVar6 >> 0x10);
local_f = uStack_12;
uStack_13 = (undefined1)((uint)fVar6 >> 8);
local_e = uStack_13;
local_14 = SUB41(fVar6,0);
local_d = local_14;
_V_memcpy(pvVar5,&local_10,4);
iVar4 = *(int *)(param_1 + 0x10);
}
}
*(int *)(param_1 + 0x10) = iVar4 + 4;
CUtlBuffer::AddNullTermination(param_1);
return param_1[0x14] == (CUtlBuffer)0x0;
}
}
else {
CUtlBuffer::Printf(param_1,"%f",(double)fVar6);
}
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.