Unserialize
0x00bf4080 · 517 bytes · __cdecl
_Z11UnserializeR10CUtlBufferR5Color
Decompiled
undefined (2 params)
/* Unserialize(CUtlBuffer&, Color&) */
bool Unserialize(CUtlBuffer *param_1,Color *param_2)
{
char cVar1;
int iVar2;
undefined1 uVar3;
byte bVar4;
bool bVar5;
undefined4 local_1c;
undefined4 local_18;
undefined4 local_14;
uint local_10;
if (((byte)param_1[0x15] & 1) == 0) {
cVar1 = CUtlBuffer::CheckGet(param_1,1);
uVar3 = 0;
if (cVar1 != '\0') {
uVar3 = *(undefined1 *)
(*(int *)param_1 + (*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)));
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
}
*param_2 = uVar3;
bVar4 = (byte)param_1[0x15] & 1;
if (((byte)param_1[0x15] & 1) == 0) {
cVar1 = CUtlBuffer::CheckGet(param_1,1);
if (cVar1 != '\0') {
bVar4 = *(byte *)(*(int *)param_1 + (*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)));
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
}
}
else {
local_10 = local_10 & 0xffffff00;
CUtlBuffer::Scanf(param_1,"%u",&local_10);
bVar4 = (byte)local_10;
}
param_2[1] = bVar4;
bVar4 = (byte)param_1[0x15] & 1;
if (((byte)param_1[0x15] & 1) == 0) {
cVar1 = CUtlBuffer::CheckGet(param_1,1);
if (cVar1 != '\0') {
bVar4 = *(byte *)(*(int *)param_1 + (*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)));
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
}
}
else {
local_10 = local_10 & 0xffffff00;
CUtlBuffer::Scanf(param_1,"%u",&local_10);
bVar4 = (byte)local_10;
}
param_2[2] = bVar4;
bVar4 = (byte)param_1[0x15] & 1;
if (((byte)param_1[0x15] & 1) == 0) {
cVar1 = CUtlBuffer::CheckGet(param_1,1);
if (cVar1 != '\0') {
bVar4 = *(byte *)(*(int *)param_1 + (*(int *)(param_1 + 0xc) - *(int *)(param_1 + 0x20)));
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
}
}
else {
local_10 = local_10 & 0xffffff00;
CUtlBuffer::Scanf(param_1,"%u",&local_10);
bVar4 = (byte)local_10;
}
param_2[3] = bVar4;
return param_1[0x14] == (CUtlBuffer)0x0;
}
local_1c = 0;
local_18 = 0;
local_14 = 0;
local_10 = 0xff;
iVar2 = CUtlBuffer::Scanf(param_1,"%d %d %d %d",&local_1c,&local_18,&local_14,&local_10);
*param_2 = (char)local_1c;
param_2[1] = (char)local_18;
param_2[2] = (char)local_14;
param_2[3] = (char)local_10;
bVar5 = false;
if (iVar2 == 4) {
bVar5 = param_1[0x14] == (CUtlBuffer)0x0;
}
return bVar5;
}
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.