SVC_ServerInfo::WriteToBuffer
0x000ab1b0 · 711 bytes · __thiscall
_ZN14SVC_ServerInfo13WriteToBufferER8bf_write
Decompiled
undefined (2 params)
/* SVC_ServerInfo::WriteToBuffer(bf_write&) */
byte __thiscall SVC_ServerInfo::WriteToBuffer(SVC_ServerInfo *this,bf_write *param_1)
{
byte *pbVar1;
uint uVar2;
int iVar3;
int iVar4;
SVC_ServerInfo SVar5;
uint uVar6;
uint *puVar7;
sbyte local_20;
uVar2 = (**(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 {
iVar4 = ((int)uVar6 >> 5) * 4;
uVar6 = uVar6 & 0x1f;
puVar7 = (uint *)(iVar4 + *(int *)param_1);
local_20 = (sbyte)uVar6;
*puVar7 = uVar2 << local_20 | *puVar7 & *(uint *)(&DAT_003f2db8 + uVar6 * 0x84);
iVar3 = 0x20 - uVar6;
if (iVar3 < 6) {
puVar7 = (uint *)(*(int *)param_1 + 4 + iVar4);
*puVar7 = uVar2 >> ((byte)iVar3 & 0x1f) | (&g_BitWriteMasks)[6 - iVar3] & *puVar7;
}
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 6;
}
bf_write::WriteShort(param_1,*(int *)(this + 0x4c));
bf_write::WriteLong(param_1,*(long *)(this + 0x50));
iVar4 = *(int *)(param_1 + 0xc);
if (iVar4 < *(int *)(param_1 + 8)) {
if (param_1[0x10] != (bf_write)0x0) {
SVar5 = this[0x54];
if (param_1[0x10] == (bf_write)0x0) goto LAB_000ab29a;
LAB_000ab43e:
SVar5 = this[0x55];
LAB_000ab2cc:
if (param_1[0x10] == (bf_write)0x0) {
if (SVar5 == (SVC_ServerInfo)0x0) {
pbVar1 = (byte *)(*(int *)param_1 + (iVar4 >> 3));
*pbVar1 = *pbVar1 & ~(byte)(1 << ((byte)iVar4 & 7));
}
else {
pbVar1 = (byte *)(*(int *)param_1 + (iVar4 >> 3));
*pbVar1 = *pbVar1 | (byte)(1 << ((byte)iVar4 & 7));
}
*(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
}
goto LAB_000ab304;
}
if (this[0x56] == (SVC_ServerInfo)0x0) {
pbVar1 = (byte *)(*(int *)param_1 + (iVar4 >> 3));
*pbVar1 = *pbVar1 & ~(byte)(1 << ((byte)iVar4 & 7));
}
else {
pbVar1 = (byte *)(*(int *)param_1 + (iVar4 >> 3));
*pbVar1 = *pbVar1 | (byte)(1 << ((byte)iVar4 & 7));
}
iVar4 = *(int *)(param_1 + 0xc) + 1;
*(int *)(param_1 + 0xc) = iVar4;
SVar5 = this[0x54];
if (iVar4 < *(int *)(param_1 + 8)) {
if (param_1[0x10] != (bf_write)0x0) goto LAB_000ab43e;
LAB_000ab29a:
if (SVar5 == (SVC_ServerInfo)0x0) {
pbVar1 = (byte *)(*(int *)param_1 + (iVar4 >> 3));
*pbVar1 = *pbVar1 & ~(byte)(1 << ((byte)iVar4 & 7));
}
else {
pbVar1 = (byte *)(*(int *)param_1 + (iVar4 >> 3));
*pbVar1 = *pbVar1 | (byte)(1 << ((byte)iVar4 & 7));
}
iVar4 = *(int *)(param_1 + 0xc) + 1;
*(int *)(param_1 + 0xc) = iVar4;
SVar5 = this[0x55];
if (iVar4 < *(int *)(param_1 + 8)) goto LAB_000ab2cc;
}
}
param_1[0x10] = (bf_write)0x1;
LAB_000ab304:
bf_write::WriteLong(param_1,*(long *)(this + 0x5c));
bf_write::WriteLong(param_1,*(long *)(this + 0x60));
bf_write::WriteWord(param_1,*(uint *)(this + 0x68));
bf_write::WriteLong(param_1,*(long *)(this + 0x58));
bf_write::WriteByte(param_1,*(uint *)(this + 0x6c));
bf_write::WriteByte(param_1,*(uint *)(this + 100));
bf_write::WriteFloat((float)param_1);
bf_write::WriteChar(param_1,(int)(char)this[0x57]);
bf_write::WriteString(param_1,*(char **)(this + 0x74));
bf_write::WriteString(param_1,*(char **)(this + 0x78));
bf_write::WriteString(param_1,*(char **)(this + 0x7c));
bf_write::WriteString(param_1,*(char **)(this + 0x80));
bf_write::WriteString(param_1,*(char **)(this + 0x84));
bf_write::WriteString(param_1,*(char **)(this + 0x88));
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.