L L4D2node

CCommandBuffer::Compact

0x00246140 · 182 bytes · __thiscall

_ZN14CCommandBuffer7CompactEv

Decompiled

undefined (1 param)

/* CCommandBuffer::Compact() */

void __thiscall CCommandBuffer::Compact(CCommandBuffer *this)

{
  size_t __n;
  int iVar1;
  size_t __n_00;
  int in_GS_OFFSET;
  undefined1 local_2020 [8192];
  int local_20;
  
  __n_00 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  *(undefined4 *)(this + 0x2004) = 0;
  iVar1 = *(int *)(this + 0x2014);
  if (iVar1 != 0) {
    __n_00 = 0;
    do {
      __n = *(size_t *)(iVar1 + 8);
      memcpy(local_2020 + __n_00,this + *(int *)(iVar1 + 4),__n);
      *(size_t *)(iVar1 + 4) = __n_00;
      __n_00 = *(int *)(this + 0x2004) + __n;
      *(size_t *)(this + 0x2004) = __n_00;
      iVar1 = *(int *)(iVar1 + 0x10);
    } while (iVar1 != 0);
  }
  memcpy(this,local_2020,__n_00);
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)