compress_block
0x000ebc60 · 425 bytes · __cdecl
_Z14compress_blockR6TStateP7ct_dataS2_
Decompiled
undefined (3 params)
/* compress_block(TState&, ct_data*, ct_data*) */
void compress_block(TState *param_1,ct_data *param_2,ct_data *param_3)
{
int iVar1;
TState TVar2;
uint uVar3;
uint uVar4;
uint uVar5;
int local_38;
int local_34;
uint local_2c;
if (*(int *)(param_1 + 0x1af2c) != 0) {
local_2c = 0;
local_38 = 0;
local_34 = 0;
uVar3 = 0;
do {
if ((uVar3 & 7) == 0) {
local_2c = (uint)(byte)param_1[local_38 + 0x19f2c];
local_38 = local_38 + 1;
}
uVar5 = uVar3 + 1;
uVar3 = (uint)(byte)param_1[uVar3 + 0x1f2c];
if ((local_2c & 1) == 0) {
send_bits(param_1,(uint)*(ushort *)(param_2 + uVar3 * 4),
(uint)*(ushort *)(param_2 + uVar3 * 4 + 2));
}
else {
uVar4 = (uint)(byte)param_1[uVar3 + 0x1b3d];
send_bits(param_1,(uint)*(ushort *)(param_2 + uVar4 * 4 + 0x404),
(uint)*(ushort *)(param_2 + uVar4 * 4 + 0x404 + 2));
if ((&extra_lbits)[uVar4] != 0) {
send_bits(param_1,uVar3 - *(int *)(param_1 + uVar4 * 4 + 0x1e40),(&extra_lbits)[uVar4]);
}
iVar1 = local_34 + 1;
uVar3 = (uint)*(ushort *)(param_1 + local_34 * 2 + 0x9f2c);
if (uVar3 < 0x100) {
TVar2 = param_1[uVar3 + 0x1c3d];
}
else {
TVar2 = param_1[(*(ushort *)(param_1 + local_34 * 2 + 0x9f2c) >> 7) + 0x1d3d];
}
uVar4 = (uint)(byte)TVar2;
if (0x1d < uVar4) {
*(char **)(param_1 + 0x6afa4) = "bad d_code";
}
send_bits(param_1,(uint)*(ushort *)(param_3 + uVar4 * 4),
(uint)*(ushort *)(param_3 + uVar4 * 4 + 2));
local_34 = iVar1;
if ((&extra_dbits)[uVar4] != 0) {
send_bits(param_1,uVar3 - *(int *)(param_1 + uVar4 * 4 + 0x1eb4),(&extra_dbits)[uVar4]);
}
}
local_2c = local_2c >> 1;
uVar3 = uVar5;
} while (uVar5 < *(uint *)(param_1 + 0x1af2c));
}
send_bits(param_1,(uint)*(ushort *)(param_2 + 0x400),(uint)*(ushort *)(param_2 + 0x402));
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.