L L4D2node

Sys_InitMemory

0x002154a0 · 110 bytes · unknown

_Z14Sys_InitMemoryv

Decompiled

undefined (0 params)

/* WARNING: Unknown calling convention -- yet parameter storage is locked */
/* Sys_InitMemory() */

void Sys_InitMemory(void)

{
  int *piVar1;
  int iVar2;
  
  piVar1 = (int *)CommandLine_Tier0();
  iVar2 = (**(code **)(*piVar1 + 0x1c))(piVar1,"-heapsize",0);
  if (iVar2 != 0) {
    DAT_003a1548 = iVar2 << 10;
    return;
  }
  piVar1 = (int *)CommandLine_Tier0();
  iVar2 = (**(code **)(*piVar1 + 0x28))(piVar1,"-minmemory");
  if (iVar2 == 0) {
    DAT_003a1548 = *(int *)(mem_max_heapsize_dedicated._28_4_ + 0x30) << 0x14;
    return;
  }
  DAT_003a1548 = *(int *)(mem_min_heapsize._28_4_ + 0x30) << 0x14;
  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)