L L4D2node

SVC_SetPause::WriteToBuffer

0x000a7d10 · 250 bytes · __thiscall

_ZN12SVC_SetPause13WriteToBufferER8bf_write

Decompiled

undefined (2 params)

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

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

{
  byte *pbVar1;
  int iVar2;
  bf_write bVar3;
  uint uVar4;
  int iVar5;
  uint uVar6;
  uint *puVar7;
  
  uVar4 = (**(code **)(*(int *)this + 0x24))(this);
  uVar6 = *(uint *)(param_1 + 0xc);
  if (*(int *)(param_1 + 8) < (int)(uVar6 + 6)) {
    *(int *)(param_1 + 0xc) = *(int *)(param_1 + 8);
  }
  else {
    iVar2 = ((int)uVar6 >> 5) * 4;
    uVar6 = uVar6 & 0x1f;
    puVar7 = (uint *)(iVar2 + *(int *)param_1);
    *puVar7 = uVar4 << (sbyte)uVar6 | *puVar7 & *(uint *)(&DAT_003f2db8 + uVar6 * 0x84);
    iVar5 = 0x20 - uVar6;
    if (iVar5 < 6) {
      puVar7 = (uint *)(*(int *)param_1 + 4 + iVar2);
      *puVar7 = uVar4 >> ((byte)iVar5 & 0x1f) | (&g_BitWriteMasks)[6 - iVar5] & *puVar7;
    }
    iVar2 = *(int *)(param_1 + 0xc) + 6;
    *(int *)(param_1 + 0xc) = iVar2;
    if (iVar2 < *(int *)(param_1 + 8)) {
      bVar3 = (bf_write)0x1;
      if (param_1[0x10] == (bf_write)0x0) {
        if (this[0x4c] == (SVC_SetPause)0x0) {
          pbVar1 = (byte *)(*(int *)param_1 + (iVar2 >> 3));
          *pbVar1 = *pbVar1 & ~(byte)(1 << ((byte)iVar2 & 7));
        }
        else {
          pbVar1 = (byte *)(*(int *)param_1 + (iVar2 >> 3));
          *pbVar1 = *pbVar1 | (byte)(1 << ((byte)iVar2 & 7));
        }
        *(int *)(param_1 + 0xc) = *(int *)(param_1 + 0xc) + 1;
        bVar3 = param_1[0x10];
      }
      return (byte)bVar3 ^ 1;
    }
  }
  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)