SVC_Prefetch::WriteToBuffer
0x000a7f80 · 331 bytes · __thiscall
_ZN12SVC_Prefetch13WriteToBufferER8bf_write
Decompiled
undefined (2 params)
/* SVC_Prefetch::WriteToBuffer(bf_write&) */
byte __thiscall SVC_Prefetch::WriteToBuffer(SVC_Prefetch *this,bf_write *param_1)
{
ushort uVar1;
uint uVar2;
int iVar3;
int iVar4;
uint uVar5;
uint uVar6;
uint *puVar7;
uVar2 = (**(code **)(*(int *)this + 0x24))(this);
uVar5 = *(uint *)(param_1 + 0xc);
uVar6 = *(uint *)(param_1 + 8);
if ((int)uVar6 < (int)(uVar5 + 6)) {
*(uint *)(param_1 + 0xc) = uVar6;
param_1[0x10] = (bf_write)0x1;
uVar5 = uVar6;
}
else {
iVar4 = ((int)uVar5 >> 5) * 4;
uVar5 = uVar5 & 0x1f;
puVar7 = (uint *)(iVar4 + *(int *)param_1);
*puVar7 = uVar2 << (sbyte)uVar5 | *puVar7 & *(uint *)(&DAT_003f2db8 + uVar5 * 0x84);
iVar3 = 0x20 - uVar5;
if (iVar3 < 6) {
puVar7 = (uint *)(*(int *)param_1 + 4 + iVar4);
*puVar7 = uVar2 >> ((byte)iVar3 & 0x1f) | (&g_BitWriteMasks)[6 - iVar3] & *puVar7;
}
iVar4 = *(int *)(param_1 + 0xc);
uVar6 = *(uint *)(param_1 + 8);
*(uint *)(param_1 + 0xc) = iVar4 + 6U;
uVar5 = iVar4 + 6U;
}
uVar1 = *(ushort *)(this + 0x4e);
if ((int)(uVar5 + 0xf) <= (int)uVar6) {
uVar6 = uVar5 & 0x1f;
iVar3 = ((int)uVar5 >> 5) * 4;
puVar7 = (uint *)(*(int *)param_1 + iVar3);
iVar4 = 0x20 - uVar6;
*puVar7 = *puVar7 & *(uint *)(&DAT_003f2ddc + uVar6 * 0x84) | (uint)uVar1 << (sbyte)uVar6;
if (iVar4 < 0xf) {
puVar7 = (uint *)(*(int *)param_1 + 4 + iVar3);
*puVar7 = (&g_BitWriteMasks)[0xf - iVar4] & *puVar7 | (uint)(uVar1 >> ((byte)iVar4 & 0x1f));
}
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 0xf;
return (byte)param_1[0x10] ^ 1;
}
*(uint *)(param_1 + 0xc) = uVar6;
param_1[0x10] = (bf_write)0x1;
return 0;
}
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.