{"type": "func", "start": 8880924, "end": 8881308, "name": "GJBaseGameLayer::restoreAllUIObjects", "pseudocode": "// \n// GJBaseGameLayer::restoreAllUIObjects from 0x87831c to 0x87849c (384 bytes)\n// \n// 2 xrefs:\n// > LevelEditorLayer::onStopPlaytest @ 0x662818\n// > <???> @ 0x41298\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nvoid GJBaseGameLayer::restoreAllUIObjects(GJBaseGameLayer *a1)\n{\n  cocos2d::CCArray *m_uiObjects; // x0\n  std::unordered_map<int, cocos2d::CCPoint> *p_m_uiObjectPositions; // x23\n  cocos2d::ccArray *data; // x2\n  char *arr; // x21\n  __int64 v6; // x1\n  char *v7; // x24\n  GameObject *v8; // x19\n  GameObject_vtbl *v9; // x2\n  void (__fastcall *setStartPos)(GameObject *__hidden, cocos2d::CCPoint); // x28\n  char *v11; // x0\n  GJBaseGameLayer_vtbl *v12; // x2\n  void (__fastcall *addToSection)(GJBaseGameLayer *__hidden, GameObject *); // x2\n  std::__detail::_Hash_node_base *M_nxt; // x0\n  std::__detail::_Hash_node_base *v15; // x19\n  int m_uniqueID; // [xsp+6Ch] [xbp+6Ch] BYREF\n  cocos2d::CCPoint v17; // [xsp+70h] [xbp+70h] BYREF\n\n  m_uiObjects = a1->m_uiObjects;\n  p_m_uiObjectPositions = &a1->m_uiObjectPositions;\n  if ( m_uiObjects )\n  {\n    data = m_uiObjects->data;\n    p_m_uiObjectPositions = &a1->m_uiObjectPositions;\n    if ( data->num )\n    {\n      arr = (char *)data->arr;\n      v6 = 8LL * data->num - 8;\n      v7 = &arr[v6];\n      if ( arr <= &arr[v6] )\n      {\n        v8 = *(GameObject **)arr;\n        if ( *(_QWORD *)arr )\n        {\n          do\n          {\n            v9 = v8->CCSpritePlus::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n            m_uniqueID = v8->m_uniqueID;\n            arr += 8;\n            setStartPos = v9->setStartPos;\n            v11 = std::__detail::_Map_base<int,std::pair<int const,cocos2d::CCPoint>,std::allocator<std::pair<int const,cocos2d::CCPoint>>,std::__detail::_Select1st,std::equal_to<int>,std::hash<int>,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits<false,false,true>,true>::operator[](\n                    (__int64)&a1->m_uiObjectPositions,\n                    &m_uniqueID);\n            cocos2d::CCPoint::CCPoint(&v17, (const cocos2d::CCPoint *)v11);\n            ((void (__fastcall *)(GameObject *, cocos2d::CCPoint *))setStartPos)(v8, &v17);\n            v8->deactivateObject(v8, 1);\n            v12 = a1->cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n            v8->m_outerSectionIndex = 0;\n            addToSection = v12->addToSection;\n            v8->m_isUIObject = 0;\n            addToSection(a1, v8);\n            cocos2d::CCDictionary::setObject(a1->m_objectsToDeactivate, v8, (unsigned int)v8->m_uniqueID);\n            v8->m_unk3ee = 1;\n            if ( v7 < arr )\n              break;\n            v8 = *(GameObject **)arr;\n          }\n          while ( *(_QWORD *)arr );\n          m_uiObjects = a1->m_uiObjects;\n        }\n      }\n    }\n  }\n  cocos2d::CCArray::removeAllObjects(m_uiObjects);\n  M_nxt = a1->m_uiObjectPositions._M_h._M_before_begin._M_nxt;\n  if ( M_nxt )\n  {\n    do\n    {\n      v15 = M_nxt->_M_nxt;\n      operator delete(M_nxt);\n      M_nxt = v15;\n    }\n    while ( v15 );\n  }\n  memset(a1->m_uiObjectPositions._M_h._M_buckets, 0, 8 * p_m_uiObjectPositions->_M_h._M_bucket_count);\n  p_m_uiObjectPositions->_M_h._M_element_count = 0;\n  p_m_uiObjectPositions->_M_h._M_before_begin._M_nxt = nullptr;\n  a1->m_calcCollisionBlockObjects2.m_finish = a1->m_calcCollisionBlockObjects2.m_start;\n  a1->m_calcCollisionBlockObjects2Size = 0;\n}", "assembly": "; \n; GJBaseGameLayer::restoreAllUIObjects from 0x87831c to 0x87849c (384 bytes)\n; \n; 2 xrefs:\n; > LevelEditorLayer::onStopPlaytest @ 0x662818\n; > <???> @ 0x41298\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nSTP             X29, X30, [SP,#var_80]!                                ; +0x0, 0x87831c\nMOV             X29, SP                                                ; +0x4, 0x878320\nSTP             X25, X26, [SP,#0x80+var_40]                            ; +0x8, 0x878324\nADRP            X25, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x878328\nSTP             X19, X20, [SP,#0x80+var_70]                            ; +0x10, 0x87832c\nMOV             X20, X0                                                ; +0x14, 0x878330\nLDR             X0, [X0,#0x3548]                                       ; +0x18, 0x878334\nLDR             X1, [X25,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1c, 0x878338\nSTP             X23, X24, [SP,#0x80+var_50]                            ; +0x20, 0x87833c\nSTP             X21, X22, [SP,#0x80+var_60]                            ; +0x24, 0x878340\nLDR             X1, [X1]                                               ; +0x28, 0x878344\nADD             X23, X20, #0x938                                       ; +0x2c, 0x878348\nSTP             X27, X28, [SP,#0x80+var_30]                            ; +0x30, 0x87834c\nSTR             X1, [X29,#0x80+var_8]                                  ; +0x34, 0x878350\nCBZ             X0, loc_878424                                         ; +0x38, 0x878354\nLDR             X2, [X0,#0x38]                                         ; +0x3c, 0x878358\nADD             X23, X20, #0x938                                       ; +0x40, 0x87835c\nLDR             W1, [X2]                                               ; +0x44, 0x878360\nCBZ             W1, loc_878424                                         ; +0x48, 0x878364\nLDR             X21, [X2,#0x10]                                        ; +0x4c, 0x878368\nMOV             X3, #0xFFFFFFFFFFFFFFF8                                ; +0x50, 0x87836c\nADD             X1, X3, W1,UXTW#3                                      ; +0x54, 0x878370\nADD             X24, X21, X1                                           ; +0x58, 0x878374\nCMP             X21, X24                                               ; +0x5c, 0x878378\nB.HI            loc_878424                                             ; +0x60, 0x87837c\nLDR             X19, [X21]                                             ; +0x64, 0x878380\nCBZ             X19, loc_878424                                        ; +0x68, 0x878384\nADD             X27, X29, #0x80+var_14                                 ; +0x6c, 0x878388\nADD             X22, X29, #0x80+var_10                                 ; +0x70, 0x87838c\nMOV             W26, #1                                                ; +0x74, 0x878390\nLDR             W3, [X19,#0x384]                                       ; +0x78, 0x878394\nMOV             X1, X27                                                ; +0x7c, 0x878398\nLDR             X2, [X19]                                              ; +0x80, 0x87839c\nMOV             X0, X23                                                ; +0x84, 0x8783a0\nSTR             W3, [X29,#0x80+var_14]                                 ; +0x88, 0x8783a4\nADD             X21, X21, #8                                           ; +0x8c, 0x8783a8\nLDR             X28, [X2,#0x548]                                       ; +0x90, 0x8783ac\nBL              _ZNSt8__detail9_Map_baseIiSt4pairIKiN7cocos2d7CCPointEESaIS5_ENS_10_Select1stESt8equal_toIiESt4hashIiENS_18_Mod_range_hashingENS_20_Default_ranged_hashENS_20_Prime_rehash_policyENS_17_Hashtable_traitsILb0ELb0ELb1EEELb1EEixEOi; std::__detail::_Map_base<int,std::pair<int const,cocos2d::CCPoint>,std::allocator<std::pair<int const,cocos2d::CCPoint>>,std::__detail::_Select1st,std::equal_to<int>,std::hash<int>,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits<false,false,true>,true>::operator[](int &&) ; +0x94, 0x8783b0\nMOV             X1, X0; cocos2d::CCPoint *                             ; +0x98, 0x8783b4\nMOV             X0, X22; this                                          ; +0x9c, 0x8783b8\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0xa0, 0x8783bc\nMOV             X0, X19                                                ; +0xa4, 0x8783c0\nMOV             X1, X22                                                ; +0xa8, 0x8783c4\nBLR             X28                                                    ; +0xac, 0x8783c8\nLDR             X2, [X19]                                              ; +0xb0, 0x8783cc\nMOV             X0, X19                                                ; +0xb4, 0x8783d0\nMOV             W1, #1                                                 ; +0xb8, 0x8783d4\nLDR             X2, [X2,#0x510]                                        ; +0xbc, 0x8783d8\nBLR             X2                                                     ; +0xc0, 0x8783dc\nLDR             X2, [X20]                                              ; +0xc4, 0x8783e0\nMOV             X0, X20                                                ; +0xc8, 0x8783e4\nMOV             X1, X19                                                ; +0xcc, 0x8783e8\nSTR             WZR, [X19,#0x274]                                      ; +0xd0, 0x8783ec\nLDR             X2, [X2,#0x510]                                        ; +0xd4, 0x8783f0\nSTRB            WZR, [X19,#0x531]                                      ; +0xd8, 0x8783f4\nBLR             X2                                                     ; +0xdc, 0x8783f8\nLDR             X0, [X20,#0x1078]; this                                ; +0xe0, 0x8783fc\nMOV             X1, X19; cocos2d::CCObject *                           ; +0xe4, 0x878400\nLDR             W2, [X19,#0x384]; __int64                              ; +0xe8, 0x878404\nBL              _ZN7cocos2d12CCDictionary9setObjectEPNS_8CCObjectEl; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,long) ; +0xec, 0x878408\nSTRB            W26, [X19,#0x3D6]                                      ; +0xf0, 0x87840c\nCMP             X24, X21                                               ; +0xf4, 0x878410\nB.CC            loc_878420                                             ; +0xf8, 0x878414\nLDR             X19, [X21]                                             ; +0xfc, 0x878418\nCBNZ            X19, loc_878394                                        ; +0x100, 0x87841c\nLDR             X0, [X20,#0x3548]; this                                ; +0x104, 0x878420\nBL              _ZN7cocos2d7CCArray16removeAllObjectsEv; cocos2d::CCArray::removeAllObjects(void) ; +0x108, 0x878424\nLDR             X0, [X20,#0x948]; p                                    ; +0x10c, 0x878428\nCBZ             X0, loc_878440                                         ; +0x110, 0x87842c\nLDR             X19, [X0]                                              ; +0x114, 0x878430\nBL              _ZdlPv; operator delete(void *)                        ; +0x118, 0x878434\nMOV             X0, X19                                                ; +0x11c, 0x878438\nCBNZ            X19, loc_878430                                        ; +0x120, 0x87843c\nLDR             X2, [X23,#8]                                           ; +0x124, 0x878440\nMOV             W1, #0; int                                            ; +0x128, 0x878444\nLDR             X0, [X20,#0x938]; void *                               ; +0x12c, 0x878448\nLSL             X2, X2, #3; size_t                                     ; +0x130, 0x87844c\nBL              .memset                                                ; +0x134, 0x878450\nSTR             XZR, [X23,#0x18]                                       ; +0x138, 0x878454\nSTR             XZR, [X23,#0x10]                                       ; +0x13c, 0x878458\nLDR             X0, [X20,#0x3608]                                      ; +0x140, 0x87845c\nSTR             X0, [X20,#0x3610]                                      ; +0x144, 0x878460\nSTR             WZR, [X20,#0x3620]                                     ; +0x148, 0x878464\nLDR             X19, [X29,#0x80+var_8]                                 ; +0x14c, 0x878468\nLDR             X25, [X25,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x150, 0x87846c\nLDR             X0, [X25]                                              ; +0x154, 0x878470\nCMP             X19, X0                                                ; +0x158, 0x878474\nB.NE            loc_878498                                             ; +0x15c, 0x878478\nLDP             X19, X20, [SP,#0x80+var_70]                            ; +0x160, 0x87847c\nLDP             X21, X22, [SP,#0x80+var_60]                            ; +0x164, 0x878480\nLDP             X23, X24, [SP,#0x80+var_50]                            ; +0x168, 0x878484\nLDP             X25, X26, [SP,#0x80+var_40]                            ; +0x16c, 0x878488\nLDP             X27, X28, [SP,#0x80+var_30]                            ; +0x170, 0x87848c\nLDP             X29, X30, [SP+0x80+var_80],#0x80                       ; +0x174, 0x878490\nRET                                                                    ; +0x178, 0x878494\nBL              .__stack_chk_fail                                      ; +0x17c, 0x878498", "xrefs": ["LevelEditorLayer::onStopPlaytest @ 0x662818", "<???> @ 0x41298"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}