L L4D2node

CBitRead::ReadBitVec3Normal

0x00259b40 · 518 bytes · __thiscall

_ZN8CBitRead17ReadBitVec3NormalER6Vector

Decompiled

undefined (2 params)

/* CBitRead::ReadBitVec3Normal(Vector&) */

void __thiscall CBitRead::ReadBitVec3Normal(CBitRead *this,Vector *param_1)

{
  int iVar1;
  CBitRead *pCVar2;
  uint uVar3;
  uint *puVar4;
  undefined4 *puVar5;
  int iVar6;
  uint *puVar7;
  uint uVar8;
  uint uVar9;
  longdouble lVar10;
  float fVar11;
  
  iVar6 = *(int *)(this + 0x14);
  uVar3 = *(uint *)(this + 0x10);
  iVar1 = iVar6 + -1;
  *(int *)(this + 0x14) = iVar1;
  if (iVar1 == 0) {
    puVar4 = *(uint **)(this + 0x18);
    *(undefined4 *)(this + 0x14) = 0x20;
    puVar7 = *(uint **)(this + 0x1c);
    if (puVar4 == puVar7) {
      *(undefined4 *)(this + 0x10) = 0;
      *(uint **)(this + 0x18) = puVar7 + 1;
      uVar9 = 0;
LAB_00259c07:
      puVar4 = *(uint **)(this + 0x18);
      *(undefined4 *)(this + 0x14) = 0x20;
      if (puVar4 == puVar7) {
        *(undefined4 *)(this + 0x14) = 1;
        *(undefined4 *)(this + 0x10) = 0;
        *(uint **)(this + 0x18) = puVar7 + 1;
      }
      else if (puVar7 < puVar4) {
        this[4] = (CBitRead)0x1;
        *(undefined4 *)(this + 0x10) = 0;
      }
      else {
        *(uint **)(this + 0x18) = puVar4 + 1;
        *(uint *)(this + 0x10) = *puVar4;
      }
      goto joined_r0x00259c2c;
    }
    if (puVar7 < puVar4) {
      this[4] = (CBitRead)0x1;
      uVar8 = 0;
      uVar9 = 0;
    }
    else {
      *(uint **)(this + 0x18) = puVar4 + 1;
      uVar8 = *puVar4;
      uVar9 = uVar8 & 1;
    }
    *(undefined4 *)(this + 0x14) = 0x1f;
  }
  else {
    uVar8 = uVar3 >> 1;
    iVar6 = iVar6 + -2;
    *(uint *)(this + 0x10) = uVar8;
    uVar9 = uVar8 & 1;
    *(int *)(this + 0x14) = iVar6;
    if (iVar6 == 0) {
      puVar7 = *(uint **)(this + 0x1c);
      goto LAB_00259c07;
    }
  }
  *(uint *)(this + 0x10) = uVar8 >> 1;
joined_r0x00259c2c:
  if ((uVar3 & 1) == 0) {
    *(undefined4 *)param_1 = 0;
  }
  else {
    lVar10 = (longdouble)ReadBitNormal(this);
    *(float *)param_1 = (float)lVar10;
  }
  if (uVar9 == 0) {
    *(undefined4 *)(param_1 + 4) = 0;
    uVar3 = *(uint *)(this + 0x10);
    pCVar2 = this + 0x14;
    *(int *)pCVar2 = *(int *)pCVar2 + -1;
    iVar1 = *(int *)pCVar2;
  }
  else {
    lVar10 = (longdouble)ReadBitNormal(this);
    *(float *)(param_1 + 4) = (float)lVar10;
    uVar3 = *(uint *)(this + 0x10);
    pCVar2 = this + 0x14;
    *(int *)pCVar2 = *(int *)pCVar2 + -1;
    iVar1 = *(int *)pCVar2;
  }
  if (iVar1 == 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 >> 1;
  }
  fVar11 = *(float *)(param_1 + 4) * *(float *)(param_1 + 4) + *(float *)param_1 * *(float *)param_1
  ;
  if (fVar11 < 1.0) {
    *(float *)(param_1 + 8) = SQRT(1.0 - fVar11);
  }
  else {
    *(undefined4 *)(param_1 + 8) = 0;
  }
  if ((uVar3 & 1) != 0) {
    *(uint *)(param_1 + 8) = *(uint *)(param_1 + 8) ^ 0x80000000;
  }
  return;
}

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)