L L4D2node

old_bf_read::ReadBitVec3Normal

0x00b674a0 · 415 bytes · __thiscall

_ZN11old_bf_read17ReadBitVec3NormalER6Vector

Decompiled

undefined (2 params)

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

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

{
  byte bVar1;
  int iVar2;
  int iVar3;
  bool bVar4;
  bool bVar5;
  longdouble lVar6;
  float fVar7;
  
  iVar2 = *(int *)(this + 0xc);
  if (iVar2 < *(int *)(this + 8)) {
    if (this[0x10] == (old_bf_read)0x0) {
      bVar1 = *(byte *)(*(int *)this + (iVar2 >> 3));
      iVar3 = iVar2 + 1;
      *(int *)(this + 0xc) = iVar3;
      bVar4 = ((uint)bVar1 & 1 << ((byte)iVar2 & 7)) != 0;
      if (*(int *)(this + 8) <= iVar3) goto LAB_00b675e2;
      bVar1 = *(byte *)(*(int *)this + (iVar3 >> 3));
      *(int *)(this + 0xc) = iVar2 + 2;
      bVar5 = ((uint)bVar1 & 1 << ((byte)iVar3 & 7)) != 0;
      goto joined_r0x00b675ea;
    }
    bVar5 = false;
LAB_00b6752e:
    *(undefined4 *)param_1 = 0;
    if (bVar5) {
LAB_00b67612:
      lVar6 = (longdouble)ReadBitNormal(this);
      *(float *)(param_1 + 4) = (float)lVar6;
      goto LAB_00b67543;
    }
  }
  else {
    bVar4 = false;
LAB_00b675e2:
    bVar5 = false;
    this[0x10] = (old_bf_read)0x1;
joined_r0x00b675ea:
    if (!bVar4) goto LAB_00b6752e;
    lVar6 = (longdouble)ReadBitNormal(this);
    *(float *)param_1 = (float)lVar6;
    if (bVar5) goto LAB_00b67612;
  }
  *(undefined4 *)(param_1 + 4) = 0;
LAB_00b67543:
  iVar2 = *(int *)(this + 0xc);
  if (iVar2 < *(int *)(this + 8)) {
    if (this[0x10] == (old_bf_read)0x0) {
      bVar1 = *(byte *)(*(int *)this + (iVar2 >> 3));
      *(int *)(this + 0xc) = iVar2 + 1;
      bVar4 = ((uint)bVar1 & 1 << ((byte)iVar2 & 7)) != 0;
    }
    else {
      bVar4 = false;
    }
  }
  else {
    this[0x10] = (old_bf_read)0x1;
    bVar4 = false;
  }
  fVar7 = *(float *)(param_1 + 4) * *(float *)(param_1 + 4) + *(float *)param_1 * *(float *)param_1;
  if (fVar7 < 1.0) {
    *(float *)(param_1 + 8) = SQRT(1.0 - fVar7);
  }
  else {
    *(undefined4 *)(param_1 + 8) = 0;
  }
  if (bVar4) {
    *(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)