Unserialize
0x00bf2230 · 196 bytes · __cdecl
_Z11UnserializeR10CUtlBufferRf
Decompiled
undefined (2 params)
/* Unserialize(CUtlBuffer&, float&) */
bool Unserialize(CUtlBuffer *param_1,float *param_2)
{
float fVar1;
char cVar2;
int iVar3;
undefined4 local_14;
undefined1 local_10;
undefined1 local_f;
undefined1 local_e;
undefined1 local_d;
if (((byte)param_1[0x15] & 1) == 0) {
cVar2 = CUtlBuffer::CheckGet(param_1,4);
local_14 = 0.0;
if (cVar2 != '\0') {
iVar3 = *(int *)(param_1 + 0xc);
fVar1 = *(float *)(*(int *)param_1 + (iVar3 - *(int *)(param_1 + 0x20)));
local_14 = fVar1;
if (((byte)param_1[0x34] & 1) != 0) {
local_14._3_1_ = (undefined1)((uint)fVar1 >> 0x18);
local_10 = local_14._3_1_;
local_14._2_1_ = (undefined1)((uint)fVar1 >> 0x10);
local_f = local_14._2_1_;
local_14._1_1_ = (undefined1)((uint)fVar1 >> 8);
local_e = local_14._1_1_;
local_14._0_1_ = SUB41(fVar1,0);
local_d = (undefined1)local_14;
_V_memcpy(&local_14,&local_10,4);
iVar3 = *(int *)(param_1 + 0xc);
}
*(int *)(param_1 + 0xc) = iVar3 + 4;
}
*param_2 = local_14;
}
else {
iVar3 = CUtlBuffer::Scanf(param_1,"%f",param_2);
if (iVar3 != 1) {
return false;
}
}
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.