L L4D2node

CBitRead::ReadBitsClamped_ptr

0x00258220 · 118 bytes · __thiscall

_ZN8CBitRead19ReadBitsClamped_ptrEPvjj

Decompiled

undefined (4 params)

/* CBitRead::ReadBitsClamped_ptr(void*, unsigned int, unsigned int) */

uint __thiscall
CBitRead::ReadBitsClamped_ptr(CBitRead *this,void *param_1,uint param_2,uint param_3)

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  iVar3 = 0;
  if (param_2 * 8 < param_3) {
    iVar3 = param_3 + param_2 * -8;
    param_3 = param_2 * 8;
  }
  ReadBits(this,param_1,param_3);
  if (*(int *)(this + 0x20) == 0) {
    iVar2 = 0;
  }
  else {
    iVar1 = (((uint)(*(int *)(this + 0x18) - *(int *)(this + 0x20)) >> 2) * 0x20 -
            *(int *)(this + 0x14)) + (*(uint *)(this + 0xc) & 3) * 8;
    iVar2 = *(int *)(this + 8);
    if (iVar1 <= *(int *)(this + 8)) {
      iVar2 = iVar1;
    }
  }
  Seek(this,iVar3 + iVar2);
  return param_3;
}

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)