L L4D2node

old_bf_read::ReadBitLong

0x0009a500 · 156 bytes · __thiscall

_ZN11old_bf_read11ReadBitLongEib

Decompiled

undefined (3 params)

/* old_bf_read::ReadBitLong(int, bool) */

uint __thiscall old_bf_read::ReadBitLong(old_bf_read *this,int param_1,bool param_2)

{
  int iVar1;
  uint uVar2;
  int iVar3;
  uint uVar4;
  
  if (param_2) {
    uVar2 = ReadSBitLong(this,param_1);
    return uVar2;
  }
  iVar1 = *(int *)(this + 0xc);
  uVar2 = param_1 + iVar1;
  if ((int)uVar2 <= *(int *)(this + 8)) {
    iVar3 = iVar1 >> 5;
    uVar4 = *(uint *)(*(int *)this + iVar3 * 4);
    *(uint *)(this + 0xc) = uVar2;
    uVar4 = uVar4 >> ((byte)iVar1 & 0x1f);
    if (iVar3 == (int)(uVar2 - 1) >> 5) {
      if (param_1 != 0x20) {
        uVar4 = uVar4 & (&g_ExtraMasks)[param_1];
      }
    }
    else {
      uVar4 = (*(uint *)(*(int *)this + 4 + iVar3 * 4) & (&g_ExtraMasks)[uVar2 & 0x1f]) <<
              ((char)param_1 - (char)(uVar2 & 0x1f) & 0x1fU) | uVar4;
    }
    return uVar4;
  }
  *(int *)(this + 0xc) = *(int *)(this + 8);
  this[0x10] = (old_bf_read)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)