L L4D2node

CBitRead::ReadBitAngle

0x0009e9e0 · 381 bytes · __thiscall

_ZN8CBitRead12ReadBitAngleEi

Decompiled

undefined (2 params)

/* CBitRead::ReadBitAngle(int) */

longdouble __thiscall CBitRead::ReadBitAngle(CBitRead *this,int param_1)

{
  int iVar1;
  int iVar2;
  uint uVar3;
  uint uVar4;
  undefined4 *puVar5;
  uint *puVar6;
  uint uVar7;
  int iVar8;
  
  iVar1 = *(int *)(this + 0x14);
  iVar2 = (&GetBitForBitnum(int)::bitsForBitnum)[param_1 & 0x1f];
  if (param_1 <= iVar1) {
    uVar3 = *(uint *)(this + 0x10);
    uVar4 = (&CBitBuffer::s_nMaskTable)[param_1];
    *(int *)(this + 0x14) = iVar1 - param_1;
    if (iVar1 - param_1 == 0) {
      puVar5 = *(undefined4 **)(this + 0x18);
      *(undefined4 *)(this + 0x14) = 0x20;
      if (puVar5 == *(undefined4 **)(this + 0x1c)) {
        *(undefined4 *)(this + 0x14) = 1;
        *(undefined4 *)(this + 0x10) = 0;
        *(undefined4 **)(this + 0x18) = puVar5 + 1;
      }
      else if (*(undefined4 **)(this + 0x1c) < puVar5) {
        this[4] = (CBitRead)0x1;
        *(undefined4 *)(this + 0x10) = 0;
      }
      else {
        *(undefined4 **)(this + 0x18) = puVar5 + 1;
        *(undefined4 *)(this + 0x10) = *puVar5;
      }
    }
    else {
      *(uint *)(this + 0x10) = uVar3 >> ((byte)param_1 & 0x1f);
    }
    return (longdouble)((360.0 / (float)iVar2) * (float)(int)(uVar4 & uVar3));
  }
  puVar6 = *(uint **)(this + 0x18);
  uVar3 = *(uint *)(this + 0x10);
  if (puVar6 == *(uint **)(this + 0x1c)) {
    *(undefined4 *)(this + 0x14) = 1;
    *(undefined4 *)(this + 0x10) = 0;
    *(uint **)(this + 0x18) = puVar6 + 1;
    this[4] = (CBitRead)0x1;
  }
  else if (*(uint **)(this + 0x1c) < puVar6) {
    this[4] = (CBitRead)0x1;
    *(undefined4 *)(this + 0x10) = 0;
  }
  else {
    *(uint **)(this + 0x18) = puVar6 + 1;
    uVar4 = *puVar6;
    *(uint *)(this + 0x10) = uVar4;
    if (this[4] == (CBitRead)0x0) {
      iVar8 = param_1 - iVar1;
      uVar7 = (&CBitBuffer::s_nMaskTable)[iVar8];
      *(int *)(this + 0x14) = 0x20 - iVar8;
      *(uint *)(this + 0x10) = uVar4 >> ((byte)iVar8 & 0x1f);
      return (longdouble)
             ((float)(int)((uVar7 & uVar4) << ((byte)iVar1 & 0x1f) | uVar3) * (360.0 / (float)iVar2)
             );
    }
  }
  return (longdouble)0.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)