L L4D2node

DecodeBits

0x0014aaf0 · 254 bytes · __cdecl

_Z10DecodeBitsP10DecodeInfoPh

Decompiled

undefined (2 params)

/* DecodeBits(DecodeInfo*, unsigned char*) */

int DecodeBits(DecodeInfo *param_1,uchar *param_2)

{
  int iVar1;
  int iVar2;
  undefined4 *puVar3;
  int iVar4;
  undefined4 local_30;
  undefined4 local_2c;
  int local_28;
  uint local_24;
  undefined4 local_20;
  int local_1c;
  int local_18;
  undefined4 local_14;
  int local_10;
  
  puVar3 = *(undefined4 **)(param_1 + 0x28);
  local_30 = *puVar3;
  local_2c = puVar3[1];
  local_28 = puVar3[2];
  local_24 = puVar3[3];
  local_20 = puVar3[4];
  local_1c = puVar3[5];
  local_18 = puVar3[6];
  local_14 = puVar3[7];
  local_10 = puVar3[8];
  *(undefined4 *)param_1 = 0;
  *(undefined4 *)(param_1 + 0x20) = 0;
  (**(code **)(g_PropTypeFns + *(int *)(*(int *)(param_1 + 0x24) + 8) * 0x24 + 4))(param_1);
  iVar4 = *(int *)(param_1 + 0x28);
  if (*(int *)(iVar4 + 0x20) == 0) {
    iVar1 = 0;
  }
  else {
    iVar1 = (((uint)(*(int *)(iVar4 + 0x18) - *(int *)(iVar4 + 0x20)) >> 2) * 0x20 -
            *(int *)(iVar4 + 0x14)) + (*(uint *)(iVar4 + 0xc) & 3) * 8;
    if (*(int *)(iVar4 + 8) < iVar1) {
      iVar1 = *(int *)(iVar4 + 8);
    }
  }
  if (local_10 == 0) {
    iVar4 = 0;
  }
  else {
    iVar2 = (((uint)(local_18 - local_10) >> 2) * 0x20 - local_1c) + (local_24 & 3) * 8;
    iVar4 = local_28;
    if (iVar2 <= local_28) {
      iVar4 = iVar2;
    }
  }
  CBitRead::ReadBits((CBitRead *)&local_30,param_2,iVar1 - iVar4);
  return iVar1 - iVar4;
}

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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)