L L4D2node

FileSystem_ManageAddonsForActiveSession

0x0015daf0 · 771 bytes · __cdecl

_Z39FileSystem_ManageAddonsForActiveSessionbPKcS0_b

Decompiled

undefined (4 params)

/* FileSystem_ManageAddonsForActiveSession(bool, char const*, char const*, bool) */

undefined4
FileSystem_ManageAddonsForActiveSession(bool param_1,char *param_2,char *param_3,bool param_4)

{
  bool bVar1;
  bool bVar2;
  undefined4 uVar3;
  char *__nptr;
  long lVar4;
  bool bVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  CUtlSymbolTable *pCVar9;
  bool bVar10;
  bool bVar11;
  CUtlSymbolTable *pCVar12;
  CUtlSymbolTable *pCVar13;
  char local_6c [22];
  short local_56;
  CUtlSymbolTable local_54 [68];
  
  if (g_pFileSystem == (int *)0x0) {
    return 0;
  }
  (**(code **)(*g_pFileSystem + 0xa8))(g_pFileSystem,0);
  (**(code **)(*g_pFileSystem + 0xb4))(g_pFileSystem);
  bVar2 = (bool)Host_AllowQueuedMaterialSystem(false);
  uVar3 = (**(code **)(*g_pMaterialSystem + 0x18c))(g_pMaterialSystem);
  pCVar13 = (CUtlSymbolTable *)0x10;
  pCVar12 = (CUtlSymbolTable *)0x0;
                    /* try { // try from 0015db72 to 0015db76 has its CatchHandler @ 0015de0a */
  CUtlSymbolTable::CUtlSymbolTable(local_54,0,0x10,false);
  bVar10 = param_3 != (char *)0x0;
  bVar11 = param_2 != (char *)0x0;
  bVar1 = bVar11;
  bVar5 = bVar10;
  if (param_1) {
    pCVar12 = (CUtlSymbolTable *)0x2a80ee;
    __nptr = (char *)StringAfterPrefix(param_2,"campaign");
    if (__nptr != (char *)0x0) {
      pCVar13 = (CUtlSymbolTable *)0xa;
      pCVar12 = (CUtlSymbolTable *)0x0;
      lVar4 = strtol(__nptr,(char **)0x0,10);
      if (lVar4 - 1U < 0xe) {
        bVar1 = false;
      }
    }
    bVar5 = param_4 && bVar10;
  }
  if ((bVar10 || bVar11) && ((bVar5 || (bVar1)))) {
    if (DAT_0039fab0 < 1) goto LAB_0015dc80;
    iVar7 = 0;
    do {
      pCVar9 = (CUtlSymbolTable *)(iVar7 * 0x108 + s_vecAddonMetadata);
      if ((bVar1) && (*(int *)(pCVar9 + 0x100) == 1)) {
        pCVar12 = pCVar9 + 0x80;
                    /* try { // try from 0015dd68 to 0015de04 has its CatchHandler @ 0015de47 */
        iVar8 = _V_stricmp(param_2,(char *)pCVar12);
LAB_0015dd6d:
        if (iVar8 == 0) {
          pCVar12 = local_54;
          CUtlSymbolTable::AddString(local_6c);
          pCVar13 = pCVar9;
        }
      }
      else if ((bVar5) && (*(int *)(pCVar9 + 0x100) == 2)) {
        pCVar12 = pCVar9 + 0x80;
        iVar8 = _V_stricmp(param_3,(char *)pCVar12);
        goto LAB_0015dd6d;
      }
      iVar7 = iVar7 + 1;
    } while (iVar7 < DAT_0039fab0);
  }
  if (0 < DAT_0039fab0) {
    iVar7 = 0;
    iVar8 = 0;
    do {
      pCVar9 = (CUtlSymbolTable *)(s_vecAddonMetadata + iVar7);
      iVar6 = *(int *)(pCVar9 + 0x100);
      if (iVar6 == 0) {
        iVar6 = *g_pFileSystem;
        if (param_1) {
LAB_0015dbcd:
                    /* try { // try from 0015dbd4 to 0015dca4 has its CatchHandler @ 0015de47 */
          (**(code **)(iVar6 + 0x1b0))(g_pFileSystem,pCVar9,pCVar13);
          pCVar12 = pCVar9;
          goto LAB_0015dbda;
        }
LAB_0015dc18:
        pCVar13 = (CUtlSymbolTable *)0x0;
        (**(code **)(iVar6 + 0x1b4))(g_pFileSystem,pCVar9);
        pCVar12 = pCVar9;
      }
      else if (bVar10 || bVar11) {
        pCVar13 = pCVar9;
        CUtlSymbolTable::Find((char *)&local_56);
        if (local_56 != -1) goto LAB_0015dc11;
        iVar6 = *g_pFileSystem;
        if (DAT_003b8088 == '\0') goto LAB_0015dbcd;
        pCVar13 = (CUtlSymbolTable *)&DAT_00000001;
        (**(code **)(iVar6 + 0x1b4))(g_pFileSystem,pCVar9);
        pCVar12 = pCVar9;
      }
      else if ((iVar6 == 1) || (iVar6 == 2)) {
LAB_0015dc11:
        iVar6 = *g_pFileSystem;
        goto LAB_0015dc18;
      }
LAB_0015dbda:
      iVar8 = iVar8 + 1;
      iVar7 = iVar7 + 0x108;
    } while (iVar8 < DAT_0039fab0);
  }
LAB_0015dc80:
  (**(code **)(*g_pMaterialSystem + 0x104))(g_pMaterialSystem,pCVar12);
  (**(code **)(*(int *)modelloader + 0x4c))(modelloader,1);
  CUtlSymbolTable::~CUtlSymbolTable(local_54);
  (**(code **)(*materials + 400))(materials,uVar3);
  Host_AllowQueuedMaterialSystem(bVar2);
  (**(code **)(*g_pFileSystem + 0xb8))(g_pFileSystem);
  return 1;
}

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)