L L4D2node

CWorkshopFileInfoManager::AddFileInfoQuery

0x0021c8e0 · 416 bytes · __thiscall

_ZN24CWorkshopFileInfoManager16AddFileInfoQueryEP25CBasePublishedFileRequestb

Decompiled

undefined (3 params)

/* CWorkshopFileInfoManager::AddFileInfoQuery(CBasePublishedFileRequest*, bool) */

undefined4 __thiscall
CWorkshopFileInfoManager::AddFileInfoQuery
          (CWorkshopFileInfoManager *this,CBasePublishedFileRequest *param_1,bool param_2)

{
  int iVar1;
  char cVar2;
  short sVar3;
  int iVar4;
  void *pvVar5;
  int iVar6;
  int iVar7;
  undefined4 local_24;
  undefined4 local_20;
  
  cVar2 = LoggingSystem_IsChannelEnabled(LOG_WORKSHOP,0);
  if (cVar2 != '\0') {
    LoggingSystem_Log(LOG_WORKSHOP,0,"[BaseModPanel] Added query for published file %llu\n",
                      *(undefined4 *)(param_1 + 4),*(undefined4 *)(param_1 + 8));
  }
  if (!param_2) {
    local_24 = *(undefined4 *)(param_1 + 4);
    local_20 = *(undefined4 *)(param_1 + 8);
    sVar3 = CUtlMap<unsigned_long_long,PublishedFileInfo_t,unsigned_short>::Find
                      ((CUtlMap<unsigned_long_long,PublishedFileInfo_t,unsigned_short> *)
                       (this + 0x40),(ulonglong *)&local_24);
    if (sVar3 != -1) {
      operator_delete(param_1);
      return 1;
    }
  }
  iVar1 = *(int *)(this + 0x68);
  iVar6 = *(int *)(this + 0x60);
  iVar7 = iVar1 + 1;
  if (iVar6 < iVar7) {
    iVar4 = *(int *)(this + 100);
    if (-1 < iVar4) {
      if (iVar4 == 0) {
        if (iVar6 == 0) {
          if (iVar7 < 9) {
            iVar4 = 8;
            goto LAB_0021c9a7;
          }
          iVar6 = 8;
        }
        do {
          iVar4 = iVar6 * 2;
          if (iVar7 <= iVar4) break;
          iVar4 = iVar6 * 4;
          iVar6 = iVar4;
        } while (iVar4 < iVar7);
      }
      else {
        for (iVar4 = (iVar1 / iVar4 + 1) * iVar4; iVar4 < iVar7; iVar4 = (iVar4 + iVar7) / 2) {
        }
      }
LAB_0021c9a7:
      *(int *)(this + 0x60) = iVar4;
      if (*(void **)(this + 0x5c) == (void *)0x0) {
        pvVar5 = malloc(iVar4 << 2);
        *(void **)(this + 0x5c) = pvVar5;
      }
      else {
        pvVar5 = realloc(*(void **)(this + 0x5c),iVar4 << 2);
        *(void **)(this + 0x5c) = pvVar5;
        iVar7 = *(int *)(this + 0x68) + 1;
      }
      goto LAB_0021c929;
    }
  }
  pvVar5 = *(void **)(this + 0x5c);
LAB_0021c929:
  *(int *)(this + 0x68) = iVar7;
  iVar7 = (iVar7 - iVar1) + -1;
  *(void **)(this + 0x6c) = pvVar5;
  iVar1 = iVar1 * 4;
  if (0 < iVar7) {
    _V_memmove((void *)((int)pvVar5 + iVar1 + 4),(void *)((int)pvVar5 + iVar1),iVar7 * 4);
    pvVar5 = *(void **)(this + 0x5c);
  }
  *(CBasePublishedFileRequest **)((int)pvVar5 + iVar1) = param_1;
  return 0;
}

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)