MattFiler

add_resource<DYNAMIC_PHYSICS_SYSTEM>

Jan 23rd, 2022 (edited)
36
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.78 KB | None
  1. bool __thiscall
  2. CATHODE::ResourceDatabase::add_resource_DYNAMIC_PHYSICS_SYSTEM_
  3.           (ResourceDatabase *this,uint param_1,DYNAMIC_PHYSICS_SYSTEM *param_2)
  4.  
  5. {
  6.   int iVar1;
  7.   char cVar2;
  8.   bool bVar3;
  9.   MemoryPool *pMVar4;
  10.   code *UNRECOVERED_JUMPTABLE;
  11.   undefined uVar5;
  12.   long *plVar6;
  13.   long lVar7;
  14.   undefined8 *puVar8;
  15.   long *plVar9;
  16.   long *local_58;
  17.  
  18.   pMVar4 = MemoryManager::m_instance;
  19.   plVar6 = (long *)MemoryPool::pr_allocate(MemoryManager::m_instance,0x10);
  20.   if (plVar6 == (long *)0x0) {
  21.                     // WARNING: Could not recover jumptable at 0x0001004e60bc. Too many branches
  22.                     // WARNING: Treating indirect jump as call
  23.     UNRECOVERED_JUMPTABLE = (code *)SoftwareBreakpoint(1,0x1004e60c0);
  24.     uVar5 = (*UNRECOVERED_JUMPTABLE)();
  25.     return (bool)uVar5;
  26.   }
  27.   lVar7 = (**(code **)(*plVar6 + 0x18))();
  28.   (**(code **)*plVar6)(plVar6);
  29.   plVar9 = plVar6 + 1;
  30.   *(int *)plVar9 = 0;
  31.   *(undefined4 *)((long)plVar6 + 0xc) = 1;
  32.   *plVar6 = (long)(PTR_vtable_101f16880 + 0x10);
  33.   plVar6[2] = lVar7;
  34.   MemoryTracker::set_owner
  35.             ((MemoryTracker *)
  36.              &MemoryAllocation<CATHODE::CONTAINER_FOR_DYNAMIC_PHYSICS_SYSTEM>::m_tracker,pMVar4);
  37.   do {
  38.     cVar2 = '\x01';
  39.     bVar3 = (bool)ExclusiveMonitorPass(plVar9,0x10);
  40.     if (bVar3) {
  41.       *(int *)plVar9 = *(int *)plVar9 + 1;
  42.       cVar2 = ExclusiveMonitorsStatus();
  43.     }
  44.   } while (cVar2 != '\0');
  45.   puVar8 = (undefined8 *)plVar6[2];
  46.   *puVar8 = &PTR__CONTAINER_FOR_TRAVERSAL_SEGMENT_1021a8420;
  47.   puVar8[1] = param_2;
  48.   do {
  49.     cVar2 = '\x01';
  50.     bVar3 = (bool)ExclusiveMonitorPass(plVar9,0x10);
  51.     if (bVar3) {
  52.       *(int *)plVar9 = *(int *)plVar9 + 1;
  53.       cVar2 = ExclusiveMonitorsStatus();
  54.     }
  55.   } while (cVar2 != '\0');
  56.   local_58 = plVar6;
  57.   if (*(int *)plVar9 == 1) {
  58.     (***(code ***)plVar6[2])();
  59.   }
  60.   do {
  61.     iVar1 = *(int *)plVar9;
  62.     cVar2 = '\x01';
  63.     bVar3 = (bool)ExclusiveMonitorPass(plVar9,0x10);
  64.     if (bVar3) {
  65.       *(int *)plVar9 = iVar1 + -1;
  66.       cVar2 = ExclusiveMonitorsStatus();
  67.     }
  68.   } while (cVar2 != '\0');
  69.   if (iVar1 + -1 == 0) {
  70.     MemoryAllocationBase::release((MemoryAllocationBase *)plVar6);
  71.   }
  72.   uVar5 = add_resource_ptr(this,param_1,(MemoryPtr *)&local_58);
  73.   if (local_58 != (long *)0x0) {
  74.     if (*(int *)(local_58 + 1) == 1) {
  75.       (***(code ***)local_58[2])();
  76.     }
  77.     plVar6 = local_58 + 1;
  78.     do {
  79.       iVar1 = *(int *)plVar6;
  80.       cVar2 = '\x01';
  81.       bVar3 = (bool)ExclusiveMonitorPass(plVar6,0x10);
  82.       if (bVar3) {
  83.         *(int *)plVar6 = iVar1 + -1;
  84.         cVar2 = ExclusiveMonitorsStatus();
  85.       }
  86.     } while (cVar2 != '\0');
  87.     if (iVar1 + -1 == 0) {
  88.       MemoryAllocationBase::release((MemoryAllocationBase *)local_58);
  89.     }
  90.   }
  91.   return (bool)uVar5;
  92. }
RAW Paste Data Copied