SVC_GameEvent::WriteToBuffer
0x000a8530 · 367 bytes · __thiscall
_ZN13SVC_GameEvent13WriteToBufferER8bf_write
Decompiled
undefined (2 params)
/* SVC_GameEvent::WriteToBuffer(bf_write&) */
undefined4 __thiscall SVC_GameEvent::WriteToBuffer(SVC_GameEvent *this,bf_write *param_1)
{
int iVar1;
uint uVar2;
uint uVar3;
undefined4 uVar4;
int iVar5;
uint uVar6;
uint *puVar7;
sbyte local_20;
*(uint *)(this + 0x4c) = *(uint *)(this + 0x80);
if (0x7ff < *(uint *)(this + 0x80)) {
return 0;
}
uVar2 = (**(code **)(*(int *)this + 0x24))(this);
uVar6 = *(uint *)(param_1 + 0xc);
uVar3 = *(uint *)(param_1 + 8);
if ((int)uVar3 < (int)(uVar6 + 6)) {
*(uint *)(param_1 + 0xc) = uVar3;
param_1[0x10] = (bf_write)0x1;
uVar6 = uVar3;
}
else {
iVar1 = ((int)uVar6 >> 5) * 4;
uVar6 = uVar6 & 0x1f;
puVar7 = (uint *)(iVar1 + *(int *)param_1);
local_20 = (sbyte)uVar6;
*puVar7 = uVar2 << local_20 | *puVar7 & *(uint *)(&DAT_003f2db8 + uVar6 * 0x84);
iVar5 = 0x20 - uVar6;
if (iVar5 < 6) {
puVar7 = (uint *)(*(int *)param_1 + 4 + iVar1);
*puVar7 = uVar2 >> ((byte)iVar5 & 0x1f) | (&g_BitWriteMasks)[6 - iVar5] & *puVar7;
}
iVar1 = *(int *)(param_1 + 0xc);
uVar3 = *(uint *)(param_1 + 8);
*(uint *)(param_1 + 0xc) = iVar1 + 6U;
uVar6 = iVar1 + 6U;
}
uVar2 = *(uint *)(this + 0x4c);
if ((int)uVar3 < (int)(uVar6 + 0xb)) {
*(uint *)(param_1 + 0xc) = uVar3;
param_1[0x10] = (bf_write)0x1;
}
else {
iVar1 = ((int)uVar6 >> 5) * 4;
uVar6 = uVar6 & 0x1f;
puVar7 = (uint *)(*(int *)param_1 + iVar1);
*puVar7 = *puVar7 & *(uint *)(&DAT_003f2dcc + uVar6 * 0x84) | uVar2 << (sbyte)uVar6;
iVar5 = 0x20 - uVar6;
if (iVar5 < 0xb) {
puVar7 = (uint *)(*(int *)param_1 + 4 + iVar1);
*puVar7 = (&g_BitWriteMasks)[0xb - iVar5] & *puVar7 | uVar2 >> ((byte)iVar5 & 0x1f);
}
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 0xb;
}
uVar4 = bf_write::WriteBits(param_1,*(void **)(this + 0x74),*(int *)(this + 0x4c));
return uVar4;
}
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.