{"type": "func", "start": 8881308, "end": 8881668, "name": "GJBaseGameLayer::addUIObject", "pseudocode": "// \n// GJBaseGameLayer::addUIObject from 0x87849c to 0x878604 (360 bytes)\n// \n// 3 xrefs:\n// > GJBaseGameLayer::positionUIObjects @ 0x878840\n// > GJBaseGameLayer::positionUIObjects @ 0x878990\n// > <???> @ 0x6b9d0\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::addUIObject(GJBaseGameLayer *a1, GameObject *a2)\n{\n  GameObject *v2; // x19\n  char *v4; // x23\n  float v5; // s0\n  float v6; // s1\n  cocos2d::CCArray *m_uiObjects; // x0\n  GameObject **m_start; // x3\n  GameObject **m_finish; // x2\n  int m_calcCollisionBlockObjects2Size; // w1\n  GameObject **v11; // x0\n  int m_uniqueID; // [xsp+4Ch] [xbp+4Ch] BYREF\n  GameObject *v13; // [xsp+50h] [xbp+50h] BYREF\n\n  v2 = a2;\n  if ( !a2->m_isUIObject )\n  {\n    m_uniqueID = a2->m_uniqueID;\n    v4 = 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    v5 = ((float (__fastcall *)(GameObject *))v2->getStartPos)(v2);\n    cocos2d::CCPoint::operator=(v4, v5, v6);\n    GJBaseGameLayer::removeObjectFromSection(a1, v2);\n    v2->deactivateObject(v2, 1);\n    m_uiObjects = a1->m_uiObjects;\n    v2->m_outerSectionIndex = -1;\n    v2->m_isUIObject = 1;\n    cocos2d::CCArray::addObject(m_uiObjects, v2);\n    if ( v2->m_objectID == 1816 )\n    {\n      m_start = a1->m_calcCollisionBlockObjects2.m_start;\n      m_finish = a1->m_calcCollisionBlockObjects2.m_finish;\n      v13 = v2;\n      m_calcCollisionBlockObjects2Size = a1->m_calcCollisionBlockObjects2Size;\n      if ( m_finish - m_start > (unsigned __int64)m_calcCollisionBlockObjects2Size )\n      {\n        m_start[m_calcCollisionBlockObjects2Size] = v2;\n        v2 = v13;\n      }\n      else if ( m_finish == a1->m_calcCollisionBlockObjects2.m_reserveEnd )\n      {\n        std::vector<EffectGameObject *>::_M_emplace_back_aux<EffectGameObject * const&>(\n          (__int64)&a1->m_calcCollisionBlockObjects2,\n          &v13);\n        v2 = v13;\n        m_calcCollisionBlockObjects2Size = a1->m_calcCollisionBlockObjects2Size;\n      }\n      else\n      {\n        if ( m_finish )\n        {\n          *m_finish = v2;\n          v11 = a1->m_calcCollisionBlockObjects2.m_finish;\n          v2 = v13;\n        }\n        else\n        {\n          v11 = nullptr;\n        }\n        a1->m_calcCollisionBlockObjects2.m_finish = v11 + 1;\n      }\n      a1->m_calcCollisionBlockObjects2Size = m_calcCollisionBlockObjects2Size + 1;\n      v2->m_innerSectionIndex = m_calcCollisionBlockObjects2Size;\n    }\n  }\n}", "assembly": "; \n; GJBaseGameLayer::addUIObject from 0x87849c to 0x878604 (360 bytes)\n; \n; 3 xrefs:\n; > GJBaseGameLayer::positionUIObjects @ 0x878840\n; > GJBaseGameLayer::positionUIObjects @ 0x878990\n; > <???> @ 0x6b9d0\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_60]!                                ; +0x0, 0x87849c\nMOV             X29, SP                                                ; +0x4, 0x8784a0\nSTP             X19, X20, [SP,#0x60+var_50]                            ; +0x8, 0x8784a4\nADRP            X20, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x8784a8\nMOV             X19, X1                                                ; +0x10, 0x8784ac\nSTP             X21, X22, [SP,#0x60+var_40]                            ; +0x14, 0x8784b0\nMOV             X21, X0                                                ; +0x18, 0x8784b4\nSTR             X23, [SP,#0x60+var_30]                                 ; +0x1c, 0x8784b8\nLDR             X1, [X20,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x20, 0x8784bc\nLDRB            W0, [X19,#0x531]                                       ; +0x24, 0x8784c0\nLDR             X1, [X1]                                               ; +0x28, 0x8784c4\nSTR             X1, [X29,#0x60+var_8]                                  ; +0x2c, 0x8784c8\nCBZ             W0, loc_8784F8                                         ; +0x30, 0x8784cc\nLDR             X20, [X20,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x34, 0x8784d0\nLDR             X1, [X29,#0x60+var_8]                                  ; +0x38, 0x8784d4\nLDR             X0, [X20]                                              ; +0x3c, 0x8784d8\nCMP             X1, X0                                                 ; +0x40, 0x8784dc\nB.NE            loc_878600                                             ; +0x44, 0x8784e0\nLDP             X19, X20, [SP,#0x60+var_50]                            ; +0x48, 0x8784e4\nLDP             X21, X22, [SP,#0x60+var_40]                            ; +0x4c, 0x8784e8\nLDR             X23, [SP,#0x60+var_30]                                 ; +0x50, 0x8784ec\nLDP             X29, X30, [SP+0x60+var_60],#0x60                       ; +0x54, 0x8784f0\nRET                                                                    ; +0x58, 0x8784f4\nADD             X1, X29, #0x60+arg_0                                   ; +0x5c, 0x8784f8\nLDR             W2, [X19,#0x384]                                       ; +0x60, 0x8784fc\nADD             X0, X21, #0x938                                        ; +0x64, 0x878500\nADD             X22, X29, #0x60+var_10                                 ; +0x68, 0x878504\nSTR             W2, [X1,#-0x14]!                                       ; +0x6c, 0x878508\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 &&) ; +0x70, 0x87850c\nMOV             X23, X0                                                ; +0x74, 0x878510\nLDR             X1, [X19]                                              ; +0x78, 0x878514\nMOV             X8, X22                                                ; +0x7c, 0x878518\nMOV             X0, X19                                                ; +0x80, 0x87851c\nLDR             X1, [X1,#0x708]                                        ; +0x84, 0x878520\nBLR             X1                                                     ; +0x88, 0x878524\nMOV             X1, X22                                                ; +0x8c, 0x878528\nMOV             X0, X23                                                ; +0x90, 0x87852c\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0x94, 0x878530\nMOV             X0, X21; this                                          ; +0x98, 0x878534\nMOV             X1, X19; GameObject *                                  ; +0x9c, 0x878538\nBL              _ZN15GJBaseGameLayer23removeObjectFromSectionEP10GameObject; GJBaseGameLayer::removeObjectFromSection(GameObject *) ; +0xa0, 0x87853c\nLDR             X2, [X19]                                              ; +0xa4, 0x878540\nMOV             X0, X19                                                ; +0xa8, 0x878544\nMOV             W1, #1                                                 ; +0xac, 0x878548\nLDR             X2, [X2,#0x510]                                        ; +0xb0, 0x87854c\nBLR             X2                                                     ; +0xb4, 0x878550\nLDR             X0, [X21,#0x3548]; this                                ; +0xb8, 0x878554\nMOV             W1, #0xFFFFFFFF                                        ; +0xbc, 0x878558\nMOV             W2, #1                                                 ; +0xc0, 0x87855c\nSTR             W1, [X19,#0x274]                                       ; +0xc4, 0x878560\nSTRB            W2, [X19,#0x531]                                       ; +0xc8, 0x878564\nMOV             X1, X19; cocos2d::CCObject *                           ; +0xcc, 0x878568\nBL              _ZN7cocos2d7CCArray9addObjectEPNS_8CCObjectE; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0xd0, 0x87856c\nLDR             W0, [X19,#0x3F4]                                       ; +0xd4, 0x878570\nCMP             W0, #0x718                                             ; +0xd8, 0x878574\nB.NE            loc_8784D0                                             ; +0xdc, 0x878578\nLDR             X3, [X21,#0x3608]                                      ; +0xe0, 0x87857c\nLDR             X2, [X21,#0x3610]                                      ; +0xe4, 0x878580\nSTR             X19, [X29,#0x60+var_10]                                ; +0xe8, 0x878584\nSUB             X0, X2, X3                                             ; +0xec, 0x878588\nLDR             W1, [X21,#0x3620]                                      ; +0xf0, 0x87858c\nASR             X0, X0, #3                                             ; +0xf4, 0x878590\nCMP             X0, W1,SXTW                                            ; +0xf8, 0x878594\nB.HI            loc_8785D8                                             ; +0xfc, 0x878598\nADD             X3, X21, #3,LSL#12                                     ; +0x100, 0x87859c\nADD             X0, X3, #0x608                                         ; +0x104, 0x8785a0\nLDR             X4, [X0,#0x10]                                         ; +0x108, 0x8785a4\nCMP             X2, X4                                                 ; +0x10c, 0x8785a8\nB.EQ            loc_8785EC                                             ; +0x110, 0x8785ac\nCBZ             X2, loc_8785E4                                         ; +0x114, 0x8785b0\nSTR             X19, [X2]                                              ; +0x118, 0x8785b4\nLDR             X0, [X0,#8]                                            ; +0x11c, 0x8785b8\nLDR             X19, [X29,#0x60+var_10]                                ; +0x120, 0x8785bc\nADD             X0, X0, #8                                             ; +0x124, 0x8785c0\nSTR             X0, [X3,#0x610]                                        ; +0x128, 0x8785c4\nADD             W0, W1, #1                                             ; +0x12c, 0x8785c8\nSTR             W0, [X21,#0x3620]                                      ; +0x130, 0x8785cc\nSTR             W1, [X19,#0x270]                                       ; +0x134, 0x8785d0\nB               loc_8784D0                                             ; +0x138, 0x8785d4\nSTR             X19, [X3,W1,SXTW#3]                                    ; +0x13c, 0x8785d8\nLDR             X19, [X29,#0x60+var_10]                                ; +0x140, 0x8785dc\nB               loc_8785C8                                             ; +0x144, 0x8785e0\nMOV             X0, #0                                                 ; +0x148, 0x8785e4\nB               loc_8785C0                                             ; +0x14c, 0x8785e8\nMOV             X1, X22                                                ; +0x150, 0x8785ec\nBL              _ZNSt6vectorIP16EffectGameObjectSaIS1_EE19_M_emplace_back_auxIJRKS1_EEEvDpOT_; std::vector<EffectGameObject *>::_M_emplace_back_aux<EffectGameObject * const&>(EffectGameObject * const&) ; +0x154, 0x8785f0\nLDR             X19, [X29,#0x60+var_10]                                ; +0x158, 0x8785f4\nLDR             W1, [X21,#0x3620]                                      ; +0x15c, 0x8785f8\nB               loc_8785C8                                             ; +0x160, 0x8785fc\nBL              .__stack_chk_fail                                      ; +0x164, 0x878600", "xrefs": ["GJBaseGameLayer::positionUIObjects @ 0x878840", "GJBaseGameLayer::positionUIObjects @ 0x878990", "<???> @ 0x6b9d0"], "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"}