BZ2_hbCreateDecodeTables
0x00299300 · 301 bytes · __cdecl
_Z24BZ2_hbCreateDecodeTablesPiS_S_Phiii
Decompiled
undefined (7 params)
/* BZ2_hbCreateDecodeTables(int*, int*, int*, unsigned char*, int, int, int) */
void BZ2_hbCreateDecodeTables
(int *param_1,int *param_2,int *param_3,uchar *param_4,int param_5,int param_6,
int param_7)
{
byte *pbVar1;
byte bVar2;
int iVar3;
int iVar4;
int iVar5;
uint uVar6;
if (param_5 <= param_6) {
iVar4 = 0;
uVar6 = param_5;
do {
if (0 < param_7) {
iVar3 = 0;
do {
while (param_4[iVar3] != uVar6) {
iVar3 = iVar3 + 1;
if (iVar3 == param_7) goto LAB_0029935f;
}
param_3[iVar4] = iVar3;
iVar3 = iVar3 + 1;
iVar4 = iVar4 + 1;
} while (iVar3 != param_7);
}
LAB_0029935f:
uVar6 = uVar6 + 1;
} while (uVar6 != param_6 + 1U);
}
iVar4 = 0;
do {
param_2[iVar4] = 0;
iVar4 = iVar4 + 1;
} while (iVar4 != 0x17);
if (0 < param_7) {
pbVar1 = param_4 + param_7;
do {
bVar2 = *param_4;
param_4 = param_4 + 1;
param_2[bVar2 + 1] = param_2[bVar2 + 1] + 1;
} while (param_4 != pbVar1);
}
iVar4 = 1;
do {
param_2[iVar4] = param_2[iVar4] + param_2[iVar4 + -1];
iVar4 = iVar4 + 1;
} while (iVar4 != 0x17);
iVar4 = 0;
do {
param_1[iVar4] = 0;
iVar4 = iVar4 + 1;
} while (iVar4 != 0x17);
iVar4 = 0;
iVar3 = param_5;
if (param_5 <= param_6) {
do {
iVar5 = (iVar4 + param_2[iVar3 + 1]) - param_2[iVar3];
iVar4 = iVar5 * 2;
param_1[iVar3] = iVar5 + -1;
iVar3 = iVar3 + 1;
} while (iVar3 != param_6 + 1);
}
iVar4 = param_5 + 1;
if (iVar4 <= param_6) {
do {
param_2[iVar4] = (param_1[iVar4 + -1] * 2 + 2) - param_2[iVar4];
iVar4 = iVar4 + 1;
} while (iVar4 != param_6 + 1);
}
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.