L L4D2node

bf_write::WriteByte

0x00242850 · 132 bytes · __thiscall

_ZN8bf_write9WriteByteEj

Decompiled

undefined (2 params)

/* bf_write::WriteByte(unsigned int) */

void __thiscall bf_write::WriteByte(bf_write *this,uint param_1)

{
  int iVar1;
  uint uVar2;
  uint *puVar3;
  int iVar4;
  
  uVar2 = *(uint *)(this + 0xc);
  if ((int)(uVar2 + 8) <= *(int *)(this + 8)) {
    iVar1 = ((int)uVar2 >> 5) * 4;
    uVar2 = uVar2 & 0x1f;
    puVar3 = (uint *)(*(int *)this + iVar1);
    *puVar3 = *puVar3 & *(uint *)(&DAT_003f2dc0 + uVar2 * 0x84) | param_1 << (sbyte)uVar2;
    iVar4 = 0x20 - uVar2;
    if (iVar4 < 8) {
      puVar3 = (uint *)(*(int *)this + 4 + iVar1);
      *puVar3 = (&g_BitWriteMasks)[8 - iVar4] & *puVar3 | param_1 >> ((byte)iVar4 & 0x1f);
    }
    *(int *)(this + 0xc) = *(int *)(this + 0xc) + 8;
    return;
  }
  *(int *)(this + 0xc) = *(int *)(this + 8);
  this[0x10] = (bf_write)0x1;
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)