old_bf_read::ReadBitCoordMP
0x00b66ac0 · 1207 bytes · __thiscall
_ZN11old_bf_read14ReadBitCoordMPE13EBitCoordType
Decompiled
undefined (2 params)
/* old_bf_read::ReadBitCoordMP(EBitCoordType) */
longdouble __thiscall old_bf_read::ReadBitCoordMP(old_bf_read *this,int param_2)
{
old_bf_read oVar1;
byte bVar2;
byte bVar3;
uint uVar4;
uint uVar5;
uint uVar6;
char cVar7;
int iVar8;
int iVar9;
uint uVar10;
int iVar11;
bool bVar12;
bool bVar13;
bool bVar14;
float fVar15;
double dVar16;
double dVar17;
double dVar18;
uint local_1c;
uVar6 = *(uint *)(this + 0xc);
uVar10 = *(uint *)(this + 8);
uVar4 = uVar6;
if ((int)uVar6 < (int)uVar10) {
oVar1 = this[0x10];
if (oVar1 == (old_bf_read)0x0) {
iVar8 = *(int *)this;
bVar2 = *(byte *)(iVar8 + ((int)uVar6 >> 3));
uVar4 = uVar6 + 1;
*(uint *)(this + 0xc) = uVar4;
bVar12 = ((uint)bVar2 & 1 << ((byte)uVar6 & 7)) != 0;
if (param_2 != 2) {
if ((int)uVar10 <= (int)uVar4) goto LAB_00b66c12;
uVar5 = uVar6 + 2;
bVar2 = *(byte *)(iVar8 + ((int)uVar4 >> 3));
*(uint *)(this + 0xc) = uVar5;
bVar13 = ((uint)bVar2 & 1 << ((byte)uVar4 & 7)) != 0;
uVar4 = uVar5;
if ((int)uVar10 <= (int)uVar5) goto LAB_00b66c19;
uVar6 = uVar6 + 3;
bVar2 = *(byte *)(iVar8 + ((int)uVar5 >> 3));
*(uint *)(this + 0xc) = uVar6;
bVar14 = ((uint)bVar2 & 1 << ((byte)uVar5 & 7)) != 0;
if (!bVar13) goto LAB_00b66c2f;
goto LAB_00b66b85;
}
}
else {
if (param_2 != 2) {
bVar14 = false;
goto LAB_00b66c2f;
}
bVar12 = false;
}
}
else {
this[0x10] = (old_bf_read)0x1;
bVar12 = false;
if (param_2 != 2) {
LAB_00b66c12:
bVar13 = false;
LAB_00b66c19:
uVar6 = uVar4;
this[0x10] = (old_bf_read)0x1;
bVar14 = false;
if (bVar13) {
LAB_00b66b85:
iVar8 = (int)uVar6 >> 5;
if (bVar12) {
uVar4 = uVar6 + 0xb;
if ((int)uVar10 < (int)uVar4) goto LAB_00b66dd8;
local_1c = *(uint *)(*(int *)this + iVar8 * 4);
*(uint *)(this + 0xc) = uVar4;
local_1c = local_1c >> ((byte)uVar6 & 0x1f);
if (iVar8 != (int)(uVar6 + 10) >> 5) {
uVar5 = uVar4 & 0x1f;
cVar7 = '\v';
uVar6 = *(uint *)(*(int *)this + 4 + iVar8 * 4) & (&g_ExtraMasks)[uVar5];
goto LAB_00b66be8;
}
dVar18 = (double)(int)((local_1c & DAT_0104428c) + 1);
uVar6 = uVar4;
}
else {
uVar4 = uVar6 + 0xe;
if ((int)uVar10 < (int)uVar4) {
LAB_00b66dd8:
*(uint *)(this + 0xc) = uVar10;
dVar18 = 1.0;
this[0x10] = (old_bf_read)0x1;
uVar6 = uVar10;
}
else {
local_1c = *(uint *)(*(int *)this + iVar8 * 4);
*(uint *)(this + 0xc) = uVar4;
local_1c = local_1c >> ((byte)uVar6 & 0x1f);
if (iVar8 == (int)(uVar6 + 0xd) >> 5) {
dVar18 = (double)(int)((local_1c & DAT_01044298) + 1);
uVar6 = uVar4;
}
else {
uVar5 = uVar4 & 0x1f;
cVar7 = '\x0e';
uVar6 = *(uint *)(*(int *)this + 4 + iVar8 * 4) & (&g_ExtraMasks)[uVar5];
LAB_00b66be8:
dVar18 = (double)(int)((uVar6 << (cVar7 - (char)uVar5 & 0x1fU) | local_1c) + 1);
uVar6 = uVar4;
}
}
}
}
else {
LAB_00b66c2f:
dVar18 = 0.0;
}
iVar8 = (-(uint)(param_2 != 1) & 2) + 3;
uVar4 = iVar8 + uVar6;
if ((int)uVar10 < (int)uVar4) {
*(uint *)(this + 0xc) = uVar10;
dVar16 = 0.0;
this[0x10] = (old_bf_read)0x1;
}
else {
iVar11 = (int)uVar6 >> 5;
uVar10 = *(uint *)(*(int *)this + iVar11 * 4);
*(uint *)(this + 0xc) = uVar4;
uVar10 = uVar10 >> ((byte)uVar6 & 0x1f);
if (iVar11 == (int)(uVar4 - 1) >> 5) {
dVar16 = (double)(int)(uVar10 & (&g_ExtraMasks)[iVar8]);
}
else {
dVar16 = (double)(int)(((&g_ExtraMasks)[uVar4 & 0x1f] &
*(uint *)(*(int *)this + 4 + iVar11 * 4)) <<
((char)iVar8 - (char)(uVar4 & 0x1f) & 0x1fU) | uVar10);
}
}
if (param_2 != 1) {
dVar17 = 0.03125;
}
else {
dVar17 = 0.125;
}
fVar15 = (float)(dVar16 * dVar17 + dVar18);
goto LAB_00b66ccf;
}
oVar1 = (old_bf_read)0x1;
}
if ((int)uVar10 <= (int)uVar4) {
this[0x10] = (old_bf_read)0x1;
LAB_00b66d28:
return (longdouble)0.0;
}
if (oVar1 != (old_bf_read)0x0) goto LAB_00b66d28;
iVar11 = *(int *)this;
iVar8 = uVar4 + 1;
bVar2 = *(byte *)(iVar11 + ((int)uVar4 >> 3));
*(int *)(this + 0xc) = iVar8;
if ((bVar2 >> (uVar4 & 7) & 1) == 0) goto LAB_00b66d28;
if (iVar8 < (int)uVar10) {
bVar3 = (byte)iVar8;
bVar2 = *(byte *)(iVar11 + (iVar8 >> 3));
iVar8 = uVar4 + 2;
*(int *)(this + 0xc) = iVar8;
bVar14 = ((uint)bVar2 & 1 << (bVar3 & 7)) != 0;
}
else {
this[0x10] = (old_bf_read)0x1;
bVar14 = false;
}
iVar9 = iVar8 >> 5;
if (bVar12) {
uVar6 = iVar8 + 0xb;
if ((int)uVar10 < (int)uVar6) {
LAB_00b66f20:
*(uint *)(this + 0xc) = uVar10;
fVar15 = 1.0;
this[0x10] = (old_bf_read)0x1;
goto LAB_00b66ccf;
}
uVar10 = *(uint *)(iVar11 + iVar9 * 4);
*(uint *)(this + 0xc) = uVar6;
uVar10 = uVar10 >> ((byte)iVar8 & 0x1f);
if (iVar9 == iVar8 + 10 >> 5) {
uVar10 = DAT_0104428c & uVar10;
LAB_00b66f6e:
fVar15 = (float)(uVar10 + 1 >> 0x10) * 65536.0 + (float)(uVar10 + 1 & 0xffff);
goto LAB_00b66ccf;
}
uVar6 = uVar6 & 0x1f;
cVar7 = '\v';
uVar4 = *(uint *)(iVar11 + 4 + iVar9 * 4) & (&g_ExtraMasks)[uVar6];
}
else {
uVar6 = iVar8 + 0xe;
if ((int)uVar10 < (int)uVar6) goto LAB_00b66f20;
uVar10 = *(uint *)(iVar11 + iVar9 * 4);
*(uint *)(this + 0xc) = uVar6;
uVar10 = uVar10 >> ((byte)iVar8 & 0x1f);
if (iVar9 == iVar8 + 0xd >> 5) {
uVar10 = DAT_01044298 & uVar10;
goto LAB_00b66f6e;
}
uVar6 = uVar6 & 0x1f;
cVar7 = '\x0e';
uVar4 = *(uint *)(iVar11 + 4 + iVar9 * 4) & (&g_ExtraMasks)[uVar6];
}
uVar6 = (uVar4 << (cVar7 - (char)uVar6 & 0x1fU) | uVar10) + 1;
fVar15 = (float)(uVar6 >> 0x10) * 65536.0 + (float)(uVar6 & 0xffff);
LAB_00b66ccf:
if (bVar14) {
fVar15 = -fVar15;
}
return (longdouble)fVar15;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.