BZ2_bzCompress
0x0028e6a0 · 384 bytes · unknown
Decompiled
undefined (0 params)
int BZ2_bzCompress(int param_1,int param_2)
{
bz_stream *pbVar1;
int iVar2;
undefined4 uVar3;
char cVar4;
int iVar5;
if (((param_1 == 0) || (pbVar1 = *(bz_stream **)(param_1 + 0x20), pbVar1 == (bz_stream *)0x0)) ||
(iVar5 = *(int *)pbVar1, iVar5 != param_1)) {
return -2;
}
iVar2 = *(int *)(pbVar1 + 4);
if (iVar2 == 2) {
if (param_2 == 0) {
cVar4 = handle_compress(pbVar1);
return (-(uint)(cVar4 == '\0') & 0xfffffffd) + 1;
}
if (param_2 == 1) {
uVar3 = *(undefined4 *)(iVar5 + 4);
*(undefined4 *)(pbVar1 + 4) = 3;
*(undefined4 *)(pbVar1 + 0xc) = uVar3;
goto LAB_0028e77e;
}
if (param_2 != 2) {
return -2;
}
uVar3 = *(undefined4 *)(iVar5 + 4);
*(undefined4 *)(pbVar1 + 4) = 4;
*(undefined4 *)(pbVar1 + 0xc) = uVar3;
}
else {
if (iVar2 < 3) {
if (iVar2 == 1) {
return -1;
}
return 0;
}
if (iVar2 == 3) {
if (param_2 != 1) {
return -1;
}
LAB_0028e77e:
if (*(int *)(pbVar1 + 0xc) != *(int *)(iVar5 + 4)) {
return -1;
}
handle_compress(*(bz_stream **)(iVar5 + 0x20));
if (*(int *)(pbVar1 + 0xc) != 0) {
return 2;
}
if ((*(uint *)(pbVar1 + 0x34) < 0x100) && (0 < *(int *)(pbVar1 + 0x38))) {
return 2;
}
if (*(int *)(pbVar1 + 0x50) < *(int *)(pbVar1 + 0x4c)) {
return 2;
}
*(undefined4 *)(pbVar1 + 4) = 2;
return 1;
}
if (iVar2 != 4) {
return 0;
}
if (param_2 != 2) {
return -1;
}
}
if ((*(int *)(pbVar1 + 0xc) == *(int *)(iVar5 + 4)) &&
(cVar4 = handle_compress(*(bz_stream **)(iVar5 + 0x20)), cVar4 != '\0')) {
iVar5 = 3;
if ((*(int *)(pbVar1 + 0xc) == 0) &&
(((0xff < *(uint *)(pbVar1 + 0x34) || (*(int *)(pbVar1 + 0x38) < 1)) &&
(iVar5 = 3, *(int *)(pbVar1 + 0x4c) <= *(int *)(pbVar1 + 0x50))))) {
*(undefined4 *)(pbVar1 + 4) = 1;
iVar5 = 4;
}
return iVar5;
}
return -1;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
⚠ This function has no mangled symbol — it may be internal/static. The
Linux gamedata field uses @-prefix symbol resolution which
requires an exported mangled name. You'll need a Linux byte signature
for this one (extract via extract_signature.java).
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.