L L4D2node

old_bf_read::ReadBitNormal

0x00244210 · 301 bytes · __thiscall

_ZN11old_bf_read13ReadBitNormalEv

Decompiled

undefined (1 param)

/* old_bf_read::ReadBitNormal() */

longdouble __thiscall old_bf_read::ReadBitNormal(old_bf_read *this)

{
  byte bVar1;
  byte bVar2;
  uint uVar3;
  int iVar4;
  int iVar5;
  uint uVar6;
  bool bVar7;
  float fVar8;
  
  iVar4 = *(int *)(this + 0xc);
  iVar5 = *(int *)(this + 8);
  if (iVar4 < iVar5) {
    if (this[0x10] == (old_bf_read)0x0) {
      bVar1 = *(byte *)(*(int *)this + (iVar4 >> 3));
      bVar2 = (byte)iVar4;
      iVar4 = iVar4 + 1;
      *(int *)(this + 0xc) = iVar4;
      bVar7 = ((uint)bVar1 & 1 << (bVar2 & 7)) != 0;
    }
    else {
      bVar7 = false;
    }
  }
  else {
    this[0x10] = (old_bf_read)0x1;
    bVar7 = false;
  }
  uVar3 = iVar4 + 0xb;
  if (iVar5 < (int)uVar3) {
    *(int *)(this + 0xc) = iVar5;
    fVar8 = 0.0;
    this[0x10] = (old_bf_read)0x1;
  }
  else {
    iVar5 = iVar4 >> 5;
    uVar6 = *(uint *)(*(int *)this + iVar5 * 4);
    *(uint *)(this + 0xc) = uVar3;
    uVar6 = uVar6 >> ((byte)iVar4 & 0x1f);
    if (iVar5 == iVar4 + 10 >> 5) {
      uVar6 = DAT_003f2d4c & uVar6;
    }
    else {
      uVar6 = (*(uint *)(*(int *)this + 4 + iVar5 * 4) & (&g_ExtraMasks)[uVar3 & 0x1f]) <<
              (0xbU - (char)(uVar3 & 0x1f) & 0x1f) | uVar6;
    }
    fVar8 = ((float)(uVar6 >> 0x10) * 65536.0 + (float)(uVar6 & 0xffff)) * 0.0004885198;
  }
  if (bVar7) {
    fVar8 = -fVar8;
  }
  return (longdouble)fVar8;
}

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)