L L4D2node

CUtlCachedFileData<CModelSoundsCache>::Get

0x00622150 · 508 bytes · __thiscall

_ZN18CUtlCachedFileDataI17CModelSoundsCacheE3GetEPKc

Decompiled

undefined (2 params)

/* CUtlCachedFileData<CModelSoundsCache>::Get(char const*) */

int * __thiscall
CUtlCachedFileData<CModelSoundsCache>::Get
          (CUtlCachedFileData<CModelSoundsCache> *this,char *param_1)

{
  int iVar1;
  int *piVar2;
  uint uVar3;
  int iVar4;
  undefined4 uVar5;
  CModelSoundsCache *this_00;
  char *pcVar6;
  int iVar7;
  int iVar8;
  CModelSoundsCache *local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  local_2c = 0;
  local_28 = 0;
  local_24 = 0xfffffffe;
  local_20 = 0xffffffff;
  local_2c = (**(code **)(*g_pFullFileSystem + 0x94))(g_pFullFileSystem,param_1);
  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>>
          ::Find((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),(ElementType_t *)&local_2c);
  uVar3 = uVar3 & 0xffff;
  if (uVar3 == 0xffff) {
    this_00 = ::operator_new(0x18);
                    /* try { // try from 006222c9 to 006222cd has its CatchHandler @ 00622388 */
    CModelSoundsCache::CModelSoundsCache(this_00);
    local_30 = this_00;
    uVar5 = CUtlVector<CModelSoundsCache*,CUtlMemory<CModelSoundsCache*,int>>::InsertBefore
                      ((CUtlVector<CModelSoundsCache*,CUtlMemory<CModelSoundsCache*,int>> *)
                       (this + 0x20),*(int *)(this + 0x2c),&local_30);
    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>>
            ::Insert((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),(ElementType_t *)&local_2c);
    uVar3 = uVar3 & 0xffff;
    *(undefined4 *)(*(int *)(this + 8) + uVar3 * 0x18 + 0x14) = uVar5;
  }
  iVar1 = *(int *)(this + 8) + uVar3 * 0x18;
  iVar8 = *(int *)(iVar1 + 0xc);
  if ((iVar8 == -1) && (*(int *)(this + 0x60) == 1)) {
    *(undefined4 *)(iVar1 + 0xc) = 0;
    iVar8 = 0;
  }
  iVar4 = *(int *)(iVar1 + 0x10);
  if (iVar4 == -2) {
    if (((byte)this[100] & 1) != 0) {
      *(int *)(iVar1 + 0x10) = iVar8;
      return *(int **)(*(int *)(this + 0x20) + *(int *)(iVar1 + 0x14) * 4);
    }
    CUtlString::CUtlString((CUtlString *)&local_2c);
                    /* try { // try from 00622264 to 0062229a has its CatchHandler @ 00622373 */
    iVar4 = CUtlString::Length((CUtlString *)(this + 0x44));
    pcVar6 = param_1;
    if (iVar4 != 0) {
                    /* try { // try from 0062231d to 00622362 has its CatchHandler @ 00622373 */
      CUtlString::operator=((CUtlString *)&local_2c,(CUtlString *)(this + 0x44));
      CUtlString::operator+=((CUtlString *)&local_2c,"/");
      CUtlString::operator+=((CUtlString *)&local_2c,param_1);
      pcVar6 = (char *)CUtlString::Get((CUtlString *)&local_2c);
    }
    if (*(int *)(this + 0x60) == 1) {
      iVar7 = (**(code **)(g_pFullFileSystem[1] + 0x1c))(g_pFullFileSystem + 1,pcVar6,"GAME");
      iVar4 = 0;
      if (iVar7 != -1) {
        iVar4 = iVar7;
      }
      *(int *)(iVar1 + 0x10) = iVar4;
    }
    else {
      uVar5 = (**(code **)(g_pFullFileSystem[1] + 0x34))();
      *(undefined4 *)(iVar1 + 0x10) = uVar5;
    }
    CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)&local_2c);
    iVar4 = *(int *)(iVar1 + 0x10);
  }
  piVar2 = *(int **)(*(int *)(this + 0x20) + *(int *)(iVar1 + 0x14) * 4);
  if (iVar8 != iVar4) {
    if (((byte)this[100] & 2) == 0) {
      this[100] = (CUtlCachedFileData<CModelSoundsCache>)((byte)this[100] | 8);
      (**(code **)(*piVar2 + 8))(piVar2,param_1);
      iVar4 = *(int *)(iVar1 + 0x10);
    }
    *(int *)(iVar1 + 0xc) = iVar4;
  }
  return piVar2;
}

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)