L L4D2node

CWorkshopFileInfoManager::Steam_OnGetPublishedFileDetails

0x0021cd70 · 2450 bytes · __thiscall

_ZN24CWorkshopFileInfoManager31Steam_OnGetPublishedFileDetailsEP44RemoteStorageGetPublishedFileDetailsResult_tb

Decompiled

undefined (3 params)

/* CWorkshopFileInfoManager::Steam_OnGetPublishedFileDetails(RemoteStorageGetPublishedFileDetailsResult_t*,
   bool) */

void __thiscall
CWorkshopFileInfoManager::Steam_OnGetPublishedFileDetails
          (CWorkshopFileInfoManager *this,RemoteStorageGetPublishedFileDetailsResult_t *param_1,
          bool param_2)

{
  int iVar1;
  RemoteStorageGetPublishedFileDetailsResult_t RVar2;
  int *piVar3;
  undefined4 uVar4;
  undefined4 uVar5;
  undefined4 uVar6;
  undefined4 uVar7;
  undefined4 uVar8;
  undefined4 uVar9;
  undefined4 uVar10;
  undefined4 uVar11;
  undefined4 uVar12;
  undefined4 uVar13;
  undefined4 uVar14;
  char cVar15;
  int iVar16;
  int iVar17;
  RemoteStorageGetPublishedFileDetailsResult_t *pRVar18;
  int iVar19;
  RemoteStorageGetPublishedFileDetailsResult_t *pRVar20;
  RemoteStorageGetPublishedFileDetailsResult_t *pRVar21;
  undefined4 *puVar22;
  RemoteStorageGetPublishedFileDetailsResult_t *pRVar23;
  undefined4 *puVar24;
  int in_GS_OFFSET;
  byte bVar25;
  uint local_4a94;
  RemoteStorageGetPublishedFileDetailsResult_t local_4a80 [132];
  undefined4 local_49fc;
  undefined4 local_49f8;
  undefined4 local_49f4;
  undefined4 local_49f0;
  undefined4 local_49ec;
  undefined4 local_49e8;
  undefined4 local_49e4;
  undefined4 local_49e0;
  undefined4 local_49dc;
  undefined4 local_49d8;
  undefined4 local_49d4;
  undefined4 local_49d0;
  undefined4 local_49cc [2000];
  undefined4 local_2a8c [65];
  undefined1 local_2988 [1025];
  RemoteStorageGetPublishedFileDetailsResult_t local_2587;
  undefined **local_2584;
  undefined4 local_2580;
  undefined4 local_257c;
  undefined4 local_2578;
  undefined4 local_2574;
  undefined4 local_2570;
  undefined1 local_256c;
  undefined4 local_2568;
  undefined4 local_2564;
  undefined4 local_2560;
  undefined4 local_255c;
  undefined4 local_2558;
  undefined4 local_2554;
  undefined4 local_2550;
  undefined4 local_254c;
  RemoteStorageGetPublishedFileDetailsResult_t local_2548 [132];
  undefined4 local_24c4;
  undefined4 local_24c0;
  undefined4 local_24bc;
  undefined4 local_24b8;
  undefined4 local_24b4;
  undefined4 local_24b0;
  undefined4 local_24ac;
  undefined4 local_24a8;
  undefined4 local_24a4;
  undefined4 local_24a0;
  undefined4 local_249c;
  undefined4 local_2498;
  undefined4 local_2494 [2000];
  undefined4 local_554 [65];
  undefined1 local_450 [1025];
  RemoteStorageGetPublishedFileDetailsResult_t local_4f;
  undefined **local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined1 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  bVar25 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if ((param_2) || (*(int *)param_1 != 1)) {
    if (*(int *)param_1 == 9) {
      cVar15 = LoggingSystem_IsChannelEnabled(LOG_WORKSHOP,0);
      if (cVar15 != '\0') {
        LoggingSystem_Log(LOG_WORKSHOP,0,
                          "[BaseModPanel] Error: Failed to retrieve data for %llu (File Not Found)\n"
                          ,*(undefined4 *)(*(int *)(this + 0x74) + 4),
                          *(undefined4 *)(*(int *)(this + 0x74) + 8));
      }
    }
    else {
      cVar15 = LoggingSystem_IsChannelEnabled(LOG_WORKSHOP,0);
      if (cVar15 != '\0') {
        LoggingSystem_Log(LOG_WORKSHOP,0,
                          "[BaseModPanel] Error: Failed to retrieve data for %llu (Error: %d)\n",
                          *(undefined4 *)(*(int *)(this + 0x74) + 4),
                          *(undefined4 *)(*(int *)(this + 0x74) + 8),*(undefined4 *)param_1);
      }
    }
    (**(code **)**(undefined4 **)(this + 0x74))
              (*(undefined4 **)(this + 0x74),*(undefined4 *)param_1);
    piVar3 = *(int **)(this + 0x98);
    if (piVar3 != (int *)0x0) {
      (**(code **)(*piVar3 + 4))(piVar3,*(undefined4 *)(param_1 + 4),*(undefined4 *)(param_1 + 8));
    }
  }
  else {
    if (*(int *)(this + 0x74) == 0) goto LAB_0021ce14;
    local_48 = 0;
    local_34 = 0;
    local_2550 = 0;
    local_254c = 0;
    local_24c4 = 0xffffffff;
    local_24c0 = 0xffffffff;
    local_24bc = 0xffffffff;
    local_24b8 = 0xffffffff;
    local_24b4 = 0;
    local_24b0 = 0;
    local_24ac = 0;
    local_24a8 = 0;
    local_24a4 = 0;
    local_24a0 = 0;
    local_249c = 0;
    local_2498 = 0;
    local_44 = 0;
    local_40 = 0;
    local_3c = 0;
    local_38 = 0;
    local_4c = &PTR__CCopyableUtlVector_002c8068;
    local_30 = 0;
    local_2c = 0;
    local_28 = 0;
    local_24 = 0;
    pRVar18 = local_2548;
    for (iVar16 = 0x20; iVar16 != 0; iVar16 = iVar16 + -1) {
      *(undefined4 *)pRVar18 = 0;
      pRVar18 = pRVar18 + 4;
    }
    *pRVar18 = (RemoteStorageGetPublishedFileDetailsResult_t)0x0;
    puVar22 = local_2494;
    for (iVar16 = 2000; iVar16 != 0; iVar16 = iVar16 + -1) {
      *puVar22 = 0;
      puVar22 = puVar22 + 1;
    }
    puVar22 = local_554;
    for (iVar16 = 0x41; iVar16 != 0; iVar16 = iVar16 + -1) {
      *puVar22 = 0;
      puVar22 = puVar22 + 1;
    }
    local_2554 = *(undefined4 *)(param_1 + 8);
    local_2558 = *(undefined4 *)(param_1 + 4);
                    /* try { // try from 0021cfe7 to 0021cfeb has its CatchHandler @ 0021d745 */
    local_4a94 = CUtlRBTree<CUtlMap<unsigned_long_long,PublishedFileInfo_t,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,PublishedFileInfo_t,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,PublishedFileInfo_t,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                 ::Find((CUtlRBTree<CUtlMap<unsigned_long_long,PublishedFileInfo_t,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,PublishedFileInfo_t,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,PublishedFileInfo_t,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                         *)(this + 0x40),(Node_t *)&local_2558);
    local_4a94 = local_4a94 & 0xffff;
    local_4c = &PTR__CCopyableUtlVector_002c8068;
    local_3c = 0;
    CUtlMemory<char*,int>::Purge((CUtlMemory<char*,int> *)&local_48);
    local_38 = local_48;
    CUtlMemory<char*,int>::Purge((CUtlMemory<char*,int> *)&local_48);
    if (local_4a94 == 0xffff) {
      cVar15 = LoggingSystem_IsChannelEnabled(LOG_WORKSHOP,0);
      if (cVar15 != '\0') {
        LoggingSystem_Log(LOG_WORKSHOP,0,"[BaseModPanel] Added file information for %llu\n",
                          *(undefined4 *)(param_1 + 4),*(undefined4 *)(param_1 + 8));
      }
      local_49d8 = 0;
      local_49d4 = 0;
      local_49d0 = 0;
      uVar4 = *(undefined4 *)(param_1 + 8);
      local_2580 = 0;
      uVar5 = *(undefined4 *)(param_1 + 4);
      local_257c = 0;
      local_2578 = 0;
      local_2574 = 0;
      pRVar18 = local_4a80;
      for (iVar16 = 0x20; iVar16 != 0; iVar16 = iVar16 + -1) {
        *(undefined4 *)pRVar18 = 0;
        pRVar18 = pRVar18 + ((uint)bVar25 * -2 + 1) * 4;
      }
      uVar6 = *(undefined4 *)(param_1 + 0x1fd8);
      local_2570 = 0;
      local_2584 = &PTR__CCopyableUtlVector_002c8068;
      local_256c = 0;
      puVar22 = local_49cc;
      for (iVar16 = 2000; iVar16 != 0; iVar16 = iVar16 + -1) {
        *puVar22 = 0;
        puVar22 = puVar22 + (uint)bVar25 * -2 + 1;
      }
      local_2568 = 0;
      local_2564 = 0;
      local_2560 = 0;
      local_255c = 0;
      puVar22 = local_2a8c;
      for (iVar16 = 0x41; iVar16 != 0; iVar16 = iVar16 + -1) {
        *puVar22 = 0;
        puVar22 = puVar22 + (uint)bVar25 * -2 + 1;
      }
      uVar7 = *(undefined4 *)(param_1 + 0x1ff8);
      uVar8 = *(undefined4 *)(param_1 + 0x1fdc);
      uVar9 = *(undefined4 *)(param_1 + 0x1fe4);
      uVar10 = *(undefined4 *)(param_1 + 0x1fe0);
      uVar11 = *(undefined4 *)(param_1 + 0x1ff0);
      RVar2 = param_1[0x23fe];
      uVar12 = *(undefined4 *)(param_1 + 0x1ff4);
      uVar13 = *(undefined4 *)(param_1 + 0x1fe8);
      uVar14 = *(undefined4 *)(param_1 + 0x1fec);
      pRVar20 = param_1 + 0x14;
      pRVar21 = local_4a80;
      local_49fc = uVar6;
      local_49f8 = uVar8;
      local_49f4 = uVar10;
      local_49f0 = uVar9;
      local_49ec = uVar13;
      local_49e8 = uVar14;
      local_49e4 = uVar11;
      local_49e0 = uVar12;
      local_49dc = uVar7;
      for (iVar16 = 0x20; iVar16 != 0; iVar16 = iVar16 + -1) {
        *(undefined4 *)pRVar21 = *(undefined4 *)pRVar20;
        pRVar20 = pRVar20 + (uint)bVar25 * -8 + 4;
        pRVar21 = pRVar21 + (uint)bVar25 * -8 + 4;
      }
      *pRVar21 = *pRVar20;
      local_2587 = RVar2;
      memcpy(local_49cc,param_1 + 0x95,8000);
      pRVar20 = param_1 + 0x23ff;
      puVar22 = local_2a8c;
      for (iVar16 = 0x41; iVar16 != 0; iVar16 = iVar16 + -1) {
        *puVar22 = *(undefined4 *)pRVar20;
        pRVar20 = pRVar20 + (uint)bVar25 * -8 + 4;
        puVar22 = puVar22 + (uint)bVar25 * -2 + 1;
      }
      memcpy(local_2988,param_1 + 0x1ffd,0x401);
      local_24a0 = 0;
      local_249c = 0;
      local_2498 = 0;
      local_48 = 0;
      local_44 = 0;
      local_40 = 0;
      local_3c = 0;
      local_38 = 0;
      local_4c = &PTR__CCopyableUtlVector_002c8068;
      pRVar20 = local_2548;
      for (iVar16 = 0x20; iVar16 != 0; iVar16 = iVar16 + -1) {
        *(undefined4 *)pRVar20 = 0;
        pRVar20 = pRVar20 + ((uint)bVar25 * -2 + 1) * 4;
      }
      *pRVar20 = (RemoteStorageGetPublishedFileDetailsResult_t)0x0;
      puVar22 = local_2494;
      for (iVar16 = 2000; iVar16 != 0; iVar16 = iVar16 + -1) {
        *puVar22 = 0;
        puVar22 = puVar22 + (uint)bVar25 * -2 + 1;
      }
      puVar22 = local_554;
      for (iVar16 = 0x41; iVar16 != 0; iVar16 = iVar16 + -1) {
        *puVar22 = 0;
        puVar22 = puVar22 + (uint)bVar25 * -2 + 1;
      }
      local_2558 = uVar5;
      local_2550 = uVar5;
      local_2554 = uVar4;
      local_254c = uVar4;
      pRVar21 = local_4a80;
      pRVar23 = local_2548;
      for (iVar16 = 0x20; iVar16 != 0; iVar16 = iVar16 + -1) {
        *(undefined4 *)pRVar23 = *(undefined4 *)pRVar21;
        pRVar21 = pRVar21 + ((uint)bVar25 * -2 + 1) * 4;
        pRVar23 = pRVar23 + ((uint)bVar25 * -2 + 1) * 4;
      }
      *pRVar20 = *pRVar18;
      local_24c4 = uVar6;
      local_24c0 = uVar8;
      local_24bc = uVar10;
      local_24b8 = uVar9;
      local_24b4 = uVar13;
      local_24b0 = uVar14;
      local_24ac = uVar11;
      local_24a8 = uVar12;
      local_24a4 = uVar7;
      memcpy(local_2494,local_49cc,8000);
      puVar22 = local_2a8c;
      puVar24 = local_554;
      for (iVar16 = 0x41; iVar16 != 0; iVar16 = iVar16 + -1) {
        *puVar24 = *puVar22;
        puVar22 = puVar22 + (uint)bVar25 * -2 + 1;
        puVar24 = puVar24 + (uint)bVar25 * -2 + 1;
      }
      memcpy(local_450,local_2988,0x401);
      local_34 = 0;
      local_30 = 0;
      local_2c = 0;
      local_28 = 0;
      local_24 = 0;
      local_4f = RVar2;
                    /* try { // try from 0021d623 to 0021d627 has its CatchHandler @ 0021d711 */
      local_4a94 = CUtlRBTree<CUtlMap<unsigned_long_long,PublishedFileInfo_t,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,PublishedFileInfo_t,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,PublishedFileInfo_t,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                   ::Insert((CUtlRBTree<CUtlMap<unsigned_long_long,PublishedFileInfo_t,unsigned_short>::Node_t,unsigned_short,CUtlMap<unsigned_long_long,PublishedFileInfo_t,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<unsigned_long_long,PublishedFileInfo_t,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                             *)(this + 0x40),(Node_t *)&local_2558);
      local_4c = &PTR__CCopyableUtlVector_002c8068;
      local_3c = 0;
      CUtlMemory<char*,int>::Purge((CUtlMemory<char*,int> *)&local_48);
      local_38 = local_48;
      CUtlMemory<char*,int>::Purge((CUtlMemory<char*,int> *)&local_48);
      local_4a94 = local_4a94 & 0xffff;
      local_2584 = &PTR__CCopyableUtlVector_002c8068;
      local_2574 = 0;
      CUtlMemory<char*,int>::Purge((CUtlMemory<char*,int> *)&local_2580);
      local_2570 = local_2580;
      CUtlMemory<char*,int>::Purge((CUtlMemory<char*,int> *)&local_2580);
    }
    else {
      cVar15 = LoggingSystem_IsChannelEnabled(LOG_WORKSHOP,0);
      if (cVar15 != '\0') {
        LoggingSystem_Log(LOG_WORKSHOP,0,"[BaseModPanel] Updated file information for %llu\n",
                          *(undefined4 *)(param_1 + 4),*(undefined4 *)(param_1 + 8));
      }
      iVar17 = local_4a94 * 0x2540;
      *(undefined4 *)(*(int *)(this + 0x44) + 0xbc + iVar17) = *(undefined4 *)(param_1 + 0x1ff8);
      uVar4 = *(undefined4 *)(param_1 + 0x1fdc);
      iVar16 = *(int *)(this + 0x44);
      *(undefined4 *)(iVar16 + 0x9c + iVar17) = *(undefined4 *)(param_1 + 0x1fd8);
      *(undefined4 *)(iVar16 + 0xa0 + iVar17) = uVar4;
      uVar4 = *(undefined4 *)(param_1 + 0x1fe4);
      iVar16 = *(int *)(this + 0x44);
      *(undefined4 *)(iVar16 + 0xa4 + iVar17) = *(undefined4 *)(param_1 + 0x1fe0);
      *(undefined4 *)(iVar16 + 0xa8 + iVar17) = uVar4;
      *(undefined4 *)(*(int *)(this + 0x44) + 0xb4 + iVar17) = *(undefined4 *)(param_1 + 0x1ff0);
      *(undefined4 *)(*(int *)(this + 0x44) + 0xb8 + iVar17) = *(undefined4 *)(param_1 + 0x1ff4);
      uVar4 = *(undefined4 *)(param_1 + 0x1fec);
      iVar16 = *(int *)(this + 0x44);
      *(undefined4 *)(iVar16 + 0xac + iVar17) = *(undefined4 *)(param_1 + 0x1fe8);
      *(undefined4 *)(iVar16 + 0xb0 + iVar17) = uVar4;
      *(RemoteStorageGetPublishedFileDetailsResult_t *)(*(int *)(this + 0x44) + 0x2511 + iVar17) =
           param_1[0x23fe];
      pRVar18 = param_1 + 0x14;
      pRVar20 = (RemoteStorageGetPublishedFileDetailsResult_t *)
                (*(int *)(this + 0x44) + iVar17 + 0x18);
      for (iVar16 = 0x20; iVar16 != 0; iVar16 = iVar16 + -1) {
        *(undefined4 *)pRVar20 = *(undefined4 *)pRVar18;
        pRVar18 = pRVar18 + (uint)bVar25 * -8 + 4;
        pRVar20 = pRVar20 + (uint)bVar25 * -8 + 4;
      }
      *pRVar20 = *pRVar18;
      memcpy((void *)(iVar17 + *(int *)(this + 0x44) + 0xcc),param_1 + 0x95,8000);
      pRVar18 = param_1 + 0x23ff;
      puVar22 = (undefined4 *)(*(int *)(this + 0x44) + iVar17 + 0x200c);
      for (iVar16 = 0x41; iVar16 != 0; iVar16 = iVar16 + -1) {
        *puVar22 = *(undefined4 *)pRVar18;
        pRVar18 = pRVar18 + (uint)bVar25 * -8 + 4;
        puVar22 = puVar22 + (uint)bVar25 * -2 + 1;
      }
      memcpy((void *)(*(int *)(this + 0x44) + iVar17 + 0x2110),param_1 + 0x1ffd,0x401);
    }
    iVar19 = 0;
    iVar16 = local_4a94 * 0x2540;
    iVar17 = iVar16 + *(int *)(this + 0x44);
    if (0 < *(int *)(iVar17 + 0x2524)) {
      do {
        iVar1 = iVar19 * 4;
        iVar19 = iVar19 + 1;
        operator_delete(*(void **)(*(int *)(iVar17 + 0x2518) + iVar1));
      } while (iVar19 < *(int *)(iVar17 + 0x2524));
    }
    *(undefined4 *)(iVar17 + 0x2524) = 0;
    CUtlMemory<char*,int>::Purge((CUtlMemory<char*,int> *)(iVar17 + 0x2518));
    *(undefined4 *)(iVar17 + 0x2528) = *(undefined4 *)(iVar17 + 0x2518);
    V_SplitString((char *)(*(int *)(this + 0x44) + iVar16 + 0x2110),",",
                  (CUtlVector *)(*(int *)(this + 0x44) + iVar16 + 0x2518));
    (**(code **)(**(int **)(this + 0x74) + 4))
              (*(int **)(this + 0x74),*(int *)(this + 0x44) + iVar16 + 0x10);
    puVar22 = *(undefined4 **)(this + 0x98);
    if (puVar22 != (undefined4 *)0x0) {
      (**(code **)*puVar22)(puVar22,*(undefined4 *)(param_1 + 4),*(undefined4 *)(param_1 + 8));
    }
  }
  operator_delete(*(void **)(this + 0x74));
  *(undefined4 *)(this + 0x74) = 0;
LAB_0021ce14:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)