// // LevelEditorLayer::getNextFreeItemID from 0x1000ec080 to 0x1000ec2f7 (631 bytes) // // 2 xrefs: // > SetupPickupTriggerPopup::onPlusButton @ 0x1000593a2 // > SetupInteractObjectPopup::onPlusButton @ 0x10050eb7e // // This function is hookable on this platform! // // Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings // int __fastcall LevelEditorLayer::getNextFreeItemID(LevelEditorLayer *a1, std::unordered_set *const a2) { double v2; // xmm1_8 double v3; // xmm2_8 std::__hash_node_base *>::__next_pointer i; // r15 cocos2d::CCArray *m_objects; // rax cocos2d::ccArray *data; // rax cocos2d::CCObject **arr; // r12 unsigned __int64 v8; // r13 cocos2d::CCObject *v9; // r15 void *v10; // rdi int v11; // ebx unsigned __int64 v12; // r8 unsigned __int64 v13; // rcx __int64 *v14; // rsi __int64 v15; // r9 unsigned __int64 v16; // rsi __int64 **v17; // rax __int64 *j; // r9 unsigned __int64 v19; // rax _QWORD *v20; // rdi _QWORD *v21; // r14 void *v23[2]; // [rsp+0h] [rbp-60h] BYREF void *__p[2]; // [rsp+10h] [rbp-50h] int v25; // [rsp+20h] [rbp-40h] int v26[11]; // [rsp+34h] [rbp-2Ch] BYREF *(_OWORD *)__p = 0; *(_OWORD *)v23 = 0; v25 = 1065353216; for ( i = a2->__table_.__p1_.__value_.__next_; i; i = i->__next_ ) sub_100054F50((float *)v23, (int *)&i[2], &i[2], (__m128)0LL, v2, v3); m_objects = a1->m_objects; if ( m_objects ) { data = m_objects->data; if ( data->num ) { arr = data->arr; v8 = (unsigned __int64)&arr[data->num - 1]; do { v9 = *arr; if ( !*arr ) break; if ( v9[22].m_nTag == 1 && (((unsigned int (__fastcall *)(cocos2d::CCObject *))v9->__vftable[22].isEqual)(*arr) == 30 && LOBYTE(v9[30].m_uID) || v9[18].m_uReference == 1817) ) { v26[0] = (int)v9[30].__vftable; sub_100056510((float *)v23, v26, v26, (__m128)0LL); } ++arr; } while ( (unsigned __int64)arr <= v8 ); } } v10 = v23[0]; v11 = 1; if ( v23[1] ) { if ( (((__int64)v23[1] - 1) & (__int64)v23[1]) == 0 ) { v12 = (unsigned __int64)v23[1] + 0x7FFFFFFF; v13 = 1; v11 = 1000; LABEL_17: v14 = *((__int64 **)v23[0] + (v12 & v13)); if ( v14 ) { while ( 1 ) { v14 = (__int64 *)*v14; if ( !v14 ) break; v15 = v14[1]; if ( v15 == v13 ) { if ( v13 == *((_DWORD *)v14 + 4) ) { if ( ++v13 != 1001 ) goto LABEL_17; goto LABEL_46; } } else if ( (((unsigned __int64)v23[1] - 1) & v15) != (v12 & v13) ) { goto LABEL_45; } } } goto LABEL_45; } v13 = 1; v11 = 1000; LABEL_26: v16 = v13; if ( v23[1] <= (void *)v13 ) { if ( !(((unsigned __int64)v23[1] | v13) >> 32) ) { v16 = (unsigned int)v13 % LODWORD(v23[1]); v17 = *((__int64 ***)v23[0] + v16); if ( v17 ) goto LABEL_30; goto LABEL_45; } v16 = v13 % (unsigned __int64)v23[1]; } v17 = *((__int64 ***)v23[0] + v16); if ( v17 ) { LABEL_30: for ( j = *v17; j; j = (__int64 *)*j ) { v19 = j[1]; if ( v19 == v13 ) { if ( v13 == *((_DWORD *)j + 4) ) { if ( ++v13 != 1001 ) goto LABEL_26; goto LABEL_46; } } else { if ( (void *)v19 < v23[1] ) goto LABEL_38; if ( ((unsigned __int64)v23[1] | v19) >> 32 ) { v19 %= (unsigned __int64)v23[1]; LABEL_38: if ( v19 != v16 ) break; continue; } if ( (unsigned int)v19 % LODWORD(v23[1]) != v16 ) break; } } } LABEL_45: v11 = v13; } LABEL_46: if ( __p[0] ) { v20 = __p[0]; do { v21 = (_QWORD *)*v20; operator delete(v20); v20 = v21; } while ( v21 ); v10 = v23[0]; } v23[0] = nullptr; if ( v10 ) operator delete(v10); return v11; }
GD Web Decomp Icon

GD Web Decomp

Raw Source