L L4D2node

CUtlCachedFileData<CModelSoundsCache>::CheckDiskInfo

0x006223a0 · 1070 bytes · __thiscall

_ZN18CUtlCachedFileDataI17CModelSoundsCacheE13CheckDiskInfoEbl

Decompiled

undefined (3 params)

/* CUtlCachedFileData<CModelSoundsCache>::CheckDiskInfo(bool, long) */

void __thiscall
CUtlCachedFileData<CModelSoundsCache>::CheckDiskInfo
          (CUtlCachedFileData<CModelSoundsCache> *this,bool param_1,long param_2)

{
  bool bVar1;
  char cVar2;
  ushort uVar3;
  uint uVar4;
  int iVar5;
  int iVar6;
  undefined4 uVar7;
  int iVar8;
  int iVar9;
  int in_GS_OFFSET;
  int local_254;
  int local_250;
  undefined4 local_244;
  uint local_240;
  int local_23c;
  undefined4 local_238;
  undefined4 local_234;
  int local_230;
  int local_22c;
  undefined4 local_228;
  undefined1 local_224;
  char local_220 [512];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_1) {
    uVar4 = CUtlRBTree<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short,bool(*)(CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&,CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&),CUtlMemory<UtlRBTreeNode_t<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short>,unsigned_short>>
            ::FirstInorder((CUtlRBTree<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short,bool(*)(CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&,CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&),CUtlMemory<UtlRBTreeNode_t<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short>,unsigned_short>>
                            *)(this + 4));
    uVar4 = uVar4 & 0xffff;
    if (uVar4 != 0xffff) {
      do {
        (**(code **)(*g_pFullFileSystem + 0x98))
                  (g_pFullFileSystem,*(int *)(this + 8) + 8 + uVar4 * 0x18,local_220,0x200);
        Get(this,local_220);
        uVar4 = CUtlRBTree<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short,bool(*)(CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&,CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&),CUtlMemory<UtlRBTreeNode_t<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short>,unsigned_short>>
                ::NextInorder((CUtlRBTree<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short,bool(*)(CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&,CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&),CUtlMemory<UtlRBTreeNode_t<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short>,unsigned_short>>
                               *)(this + 4),(ushort)uVar4);
        uVar4 = uVar4 & 0xffff;
      } while (uVar4 != 0xffff);
    }
  }
  else {
    local_23c = 0;
    local_238 = 0;
    local_234 = 0;
    local_230 = 0;
    local_22c = 0;
    local_228 = 0;
    local_224 = 0;
    uVar3 = CUtlRBTree<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short,bool(*)(CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&,CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&),CUtlMemory<UtlRBTreeNode_t<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short>,unsigned_short>>
            ::FirstInorder((CUtlRBTree<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short,bool(*)(CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&,CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&),CUtlMemory<UtlRBTreeNode_t<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short>,unsigned_short>>
                            *)(this + 4));
    uVar4 = local_240;
    while (local_240 = (uint)uVar3, local_240 != 0xffff) {
      iVar5 = *(int *)(this + 8) + local_240 * 0x18;
      local_244 = *(undefined4 *)(iVar5 + 8);
                    /* try { // try from 00622508 to 006227c7 has its CatchHandler @ 006227e8 */
      CUtlSortVector<CSortedCacheFile,CSortedCacheFile>::InsertNoSort
                ((CUtlSortVector<CSortedCacheFile,CSortedCacheFile> *)&local_23c,
                 (CSortedCacheFile *)&local_244);
      if ((((byte)this[100] & 1) != 0) && (*(int *)(iVar5 + 0x10) == -2)) {
        *(undefined4 *)(iVar5 + 0x10) = *(undefined4 *)(iVar5 + 0xc);
      }
      uVar3 = CUtlRBTree<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short,bool(*)(CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&,CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&),CUtlMemory<UtlRBTreeNode_t<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short>,unsigned_short>>
              ::NextInorder((CUtlRBTree<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short,bool(*)(CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&,CUtlCachedFileData<CModelSoundsCache>::ElementType_t_const&),CUtlMemory<UtlRBTreeNode_t<CUtlCachedFileData<CModelSoundsCache>::ElementType_t,unsigned_short>,unsigned_short>>
                             *)(this + 4),uVar3);
      uVar4 = local_240;
    }
    local_240 = uVar4;
    if (((local_230 != 0) && (((byte)this[100] & 1) == 0)) &&
       (cVar2 = (**(code **)(*g_pFullFileSystem + 0x14))(g_pFullFileSystem), 0 < local_230)) {
      local_250 = 0;
      do {
        iVar9 = local_250 * 8;
        iVar5 = (**(code **)(*g_pFullFileSystem + 0x160))
                          (g_pFullFileSystem,
                           *(int *)(this + 8) + 8 + (uint)*(ushort *)(local_23c + 4 + iVar9) * 0x18)
        ;
        if (local_250 < local_230) {
          local_254 = local_250;
          iVar8 = iVar9;
          do {
            iVar6 = (**(code **)(*g_pFullFileSystem + 0x160))
                              (g_pFullFileSystem,
                               *(int *)(this + 8) + 8 +
                               (uint)*(ushort *)(local_23c + 4 + iVar8) * 0x18);
            if (iVar5 != iVar6) break;
            local_254 = local_254 + 1;
            iVar8 = iVar8 + 8;
          } while (local_254 < local_230);
        }
        else {
          local_254 = local_250;
        }
        (**(code **)(*g_pFullFileSystem + 0x98))
                  (g_pFullFileSystem,
                   *(int *)(this + 8) + 8 + (uint)*(ushort *)(local_23c + 4 + iVar9) * 0x18,
                   local_220,0x200);
        V_StripFilename(local_220);
        bVar1 = true;
        if (cVar2 == '\0') {
          iVar5 = (**(code **)(*g_pFullFileSystem + 0x164))(g_pFullFileSystem,local_220,"GAME");
          bVar1 = param_2 < iVar5;
        }
        if (local_250 < local_254) {
          do {
            iVar5 = *(int *)(this + 8) + (uint)*(ushort *)(local_23c + 4 + iVar9) * 0x18;
            if (*(int *)(iVar5 + 0x10) == -2) {
              if (bVar1) {
                (**(code **)(*g_pFullFileSystem + 0x98))
                          (g_pFullFileSystem,iVar5 + 8,local_220,0x200);
                if (*(int *)(this + 0x60) == 1) {
                  iVar8 = (**(code **)(g_pFullFileSystem[1] + 0x1c))
                                    (g_pFullFileSystem + 1,local_220,"GAME");
                  if (iVar8 == -1) {
                    iVar8 = 0;
                  }
                  *(int *)(iVar5 + 0x10) = iVar8;
                }
                else {
                  uVar7 = (**(code **)(g_pFullFileSystem[1] + 0x34))();
                  *(undefined4 *)(iVar5 + 0x10) = uVar7;
                }
              }
              else {
                *(undefined4 *)(iVar5 + 0x10) = *(undefined4 *)(iVar5 + 0xc);
              }
            }
            local_250 = local_250 + 1;
            iVar9 = iVar9 + 8;
          } while (local_250 != local_254);
        }
        local_250 = local_254 + 1;
      } while (local_250 < local_230);
    }
    local_230 = 0;
    CUtlMemory<CSortedCacheFile,int>::Purge((CUtlMemory<CSortedCacheFile,int> *)&local_23c);
    local_22c = local_23c;
    CUtlMemory<CSortedCacheFile,int>::Purge((CUtlMemory<CSortedCacheFile,int> *)&local_23c);
  }
  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)