NET_StringCmd::WriteToBuffer
0x000a97c0 · 222 bytes · __thiscall
_ZN13NET_StringCmd13WriteToBufferER8bf_write
Decompiled
undefined (2 params)
/* NET_StringCmd::WriteToBuffer(bf_write&) */
undefined4 __thiscall NET_StringCmd::WriteToBuffer(NET_StringCmd *this,bf_write *param_1)
{
char *pcVar1;
int iVar2;
uint uVar3;
undefined4 uVar4;
int iVar5;
uint *puVar6;
int iVar7;
uint uVar8;
char *pcVar9;
sbyte local_20;
pcVar1 = *(char **)(this + 0x4c);
iVar5 = *(int *)(param_1 + 8);
pcVar9 = " NET_StringCmd NULL";
if (pcVar1 != (char *)0x0) {
pcVar9 = pcVar1;
}
iVar7 = *(int *)(param_1 + 0xc);
iVar2 = _V_strlen(pcVar1);
if (iVar5 - iVar7 >> 3 < iVar2) {
return 0;
}
uVar3 = (**(code **)(*(int *)this + 0x24))(this);
uVar8 = *(uint *)(param_1 + 0xc);
if (*(int *)(param_1 + 8) < (int)(uVar8 + 6)) {
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 8);
param_1[0x10] = (bf_write)0x1;
}
else {
iVar5 = ((int)uVar8 >> 5) * 4;
uVar8 = uVar8 & 0x1f;
puVar6 = (uint *)(iVar5 + *(int *)param_1);
local_20 = (sbyte)uVar8;
*puVar6 = uVar3 << local_20 | *puVar6 & *(uint *)(&DAT_003f2db8 + uVar8 * 0x84);
iVar7 = 0x20 - uVar8;
if (iVar7 < 6) {
puVar6 = (uint *)(*(int *)param_1 + 4 + iVar5);
*puVar6 = uVar3 >> ((byte)iVar7 & 0x1f) | (&g_BitWriteMasks)[6 - iVar7] & *puVar6;
}
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 6;
}
uVar4 = bf_write::WriteString(param_1,pcVar9);
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.