BZ2_bzWrite
0x0028fa80 · 384 bytes · unknown
Decompiled
undefined (0 params)
void BZ2_bzWrite(int *param_1,undefined4 *param_2,int param_3,int param_4)
{
int iVar1;
size_t sVar2;
size_t __n;
if (param_1 != (int *)0x0) {
*param_1 = 0;
}
if (((param_2 == (undefined4 *)0x0) || (param_2[0x4f1] = 0, param_3 == 0)) || (param_4 < 0)) {
if (param_1 != (int *)0x0) {
*param_1 = -2;
}
if (param_2 != (undefined4 *)0x0) {
param_2[0x4f1] = 0xfffffffe;
}
}
else {
if (*(char *)(param_2 + 0x4e4) == '\0') {
if (param_1 != (int *)0x0) {
*param_1 = -1;
}
param_2[0x4f1] = 0xffffffff;
return;
}
iVar1 = ferror((FILE *)*param_2);
if (iVar1 == 0) {
if (param_4 != 0) {
param_2[0x4e6] = param_4;
param_2[0x4e5] = param_3;
do {
param_2[0x4e9] = param_2 + 1;
param_2[0x4ea] = 5000;
iVar1 = BZ2_bzCompress(param_2 + 0x4e5,0);
if (iVar1 != 1) {
if (param_1 != (int *)0x0) {
*param_1 = iVar1;
}
param_2[0x4f1] = iVar1;
return;
}
if (((uint)param_2[0x4ea] < 5000) &&
((__n = 5000 - param_2[0x4ea], sVar2 = fwrite(param_2 + 1,1,__n,(FILE *)*param_2),
__n != sVar2 || (iVar1 = ferror((FILE *)*param_2), iVar1 != 0)))) goto LAB_0028fbe0;
} while (param_2[0x4e6] != 0);
}
if (param_1 != (int *)0x0) {
*param_1 = 0;
}
param_2[0x4f1] = 0;
}
else {
LAB_0028fbe0:
if (param_1 != (int *)0x0) {
*param_1 = -6;
}
param_2[0x4f1] = 0xfffffffa;
}
}
return;
}
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.