L L4D2node

CBitWrite::SeekToBit

0x0009d000 · 102 bytes · __thiscall

_ZN9CBitWrite9SeekToBitEi

Decompiled

undefined (2 params)

/* CBitWrite::SeekToBit(int) */

void __thiscall CBitWrite::SeekToBit(CBitWrite *this,int param_1)

{
  undefined4 *puVar1;
  uint *puVar2;
  int iVar3;
  
  if (*(int *)(this + 0x14) != 0x20) {
    puVar2 = *(uint **)(this + 0x18);
    if (puVar2 == *(uint **)(this + 0x1c)) {
      this[4] = (CBitWrite)0x1;
    }
    else {
      *puVar2 = ~(&CBitBuffer::s_nMaskTable)[0x20 - *(int *)(this + 0x14)] & *puVar2 |
                *(uint *)(this + 0x10);
    }
  }
  this[0x24] = (CBitWrite)0x1;
  iVar3 = param_1 + 0x1f;
  if (-1 < param_1) {
    iVar3 = param_1;
  }
  puVar1 = (undefined4 *)(*(int *)(this + 0x20) + (iVar3 >> 5) * 4);
  *(undefined4 **)(this + 0x18) = puVar1;
  *(undefined4 *)(this + 0x10) = *puVar1;
  *(uint *)(this + 0x14) = 0x20 - (param_1 & 0x1fU);
  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)