{"type": "func", "start": 3694600, "end": 3694770, "name": "EditorUI::findSnapObject", "pseudocode": "// \n// EditorUI::findSnapObject from 0x386008 to 0x3860b2 (170 bytes)\n// \n// 2 xrefs:\n// > EditorUI::ccTouchBegan @ 0x3a6bec\n// > EditorUI::ccTouchBegan @ 0x3a6d98\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 EditorUI::findSnapObject(EditorUI *a1, cocos2d::CCArray *a2, float a3)\n{\n  cocos2d::CCArray *v5; // r0\n  cocos2d::CCArray *v6; // r1\n  unsigned int v7; // r5\n  cocos2d::CCArray *v8; // r7\n  GameObject *v9; // r10\n  EditorUI *v10; // r0\n  cocos2d::CCRect v12; // [sp+10h] [bp-2Ch] BYREF\n  cocos2d::CCRect v13; // [sp+24h] [bp-18h] BYREF\n\n  v5 = (cocos2d::CCArray *)cocos2d::CCArray::count(a1->m_selectedObjects);\n  v6 = v5;\n  if ( v5 )\n  {\n    v7 = 0;\n    v8 = (cocos2d::CCArray *)cocos2d::CCArray::create(v5);\n    while ( v7 < cocos2d::CCArray::count(a1->m_selectedObjects) )\n    {\n      v9 = (GameObject *)cocos2d::CCArray::objectAtIndex(a1->m_selectedObjects, v7);\n      LevelEditorLayer::getObjectRect(&v12, a1->m_editorLayer, v9, 0, 0);\n      LevelEditorLayer::getObjectRect(&v13, a1->m_editorLayer, v9, 0, 0);\n      if ( cocos2d::CCRect::containsPoint(&v13, (const cocos2d::CCPoint *)a2) )\n        cocos2d::CCArray::addObject(v8, v9);\n      ++v7;\n    }\n    v10 = a1;\n    v6 = v8;\n  }\n  else\n  {\n    v10 = a1;\n  }\n  EditorUI::findSnapObject(v10, v6, a3);\n}", "assembly": "; \n; EditorUI::findSnapObject from 0x386008 to 0x3860b2 (170 bytes)\n; \n; 2 xrefs:\n; > EditorUI::ccTouchBegan @ 0x3a6bec\n; > EditorUI::ccTouchBegan @ 0x3a6d98\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\nPUSH.W          {R4-R11,LR}                                            ; +0x0, 0x386008\nSUB             SP, SP, #0x3C                                          ; +0x4, 0x38600c\nLDR             R5, =(__stack_chk_guard_ptr - 0x38601C)                ; +0x6, 0x38600e\nMOV             R4, R0                                                 ; +0x8, 0x386010\nLDR.W           R0, [R0,#0x260]; this                                  ; +0xa, 0x386012\nMOV             R6, R2                                                 ; +0xe, 0x386016\nADD             R5, PC; __stack_chk_guard_ptr                          ; +0x10, 0x386018\nLDR             R5, [R5]; __stack_chk_guard                            ; +0x12, 0x38601a\nSTR             R1, [SP,#0x3C+var_34]                                  ; +0x14, 0x38601c\nLDR             R3, [R5]                                               ; +0x16, 0x38601e\nSTR             R3, [SP,#0x3C+var_8]                                   ; +0x18, 0x386020\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x1a, 0x386022\nSTR             R5, [SP,#0x3C+var_30]                                  ; +0x1e, 0x386026\nMOV             R1, R0; cocos2d::CCArray *                             ; +0x20, 0x386028\nCBZ             R0, loc_386096                                         ; +0x22, 0x38602a\nBL              _ZN7cocos2d7CCArray6createEv; cocos2d::CCArray::create(void) ; +0x24, 0x38602c\nMOVS            R5, #0                                                 ; +0x28, 0x386030\nADD.W           R11, SP, #0x3C+var_2C                                  ; +0x2a, 0x386032\nADD.W           R9, SP, #0x3C+var_18                                   ; +0x2e, 0x386036\nMOV             R8, R5                                                 ; +0x32, 0x38603a\nMOV             R7, R0                                                 ; +0x34, 0x38603c\nLDR.W           R0, [R4,#0x260]; this                                  ; +0x36, 0x38603e\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x3a, 0x386042\nCMP             R5, R0                                                 ; +0x3e, 0x386046\nBCS             loc_386090                                             ; +0x40, 0x386048\nMOV             R1, R5; unsigned int                                   ; +0x42, 0x38604a\nLDR.W           R0, [R4,#0x260]; this                                  ; +0x44, 0x38604c\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x48, 0x386050\nLDR.W           R1, [R4,#0x340]; GameObject *                          ; +0x4c, 0x386054\nMOVS            R3, #0; bool                                           ; +0x50, 0x386058\nSTR.W           R8, [SP,#0x3C+var_3C]                                  ; +0x52, 0x38605a\nMOV             R10, R0                                                ; +0x56, 0x38605e\nMOV             R0, R11; this                                          ; +0x58, 0x386060\nMOV             R2, R10; bool                                          ; +0x5a, 0x386062\nBL              _ZN16LevelEditorLayer13getObjectRectEP10GameObjectbb; LevelEditorLayer::getObjectRect(GameObject *,bool,bool) ; +0x5c, 0x386064\nMOV             R0, R9; this                                           ; +0x60, 0x386068\nLDR.W           R1, [R4,#0x340]; GameObject *                          ; +0x62, 0x38606a\nMOV             R2, R10; bool                                          ; +0x66, 0x38606e\nSTR.W           R8, [SP,#0x3C+var_3C]                                  ; +0x68, 0x386070\nMOVS            R3, #0; bool                                           ; +0x6c, 0x386074\nBL              _ZN16LevelEditorLayer13getObjectRectEP10GameObjectbb; LevelEditorLayer::getObjectRect(GameObject *,bool,bool) ; +0x6e, 0x386076\nMOV             R0, R9; this                                           ; +0x72, 0x38607a\nLDR             R1, [SP,#0x3C+var_34]; cocos2d::CCPoint *              ; +0x74, 0x38607c\nBL              _ZNK7cocos2d6CCRect13containsPointERKNS_7CCPointE; cocos2d::CCRect::containsPoint(cocos2d::CCPoint const&) ; +0x76, 0x38607e\nCBZ             R0, loc_38608C                                         ; +0x7a, 0x386082\nMOV             R0, R7; this                                           ; +0x7c, 0x386084\nMOV             R1, R10; cocos2d::CCObject *                           ; +0x7e, 0x386086\nBL              _ZN7cocos2d7CCArray9addObjectEPNS_8CCObjectE; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x80, 0x386088\nADDS            R5, #1                                                 ; +0x84, 0x38608c\nB               loc_38603E                                             ; +0x86, 0x38608e\nMOV             R0, R4                                                 ; +0x88, 0x386090\nMOV             R1, R7                                                 ; +0x8a, 0x386092\nB               loc_386098                                             ; +0x8c, 0x386094\nMOV             R0, R4; this                                           ; +0x8e, 0x386096\nMOV             R2, R6; float                                          ; +0x90, 0x386098\nBL              _ZN8EditorUI14findSnapObjectEPN7cocos2d7CCArrayEf; EditorUI::findSnapObject(cocos2d::CCArray *,float) ; +0x92, 0x38609a\nLDR             R3, [SP,#0x3C+var_30]                                  ; +0x96, 0x38609e\nLDR             R2, [SP,#0x3C+var_8]                                   ; +0x98, 0x3860a0\nLDR             R3, [R3]                                               ; +0x9a, 0x3860a2\nCMP             R2, R3                                                 ; +0x9c, 0x3860a4\nBEQ             loc_3860AC                                             ; +0x9e, 0x3860a6\nBLX             __stack_chk_fail                                       ; +0xa0, 0x3860a8\nADD             SP, SP, #0x3C ; '<'                                    ; +0xa4, 0x3860ac\nPOP.W           {R4-R11,PC}                                            ; +0xa6, 0x3860ae", "xrefs": ["EditorUI::ccTouchBegan @ 0x3a6bec", "EditorUI::ccTouchBegan @ 0x3a6d98"], "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"}