L L4D2node

CSPSharedMemoryManager::GetSharedMemory

0x001db370 · 227 bytes · __thiscall

_ZN22CSPSharedMemoryManager15GetSharedMemoryEPKci

Decompiled

undefined (3 params)

/* CSPSharedMemoryManager::GetSharedMemory(char const*, int) */

CSPSharedMemory * __thiscall
CSPSharedMemoryManager::GetSharedMemory(CSPSharedMemoryManager *this,char *param_1,int param_2)

{
  int *piVar1;
  char cVar2;
  CSPSharedMemory *pCVar3;
  int iVar4;
  int iVar5;
  CSPSharedMemory *local_20 [4];
  
  iVar4 = *(int *)(this + 0xc) + -1;
  iVar5 = iVar4 * 4;
  while( true ) {
    if (iVar4 < 0) {
      pCVar3 = operator_new(0x24);
      *(undefined ***)pCVar3 = &PTR_Init_002be170;
                    /* try { // try from 001db3e2 to 001db3e6 has its CatchHandler @ 001db45d */
      CUtlString::CUtlString((CUtlString *)(pCVar3 + 4));
      *(int *)(pCVar3 + 0x18) = 0;
      *(int *)(pCVar3 + 0x1c) = 0;
      *(int *)(pCVar3 + 0x20) = 0;
      local_20[0] = pCVar3;
      CUtlString::operator=((CUtlString *)(pCVar3 + 4),param_1);
      *(int *)(local_20[0] + 0x14) = param_2;
      CUtlVector<CSPSharedMemory*,CUtlMemory<CSPSharedMemory*,int>>::InsertBefore
                ((CUtlVector<CSPSharedMemory*,CUtlMemory<CSPSharedMemory*,int>> *)this,
                 *(int *)(this + 0xc),local_20);
      (**(code **)(*(int *)local_20[0] + 0xc))(local_20[0]);
      return local_20[0];
    }
    cVar2 = CUtlString::operator==((CUtlString *)(*(int *)(*(int *)this + iVar5) + 4),param_1);
    if ((cVar2 != '\0') && (piVar1 = *(int **)(*(int *)this + iVar5), piVar1[5] == param_2)) break;
    iVar5 = iVar5 + -4;
    iVar4 = iVar4 + -1;
  }
  (**(code **)(*piVar1 + 0xc))(piVar1);
  return (CSPSharedMemory *)*(int **)(*(int *)this + iVar5);
}

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)