Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ResourceDatabase * __thiscall CATHODE::ResourceDatabase::ResourceDatabase(ResourceDatabase *this)
- {
- int *piVar1;
- int iVar2;
- char cVar3;
- bool bVar4;
- MemoryPool *pMVar5;
- long *plVar6;
- long lVar7;
- MemoryAllocationBase *this_00;
- long *plVar8;
- long *local_48;
- *(undefined8 *)this = 0;
- pMVar5 = MemoryManager::m_instance;
- plVar6 = (long *)MemoryPool::pr_allocate(MemoryManager::m_instance,0);
- if (plVar6 == (long *)0x0) {
- local_48 = (long *)0x0;
- plVar6 = local_48;
- }
- else {
- lVar7 = (**(code **)(*plVar6 + 0x18))(plVar6);
- (**(code **)*plVar6)(plVar6);
- plVar8 = plVar6 + 1;
- *(int *)plVar8 = 0;
- *(undefined4 *)((long)plVar6 + 0xc) = 0;
- *plVar6 = (long)(PTR_vtable_101f157c8 + 0x10);
- plVar6[2] = lVar7;
- MemoryTracker::set_owner
- ((MemoryTracker *)&MemoryAllocation<CATHODE::ResourceDatabase::ResourceKey>::m_tracker
- ,pMVar5);
- do {
- cVar3 = '\x01';
- bVar4 = (bool)ExclusiveMonitorPass(plVar8,0x10);
- if (bVar4) {
- *(int *)plVar8 = *(int *)plVar8 + 1;
- cVar3 = ExclusiveMonitorsStatus();
- }
- } while (cVar3 != '\0');
- }
- local_48 = plVar6;
- if (&local_48 != (long **)this) {
- this_00 = *(MemoryAllocationBase **)this;
- if (this_00 != (MemoryAllocationBase *)0x0) {
- if (*(int *)(this_00 + 8) == 1) {
- ArrayPtr<CATHODE::ResourceDatabase::ResourceKey>::clear
- ((ArrayPtr_CATHODE__ResourceDatabase__ResourceKey_ *)this);
- this_00 = *(MemoryAllocationBase **)this;
- }
- piVar1 = (int *)(this_00 + 8);
- do {
- iVar2 = *piVar1;
- cVar3 = '\x01';
- bVar4 = (bool)ExclusiveMonitorPass(piVar1,0x10);
- if (bVar4) {
- *piVar1 = iVar2 + -1;
- cVar3 = ExclusiveMonitorsStatus();
- }
- } while (cVar3 != '\0');
- if (iVar2 + -1 == 0) {
- MemoryAllocationBase::release(this_00);
- }
- *(undefined8 *)this = 0;
- }
- if (plVar6 != (long *)0x0) {
- *(long **)this = plVar6;
- plVar6 = plVar6 + 1;
- do {
- cVar3 = '\x01';
- bVar4 = (bool)ExclusiveMonitorPass(plVar6,0x10);
- if (bVar4) {
- *(int *)plVar6 = *(int *)plVar6 + 1;
- cVar3 = ExclusiveMonitorsStatus();
- }
- } while (cVar3 != '\0');
- }
- }
- if (local_48 != (long *)0x0) {
- if (*(int *)(local_48 + 1) == 1) {
- ArrayPtr<CATHODE::ResourceDatabase::ResourceKey>::clear
- ((ArrayPtr_CATHODE__ResourceDatabase__ResourceKey_ *)&local_48);
- }
- plVar6 = local_48 + 1;
- do {
- iVar2 = *(int *)plVar6;
- cVar3 = '\x01';
- bVar4 = (bool)ExclusiveMonitorPass(plVar6,0x10);
- if (bVar4) {
- *(int *)plVar6 = iVar2 + -1;
- cVar3 = ExclusiveMonitorsStatus();
- }
- } while (cVar3 != '\0');
- if (iVar2 + -1 == 0) {
- MemoryAllocationBase::release((MemoryAllocationBase *)local_48);
- }
- }
- return this;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement