{"type": "func", "start": 4739576, "end": 4739746, "name": "EditorUI::findSnapObject", "pseudocode": "// \n// EditorUI::findSnapObject from 0x4851f8 to 0x4852a2 (170 bytes)\n// \n// 2 xrefs:\n// > EditorUI::startFreeMoveTouch @ 0x6efece\n// > EditorUI::startFreeMoveTouch @ 0x6effdc\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:49:24 +0000\n// \n\nunsigned int __fastcall EditorUI::findSnapObject(cocos2d::CCArray **a1, const cocos2d::CCPoint *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  const cocos2d::CCPoint *v9; // r10\n  EditorUI *v10; // r0\n  _BYTE v13[20]; // [sp+10h] [bp-2Ch] BYREF\n  _BYTE v14[16]; // [sp+24h] [bp-18h] BYREF\n\n  v5 = (cocos2d::CCArray *)cocos2d::CCArray::count(a1[167]);\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[167]) )\n    {\n      v9 = (const cocos2d::CCPoint *)cocos2d::CCArray::objectAtIndex(a1[167], v7);\n      LevelEditorLayer::getObjectRect((LevelEditorLayer *)v13, a1[236], v9, 0, 0);\n      LevelEditorLayer::getObjectRect((LevelEditorLayer *)v14, a1[236], v9, 0, 0);\n      if ( cocos2d::CCRect::containsPoint((cocos2d::CCRect *)v14, a2) )\n        cocos2d::CCArray::addObject(v8, v9);\n      ++v7;\n    }\n    v10 = (EditorUI *)a1;\n    v6 = v8;\n  }\n  else\n  {\n    v10 = (EditorUI *)a1;\n  }\n  return EditorUI::findSnapObject(v10, v6, a3);\n}", "assembly": "; \n; EditorUI::findSnapObject from 0x4851f8 to 0x4852a2 (170 bytes)\n; \n; 2 xrefs:\n; > EditorUI::startFreeMoveTouch @ 0x6efece\n; > EditorUI::startFreeMoveTouch @ 0x6effdc\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:49:24 +0000\n; \nPUSH.W          {R4-R11,LR}                                            ; +0x0, 0x4851f8\nSUB             SP, SP, #0x3C                                          ; +0x4, 0x4851fc\nLDR             R5, =(__stack_chk_guard_ptr - 0x48520C)                ; +0x6, 0x4851fe\nMOV             R4, R0                                                 ; +0x8, 0x485200\nLDR.W           R0, [R0,#0x29C]; this                                  ; +0xa, 0x485202\nMOV             R6, R2                                                 ; +0xe, 0x485206\nADD             R5, PC; __stack_chk_guard_ptr                          ; +0x10, 0x485208\nLDR             R5, [R5]; __stack_chk_guard                            ; +0x12, 0x48520a\nSTR             R1, [SP,#0x3C+var_34]                                  ; +0x14, 0x48520c\nLDR             R3, [R5]                                               ; +0x16, 0x48520e\nSTR             R3, [SP,#0x3C+var_8]                                   ; +0x18, 0x485210\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x1a, 0x485212\nSTR             R5, [SP,#0x3C+var_30]                                  ; +0x1e, 0x485216\nMOV             R1, R0; cocos2d::CCArray *                             ; +0x20, 0x485218\nCBZ             R0, loc_485286                                         ; +0x22, 0x48521a\nBL              _ZN7cocos2d7CCArray6createEv; cocos2d::CCArray::create(void) ; +0x24, 0x48521c\nMOVS            R5, #0                                                 ; +0x28, 0x485220\nADD.W           R11, SP, #0x3C+var_2C                                  ; +0x2a, 0x485222\nADD.W           R9, SP, #0x3C+var_18                                   ; +0x2e, 0x485226\nMOV             R8, R5                                                 ; +0x32, 0x48522a\nMOV             R7, R0                                                 ; +0x34, 0x48522c\nLDR.W           R0, [R4,#0x29C]; this                                  ; +0x36, 0x48522e\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x3a, 0x485232\nCMP             R5, R0                                                 ; +0x3e, 0x485236\nBCS             loc_485280                                             ; +0x40, 0x485238\nMOV             R1, R5; unsigned int                                   ; +0x42, 0x48523a\nLDR.W           R0, [R4,#0x29C]; this                                  ; +0x44, 0x48523c\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x48, 0x485240\nLDR.W           R1, [R4,#0x3B0]; GameObject *                          ; +0x4c, 0x485244\nMOVS            R3, #0; bool                                           ; +0x50, 0x485248\nSTR.W           R8, [SP,#0x3C+var_3C]                                  ; +0x52, 0x48524a\nMOV             R10, R0                                                ; +0x56, 0x48524e\nMOV             R0, R11; this                                          ; +0x58, 0x485250\nMOV             R2, R10; bool                                          ; +0x5a, 0x485252\nBL              _ZN16LevelEditorLayer13getObjectRectEP10GameObjectbb; LevelEditorLayer::getObjectRect(GameObject *,bool,bool) ; +0x5c, 0x485254\nMOV             R0, R9; this                                           ; +0x60, 0x485258\nLDR.W           R1, [R4,#0x3B0]; GameObject *                          ; +0x62, 0x48525a\nMOV             R2, R10; bool                                          ; +0x66, 0x48525e\nSTR.W           R8, [SP,#0x3C+var_3C]                                  ; +0x68, 0x485260\nMOVS            R3, #0; bool                                           ; +0x6c, 0x485264\nBL              _ZN16LevelEditorLayer13getObjectRectEP10GameObjectbb; LevelEditorLayer::getObjectRect(GameObject *,bool,bool) ; +0x6e, 0x485266\nMOV             R0, R9; this                                           ; +0x72, 0x48526a\nLDR             R1, [SP,#0x3C+var_34]; cocos2d::CCPoint *              ; +0x74, 0x48526c\nBL              _ZNK7cocos2d6CCRect13containsPointERKNS_7CCPointE; cocos2d::CCRect::containsPoint(cocos2d::CCPoint const&) ; +0x76, 0x48526e\nCBZ             R0, loc_48527C                                         ; +0x7a, 0x485272\nMOV             R0, R7; this                                           ; +0x7c, 0x485274\nMOV             R1, R10; cocos2d::CCObject *                           ; +0x7e, 0x485276\nBL              _ZN7cocos2d7CCArray9addObjectEPNS_8CCObjectE; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x80, 0x485278\nADDS            R5, #1                                                 ; +0x84, 0x48527c\nB               loc_48522E                                             ; +0x86, 0x48527e\nMOV             R0, R4                                                 ; +0x88, 0x485280\nMOV             R1, R7                                                 ; +0x8a, 0x485282\nB               loc_485288                                             ; +0x8c, 0x485284\nMOV             R0, R4; this                                           ; +0x8e, 0x485286\nMOV             R2, R6; float                                          ; +0x90, 0x485288\nBL              _ZN8EditorUI14findSnapObjectEPN7cocos2d7CCArrayEf; EditorUI::findSnapObject(cocos2d::CCArray *,float) ; +0x92, 0x48528a\nLDR             R3, [SP,#0x3C+var_30]                                  ; +0x96, 0x48528e\nLDR             R2, [SP,#0x3C+var_8]                                   ; +0x98, 0x485290\nLDR             R3, [R3]                                               ; +0x9a, 0x485292\nCMP             R2, R3                                                 ; +0x9c, 0x485294\nBEQ             loc_48529C                                             ; +0x9e, 0x485296\nBLX             __stack_chk_fail                                       ; +0xa0, 0x485298\nADD             SP, SP, #0x3C ; '<'                                    ; +0xa4, 0x48529c\nPOP.W           {R4-R11,PC}                                            ; +0xa6, 0x48529e", "xrefs": ["EditorUI::startFreeMoveTouch @ 0x6efece", "EditorUI::startFreeMoveTouch @ 0x6effdc"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}