CLC_Move::WriteToBuffer
0x000a98c0 · 507 bytes · __thiscall
_ZN8CLC_Move13WriteToBufferER8bf_write
Decompiled
undefined (2 params)
/* CLC_Move::WriteToBuffer(bf_write&) */
void __thiscall CLC_Move::WriteToBuffer(CLC_Move *this,bf_write *param_1)
{
uint uVar1;
uint uVar2;
int iVar3;
int iVar4;
uint uVar5;
uint *puVar6;
sbyte local_20;
uVar1 = (**(code **)(*(int *)this + 0x24))(this);
uVar5 = *(uint *)(param_1 + 0xc);
if (*(int *)(param_1 + 8) < (int)(uVar5 + 6)) {
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 8);
param_1[0x10] = (bf_write)0x1;
}
else {
iVar3 = ((int)uVar5 >> 5) * 4;
uVar5 = uVar5 & 0x1f;
puVar6 = (uint *)(iVar3 + *(int *)param_1);
local_20 = (sbyte)uVar5;
*puVar6 = uVar1 << local_20 | *puVar6 & *(uint *)(&DAT_003f2db8 + uVar5 * 0x84);
iVar4 = 0x20 - uVar5;
if (iVar4 < 6) {
puVar6 = (uint *)(*(int *)param_1 + 4 + iVar3);
*puVar6 = uVar1 >> ((byte)iVar4 & 0x1f) | (&g_BitWriteMasks)[6 - iVar4] & *puVar6;
}
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 6;
}
*(undefined4 *)(this + 0x54) = *(undefined4 *)(this + 0x88);
uVar5 = *(uint *)(this + 0x50);
uVar1 = *(uint *)(param_1 + 0xc);
uVar2 = *(uint *)(param_1 + 8);
if ((int)uVar2 < (int)(uVar1 + 4)) {
*(uint *)(param_1 + 0xc) = uVar2;
param_1[0x10] = (bf_write)0x1;
uVar5 = uVar2;
}
else {
iVar3 = ((int)uVar1 >> 5) * 4;
uVar1 = uVar1 & 0x1f;
puVar6 = (uint *)(*(int *)param_1 + iVar3);
*puVar6 = *puVar6 & *(uint *)(&DAT_003f2db0 + uVar1 * 0x84) | uVar5 << (sbyte)uVar1;
iVar4 = 0x20 - uVar1;
if (iVar4 < 4) {
puVar6 = (uint *)(*(int *)param_1 + 4 + iVar3);
*puVar6 = (&g_BitWriteMasks)[4 - iVar4] & *puVar6 | uVar5 >> ((byte)iVar4 & 0x1f);
}
uVar2 = *(int *)(param_1 + 0xc) + 4;
*(uint *)(param_1 + 0xc) = uVar2;
uVar5 = *(uint *)(param_1 + 8);
}
uVar1 = *(uint *)(this + 0x4c);
if ((int)uVar5 < (int)(uVar2 + 3)) {
*(uint *)(param_1 + 0xc) = uVar5;
param_1[0x10] = (bf_write)0x1;
}
else {
iVar3 = ((int)uVar2 >> 5) * 4;
uVar2 = uVar2 & 0x1f;
puVar6 = (uint *)(*(int *)param_1 + iVar3);
*puVar6 = *puVar6 & *(uint *)(&DAT_003f2dac + uVar2 * 0x84) | uVar1 << (sbyte)uVar2;
iVar4 = 0x20 - uVar2;
if (iVar4 < 3) {
puVar6 = (uint *)(*(int *)param_1 + 4 + iVar3);
*puVar6 = (&g_BitWriteMasks)[3 - iVar4] & *puVar6 | uVar1 >> ((byte)iVar4 & 0x1f);
}
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 3;
}
bf_write::WriteWord(param_1,*(uint *)(this + 0x54));
bf_write::WriteBits(param_1,*(void **)(this + 0x7c),*(int *)(this + 0x54));
return;
}
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.