L L4D2node

CAppSystemGroup::LoadModule

0x0026bb50 · 256 bytes · __thiscall

_ZN15CAppSystemGroup10LoadModuleEPFPvPKcPiE

Decompiled

undefined (2 params)

/* CAppSystemGroup::LoadModule(void* (*)(char const*, int*)) */

int __thiscall
CAppSystemGroup::LoadModule(CAppSystemGroup *this,_func_void_ptr_char_ptr_int_ptr *param_1)

{
  _func_void_ptr_char_ptr_int_ptr *p_Var1;
  int iVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  
  if (param_1 == (_func_void_ptr_char_ptr_int_ptr *)0x0) {
    Warning("AppFramework : Unable to load module %p!\n",0);
    iVar2 = -1;
  }
  else {
    iVar2 = *(int *)(this + 0x10);
    iVar4 = (iVar2 * 3 + -3) * 4;
    iVar3 = iVar4;
    iVar5 = iVar2;
    while (iVar5 = iVar5 + -1, -1 < iVar5) {
      p_Var1 = *(_func_void_ptr_char_ptr_int_ptr **)(*(int *)(this + 4) + 4 + iVar3);
      if ((p_Var1 != (_func_void_ptr_char_ptr_int_ptr *)0x0) && (param_1 == p_Var1)) {
        return iVar5;
      }
      iVar3 = iVar3 + -0xc;
    }
    iVar3 = iVar2 + 1;
    if (*(int *)(this + 8) < iVar3) {
      CUtlMemory<CAppSystemGroup::Module_t,int>::Grow
                ((CUtlMemory<CAppSystemGroup::Module_t,int> *)(this + 4),iVar3 - *(int *)(this + 8))
      ;
      iVar3 = *(int *)(this + 0x10) + 1;
    }
    iVar5 = *(int *)(this + 4);
    *(int *)(this + 0x10) = iVar3;
    iVar3 = (iVar3 - iVar2) + -1;
    *(int *)(this + 0x14) = iVar5;
    if (0 < iVar3) {
      _V_memmove((void *)(iVar5 + 0x18 + iVar4),(void *)(iVar5 + iVar4 + 0xc),iVar3 * 0xc);
      iVar5 = *(int *)(this + 4);
    }
    iVar4 = iVar4 + 0xc;
    *(undefined4 *)(iVar5 + iVar4) = 0;
    *(_func_void_ptr_char_ptr_int_ptr **)(*(int *)(this + 4) + 4 + iVar4) = param_1;
    *(undefined4 *)(*(int *)(this + 4) + 8 + iVar4) = 0;
  }
  return iVar2;
}

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)