{"type": "func", "start": 3677988, "end": 3678198, "name": "EditorUI::playerTouchBegan", "pseudocode": "// \n// EditorUI::playerTouchBegan from 0x381f24 to 0x381ff6 (210 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::playerTouchBegan(EditorUI *a1, cocos2d::CCTouch *a2, cocos2d::CCEvent *a3)\n{\n  cocos2d::CCDirector *v5; // r0\n  int v6; // r2\n  bool v7; // r3\n  float x; // s17\n  float v9; // s16\n  GameManager *v10; // r0\n  LevelEditorLayer *v11; // r0\n  LevelEditorLayer *m_editorLayer; // r0\n  cocos2d::CCSize v13; // [sp+Ch] [bp-8h] BYREF\n  cocos2d::CCPoint v14; // [sp+14h] [bp+0h] BYREF\n  cocos2d::CCPoint v15; // [sp+1Ch] [bp+8h] BYREF\n\n  v5 = cocos2d::CCDirector::sharedDirector();\n  cocos2d::CCDirector::getWinSize(&v13, v5);\n  cocos2d::CCTouch::getLocation(&v14, a2);\n  cocos2d::CCNode::convertToNodeSpace(&v15, a1, &v14);\n  cocos2d::CCPoint::operator=((PlayerObject *)&v14, COERCE_FLOAT(&v15), v6, v7);\n  x = v14.x;\n  v9 = v13.width * 0.5;\n  if ( (a1->m_editorLayer->m_gameState.m_isDualMode\n     || (v10 = GameManager::sharedState(), GameManager::getGameVariable(v10, \"0011\")))\n    && x > v9 )\n  {\n    if ( a1->m_playerTouchID2 == -1 )\n    {\n      m_editorLayer = a1->m_editorLayer;\n      a1->m_playerTouchID2 = a2->m_nId;\n      GJBaseGameLayer::queueButton(m_editorLayer, 1, 1, 1, a2->m_timestamp);\n    }\n  }\n  else if ( a1->m_playerTouchID1 == -1 )\n  {\n    v11 = a1->m_editorLayer;\n    a1->m_playerTouchID1 = a2->m_nId;\n    GJBaseGameLayer::queueButton(v11, 1, 1, 0, a2->m_timestamp);\n  }\n}", "assembly": "; \n; EditorUI::playerTouchBegan from 0x381f24 to 0x381ff6 (210 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-R8,LR}                                             ; +0x0, 0x381f24\nMOV             R4, R0                                                 ; +0x4, 0x381f28\nLDR             R6, =(__stack_chk_guard_ptr - 0x381F36)                ; +0x6, 0x381f2a\nMOV             R5, R1                                                 ; +0x8, 0x381f2c\nVPUSH           {D8}                                                   ; +0xa, 0x381f2e\nADD             R6, PC; __stack_chk_guard_ptr                          ; +0xe, 0x381f32\nLDR             R6, [R6]; __stack_chk_guard                            ; +0x10, 0x381f34\nLDR             R3, [R6]                                               ; +0x12, 0x381f36\nVMOV.F32        S16, #0.5                                              ; +0x14, 0x381f38\nSUB             SP, SP, #0x28                                          ; +0x18, 0x381f3c\nADD             R7, SP, #0x14                                          ; +0x1a, 0x381f3e\nADD.W           R8, SP, #0x28+var_C                                    ; +0x1c, 0x381f40\nSTR             R3, [SP,#0x28+var_4]                                   ; +0x20, 0x381f44\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x22, 0x381f46\nMOV             R1, R0                                                 ; +0x26, 0x381f4a\nADD             R0, SP, #0x28+var_1C; this                             ; +0x28, 0x381f4c\nBL              _ZN7cocos2d10CCDirector10getWinSizeEv; cocos2d::CCDirector::getWinSize(void) ; +0x2a, 0x381f4e\nMOV             R0, R7; this                                           ; +0x2e, 0x381f52\nMOV             R1, R5                                                 ; +0x30, 0x381f54\nBL              _ZNK7cocos2d7CCTouch11getLocationEv; cocos2d::CCTouch::getLocation(void) ; +0x32, 0x381f56\nMOV             R0, R8; this                                           ; +0x36, 0x381f5a\nMOV             R1, R4; cocos2d::CCPoint *                             ; +0x38, 0x381f5c\nMOV             R2, R7                                                 ; +0x3a, 0x381f5e\nBL              _ZN7cocos2d6CCNode18convertToNodeSpaceERKNS_7CCPointE; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const&) ; +0x3c, 0x381f60\nMOV             R0, R7                                                 ; +0x40, 0x381f64\nMOV             R1, R8                                                 ; +0x42, 0x381f66\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0x44, 0x381f68\nLDR.W           R3, [R4,#0x340]                                        ; +0x48, 0x381f6c\nVLDR            S15, [SP,#0x28+var_1C]                                 ; +0x4c, 0x381f70\nLDRB.W          R3, [R3,#0x372]                                        ; +0x50, 0x381f74\nVLDR            S17, [SP,#0x28+var_14]                                 ; +0x54, 0x381f78\nVMUL.F32        S16, S15, S16                                          ; +0x58, 0x381f7c\nCBNZ            R3, loc_381FB2                                         ; +0x5c, 0x381f80\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x5e, 0x381f82\nLDR             R1, =(a0011 - 0x381F8C); \"0011\"                        ; +0x62, 0x381f86\nADD             R1, PC; \"0011\"                                         ; +0x64, 0x381f88\nBL              _ZN11GameManager15getGameVariableEPKc; GameManager::getGameVariable(char const*) ; +0x66, 0x381f8a\nCBNZ            R0, loc_381FB2                                         ; +0x6a, 0x381f8e\nLDR.W           R3, [R4,#0x1D0]                                        ; +0x6c, 0x381f90\nADDS            R3, #1                                                 ; +0x70, 0x381f94\nBNE             loc_381FE0                                             ; +0x72, 0x381f96\nLDR             R3, [R5,#0x34]                                         ; +0x74, 0x381f98\nMOVS            R1, #1                                                 ; +0x76, 0x381f9a\nLDR.W           R0, [R4,#0x340]                                        ; +0x78, 0x381f9c\nSTR.W           R3, [R4,#0x1D0]                                        ; +0x7c, 0x381fa0\nLDRD.W          R2, R3, [R5,#0x58]                                     ; +0x80, 0x381fa4\nSTRD.W          R2, R3, [SP,#0x28+var_28]                              ; +0x84, 0x381fa8\nMOV             R2, R1                                                 ; +0x88, 0x381fac\nMOVS            R3, #0                                                 ; +0x8a, 0x381fae\nB               loc_381FDC                                             ; +0x8c, 0x381fb0\nVCMPE.F32       S17, S16                                               ; +0x8e, 0x381fb2\nVMRS            APSR_nzcv, FPSCR                                       ; +0x92, 0x381fb6\nBLS             loc_381F90                                             ; +0x96, 0x381fba\nLDR.W           R3, [R4,#0x1D4]                                        ; +0x98, 0x381fbc\nADDS            R3, #1                                                 ; +0x9c, 0x381fc0\nBNE             loc_381FE0                                             ; +0x9e, 0x381fc2\nLDR             R3, [R5,#0x34]                                         ; +0xa0, 0x381fc4\nMOVS            R1, #1; int                                            ; +0xa2, 0x381fc6\nLDR.W           R0, [R4,#0x340]; this                                  ; +0xa4, 0x381fc8\nSTR.W           R3, [R4,#0x1D4]                                        ; +0xa8, 0x381fcc\nLDRD.W          R2, R3, [R5,#0x58]                                     ; +0xac, 0x381fd0\nSTRD.W          R2, R3, [SP,#0x28+var_28]; double                      ; +0xb0, 0x381fd4\nMOV             R2, R1; bool                                           ; +0xb4, 0x381fd8\nMOV             R3, R1; bool                                           ; +0xb6, 0x381fda\nBL              _ZN15GJBaseGameLayer11queueButtonEibbd; GJBaseGameLayer::queueButton(int,bool,bool,double) ; +0xb8, 0x381fdc\nLDR             R2, [SP,#0x28+var_4]                                   ; +0xbc, 0x381fe0\nLDR             R3, [R6]                                               ; +0xbe, 0x381fe2\nCMP             R2, R3                                                 ; +0xc0, 0x381fe4\nBEQ             loc_381FEC                                             ; +0xc2, 0x381fe6\nBLX             __stack_chk_fail                                       ; +0xc4, 0x381fe8\nADD             SP, SP, #0x28 ; '('                                    ; +0xc8, 0x381fec\nVPOP            {D8}                                                   ; +0xca, 0x381fee\nPOP.W           {R4-R8,PC}                                             ; +0xce, 0x381ff2", "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"}