BZ2_bzReadOpen
0x0028fed0 · 382 bytes · unknown
Decompiled
undefined (0 params)
undefined4 *
BZ2_bzReadOpen(int *param_1,FILE *param_2,uint param_3,uint param_4,undefined1 *param_5,uint param_6
)
{
undefined1 *puVar1;
int iVar2;
undefined4 *__ptr;
undefined1 *puVar3;
if (param_1 != (int *)0x0) {
*param_1 = 0;
}
if ((((param_2 == (FILE *)0x0) || (1 < param_4)) || (4 < param_3)) ||
(((param_5 == (undefined1 *)0x0 && (param_6 != 0)) ||
((5000 < param_6 && (param_5 != (undefined1 *)0x0)))))) {
if (param_1 != (int *)0x0) {
*param_1 = -2;
}
}
else {
iVar2 = ferror(param_2);
if (iVar2 == 0) {
__ptr = malloc(0x13cc);
if (__ptr == (undefined4 *)0x0) {
if (param_1 != (int *)0x0) {
*param_1 = -3;
}
}
else {
if (param_1 != (int *)0x0) {
*param_1 = 0;
}
iVar2 = 0;
*(undefined1 *)(__ptr + 0x4f2) = 0;
*__ptr = param_2;
__ptr[0x4f1] = 0;
__ptr[0x4e3] = 0;
puVar3 = param_5 + param_6;
*(undefined1 *)(__ptr + 0x4e4) = 0;
__ptr[0x4ee] = 0;
__ptr[0x4ef] = 0;
__ptr[0x4f0] = 0;
if (0 < (int)param_6) {
do {
puVar1 = param_5 + 1;
*(undefined1 *)((int)__ptr + iVar2 + 4) = *param_5;
iVar2 = __ptr[0x4e3] + 1;
__ptr[0x4e3] = iVar2;
param_5 = puVar1;
} while (puVar1 != puVar3);
}
iVar2 = BZ2_bzDecompressInit(__ptr + 0x4e5,param_3,param_4);
if (iVar2 == 0) {
*(undefined1 *)(__ptr + 0x4f2) = 1;
__ptr[0x4e6] = __ptr[0x4e3];
__ptr[0x4e5] = __ptr + 1;
return __ptr;
}
if (param_1 != (int *)0x0) {
*param_1 = iVar2;
}
__ptr[0x4f1] = iVar2;
free(__ptr);
}
}
else if (param_1 != (int *)0x0) {
*param_1 = -6;
return (undefined4 *)0x0;
}
}
return (undefined4 *)0x0;
}
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.