CBitWrite::WriteLongLong
0x00b746c0 · 408 bytes · __cdecl
_ZN9CBitWrite13WriteLongLongEx
Decompiled
undefined (1 param)
/* WARNING: Restarted to delay deadcode elimination for space: stack */
/* CBitWrite::WriteLongLong(long long) */
void CBitWrite::WriteLongLong(longlong param_1)
{
int iVar1;
byte bVar2;
int iVar3;
uint *puVar4;
uint uVar5;
uint in_stack_0000000c;
uint *local_3c;
uint local_38;
uint local_34;
byte local_30;
iVar3 = *(int *)((int)param_1 + 0x14);
bVar2 = (byte)iVar3;
if (iVar3 < 0x20) {
local_38 = *(uint *)(CBitBuffer::s_nMaskTable + iVar3 * 4);
local_30 = 0x20 - bVar2;
puVar4 = *(uint **)((int)param_1 + 0x18);
uVar5 = (local_38 & param_1._4_4_) << (local_30 & 0x1f) | *(uint *)((int)param_1 + 0x10);
*(uint *)((int)param_1 + 0x10) = uVar5;
if (puVar4 == *(uint **)((int)param_1 + 0x1c)) {
*(undefined1 *)((int)param_1 + 4) = 1;
local_3c = puVar4;
}
else {
*(uint **)((int)param_1 + 0x18) = puVar4 + 1;
*puVar4 = uVar5;
puVar4 = *(uint **)((int)param_1 + 0x18);
local_3c = *(uint **)((int)param_1 + 0x1c);
}
*(int *)((int)param_1 + 0x14) = iVar3;
local_34 = param_1._4_4_ >> (bVar2 & 0x1f);
LAB_00b74799:
local_34 = (local_38 & in_stack_0000000c) << (local_30 & 0x1f) | local_34;
*(uint *)((int)param_1 + 0x10) = local_34;
if (puVar4 == local_3c) {
*(undefined1 *)((int)param_1 + 4) = 1;
}
else {
*(uint **)((int)param_1 + 0x18) = puVar4 + 1;
*puVar4 = local_34;
}
*(int *)((int)param_1 + 0x14) = iVar3;
*(uint *)((int)param_1 + 0x10) = in_stack_0000000c >> ((byte)iVar3 & 0x1f);
return;
}
local_34 = param_1._4_4_ << (0x20 - bVar2 & 0x1f) | *(uint *)((int)param_1 + 0x10);
iVar1 = iVar3 + -0x20;
*(int *)((int)param_1 + 0x14) = iVar1;
*(uint *)((int)param_1 + 0x10) = local_34;
if (iVar1 == 0) {
puVar4 = *(uint **)((int)param_1 + 0x18);
if (puVar4 == *(uint **)((int)param_1 + 0x1c)) {
*(undefined1 *)((int)param_1 + 4) = 1;
}
else {
*(uint **)((int)param_1 + 0x18) = puVar4 + 1;
*puVar4 = local_34;
puVar4 = *(uint **)((int)param_1 + 0x18);
}
*(undefined4 *)((int)param_1 + 0x14) = 0;
*(uint *)((int)param_1 + 0x10) = in_stack_0000000c;
}
else {
if (iVar1 < 0x20) {
local_38 = *(uint *)(CBitBuffer::s_nMaskTable + iVar1 * 4);
local_30 = 0x40 - bVar2;
local_3c = *(uint **)((int)param_1 + 0x1c);
puVar4 = *(uint **)((int)param_1 + 0x18);
iVar3 = iVar1;
goto LAB_00b74799;
}
*(int *)((int)param_1 + 0x14) = iVar3 + -0x40;
in_stack_0000000c = in_stack_0000000c << (0x40 - bVar2 & 0x1f) | local_34;
*(uint *)((int)param_1 + 0x10) = in_stack_0000000c;
if (iVar3 + -0x40 != 0) {
return;
}
puVar4 = *(uint **)((int)param_1 + 0x18);
}
if (puVar4 == *(uint **)((int)param_1 + 0x1c)) {
*(undefined1 *)((int)param_1 + 4) = 1;
}
else {
*(uint **)((int)param_1 + 0x18) = puVar4 + 1;
*puVar4 = in_stack_0000000c;
}
*(undefined4 *)((int)param_1 + 0x10) = 0;
*(undefined4 *)((int)param_1 + 0x14) = 0x20;
return;
}
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.