L L4D2node

CDecalEmitterSystem::GetDecalIndexForName

0x00446790 · 615 bytes · __thiscall

_ZN19CDecalEmitterSystem20GetDecalIndexForNameEPKc

Decompiled

undefined (2 params)

/* CDecalEmitterSystem::GetDecalIndexForName(char const*) */

undefined4 __thiscall
CDecalEmitterSystem::GetDecalIndexForName(CDecalEmitterSystem *this,char *param_1)

{
  int iVar1;
  int iVar2;
  int iVar3;
  char cVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  int iVar9;
  longdouble lVar10;
  float fVar11;
  char *local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  if ((param_1 != (char *)0x0) && (*param_1 != '\0')) {
    local_34 = param_1;
    local_30 = 0;
    local_2c = 0;
    local_28 = 0;
    iVar6 = *(int *)(this + 0x34);
    local_24 = 0;
    local_20 = 0;
    if (iVar6 != -1) {
      iVar5 = *(int *)(this + 0x28);
      do {
        while( true ) {
          iVar2 = iVar6 * 0x28;
                    /* try { // try from 00446826 to 00446844 has its CatchHandler @ 00446a17 */
          cVar4 = (**(code **)(this + 0x24))(&local_34,iVar5 + 0x10 + iVar2);
          if (cVar4 != '\0') break;
          cVar4 = (**(code **)(this + 0x24))(*(int *)(this + 0x28) + iVar2 + 0x10,&local_34);
          if (cVar4 == '\0') {
            local_24 = 0;
            CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)&local_30);
            local_20 = local_30;
            CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)&local_30);
            if (iVar6 == -1) {
              return 0xffffffff;
            }
            iVar6 = *(int *)(this + 0x28);
            iVar5 = *(int *)(iVar2 + iVar6 + 0x20);
            if (iVar5 < 1) {
              return 0xffffffff;
            }
            iVar9 = 0;
            fVar11 = 0.0;
            iVar7 = *(int *)(this + 0x10);
            iVar8 = 0;
            goto LAB_00446988;
          }
          if ((CUtlRBTree<CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::Node_t,int,CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::Node_t,int>,int>>
               ::Links(int)::s_Sentinel == '\0') &&
             (iVar6 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::Node_t,int,CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::Node_t,int>,int>>
                                           ::Links(int)::s_Sentinel), iVar6 != 0)) {
            CUtlRBTree<CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::Node_t,int,CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::Node_t,int>,int>>
            ::Links(int)::s_Sentinel = 0xffffffff;
            DAT_00f158c8 = 0xffffffff;
            DAT_00f158cc = 0xffffffff;
            __cxa_guard_release(&CUtlRBTree<CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::Node_t,int,CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::Node_t,int>,int>>
                                 ::Links(int)::s_Sentinel);
          }
          iVar5 = *(int *)(this + 0x28);
          iVar6 = *(int *)(iVar5 + 4 + iVar2);
          if (iVar6 == -1) goto LAB_00446869;
        }
        if ((CUtlRBTree<CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::Node_t,int,CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::Node_t,int>,int>>
             ::Links(int)::s_Sentinel == '\0') &&
           (iVar5 = __cxa_guard_acquire(&CUtlRBTree<CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::Node_t,int,CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::Node_t,int>,int>>
                                         ::Links(int)::s_Sentinel), iVar5 != 0)) {
          CUtlRBTree<CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::Node_t,int,CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::Node_t,int>,int>>
          ::Links(int)::s_Sentinel = 0xffffffff;
          DAT_00f158c8 = 0xffffffff;
          DAT_00f158cc = 0xffffffff;
          __cxa_guard_release(&CUtlRBTree<CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::Node_t,int,CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<char_const*,CDecalEmitterSystem::DecalEntry,int>::Node_t,int>,int>>
                               ::Links(int)::s_Sentinel);
        }
        iVar5 = *(int *)(this + 0x28);
        iVar6 = *(int *)(iVar5 + iVar6 * 0x28);
      } while (iVar6 != -1);
    }
LAB_00446869:
    local_24 = 0;
    CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)&local_30);
    local_20 = local_30;
    CUtlMemory<int,int>::Purge((CUtlMemory<int,int> *)&local_30);
  }
  return 0xffffffff;
LAB_00446988:
  iVar3 = *(int *)(*(int *)(iVar2 + iVar6 + 0x14) + iVar8 * 4);
  iVar1 = iVar7 + iVar3 * 0xc;
  if (fVar11 == 0.0) {
    iVar9 = iVar3;
  }
  fVar11 = fVar11 + *(float *)(iVar1 + 8);
  if (fVar11 == 0.0) {
LAB_004469a4:
    iVar9 = iVar3;
  }
  else {
    lVar10 = (longdouble)(**(code **)(*random_valve + 4))(random_valve,0,fVar11);
    iVar7 = *(int *)(this + 0x10);
    if ((float)lVar10 < *(float *)(iVar1 + 8)) goto LAB_004469a4;
  }
  iVar8 = iVar8 + 1;
  if (iVar8 == iVar5) {
    return *(undefined4 *)(iVar7 + 4 + iVar9 * 0xc);
  }
  goto LAB_00446988;
}

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)