MessageWriteUBitLong
0x006caa50 · 187 bytes · __cdecl
_Z20MessageWriteUBitLongji
Decompiled
undefined (2 params)
/* MessageWriteUBitLong(unsigned int, int) */
void MessageWriteUBitLong(uint param_1,int param_2)
{
int iVar1;
int *piVar2;
uint uVar3;
int iVar4;
uint *puVar5;
if (g_pMsgBuffer == (int *)0x0) {
Error("WriteUBitLong called with no active message\n");
}
piVar2 = g_pMsgBuffer;
uVar3 = g_pMsgBuffer[3];
if ((int)(param_2 + uVar3) <= g_pMsgBuffer[2]) {
iVar1 = ((int)uVar3 >> 5) * 4;
uVar3 = uVar3 & 0x1f;
puVar5 = (uint *)(iVar1 + *g_pMsgBuffer);
*puVar5 = *puVar5 & (&g_BitWriteMasks)[uVar3 * 0x21 + param_2] | param_1 << (sbyte)uVar3;
iVar4 = 0x20 - uVar3;
if (iVar4 < param_2) {
puVar5 = (uint *)(*piVar2 + 4 + iVar1);
*puVar5 = (&g_BitWriteMasks)[param_2 - iVar4] & *puVar5 | param_1 >> ((byte)iVar4 & 0x1f);
}
piVar2[3] = piVar2[3] + param_2;
return;
}
g_pMsgBuffer[3] = g_pMsgBuffer[2];
*(undefined1 *)(piVar2 + 4) = 1;
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.