L L4D2node

SVC_VoiceData::WriteToBuffer

0x000aa1a0 · 332 bytes · __thiscall

_ZN13SVC_VoiceData13WriteToBufferER8bf_write

Decompiled

undefined (2 params)

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

void __thiscall SVC_VoiceData::WriteToBuffer(SVC_VoiceData *this,bf_write *param_1)

{
  uint uVar1;
  int iVar2;
  uint uVar3;
  uint *puVar4;
  int iVar5;
  
  uVar1 = (**(code **)(*(int *)this + 0x24))(this);
  uVar3 = *(uint *)(param_1 + 0xc);
  if (*(int *)(param_1 + 8) < (int)(uVar3 + 6)) {
    *(int *)(param_1 + 0xc) = *(int *)(param_1 + 8);
    param_1[0x10] = (bf_write)0x1;
  }
  else {
    iVar2 = ((int)uVar3 >> 5) * 4;
    uVar3 = uVar3 & 0x1f;
    puVar4 = (uint *)(iVar2 + *(int *)param_1);
    *puVar4 = uVar1 << (sbyte)uVar3 | *puVar4 & *(uint *)(&DAT_003f2db8 + uVar3 * 0x84);
    iVar5 = 0x20 - uVar3;
    if (iVar5 < 6) {
      puVar4 = (uint *)(*(int *)param_1 + 4 + iVar2);
      *puVar4 = uVar1 >> ((byte)iVar5 & 0x1f) | (&g_BitWriteMasks)[6 - iVar5] & *puVar4;
    }
    *(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 6;
  }
  bf_write::WriteByte(param_1,*(uint *)(this + 0x4c));
  bf_write::WriteByte(param_1,(uint)(byte)this[0x50]);
  bf_write::WriteWord(param_1,*(uint *)(this + 0x54));
  iVar2 = 0;
  do {
    uVar3 = *(uint *)(param_1 + 0xc);
    if ((int)uVar3 < *(int *)(param_1 + 8)) {
      puVar4 = (uint *)(*(int *)param_1 + ((int)uVar3 >> 5) * 4);
      *puVar4 = (uint)(byte)this[iVar2 + 0x60] << (sbyte)(uVar3 & 0x1f) |
                *puVar4 & (&DAT_003f2da4)[(uVar3 & 0x1f) * 0x21];
      *(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
    }
    else {
      *(int *)(param_1 + 0xc) = *(int *)(param_1 + 8);
      param_1[0x10] = (bf_write)0x1;
    }
    iVar2 = iVar2 + 1;
  } while (iVar2 != 4);
  bf_write::WriteBits(param_1,*(void **)(this + 0x88),*(int *)(this + 0x54));
  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)