CLC_ListenEvents::WriteToBuffer
0x000ab050 · 339 bytes · __thiscall
_ZN16CLC_ListenEvents13WriteToBufferER8bf_write
Decompiled
undefined (2 params)
/* CLC_ListenEvents::WriteToBuffer(bf_write&) */
byte __thiscall CLC_ListenEvents::WriteToBuffer(CLC_ListenEvents *this,bf_write *param_1)
{
uint uVar1;
int iVar2;
uint uVar3;
uint uVar4;
int iVar5;
uint *puVar6;
int iVar7;
uVar1 = (**(code **)(*(int *)this + 0x24))(this);
uVar4 = *(uint *)(param_1 + 0xc);
uVar3 = *(uint *)(param_1 + 8);
if ((int)uVar3 < (int)(uVar4 + 6)) {
*(uint *)(param_1 + 0xc) = uVar3;
param_1[0x10] = (bf_write)0x1;
uVar4 = uVar3;
}
else {
iVar5 = ((int)uVar4 >> 5) * 4;
uVar4 = uVar4 & 0x1f;
puVar6 = (uint *)(iVar5 + *(int *)param_1);
*puVar6 = uVar1 << (sbyte)uVar4 | *puVar6 & *(uint *)(&DAT_003f2db8 + uVar4 * 0x84);
iVar7 = 0x20 - uVar4;
if (iVar7 < 6) {
puVar6 = (uint *)(*(int *)param_1 + 4 + iVar5);
*puVar6 = uVar1 >> ((byte)iVar7 & 0x1f) | (&g_BitWriteMasks)[6 - iVar7] & *puVar6;
}
iVar5 = *(int *)(param_1 + 0xc);
uVar3 = *(uint *)(param_1 + 8);
*(uint *)(param_1 + 0xc) = iVar5 + 6U;
uVar4 = iVar5 + 6U;
}
iVar5 = 0;
while( true ) {
uVar1 = *(uint *)(this + iVar5 * 4 + 0x4c);
if ((int)uVar3 < (int)(uVar4 + 0x20)) {
*(uint *)(param_1 + 0xc) = uVar3;
param_1[0x10] = (bf_write)0x1;
}
else {
iVar7 = ((int)uVar4 >> 5) * 4;
uVar4 = uVar4 & 0x1f;
puVar6 = (uint *)(*(int *)param_1 + iVar7);
*puVar6 = *puVar6 & *(uint *)(&DAT_003f2e20 + uVar4 * 0x84) | uVar1 << (sbyte)uVar4;
iVar2 = 0x20 - uVar4;
if (iVar2 != 0x20) {
puVar6 = (uint *)(*(int *)param_1 + 4 + iVar7);
*puVar6 = (&g_BitWriteMasks)[0x20 - iVar2] & *puVar6 | uVar1 >> ((byte)iVar2 & 0x1f);
}
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 0x20;
}
if (iVar5 == 0xf) break;
iVar5 = iVar5 + 1;
uVar4 = *(uint *)(param_1 + 0xc);
uVar3 = *(uint *)(param_1 + 8);
}
return (byte)param_1[0x10] ^ 1;
}
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.