L L4D2node

old_bf_read::PeekUBitLong

0x0009a130 · 165 bytes · __thiscall

_ZN11old_bf_read12PeekUBitLongEi

Decompiled

undefined (2 params)

/* old_bf_read::PeekUBitLong(int) */

uint __thiscall old_bf_read::PeekUBitLong(old_bf_read *this,int param_1)

{
  old_bf_read oVar1;
  byte bVar2;
  int iVar3;
  int iVar4;
  uint uVar5;
  uint local_1c;
  
  iVar3 = *(int *)(this + 0xc);
  oVar1 = this[0x10];
  if (param_1 < 1) {
    local_1c = 0;
  }
  else {
    uVar5 = 0;
    local_1c = 0;
    iVar4 = iVar3;
    while( true ) {
      if (iVar4 < *(int *)(this + 8)) {
        if ((this[0x10] == (old_bf_read)0x0) &&
           (bVar2 = *(byte *)(*(int *)this + (iVar4 >> 3)), *(int *)(this + 0xc) = iVar4 + 1,
           ((uint)bVar2 & 1 << ((byte)iVar4 & 7)) != 0)) {
          local_1c = local_1c | (&GetBitForBitnum(int)::bitsForBitnum)[uVar5 & 0x1f];
        }
      }
      else {
        this[0x10] = (old_bf_read)0x1;
      }
      if (uVar5 + 1 == param_1) break;
      uVar5 = uVar5 + 1;
      iVar4 = *(int *)(this + 0xc);
    }
  }
  *(int *)(this + 0xc) = iVar3;
  this[0x10] = oVar1;
  return local_1c;
}

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)