L L4D2node

CCircularBuffer::Write

0x00b69280 · 155 bytes · __thiscall

_ZN15CCircularBuffer5WriteEPvi

Decompiled

undefined (3 params)

/* CCircularBuffer::Write(void*, int) */

int __thiscall CCircularBuffer::Write(CCircularBuffer *this,void *param_1,int param_2)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  int local_20;
  
  if (param_2 == 0) {
    iVar1 = *(int *)(this + 0xc);
  }
  else {
    iVar2 = *(int *)(this + 8);
    iVar1 = *(int *)(this + 0xc);
    local_20 = param_2;
    do {
      iVar3 = local_20 + iVar2;
      if (iVar1 <= local_20 + iVar2) {
        iVar3 = iVar1;
      }
      iVar4 = iVar2 - iVar3;
      memcpy(this + iVar2 + 0x10,param_1,iVar3 - iVar2);
      iVar1 = *(int *)(this + 0xc);
      param_1 = (void *)((int)param_1 + (iVar3 - iVar2));
      iVar2 = iVar3 % iVar1;
      local_20 = local_20 + iVar4;
      *(int *)(this + 8) = iVar2;
    } while (local_20 != 0);
  }
  if (iVar1 - *(int *)this < param_2) {
    *(int *)this = iVar1;
    *(undefined4 *)(this + 4) = *(undefined4 *)(this + 8);
    return param_2;
  }
  *(int *)this = *(int *)this + param_2;
  return param_2;
}

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)