old_bf_read::ReadUBitVar
0x0009a2c0 · 539 bytes · __thiscall
_ZN11old_bf_read11ReadUBitVarEv
Decompiled
undefined (1 param)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* old_bf_read::ReadUBitVar() */
uint __thiscall old_bf_read::ReadUBitVar(old_bf_read *this)
{
int iVar1;
int iVar2;
int iVar3;
int iVar4;
uint uVar5;
byte bVar6;
uint uVar7;
uint local_1c;
iVar1 = *(int *)(this + 0xc);
iVar2 = *(int *)(this + 8);
uVar5 = iVar1 + 6;
if (iVar2 < (int)uVar5) {
*(int *)(this + 0xc) = iVar2;
this[0x10] = (old_bf_read)0x1;
return 0;
}
iVar3 = *(int *)this;
iVar4 = iVar1 >> 5;
local_1c = *(uint *)(iVar3 + iVar4 * 4) >> ((byte)iVar1 & 0x1f);
*(uint *)(this + 0xc) = uVar5;
if (iVar4 == iVar1 + 5 >> 5) {
local_1c = local_1c & _DAT_000d6a58;
}
else {
local_1c = (*(uint *)(iVar3 + 4 + iVar4 * 4) & (&g_ExtraMasks)[uVar5 & 0x1f]) <<
(6U - (char)(uVar5 & 0x1f) & 0x1f) | local_1c;
}
uVar7 = local_1c & 0x30;
iVar4 = (int)uVar5 >> 5;
bVar6 = (byte)uVar5;
if (uVar7 == 0x20) {
uVar5 = iVar1 + 0xe;
if ((int)uVar5 <= iVar2) {
uVar7 = *(uint *)(iVar3 + iVar4 * 4);
*(uint *)(this + 0xc) = uVar5;
uVar7 = uVar7 >> (bVar6 & 0x1f);
if (iVar4 == iVar1 + 0xd >> 5) {
uVar5 = (DAT_000d6a60 & uVar7) << 4;
}
else {
uVar5 = ((*(uint *)(iVar3 + 4 + iVar4 * 4) & (&g_ExtraMasks)[uVar5 & 0x1f]) <<
(8U - (char)(uVar5 & 0x1f) & 0x1f) | uVar7) << 4;
}
goto LAB_0009a3da;
}
}
else if (uVar7 == 0x30) {
uVar5 = iVar1 + 0x22;
if ((int)uVar5 <= iVar2) {
uVar7 = *(uint *)(iVar3 + iVar4 * 4);
*(uint *)(this + 0xc) = uVar5;
uVar7 = uVar7 >> (bVar6 & 0x1f);
if (iVar4 == iVar1 + 0x21 >> 5) {
uVar5 = (DAT_000d6ab0 & uVar7) << 4;
}
else {
uVar5 = ((*(uint *)(iVar3 + 4 + iVar4 * 4) & (&g_ExtraMasks)[uVar5 & 0x1f]) <<
(0x1cU - (char)(uVar5 & 0x1f) & 0x1f) | uVar7) << 4;
}
goto LAB_0009a3da;
}
}
else {
if (uVar7 != 0x10) {
return local_1c;
}
uVar5 = iVar1 + 10;
if ((int)uVar5 <= iVar2) {
uVar7 = *(uint *)(iVar3 + iVar4 * 4);
*(uint *)(this + 0xc) = uVar5;
uVar7 = uVar7 >> (bVar6 & 0x1f);
if (iVar4 != iVar1 + 9 >> 5) {
return ((*(uint *)(iVar3 + 4 + iVar4 * 4) & (&g_ExtraMasks)[uVar5 & 0x1f]) <<
(4U - (char)(uVar5 & 0x1f) & 0x1f) | uVar7) << 4 | local_1c & 0xf;
}
uVar5 = (DAT_000d6a50 & uVar7) << 4;
goto LAB_0009a3da;
}
}
*(int *)(this + 0xc) = iVar2;
uVar5 = 0;
this[0x10] = (old_bf_read)0x1;
LAB_0009a3da:
local_1c = local_1c & 0xf;
return uVar5 | local_1c;
}
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.