L L4D2node

CLC_BaselineAck::WriteToBuffer

0x000a8410 · 256 bytes · __thiscall

_ZN15CLC_BaselineAck13WriteToBufferER8bf_write

Decompiled

undefined (2 params)

/* CLC_BaselineAck::WriteToBuffer(bf_write&) */

byte __thiscall CLC_BaselineAck::WriteToBuffer(CLC_BaselineAck *this,bf_write *param_1)

{
  int iVar1;
  uint uVar2;
  int iVar3;
  uint uVar4;
  uint *puVar5;
  sbyte local_20;
  
  uVar2 = (**(code **)(*(int *)this + 0x24))(this);
  uVar4 = *(uint *)(param_1 + 0xc);
  if (*(int *)(param_1 + 8) < (int)(uVar4 + 6)) {
    *(int *)(param_1 + 0xc) = *(int *)(param_1 + 8);
    param_1[0x10] = (bf_write)0x1;
  }
  else {
    iVar1 = ((int)uVar4 >> 5) * 4;
    uVar4 = uVar4 & 0x1f;
    puVar5 = (uint *)(iVar1 + *(int *)param_1);
    local_20 = (sbyte)uVar4;
    *puVar5 = uVar2 << local_20 | *puVar5 & *(uint *)(&DAT_003f2db8 + uVar4 * 0x84);
    iVar3 = 0x20 - uVar4;
    if (iVar3 < 6) {
      puVar5 = (uint *)(*(int *)param_1 + 4 + iVar1);
      *puVar5 = uVar2 >> ((byte)iVar3 & 0x1f) | (&g_BitWriteMasks)[6 - iVar3] & *puVar5;
    }
    *(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 6;
  }
  bf_write::WriteLong(param_1,*(long *)(this + 0x4c));
  uVar4 = *(uint *)(param_1 + 0xc);
  if ((int)uVar4 < *(int *)(param_1 + 8)) {
    puVar5 = (uint *)(*(int *)param_1 + ((int)uVar4 >> 5) * 4);
    *puVar5 = *puVar5 & (&DAT_003f2da4)[(uVar4 & 0x1f) * 0x21] |
              *(int *)(this + 0x50) << (sbyte)(uVar4 & 0x1f);
    *(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
    return (byte)param_1[0x10] ^ 1;
  }
  *(int *)(param_1 + 0xc) = *(int *)(param_1 + 8);
  param_1[0x10] = (bf_write)0x1;
  return 0;
}

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)