Advertisement
MattFiler

ResourceRegistry

Jan 23rd, 2022
784
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ResourceRegistry * __thiscall CATHODE::ResourceRegistry::ResourceRegistry(ResourceRegistry *this)
  2.  
  3. {
  4.   long *plVar1;
  5.   int iVar2;
  6.   char cVar3;
  7.   bool bVar4;
  8.   MemoryPool *pMVar5;
  9.   long lVar6;
  10.   long *plVar7;
  11.   int iVar8;
  12.   int *piVar9;
  13.   long *local_48;
  14.  
  15.   lVar6 = ResourceDatabase::ResourceDatabase((ResourceDatabase *)this);
  16.   *(undefined8 *)(lVar6 + 8) = 0;
  17.   pMVar5 = MemoryManager::m_instance;
  18.   local_48 = (long *)MemoryPool::pr_allocate(MemoryManager::m_instance,0);
  19.   if (local_48 == (long *)0x0) {
  20.     local_48 = (long *)0x0;
  21.     plVar7 = *(long **)(this + 8);
  22.   }
  23.   else {
  24.     lVar6 = (**(code **)(*local_48 + 0x18))(local_48);
  25.     (**(code **)*local_48)(local_48);
  26.     plVar7 = local_48 + 1;
  27.     *(int *)plVar7 = 0;
  28.     *(undefined4 *)((long)local_48 + 0xc) = 0;
  29.     *local_48 = (long)(PTR_vtable_101f157d0 + 0x10);
  30.     local_48[2] = lVar6;
  31.     MemoryTracker::set_owner
  32.               ((MemoryTracker *)&MemoryAllocation<CATHODE::ResourceRegistry::ResourceKey>::m_tracker
  33.                ,pMVar5);
  34.     do {
  35.       cVar3 = '\x01';
  36.       bVar4 = (bool)ExclusiveMonitorPass(plVar7,0x10);
  37.       if (bVar4) {
  38.         *(int *)plVar7 = *(int *)plVar7 + 1;
  39.         cVar3 = ExclusiveMonitorsStatus();
  40.       }
  41.     } while (cVar3 != '\0');
  42.     plVar7 = *(long **)(this + 8);
  43.   }
  44.   if (plVar7 != (long *)0x0) {
  45.     if ((*(int *)(plVar7 + 1) == 1) && (piVar9 = (int *)((long)plVar7 + 0xc), *piVar9 != 0)) {
  46.       iVar2 = *(int *)((long)plVar7 + 0xc);
  47.       if (iVar2 != 0) {
  48.         do {
  49.           cVar3 = '\x01';
  50.           bVar4 = (bool)ExclusiveMonitorPass(piVar9,0x10);
  51.           if (bVar4) {
  52.             *piVar9 = *piVar9 + -1;
  53.             cVar3 = ExclusiveMonitorsStatus();
  54.           }
  55.         } while (cVar3 != '\0');
  56.         if (iVar2 != 1) {
  57.           iVar8 = 1;
  58.           do {
  59.             piVar9 = (int *)(*(long *)(this + 8) + 0xc);
  60.             do {
  61.               cVar3 = '\x01';
  62.               bVar4 = (bool)ExclusiveMonitorPass(piVar9,0x10);
  63.               if (bVar4) {
  64.                 *piVar9 = *piVar9 + -1;
  65.                 cVar3 = ExclusiveMonitorsStatus();
  66.               }
  67.             } while (cVar3 != '\0');
  68.             iVar8 = iVar8 + 1;
  69.           } while (iVar8 != iVar2);
  70.         }
  71.         plVar7 = *(long **)(this + 8);
  72.       }
  73.       (**(code **)(*plVar7 + 0x40))(plVar7,0);
  74.       plVar7 = *(long **)(this + 8);
  75.     }
  76.     plVar1 = plVar7 + 1;
  77.     do {
  78.       iVar2 = *(int *)plVar1;
  79.       cVar3 = '\x01';
  80.       bVar4 = (bool)ExclusiveMonitorPass(plVar1,0x10);
  81.       if (bVar4) {
  82.         *(int *)plVar1 = iVar2 + -1;
  83.         cVar3 = ExclusiveMonitorsStatus();
  84.       }
  85.     } while (cVar3 != '\0');
  86.     if (iVar2 + -1 == 0) {
  87.       MemoryAllocationBase::release((MemoryAllocationBase *)plVar7);
  88.     }
  89.     *(undefined8 *)(this + 8) = 0;
  90.   }
  91.   if (local_48 != (long *)0x0) {
  92.     *(long **)(this + 8) = local_48;
  93.     plVar7 = local_48 + 1;
  94.     do {
  95.       cVar3 = '\x01';
  96.       bVar4 = (bool)ExclusiveMonitorPass(plVar7,0x10);
  97.       if (bVar4) {
  98.         *(int *)plVar7 = *(int *)plVar7 + 1;
  99.         cVar3 = ExclusiveMonitorsStatus();
  100.       }
  101.     } while (cVar3 != '\0');
  102.   }
  103.   if (local_48 != (long *)0x0) {
  104.     if ((*(int *)(local_48 + 1) == 1) && (piVar9 = (int *)((long)local_48 + 0xc), *piVar9 != 0)) {
  105.       iVar2 = *(int *)((long)local_48 + 0xc);
  106.       if (iVar2 != 0) {
  107.         do {
  108.           cVar3 = '\x01';
  109.           bVar4 = (bool)ExclusiveMonitorPass(piVar9,0x10);
  110.           if (bVar4) {
  111.             *piVar9 = *piVar9 + -1;
  112.             cVar3 = ExclusiveMonitorsStatus();
  113.           }
  114.         } while (cVar3 != '\0');
  115.         if (iVar2 != 1) {
  116.           iVar8 = 1;
  117.           do {
  118.             piVar9 = (int *)((long)local_48 + 0xc);
  119.             do {
  120.               cVar3 = '\x01';
  121.               bVar4 = (bool)ExclusiveMonitorPass(piVar9,0x10);
  122.               if (bVar4) {
  123.                 *piVar9 = *piVar9 + -1;
  124.                 cVar3 = ExclusiveMonitorsStatus();
  125.               }
  126.             } while (cVar3 != '\0');
  127.             iVar8 = iVar8 + 1;
  128.           } while (iVar8 != iVar2);
  129.         }
  130.       }
  131.       (**(code **)(*local_48 + 0x40))(local_48,0);
  132.     }
  133.     plVar7 = local_48 + 1;
  134.     do {
  135.       iVar2 = *(int *)plVar7;
  136.       cVar3 = '\x01';
  137.       bVar4 = (bool)ExclusiveMonitorPass(plVar7,0x10);
  138.       if (bVar4) {
  139.         *(int *)plVar7 = iVar2 + -1;
  140.         cVar3 = ExclusiveMonitorsStatus();
  141.       }
  142.     } while (cVar3 != '\0');
  143.     if (iVar2 + -1 == 0) {
  144.       MemoryAllocationBase::release((MemoryAllocationBase *)local_48);
  145.     }
  146.   }
  147.   m_instance = this;
  148.   return this;
  149. }
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement