L L4D2node

CWorkshop::Steam_OnEnumerateWorkshopFiles

0x0023dd30 · 548 bytes · __thiscall

_ZN9CWorkshop30Steam_OnEnumerateWorkshopFilesEP43RemoteStorageEnumerateWorkshopFilesResult_tb

Decompiled

undefined (3 params)

/* CWorkshop::Steam_OnEnumerateWorkshopFiles(RemoteStorageEnumerateWorkshopFilesResult_t*, bool) */

void __thiscall
CWorkshop::Steam_OnEnumerateWorkshopFiles
          (CWorkshop *this,RemoteStorageEnumerateWorkshopFilesResult_t *param_1,bool param_2)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int *piVar4;
  char cVar5;
  int iVar6;
  int iVar7;
  int local_2c;
  RemoteStorageEnumerateWorkshopFilesResult_t *local_28;
  int local_20;
  
  if ((param_2) || (*(int *)param_1 != 1)) {
    cVar5 = LoggingSystem_IsChannelEnabled(LOG_WORKSHOP,1);
    if (cVar5 != '\0') {
      LoggingSystem_Log(LOG_WORKSHOP,1,"Steam_OnEnumerateWorkshopFiles() call failed!\n");
    }
    this[0xa5] = (CWorkshop)0x1;
  }
  else {
    this[0xa6] = (CWorkshop)0x1;
    this[0xa5] = (CWorkshop)0x0;
    iVar7 = *(int *)(param_1 + 4);
    iVar1 = *(int *)(param_1 + 8);
    if (iVar7 < 1) {
      local_20 = *(int *)(this + 0xb8);
    }
    else {
      local_28 = param_1 + 0xc;
      local_2c = 0;
      local_20 = *(int *)(this + 0xb8);
      do {
        iVar2 = *(int *)local_28;
        iVar3 = *(int *)(local_28 + 4);
        if ((*(int *)(workshop_filter_items_by_history._28_4_ + 0x30) == 0) ||
           (*(int *)(this + 0x98) < 1)) {
LAB_0023de3b:
          if (local_20 < 1) {
LAB_0023de7b:
            CUtlVector<unsigned_long_long,CUtlMemory<unsigned_long_long,int>>::InsertBefore
                      ((CUtlVector<unsigned_long_long,CUtlMemory<unsigned_long_long,int>> *)
                       (this + 0xac),local_20,(ulonglong *)local_28);
            local_20 = *(int *)(this + 0xb8);
          }
          else {
            piVar4 = *(int **)(this + 0xac);
            if (piVar4[1] != iVar3 || *piVar4 != iVar2) {
              iVar6 = 0;
              do {
                iVar6 = iVar6 + 1;
                if (iVar6 == local_20) goto LAB_0023de7b;
              } while (piVar4[iVar6 * 2 + 1] != iVar3 || piVar4[iVar6 * 2] != iVar2);
              if (iVar6 == -1) goto LAB_0023de7b;
            }
          }
        }
        else {
          piVar4 = *(int **)(this + 0x8c);
          if (piVar4[1] != iVar3 || *piVar4 != iVar2) {
            iVar6 = 0;
            do {
              iVar6 = iVar6 + 1;
              if (iVar6 == *(int *)(this + 0x98)) goto LAB_0023de3b;
            } while (piVar4[iVar6 * 2 + 1] != iVar3 || piVar4[iVar6 * 2] != iVar2);
            if (iVar6 == -1) goto LAB_0023de3b;
          }
        }
        local_2c = local_2c + 1;
        local_28 = local_28 + 8;
      } while (local_2c != iVar7);
    }
    iVar2 = *(int *)(this + 0xa0);
    *(int *)(this + 0xa0) = iVar7 + iVar2;
    if ((iVar7 + iVar2 < iVar1) && (local_20 < 0x14)) {
      RequestAvailableItems_Internal();
      return;
    }
    this[0xa4] = (CWorkshop)0x1;
    if (0 < local_20) {
      iVar7 = 0;
      do {
        iVar2 = iVar7 * 8;
        iVar1 = iVar7 * 8;
        iVar7 = iVar7 + 1;
        (**(code **)(*(int *)this + 0x44))
                  (this,*(undefined4 *)(*(int *)(this + 0xac) + iVar1),
                   *(undefined4 *)(*(int *)(this + 0xac) + 4 + iVar2));
      } while (iVar7 < *(int *)(this + 0xb8));
    }
  }
  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)