L L4D2node

CLC_SplitPlayerConnect::WriteToBuffer

0x000ab6f0 · 259 bytes · __thiscall

_ZN22CLC_SplitPlayerConnect13WriteToBufferER8bf_write

Decompiled

undefined (2 params)

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

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

{
  uint uVar1;
  int iVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  char *pcVar6;
  
  uVar1 = (**(code **)(*(int *)this + 0x24))(this);
  uVar5 = *(uint *)(param_1 + 0xc);
  if (*(int *)(param_1 + 8) < (int)(uVar5 + 6)) {
    *(int *)(param_1 + 0xc) = *(int *)(param_1 + 8);
    param_1[0x10] = (bf_write)0x1;
  }
  else {
    iVar2 = ((int)uVar5 >> 5) * 4;
    uVar5 = uVar5 & 0x1f;
    puVar3 = (uint *)(iVar2 + *(int *)param_1);
    *puVar3 = *puVar3 & *(uint *)(&DAT_003f2db8 + uVar5 * 0x84) | uVar1 << (sbyte)uVar5;
    iVar4 = 0x20 - uVar5;
    if (iVar4 < 6) {
      puVar3 = (uint *)(*(int *)param_1 + 4 + iVar2);
      *puVar3 = uVar1 >> ((byte)iVar4 & 0x1f) | (&g_BitWriteMasks)[6 - iVar4] & *puVar3;
    }
    *(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 6;
  }
  uVar5 = *(uint *)(this + 0x58);
  bf_write::WriteByte(param_1,uVar5);
  if (0 < (int)uVar5) {
    uVar1 = 0;
    do {
      iVar2 = uVar1 * 0x208;
      uVar1 = uVar1 + 1;
      pcVar6 = (char *)(iVar2 + *(int *)(this + 0x4c));
      bf_write::WriteString(param_1,pcVar6);
      bf_write::WriteString(param_1,pcVar6 + 0x104);
    } while (uVar1 != uVar5);
  }
  return (byte)param_1[0x10] ^ 1;
}

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)