// // GJBaseGameLayer::activatePersistentItemTrigger from 0x10012b160 to 0x10012b529 (969 bytes) // // 1 xrefs: // > ItemTriggerGameObject::triggerObject @ 0x1001c6604 // // This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True! // // Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings // Generated at Fri, 27 Nov 2026 12:24:44 +0000 // void __fastcall GJBaseGameLayer::activatePersistentItemTrigger(__int64 a1, __int64 a2) { __int64 v2; // r15 __int64 v3; // r14 char v4; // al void **v5; // rbx __int64 v6; // rbx unsigned __int64 v7; // r14 int *v8; // r13 int *v9; // rdx __int64 *v10; // r14 int *v11; // r15 signed __int64 v12; // r15 __int64 v13; // r12 unsigned __int64 v14; // rax __int64 v15; // rdx unsigned __int64 v16; // rbx int *v17; // rbx _QWORD *v18; // rdi _QWORD *v19; // rbx void *v20; // rdi void *v21; // [rsp+0h] [rbp-70h] BYREF void *__p; // [rsp+10h] [rbp-60h] int *v23; // [rsp+28h] [rbp-48h] __int64 v24; // [rsp+30h] [rbp-40h] __int64 v25; // [rsp+38h] [rbp-38h] void *__src; // [rsp+40h] [rbp-30h] v2 = a2; v3 = a1; v4 = *(_BYTE *)(a2 + 1893); if ( *(_BYTE *)(a2 + 1895) == 1 ) { if ( v4 ) { if ( *(_BYTE *)(a2 + 1894) == 1 ) { sub_1001518D0(&v21, *(_QWORD *)(a1 + 2152) + 792LL); v5 = (void **)__p; if ( __p ) { do { if ( (unsigned __int8)GJEffectManager::timerExists(*(_QWORD *)(a1 + 2152), *((unsigned int *)v5 + 4)) ) GJEffectManager::updateTimer(*(_QWORD *)(a1 + 2152), *((unsigned int *)v5 + 4), 0.0); v5 = (void **)*v5; } while ( v5 ); v18 = __p; if ( __p ) { do { v19 = (_QWORD *)*v18; operator delete(v18); v18 = v19; } while ( v19 ); } } v20 = v21; v21 = nullptr; if ( v20 ) operator delete(v20); } if ( !*(_BYTE *)(a2 + 1892) ) GJEffectManager::removePersistentFromAllTimers(*(_QWORD *)(v3 + 2152)); } else { GJEffectManager::toggleTimerPersistent( *(_QWORD *)(a1 + 2152), *(unsigned int *)(a2 + 1680), *(unsigned __int8 *)(a2 + 1892)); if ( *(_BYTE *)(a2 + 1894) == 1 && (unsigned __int8)GJEffectManager::timerExists(*(_QWORD *)(a1 + 2152), *(unsigned int *)(a2 + 1680)) ) { GJEffectManager::updateTimer(*(_QWORD *)(a1 + 2152), *(unsigned int *)(a2 + 1680), 0.0); } } return; } if ( v4 ) { if ( *(_BYTE *)(a2 + 1894) != 1 ) goto LABEL_48; v25 = a1; v6 = *(_QWORD *)(a1 + 2152); v7 = *(_QWORD *)(v6 + 776); if ( v7 ) { if ( v7 > 0x3FFFFFFFFFFFFFFFLL ) sub_100093980(); v8 = (int *)operator new(4 * v7); v9 = &v8[v7]; v10 = *(__int64 **)(v6 + 768); if ( v10 ) goto LABEL_14; } else { v8 = nullptr; v9 = nullptr; v10 = *(__int64 **)(v6 + 768); if ( v10 ) { LABEL_14: v24 = a2; v11 = v8; do { while ( v11 < v9 ) { *v11++ = *((_DWORD *)v10 + 4); v10 = (__int64 *)*v10; if ( !v10 ) goto LABEL_29; } v12 = (char *)v11 - (char *)v8; v13 = v12 >> 2; v14 = (v12 >> 2) + 1; __src = v8; if ( v14 > 0x3FFFFFFFFFFFFFFFLL ) sub_100093980(); v15 = (char *)v9 - (char *)v8; v16 = v15 >> 1; if ( v15 >> 1 <= v14 ) v16 = (v12 >> 2) + 1; if ( (unsigned __int64)v15 >= 0x7FFFFFFFFFFFFFFCLL ) v16 = 0x3FFFFFFFFFFFFFFFLL; if ( v16 ) { if ( v16 > 0x3FFFFFFFFFFFFFFFLL ) sub_10001ADB0(); v8 = (int *)operator new(4 * v16); } else { v8 = nullptr; } v23 = &v8[v16]; v8[v13] = *((_DWORD *)v10 + 4); memcpy(v8, __src, v12); if ( __src ) operator delete(__src); v11 = &v8[v13 + 1]; v9 = v23; v10 = (__int64 *)*v10; } while ( v10 ); LABEL_29: if ( v8 == v11 ) { v3 = v25; v2 = v24; if ( !v8 ) goto LABEL_48; } else { v17 = v8; v3 = v25; do { GJEffectManager::updateCountForItem(*(_QWORD *)(v25 + 2152), (unsigned int)*v17, 0); GJBaseGameLayer::updateCounters(v25, *v17++, 0); } while ( v17 != v11 ); v2 = v24; if ( !v8 ) { LABEL_48: if ( !*(_BYTE *)(v2 + 1892) ) GJEffectManager::removePersistentFromAllItems(*(_QWORD *)(v3 + 2152)); return; } } LABEL_47: operator delete(v8); goto LABEL_48; } } v3 = v25; if ( !v8 ) goto LABEL_48; goto LABEL_47; } GJEffectManager::toggleItemPersistent( *(_QWORD *)(a1 + 2152), *(unsigned int *)(a2 + 1680), *(unsigned __int8 *)(a2 + 1892)); if ( *(_BYTE *)(a2 + 1894) == 1 ) { GJEffectManager::updateCountForItem(*(_QWORD *)(a1 + 2152), *(unsigned int *)(a2 + 1680), 0); GJBaseGameLayer::updateCounters(a1, *(_DWORD *)(a2 + 1680), 0); } }
GD Web Decomp Icon

GD Web Decomp

Raw Source