old_bf_read::ReadBitCoord
0x00b66820 · 640 bytes · __thiscall
_ZN11old_bf_read12ReadBitCoordEv
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* old_bf_read::ReadBitCoord() */
longdouble __thiscall old_bf_read::ReadBitCoord(old_bf_read *this)
{
uint uVar1;
old_bf_read oVar2;
byte bVar3;
int iVar4;
int iVar5;
int iVar6;
uint uVar7;
bool bVar8;
bool bVar9;
bool bVar10;
float fVar11;
double dVar12;
double dVar13;
iVar6 = *(int *)(this + 8);
iVar4 = *(int *)(this + 0xc);
if (iVar4 < iVar6) {
oVar2 = this[0x10];
if (oVar2 == (old_bf_read)0x0) {
bVar3 = *(byte *)(*(int *)this + (iVar4 >> 3));
iVar5 = iVar4 + 1;
*(int *)(this + 0xc) = iVar5;
bVar8 = ((uint)bVar3 & 1 << ((byte)iVar4 & 7)) != 0;
if (iVar6 <= iVar5) goto LAB_00b668b2;
bVar3 = *(byte *)(*(int *)this + (iVar5 >> 3));
*(int *)(this + 0xc) = iVar4 + 2;
bVar9 = ((uint)bVar3 & 1 << ((byte)iVar5 & 7)) != 0;
}
else {
bVar8 = false;
bVar9 = false;
}
fVar11 = 0.0;
if (!bVar9 && !bVar8) goto LAB_00b6689d;
}
else {
bVar8 = false;
LAB_00b668b2:
bVar9 = false;
this[0x10] = (old_bf_read)0x1;
fVar11 = 0.0;
oVar2 = (old_bf_read)0x1;
if (!bVar8) goto LAB_00b6689d;
}
iVar4 = *(int *)(this + 0xc);
if (iVar4 < iVar6) {
if (oVar2 == (old_bf_read)0x0) {
bVar3 = *(byte *)(*(int *)this + (iVar4 >> 3));
*(int *)(this + 0xc) = iVar4 + 1;
bVar10 = ((uint)bVar3 & 1 << ((byte)iVar4 & 7)) != 0;
}
else {
bVar10 = false;
}
}
else {
bVar10 = false;
this[0x10] = (old_bf_read)0x1;
}
dVar13 = 0.0;
if (bVar8) {
iVar4 = *(int *)(this + 0xc);
uVar1 = iVar4 + 0xe;
if (iVar6 < (int)uVar1) {
this[0x10] = (old_bf_read)0x1;
dVar13 = 1.0;
*(int *)(this + 0xc) = iVar6;
}
else {
iVar5 = iVar4 >> 5;
uVar7 = *(uint *)(*(int *)this + iVar5 * 4) >> ((byte)iVar4 & 0x1f);
*(uint *)(this + 0xc) = uVar1;
if (iVar5 == iVar4 + 0xd >> 5) {
dVar13 = (double)(int)((uVar7 & DAT_01044298) + 1);
}
else {
dVar13 = (double)(int)(((*(uint *)(*(int *)this + 4 + iVar5 * 4) &
(&g_ExtraMasks)[uVar1 & 0x1f]) <<
(0xeU - (char)(uVar1 & 0x1f) & 0x1f) | uVar7) + 1);
}
}
}
dVar12 = 0.0;
if (bVar9) {
iVar4 = *(int *)(this + 0xc);
uVar1 = iVar4 + 5;
if (iVar6 < (int)uVar1) {
*(int *)(this + 0xc) = iVar6;
this[0x10] = (old_bf_read)0x1;
}
else {
iVar6 = iVar4 >> 5;
uVar7 = *(uint *)(*(int *)this + iVar6 * 4);
*(uint *)(this + 0xc) = uVar1;
uVar7 = uVar7 >> ((byte)iVar4 & 0x1f);
if (iVar6 == iVar4 + 4 >> 5) {
dVar12 = (double)(int)(uVar7 & _DAT_01044274) * 0.03125;
}
else {
dVar12 = (double)(int)((*(uint *)(*(int *)this + 4 + iVar6 * 4) &
(&g_ExtraMasks)[uVar1 & 0x1f]) << (5U - (char)(uVar1 & 0x1f) & 0x1f)
| uVar7) * 0.03125;
}
}
}
fVar11 = (float)(dVar12 + dVar13);
if (bVar10) {
return (longdouble)-fVar11;
}
LAB_00b6689d:
return (longdouble)fVar11;
}
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.