L L4D2node

BZ2_bzCompressInit

0x0028e450 · 590 bytes · unknown

Decompiled

undefined (0 params)

undefined4 BZ2_bzCompressInit(int param_1,int param_2,int param_3,uint param_4)

{
  uint uVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  code *pcVar5;
  undefined4 uVar6;
  
  if (((param_1 == 0) || (8 < param_2 - 1U)) || (0xfa < param_4)) {
    uVar6 = 0xfffffffe;
  }
  else {
    uVar1 = 0x1e;
    if (param_4 != 0) {
      uVar1 = param_4;
    }
    pcVar5 = *(code **)(param_1 + 0x24);
    if (pcVar5 == (code *)0x0) {
      *(code **)(param_1 + 0x24) = default_bzalloc;
      pcVar5 = default_bzalloc;
    }
    if (*(int *)(param_1 + 0x28) == 0) {
      *(code **)(param_1 + 0x28) = default_bzfree;
    }
    piVar2 = (int *)(*pcVar5)(*(undefined4 *)(param_1 + 0x2c),0xd9b0,1);
    if (piVar2 != (int *)0x0) {
      *piVar2 = param_1;
      piVar2[4] = 0;
      piVar2[5] = 0;
      piVar2[6] = 0;
      iVar3 = (**(code **)(param_1 + 0x24))(*(undefined4 *)(param_1 + 0x2c),param_2 * 400000,1);
      piVar2[4] = iVar3;
      iVar3 = (**(code **)(param_1 + 0x24))
                        (*(undefined4 *)(param_1 + 0x2c),param_2 * 400000 + 0x88,1);
      piVar2[5] = iVar3;
      iVar4 = (**(code **)(param_1 + 0x24))(*(undefined4 *)(param_1 + 0x2c),0x40004,1);
      iVar3 = piVar2[4];
      piVar2[6] = iVar4;
      if (iVar3 != 0) {
        if ((piVar2[5] != 0) && (iVar4 != 0)) {
          piVar2[2] = 2;
          piVar2[0x9b] = 0;
          piVar2[1] = 2;
          piVar2[0x99] = 0;
          piVar2[0x9c] = param_2;
          piVar2[0x12] = param_2 * 100000 + -0x13;
          piVar2[9] = piVar2[5];
          piVar2[10] = iVar3;
          piVar2[0x9a] = param_3;
          piVar2[0xb] = 0;
          piVar2[8] = iVar3;
          piVar2[0xc] = uVar1;
          iVar3 = 0;
          *(int **)(param_1 + 0x20) = piVar2;
          *(undefined4 *)(param_1 + 8) = 0;
          *(undefined4 *)(param_1 + 0xc) = 0;
          *(undefined4 *)(param_1 + 0x18) = 0;
          *(undefined4 *)(param_1 + 0x1c) = 0;
          piVar2[0xd] = 0x100;
          piVar2[0xe] = 0;
          piVar2[0x11] = 0;
          piVar2[0x13] = 0;
          piVar2[0x14] = 0;
          piVar2[0x98] = -1;
          do {
            *(undefined1 *)((int)piVar2 + iVar3 + 0x58) = 0;
            iVar3 = iVar3 + 1;
          } while (iVar3 != 0x100);
          piVar2[0x9b] = piVar2[0x9b] + 1;
          return 0;
        }
        (**(code **)(param_1 + 0x28))(*(undefined4 *)(param_1 + 0x2c),iVar3);
      }
      if (piVar2[5] != 0) {
        (**(code **)(param_1 + 0x28))(*(undefined4 *)(param_1 + 0x2c),piVar2[5]);
      }
      if (piVar2[6] != 0) {
        (**(code **)(param_1 + 0x28))(*(undefined4 *)(param_1 + 0x2c),piVar2[6]);
      }
      (**(code **)(param_1 + 0x28))(*(undefined4 *)(param_1 + 0x2c),piVar2);
      return 0xfffffffd;
    }
    uVar6 = 0xfffffffd;
  }
  return uVar6;
}

SourceMod gamedata

paste into addons/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.



        
        

⚠ 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.

Return-type handling cheatsheet (DHookReturn)