L L4D2node

CWorkshopFileInfoManager::RemovePublishedFileInfo

0x0021d770 · 830 bytes · __cdecl

_ZN24CWorkshopFileInfoManager23RemovePublishedFileInfoEy

Decompiled

undefined (1 param)

/* CWorkshopFileInfoManager::RemovePublishedFileInfo(unsigned long long) */

undefined1 CWorkshopFileInfoManager::RemovePublishedFileInfo(ulonglong param_1)

{
  size_t sVar1;
  int iVar2;
  void *pvVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int in_stack_0000000c;
  undefined1 local_4d;
  int local_44;
  int local_40;
  undefined4 *local_34;
  int local_30;
  int local_2c;
  int local_28;
  undefined4 *local_24;
  undefined4 local_20;
  
  local_44 = param_1._4_4_;
  local_40 = in_stack_0000000c;
  local_4d = CUtlMap<unsigned_long_long,PublishedFileInfo_t,unsigned_short>::Remove
                       ((CUtlMap<unsigned_long_long,PublishedFileInfo_t,unsigned_short> *)
                        ((int)param_1 + 0x40),(ulonglong *)&local_44);
  if (*(int *)((int)param_1 + 0x68) == 0) {
    return local_4d;
  }
  local_34 = (undefined4 *)0x0;
  local_30 = 0;
  local_2c = 0;
  local_28 = 0;
  local_24 = (undefined4 *)0x0;
  do {
    while( true ) {
      *(undefined4 *)((int)param_1 + 0x70) = **(undefined4 **)((int)param_1 + 0x5c);
                    /* try { // try from 0021d82f to 0021da39 has its CatchHandler @ 0021dad1 */
      CUtlVector<CBasePublishedFileRequest*,CUtlMemory<CBasePublishedFileRequest*,int>>::
      ShiftElementsLeft((CUtlVector<CBasePublishedFileRequest*,CUtlMemory<CBasePublishedFileRequest*,int>>
                         *)((int)param_1 + 0x5c),0,1);
      iVar6 = local_28;
      pvVar3 = *(void **)((int)param_1 + 0x70);
      *(int *)((int)param_1 + 0x68) = *(int *)((int)param_1 + 0x68) + -1;
      if (local_40 == *(int *)((int)pvVar3 + 8) && local_44 == *(int *)((int)pvVar3 + 4)) break;
      iVar5 = local_28 + 1;
      if ((local_30 < iVar5) && (-1 < local_2c)) {
        if (local_2c == 0) {
          if (local_30 == 0) {
            if (iVar5 < 9) {
              local_30 = 8;
              goto LAB_0021d897;
            }
            local_30 = 8;
          }
          do {
            iVar4 = local_30;
            local_30 = iVar4 * 2;
          } while (local_30 < iVar5);
          sVar1 = iVar4 << 3;
        }
        else {
          for (local_30 = (local_28 / local_2c + 1) * local_2c; local_30 < iVar5;
              local_30 = (local_30 + iVar5) / 2) {
          }
LAB_0021d897:
          sVar1 = local_30 << 2;
        }
        if (local_34 == (undefined4 *)0x0) {
          local_34 = malloc(sVar1);
        }
        else {
          local_34 = realloc(local_34,sVar1);
          iVar5 = local_28 + 1;
        }
      }
      iVar4 = (iVar5 - iVar6) + -1;
      local_28 = iVar5;
      local_24 = local_34;
      if (0 < iVar4) {
        _V_memmove(local_34 + iVar6 + 1,local_34 + iVar6,iVar4 * 4);
      }
      local_34[iVar6] = pvVar3;
      if (*(int *)((int)param_1 + 0x68) == 0) goto LAB_0021d907;
    }
    operator_delete(pvVar3);
    local_4d = 1;
  } while (*(int *)((int)param_1 + 0x68) != 0);
LAB_0021d907:
  *(undefined4 *)((int)param_1 + 0x68) = 0;
  do {
    if (local_28 == 0) {
      local_28 = 0;
      CUtlMemory<CBasePublishedFileRequest*,int>::Purge
                ((CUtlMemory<CBasePublishedFileRequest*,int> *)&local_34);
      local_24 = local_34;
      CUtlMemory<CBasePublishedFileRequest*,int>::Purge
                ((CUtlMemory<CBasePublishedFileRequest*,int> *)&local_34);
      return local_4d;
    }
    local_20 = *local_34;
    CUtlVector<CBasePublishedFileRequest*,CUtlMemory<CBasePublishedFileRequest*,int>>::
    ShiftElementsLeft((CUtlVector<CBasePublishedFileRequest*,CUtlMemory<CBasePublishedFileRequest*,int>>
                       *)&local_34,0,1);
    iVar5 = *(int *)((int)param_1 + 0x68);
    iVar4 = *(int *)((int)param_1 + 0x60);
    local_28 = local_28 + -1;
    iVar6 = iVar5 + 1;
    if (iVar4 < iVar6) {
      iVar2 = *(int *)((int)param_1 + 100);
      if (iVar2 < 0) goto LAB_0021d920;
      if (iVar2 == 0) {
        if (iVar4 == 0) {
          if (iVar6 < 9) {
            iVar2 = 8;
            goto LAB_0021d9af;
          }
          iVar4 = 8;
        }
        do {
          iVar2 = iVar4;
          iVar4 = iVar2 * 2;
        } while (iVar4 < iVar6);
        pvVar3 = *(void **)((int)param_1 + 0x5c);
        *(int *)((int)param_1 + 0x60) = iVar4;
        sVar1 = iVar2 << 3;
        if (pvVar3 != (void *)0x0) goto LAB_0021d9c3;
LAB_0021daaa:
        pvVar3 = malloc(sVar1);
        *(void **)((int)param_1 + 0x5c) = pvVar3;
      }
      else {
        for (iVar2 = (iVar5 / iVar2 + 1) * iVar2; iVar2 < iVar6; iVar2 = (iVar2 + iVar6) / 2) {
        }
LAB_0021d9af:
        pvVar3 = *(void **)((int)param_1 + 0x5c);
        *(int *)((int)param_1 + 0x60) = iVar2;
        sVar1 = iVar2 << 2;
        if (pvVar3 == (void *)0x0) goto LAB_0021daaa;
LAB_0021d9c3:
        pvVar3 = realloc(pvVar3,sVar1);
        *(void **)((int)param_1 + 0x5c) = pvVar3;
        iVar6 = *(int *)((int)param_1 + 0x68) + 1;
      }
    }
    else {
LAB_0021d920:
      pvVar3 = *(void **)((int)param_1 + 0x5c);
    }
    *(int *)((int)param_1 + 0x68) = iVar6;
    iVar6 = (iVar6 - iVar5) + -1;
    *(void **)((int)param_1 + 0x6c) = pvVar3;
    iVar5 = iVar5 * 4;
    if (iVar6 < 1) {
      *(undefined4 *)((int)pvVar3 + iVar5) = local_20;
    }
    else {
      _V_memmove((void *)((int)pvVar3 + iVar5 + 4),(void *)((int)pvVar3 + iVar5),iVar6 * 4);
      *(undefined4 *)(*(int *)((int)param_1 + 0x5c) + iVar5) = local_20;
    }
  } while( true );
}

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)