CBitRead::ReadLongLong
0x00b76720 · 680 bytes · __thiscall
_ZN8CBitRead12ReadLongLongEv
Decompiled
undefined (1 param)
/* CBitRead::ReadLongLong() */
ulonglong __thiscall CBitRead::ReadLongLong(CBitRead *this)
{
int iVar1;
uint *puVar2;
undefined4 uVar3;
uint uVar4;
uint *puVar5;
int iVar6;
uint uVar7;
uint *puVar8;
uint local_28;
uint local_1c;
iVar6 = *(int *)(this + 0x14);
if (iVar6 < 0x20) {
local_1c = *(uint *)(this + 0x10);
puVar2 = *(uint **)(this + 0x18);
puVar8 = *(uint **)(this + 0x1c);
if (puVar2 == puVar8) {
puVar5 = puVar2 + 1;
*(undefined4 *)(this + 0x14) = 1;
iVar6 = 1;
*(undefined4 *)(this + 0x10) = 0;
*(uint **)(this + 0x18) = puVar5;
this[4] = (CBitRead)0x1;
}
else {
if (puVar2 <= puVar8) {
puVar5 = puVar2 + 1;
*(uint **)(this + 0x18) = puVar5;
uVar7 = *puVar2;
*(uint *)(this + 0x10) = uVar7;
if (this[4] == (CBitRead)0x0) {
*(int *)(this + 0x14) = iVar6;
local_28._0_1_ = (byte)(0x20 - iVar6);
local_1c = (uVar7 & *(uint *)(CBitBuffer::s_nMaskTable + (0x20 - iVar6) * 4)) <<
((byte)iVar6 & 0x1f) | local_1c;
local_28 = uVar7 >> ((byte)local_28 & 0x1f);
*(uint *)(this + 0x10) = local_28;
}
else {
local_1c = 0;
local_28 = uVar7;
}
goto LAB_00b767c9;
}
this[4] = (CBitRead)0x1;
*(undefined4 *)(this + 0x10) = 0;
puVar5 = puVar2;
}
local_28 = 0;
local_1c = 0;
LAB_00b767c9:
if (puVar5 == puVar8) {
*(undefined4 *)(this + 0x14) = 1;
*(undefined4 *)(this + 0x10) = 0;
*(uint **)(this + 0x18) = puVar5 + 1;
this[4] = (CBitRead)0x1;
}
else if (puVar8 < puVar5) {
this[4] = (CBitRead)0x1;
*(undefined4 *)(this + 0x10) = 0;
}
else {
*(uint **)(this + 0x18) = puVar5 + 1;
uVar7 = *puVar5;
*(uint *)(this + 0x10) = uVar7;
if (this[4] == (CBitRead)0x0) {
uVar3 = *(undefined4 *)(this + 0x14);
*(int *)(this + 0x14) = iVar6;
uVar4 = *(uint *)(CBitBuffer::s_nMaskTable + (0x20 - iVar6) * 4);
*(uint *)(this + 0x10) = uVar7 >> ((byte)(0x20 - iVar6) & 0x1f);
return CONCAT44((uVar7 & uVar4) << ((byte)uVar3 & 0x1f) | local_28,local_1c);
}
}
uVar7 = 0;
}
else {
iVar1 = iVar6 + -0x20;
local_1c = *(uint *)(this + 0x10);
*(int *)(this + 0x14) = iVar1;
if (iVar1 == 0) {
puVar5 = *(uint **)(this + 0x18);
*(undefined4 *)(this + 0x14) = 0x20;
puVar8 = *(uint **)(this + 0x1c);
if (puVar5 == puVar8) {
puVar5 = puVar5 + 1;
*(undefined4 *)(this + 0x14) = 1;
iVar6 = 1;
*(undefined4 *)(this + 0x10) = 0;
*(uint **)(this + 0x18) = puVar5;
local_28 = 0;
goto LAB_00b767c9;
}
if (puVar5 < puVar8) {
*(uint **)(this + 0x18) = puVar5 + 1;
uVar7 = *puVar5;
*(uint *)(this + 0x10) = uVar7;
puVar5 = puVar5 + 1;
}
else {
this[4] = (CBitRead)0x1;
uVar7 = 0;
*(undefined4 *)(this + 0x10) = 0;
}
}
else {
*(undefined4 *)(this + 0x10) = 0;
if (iVar1 < 0x20) {
local_28 = 0;
puVar5 = *(uint **)(this + 0x18);
puVar8 = *(uint **)(this + 0x1c);
iVar6 = iVar1;
goto LAB_00b767c9;
}
*(int *)(this + 0x14) = iVar6 + -0x40;
if (iVar6 + -0x40 != 0) {
*(undefined4 *)(this + 0x10) = 0;
return (ulonglong)local_1c;
}
uVar7 = 0;
puVar8 = *(uint **)(this + 0x1c);
puVar5 = *(uint **)(this + 0x18);
}
*(undefined4 *)(this + 0x14) = 0x20;
if (puVar5 != puVar8) {
if (puVar5 <= puVar8) {
*(uint **)(this + 0x18) = puVar5 + 1;
*(uint *)(this + 0x10) = *puVar5;
return CONCAT44(uVar7,local_1c);
}
this[4] = (CBitRead)0x1;
*(undefined4 *)(this + 0x10) = 0;
return CONCAT44(uVar7,local_1c);
}
*(undefined4 *)(this + 0x14) = 1;
*(undefined4 *)(this + 0x10) = 0;
*(uint **)(this + 0x18) = puVar5 + 1;
}
return CONCAT44(uVar7,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.