L L4D2node

CMemoryStack::Init

0x00b74310 · 77 bytes · __thiscall

_ZN12CMemoryStack4InitEjjjj

Decompiled

undefined (5 params)

/* CMemoryStack::Init(unsigned int, unsigned int, unsigned int, unsigned int) */

bool __thiscall
CMemoryStack::Init(CMemoryStack *this,uint param_1,uint param_2,uint param_3,uint param_4)

{
  uint uVar1;
  int iVar2;
  
  *(uint *)(this + 0x18) = param_4 + 3 & 0xfffffffc;
  uVar1 = 1;
  if (param_4 != 0) {
    uVar1 = param_4;
  }
  *(uint *)(this + 0x14) = param_1;
  iVar2 = memalign(uVar1,param_1);
  *(int *)(this + 0xc) = iVar2;
  *(int *)this = iVar2;
  *(int *)(this + 4) = *(int *)(this + 0x14) + iVar2;
  *(int *)(this + 8) = *(int *)(this + 0x14) + iVar2;
  return iVar2 != 0;
}

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)