SVC_UpdateStringTable::WriteToBuffer
0x000a9db0 · 652 bytes · __thiscall
_ZN21SVC_UpdateStringTable13WriteToBufferER8bf_write
Decompiled
undefined (2 params)
/* SVC_UpdateStringTable::WriteToBuffer(bf_write&) */
void __thiscall SVC_UpdateStringTable::WriteToBuffer(SVC_UpdateStringTable *this,bf_write *param_1)
{
uint uVar1;
int iVar2;
byte *pbVar3;
int iVar4;
int iVar5;
uint uVar6;
uint *puVar7;
uint uVar8;
sbyte local_20;
uVar1 = (**(code **)(*(int *)this + 0x24))(this);
uVar6 = *(uint *)(param_1 + 0xc);
if (*(int *)(param_1 + 8) < (int)(uVar6 + 6)) {
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 8);
param_1[0x10] = (bf_write)0x1;
}
else {
iVar2 = ((int)uVar6 >> 5) * 4;
uVar6 = uVar6 & 0x1f;
puVar7 = (uint *)(iVar2 + *(int *)param_1);
local_20 = (sbyte)uVar6;
*puVar7 = uVar1 << local_20 | *puVar7 & *(uint *)(&DAT_003f2db8 + uVar6 * 0x84);
iVar4 = 0x20 - uVar6;
if (iVar4 < 6) {
puVar7 = (uint *)(*(int *)param_1 + 4 + iVar2);
*puVar7 = uVar1 >> ((byte)iVar4 & 0x1f) | (&g_BitWriteMasks)[6 - iVar4] & *puVar7;
}
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 6;
}
*(undefined4 *)(this + 0x54) = *(undefined4 *)(this + 0x88);
iVar2 = Q_log2(0x20);
uVar6 = *(uint *)(this + 0x4c);
uVar1 = *(uint *)(param_1 + 0xc);
uVar8 = *(uint *)(param_1 + 8);
if ((int)uVar8 < (int)(iVar2 + uVar1)) {
*(uint *)(param_1 + 0xc) = uVar8;
param_1[0x10] = (bf_write)0x1;
uVar6 = uVar8;
if (*(int *)(this + 0x50) == 1) goto LAB_000aa052;
LAB_000a9fc1:
param_1[0x10] = (bf_write)0x1;
}
else {
uVar8 = uVar1 & 0x1f;
iVar4 = ((int)uVar1 >> 5) * 4;
puVar7 = (uint *)(iVar4 + *(int *)param_1);
*puVar7 = (&g_BitWriteMasks)[uVar8 * 0x21 + iVar2] & *puVar7 | uVar6 << (sbyte)uVar8;
iVar5 = 0x20 - uVar8;
if (iVar5 < iVar2) {
puVar7 = (uint *)(*(int *)param_1 + 4 + iVar4);
*puVar7 = (&g_BitWriteMasks)[iVar2 - iVar5] & *puVar7 | uVar6 >> ((byte)iVar5 & 0x1f);
}
uVar6 = iVar2 + *(int *)(param_1 + 0xc);
*(uint *)(param_1 + 0xc) = uVar6;
uVar8 = *(uint *)(param_1 + 8);
if (*(int *)(this + 0x50) == 1) {
if ((int)uVar6 < (int)uVar8) {
if (param_1[0x10] == (bf_write)0x0) {
pbVar3 = (byte *)(((int)uVar6 >> 3) + *(int *)param_1);
*pbVar3 = *pbVar3 & ~(byte)(1 << ((byte)uVar6 & 7));
uVar6 = *(int *)(param_1 + 0xc) + 1;
uVar8 = *(uint *)(param_1 + 8);
*(uint *)(param_1 + 0xc) = uVar6;
}
goto LAB_000a9f10;
}
LAB_000aa052:
param_1[0x10] = (bf_write)0x1;
goto LAB_000a9f10;
}
if ((int)uVar8 <= (int)uVar6) goto LAB_000a9fc1;
if (param_1[0x10] == (bf_write)0x0) {
pbVar3 = (byte *)(((int)uVar6 >> 3) + *(int *)param_1);
*pbVar3 = *pbVar3 | (byte)(1 << ((byte)uVar6 & 7));
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
}
}
bf_write::WriteWord(param_1,*(uint *)(this + 0x50));
uVar6 = *(uint *)(param_1 + 0xc);
uVar8 = *(uint *)(param_1 + 8);
LAB_000a9f10:
uVar1 = *(uint *)(this + 0x54);
if ((int)uVar8 < (int)(uVar6 + 0x14)) {
*(uint *)(param_1 + 0xc) = uVar8;
param_1[0x10] = (bf_write)0x1;
}
else {
iVar2 = ((int)uVar6 >> 5) * 4;
uVar6 = uVar6 & 0x1f;
puVar7 = (uint *)(*(int *)param_1 + iVar2);
*puVar7 = *puVar7 & *(uint *)(&DAT_003f2df0 + uVar6 * 0x84) | uVar1 << (sbyte)uVar6;
iVar4 = 0x20 - uVar6;
if (iVar4 < 0x14) {
puVar7 = (uint *)(*(int *)param_1 + 4 + iVar2);
*puVar7 = (&g_BitWriteMasks)[0x14 - iVar4] & *puVar7 | uVar1 >> ((byte)iVar4 & 0x1f);
}
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 0x14;
}
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.