{"type": "func", "start": 3786580, "end": 3786926, "name": "EditorUI::activateScaleControl", "pseudocode": "// \n// EditorUI::activateScaleControl from 0x39c754 to 0x39c8ae (346 bytes)\n// \n// 0 xrefs:\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::activateScaleControl(EditorUI *a1, cocos2d::CCObject *a2)\n{\n  int v4; // r0\n  int m_senderTag; // r5\n  int v6; // r8\n  int v7; // r0\n  int v8; // r2\n  bool v9; // r3\n  PlayerObject *p_m_pivotPoint; // r0\n  cocos2d::CCPoint *v11; // r1\n  GJScaleControl *m_scaleControl; // r9\n  GJScaleControl *v13; // r9\n  void (__fastcall *setPosition)(cocos2d::CCNode *__hidden, const cocos2d::CCPoint *); // r10\n  GJScaleControl *v15; // r5\n  void (__fastcall *setScale)(cocos2d::CCNode *__hidden, float); // r7\n  float v17; // r0\n  cocos2d::CCPoint v18; // [sp+4h] [bp-14h] BYREF\n  cocos2d::CCPoint v19; // [sp+Ch] [bp-Ch] BYREF\n\n  if ( cocos2d::CCArray::count(a1->m_selectedObjects) || a1->m_selectedObject )\n  {\n    EditorUI::deactivateTransformControl(a1);\n    if ( !((int (__fastcall *)(GJScaleControl *))a1->m_scaleControl->isVisible)(a1->m_scaleControl)\n      || (v4 = a2->getTag(a2),\n          m_senderTag = a1->m_scaleControl->m_senderTag,\n          v6 = v4,\n          EditorUI::deactivateScaleControl(a1),\n          v6 != m_senderTag) )\n    {\n      if ( !((int (__fastcall *)(GJScaleControl *))a1->m_scaleControl->isVisible)(a1->m_scaleControl)\n        || a1->m_canActivateControls )\n      {\n        v7 = a2->getTag(a2);\n        EditorUI::updateEditButtonColor(a1, v7, (cocos2d::ccColor3B)-5855578);\n        a1->m_canActivateControls = 0;\n        if ( cocos2d::CCArray::count(a1->m_selectedObjects) )\n        {\n          EditorUI::getGroupCenter(&v19, a1, a1->m_selectedObjects, 0);\n          p_m_pivotPoint = (PlayerObject *)&a1->m_pivotPoint;\n          v11 = &v19;\n        }\n        else\n        {\n          v11 = (cocos2d::CCPoint *)a1->m_selectedObject->getPosition(a1->m_selectedObject);\n          p_m_pivotPoint = (PlayerObject *)&a1->m_pivotPoint;\n        }\n        cocos2d::CCPoint::operator=(p_m_pivotPoint, *(float *)&v11, v8, v9);\n        m_scaleControl = a1->m_scaleControl;\n        m_scaleControl->m_senderTag = a2->getTag(a2);\n        v13 = a1->m_scaleControl;\n        setPosition = v13->setPosition;\n        cocos2d::CCPoint::CCPoint(&v19, 0.0, 40.0);\n        cocos2d::CCPoint::operator+(&v18, &a1->m_pivotPoint, &v19);\n        setPosition(v13, &v18);\n        v15 = a1->m_scaleControl;\n        setScale = v15->setScale;\n        v17 = COERCE_FLOAT(((int (__fastcall *)(cocos2d::CCLayer *))a1->m_editorLayer->m_objectLayer->getScale)(a1->m_editorLayer->m_objectLayer));\n        ((void (__fastcall *)(GJScaleControl *, _DWORD))setScale)(v15, 1.0 / v17);\n        a1->m_scaleControl->setVisible(a1->m_scaleControl, 1);\n        a1->updateScaleControl(a1);\n      }\n    }\n  }\n}", "assembly": "; \n; EditorUI::activateScaleControl from 0x39c754 to 0x39c8ae (346 bytes)\n; \n; 0 xrefs:\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-R10,LR}                                            ; +0x0, 0x39c754\nSUB             SP, SP, #0x18                                          ; +0x4, 0x39c758\nLDR             R6, =(__stack_chk_guard_ptr - 0x39C768)                ; +0x6, 0x39c75a\nMOV             R4, R0                                                 ; +0x8, 0x39c75c\nLDR.W           R0, [R0,#0x260]; this                                  ; +0xa, 0x39c75e\nMOV             R7, R1                                                 ; +0xe, 0x39c762\nADD             R6, PC; __stack_chk_guard_ptr                          ; +0x10, 0x39c764\nLDR             R6, [R6]; __stack_chk_guard                            ; +0x12, 0x39c766\nLDR             R3, [R6]                                               ; +0x14, 0x39c768\nSTR             R3, [SP,#0x18+var_4]                                   ; +0x16, 0x39c76a\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x18, 0x39c76c\nCBNZ            R0, loc_39C77C                                         ; +0x1c, 0x39c770\nLDR.W           R3, [R4,#0x374]                                        ; +0x1e, 0x39c772\nCMP             R3, #0                                                 ; +0x22, 0x39c776\nBEQ.W           loc_39C89C                                             ; +0x24, 0x39c778\nMOV             R0, R4; this                                           ; +0x28, 0x39c77c\nBL              _ZN8EditorUI26deactivateTransformControlEv; EditorUI::deactivateTransformControl(void) ; +0x2a, 0x39c77e\nLDR.W           R0, [R4,#0x214]                                        ; +0x2e, 0x39c782\nLDR             R3, [R0]                                               ; +0x32, 0x39c786\nLDR.W           R3, [R3,#0xA8]                                         ; +0x34, 0x39c788\nBLX             R3                                                     ; +0x38, 0x39c78c\nCBZ             R0, loc_39C7AC                                         ; +0x3a, 0x39c78e\nLDR             R3, [R7]                                               ; +0x3c, 0x39c790\nMOV             R0, R7                                                 ; +0x3e, 0x39c792\nLDR             R3, [R3,#0x20]                                         ; +0x40, 0x39c794\nBLX             R3                                                     ; +0x42, 0x39c796\nLDR.W           R3, [R4,#0x214]                                        ; +0x44, 0x39c798\nLDR.W           R5, [R3,#0x17C]                                        ; +0x48, 0x39c79c\nMOV             R8, R0                                                 ; +0x4c, 0x39c7a0\nMOV             R0, R4; this                                           ; +0x4e, 0x39c7a2\nBL              _ZN8EditorUI22deactivateScaleControlEv; EditorUI::deactivateScaleControl(void) ; +0x50, 0x39c7a4\nCMP             R8, R5                                                 ; +0x54, 0x39c7a8\nBEQ             loc_39C89C                                             ; +0x56, 0x39c7aa\nLDR.W           R0, [R4,#0x214]                                        ; +0x58, 0x39c7ac\nLDR             R3, [R0]                                               ; +0x5c, 0x39c7b0\nLDR.W           R3, [R3,#0xA8]                                         ; +0x5e, 0x39c7b2\nBLX             R3                                                     ; +0x62, 0x39c7b6\nCBZ             R0, loc_39C7C2                                         ; +0x64, 0x39c7b8\nLDRB.W          R3, [R4,#0x210]                                        ; +0x66, 0x39c7ba\nCMP             R3, #0                                                 ; +0x6a, 0x39c7be\nBEQ             loc_39C89C                                             ; +0x6c, 0x39c7c0\nLDR             R3, [R7]                                               ; +0x6e, 0x39c7c2\nMOV             R0, R7                                                 ; +0x70, 0x39c7c4\nMOV.W           R9, #0                                                 ; +0x72, 0x39c7c6\nADD             R5, SP, #0x18+var_C                                    ; +0x76, 0x39c7ca\nADD.W           R8, R4, #0x208                                         ; +0x78, 0x39c7cc\nLDR             R3, [R3,#0x20]                                         ; +0x7c, 0x39c7d0\nBLX             R3                                                     ; +0x7e, 0x39c7d2\nMOV             R1, R0                                                 ; +0x80, 0x39c7d4\nLDR             R0, =(word_9AA83C - 0x39C7DC)                          ; +0x82, 0x39c7d6\nADD             R0, PC; word_9AA83C                                    ; +0x84, 0x39c7d8\nLDRB            R2, [R0,#(word_9AA83F+1 - 0x9AA83C)]                   ; +0x86, 0x39c7da\nLDRB            R3, [R0,#(word_9AA83F - 0x9AA83C)]                     ; +0x88, 0x39c7dc\nORR.W           R3, R3, R2,LSL#8                                       ; +0x8a, 0x39c7de\nLDRB            R2, [R0,#(byte_9AA841 - 0x9AA83C)]                     ; +0x8e, 0x39c7e2\nMOV             R0, R4                                                 ; +0x90, 0x39c7e4\nORR.W           R2, R3, R2,LSL#16                                      ; +0x92, 0x39c7e6\nBL              _ZN8EditorUI21updateEditButtonColorEiN7cocos2d10_ccColor3BE; EditorUI::updateEditButtonColor(int,cocos2d::_ccColor3B) ; +0x96, 0x39c7ea\nSTRB.W          R9, [R4,#0x210]                                        ; +0x9a, 0x39c7ee\nLDR.W           R0, [R4,#0x260]; this                                  ; +0x9e, 0x39c7f2\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0xa2, 0x39c7f6\nCBZ             R0, loc_39C810                                         ; +0xa6, 0x39c7fa\nMOV             R0, R5; this                                           ; +0xa8, 0x39c7fc\nMOV             R1, R4; cocos2d::CCArray *                             ; +0xaa, 0x39c7fe\nLDR.W           R2, [R4,#0x260]; cocos2d::CCArray *                    ; +0xac, 0x39c800\nMOV             R3, R9                                                 ; +0xb0, 0x39c804\nBL              _ZN8EditorUI14getGroupCenterEPN7cocos2d7CCArrayEb; EditorUI::getGroupCenter(cocos2d::CCArray *,bool) ; +0xb2, 0x39c806\nMOV             R0, R8                                                 ; +0xb6, 0x39c80a\nMOV             R1, R5                                                 ; +0xb8, 0x39c80c\nB               loc_39C81E                                             ; +0xba, 0x39c80e\nLDR.W           R0, [R4,#0x374]                                        ; +0xbc, 0x39c810\nLDR             R3, [R0]                                               ; +0xc0, 0x39c814\nLDR             R3, [R3,#0x60]                                         ; +0xc2, 0x39c816\nBLX             R3                                                     ; +0xc4, 0x39c818\nMOV             R1, R0                                                 ; +0xc6, 0x39c81a\nMOV             R0, R8                                                 ; +0xc8, 0x39c81c\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0xca, 0x39c81e\nLDR             R3, [R7]                                               ; +0xce, 0x39c822\nMOV             R0, R7                                                 ; +0xd0, 0x39c824\nLDR.W           R9, [R4,#0x214]                                        ; +0xd2, 0x39c826\nADD             R7, SP, #0x18+var_14                                   ; +0xd6, 0x39c82a\nLDR             R3, [R3,#0x20]                                         ; +0xd8, 0x39c82c\nBLX             R3                                                     ; +0xda, 0x39c82e\nMOVS            R1, #0; float                                          ; +0xdc, 0x39c830\nLDR             R2, flt_39C8B0; float                                  ; +0xde, 0x39c832\nSTR.W           R0, [R9,#0x17C]                                        ; +0xe0, 0x39c834\nMOV             R0, R5; this                                           ; +0xe4, 0x39c838\nLDR.W           R9, [R4,#0x214]                                        ; +0xe6, 0x39c83a\nLDR.W           R3, [R9]                                               ; +0xea, 0x39c83e\nLDR.W           R10, [R3,#0x5C]                                        ; +0xee, 0x39c842\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0xf2, 0x39c846\nMOV             R2, R5                                                 ; +0xf6, 0x39c84a\nMOV             R0, R7                                                 ; +0xf8, 0x39c84c\nMOV             R1, R8                                                 ; +0xfa, 0x39c84e\nBL              _ZNK7cocos2d7CCPointplERKS0_; cocos2d::CCPoint::operator+(cocos2d::CCPoint const&) ; +0xfc, 0x39c850\nMOV             R1, R7                                                 ; +0x100, 0x39c854\nMOV             R0, R9                                                 ; +0x102, 0x39c856\nBLX             R10                                                    ; +0x104, 0x39c858\nLDR.W           R5, [R4,#0x214]                                        ; +0x106, 0x39c85a\nLDR             R3, [R5]                                               ; +0x10a, 0x39c85e\nLDR             R7, [R3,#0x50]                                         ; +0x10c, 0x39c860\nLDR.W           R3, [R4,#0x340]                                        ; +0x10e, 0x39c862\nLDR.W           R0, [R3,#0x9F0]                                        ; +0x112, 0x39c866\nLDR             R3, [R0]                                               ; +0x116, 0x39c86a\nLDR             R3, [R3,#0x54]                                         ; +0x118, 0x39c86c\nBLX             R3                                                     ; +0x11a, 0x39c86e\nVMOV.F32        S15, #1.0                                              ; +0x11c, 0x39c870\nVMOV            S14, R0                                                ; +0x120, 0x39c874\nMOV             R0, R5                                                 ; +0x124, 0x39c878\nVDIV.F32        S15, S15, S14                                          ; +0x126, 0x39c87a\nVMOV            R1, S15                                                ; +0x12a, 0x39c87e\nBLX             R7                                                     ; +0x12e, 0x39c882\nLDR.W           R0, [R4,#0x214]                                        ; +0x130, 0x39c884\nMOVS            R1, #1                                                 ; +0x134, 0x39c888\nLDR             R3, [R0]                                               ; +0x136, 0x39c88a\nLDR.W           R3, [R3,#0xA4]                                         ; +0x138, 0x39c88c\nBLX             R3                                                     ; +0x13c, 0x39c890\nLDR             R3, [R4]                                               ; +0x13e, 0x39c892\nMOV             R0, R4                                                 ; +0x140, 0x39c894\nLDR.W           R3, [R3,#0x298]                                        ; +0x142, 0x39c896\nBLX             R3                                                     ; +0x146, 0x39c89a\nLDR             R2, [SP,#0x18+var_4]                                   ; +0x148, 0x39c89c\nLDR             R3, [R6]                                               ; +0x14a, 0x39c89e\nCMP             R2, R3                                                 ; +0x14c, 0x39c8a0\nBEQ             loc_39C8A8                                             ; +0x14e, 0x39c8a2\nBLX             __stack_chk_fail                                       ; +0x150, 0x39c8a4\nADD             SP, SP, #0x18                                          ; +0x154, 0x39c8a8\nPOP.W           {R4-R10,PC}                                            ; +0x156, 0x39c8aa", "xrefs": [], "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"}