L L4D2node

CDeltaEntityCache::AddDeltaBits

0x0016fef0 · 317 bytes · __thiscall

_ZN17CDeltaEntityCache12AddDeltaBitsEiiiP8bf_write

Decompiled

undefined (5 params)

/* CDeltaEntityCache::AddDeltaBits(int, int, int, bf_write*) */

void __thiscall
CDeltaEntityCache::AddDeltaBits
          (CDeltaEntityCache *this,int param_1,int param_2,int param_3,bf_write *param_4)

{
  size_t __size;
  int *piVar1;
  int *piVar2;
  uint uVar3;
  undefined4 *puVar4;
  int *piVar5;
  uint uVar6;
  int iVar7;
  bf_write local_58 [24];
  undefined4 local_40;
  undefined1 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  
  if (((-1 < param_1) && (param_1 < *(int *)(this + 4))) &&
     (__size = *(size_t *)(this + 8), 0 < (int)__size)) {
    iVar7 = param_3 + 7 >> 3;
    uVar6 = iVar7 + 3;
    if ((int)uVar6 < 0) {
      uVar6 = iVar7 + 6;
    }
    piVar1 = *(int **)(this + param_1 * 4 + 0xc);
    uVar6 = uVar6 & 0xfffffffc;
    piVar2 = piVar1;
    if (piVar1 == (int *)0x0) {
      if ((int)__size < (int)(uVar6 + 0xc)) {
        return;
      }
      puVar4 = malloc(__size);
      *(undefined4 **)(this + param_1 * 4 + 0xc) = puVar4;
    }
    else {
      do {
        piVar5 = piVar2;
        piVar2 = (int *)*piVar5;
      } while ((int *)*piVar5 != (int *)0x0);
      iVar7 = piVar5[2] + 7 >> 3;
      uVar3 = iVar7 + 3;
      if ((int)uVar3 < 0) {
        uVar3 = iVar7 + 6;
      }
      puVar4 = (undefined4 *)((int)piVar5 + (uVar3 & 0xfffffffc) + 0xc);
      if ((int)piVar1 + __size < (int)puVar4 + uVar6 + 0xc) {
        return;
      }
      *puVar4 = puVar4;
    }
    *puVar4 = 0;
    puVar4[1] = param_2;
    puVar4[2] = param_3;
    if (0 < param_3) {
      local_3c = 0;
      local_40 = 0;
      local_38 = 0xffffffff;
      local_34 = 0;
      CBitRead::StartReading
                ((CBitRead *)&local_40,*(void **)param_4,*(int *)(param_4 + 4),
                 *(int *)(param_4 + 0xc),-1);
      bf_write::bf_write(local_58,puVar4 + 3,uVar6,-1);
      bf_write::WriteBitsFromBuffer(local_58,(bf_read *)&local_40,param_3);
    }
  }
  return;
}

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)