DataTable_MaybeWriteSendTableBuffer
0x001444c0 · 145 bytes · __regparm3
_Z35DataTable_MaybeWriteSendTableBufferP9SendTableP8bf_writeb.part.39
Decompiled
undefined (3 params)
/* DataTable_MaybeWriteSendTableBuffer(SendTable*, bf_write*, bool) [clone .part.39] */
void __regparm3
DataTable_MaybeWriteSendTableBuffer(SendTable *param_1,bf_write *param_2,bool param_3)
{
int iVar1;
byte *pbVar2;
param_1[0x10] = (SendTable)((byte)param_1[0x10] | 2);
iVar1 = *(int *)(param_2 + 0xc);
if (iVar1 < *(int *)(param_2 + 8)) {
if (param_2[0x10] == (bf_write)0x0) {
pbVar2 = (byte *)((iVar1 >> 3) + *(int *)param_2);
*pbVar2 = *pbVar2 | (byte)(1 << ((byte)iVar1 & 7));
iVar1 = *(int *)(param_2 + 0xc) + 1;
*(int *)(param_2 + 0xc) = iVar1;
if (*(int *)(param_2 + 8) <= iVar1) goto LAB_00144540;
}
if (param_2[0x10] == (bf_write)0x0) {
if (param_3) {
pbVar2 = (byte *)(*(int *)param_2 + (iVar1 >> 3));
*pbVar2 = *pbVar2 | (byte)(1 << ((byte)iVar1 & 7));
}
else {
pbVar2 = (byte *)(*(int *)param_2 + (iVar1 >> 3));
*pbVar2 = *pbVar2 & ~(byte)(1 << ((byte)iVar1 & 7));
}
*(int *)(param_2 + 0xc) = *(int *)(param_2 + 0xc) + 1;
}
}
else {
LAB_00144540:
param_2[0x10] = (bf_write)0x1;
}
SendTable_WriteInfos(param_1,param_2);
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.