{"type": "func", "start": 5369041712, "end": 5369042231, "name": "CCTextInputNode::ccTouchBegan", "pseudocode": "// \n// CCTextInputNode::ccTouchBegan from 0x140051330 to 0x140051537 (519 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x1405323c0\n// > <???> @ 0x1406c4d94\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\nbool CCTextInputNode::ccTouchBegan(CCTextInputNode *a1, cocos2d::CCTouch *a2, cocos2d::CCEvent *a3)\n{\n  cocos2d::CCDirector *v4; // rax\n  struct cocos2d::CCPoint v5; // rax\n  int *p_m_nUpdateScriptHandler; // rdi\n  struct cocos2d::CCPoint v7; // rax\n  struct cocos2d::CCPoint v8; // rax\n  const struct cocos2d::CCPoint *v9; // rax\n  float *v10; // rbx\n  __int64 v11; // rax\n  __int64 v12; // rax\n  __int64 v13; // rax\n  __int64 v14; // rax\n  const struct cocos2d::CCPoint *v15; // rax\n  const struct cocos2d::CCPoint *v16; // rax\n  __int64 v17; // rdx\n  cocos2d::CCGLProgram *m_pShaderProgram; // rcx\n  cocos2d::CCPoint v19; // rax\n  cocos2d::CCRect *v20; // r8\n  cocos2d::CCRect v22; // [rsp+20h] [rbp-30h] BYREF\n  cocos2d::CCPoint v23; // [rsp+30h] [rbp-20h] BYREF\n  cocos2d::CCRect v24; // [rsp+38h] [rbp-18h] BYREF\n  struct cocos2d::CCPoint v25; // [rsp+70h] [rbp+20h] BYREF\n  cocos2d::CCPoint v26; // [rsp+88h] [rbp+38h] BYREF\n\n  cocos2d::CCTouch::getLocationInView(a2);\n  v4 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector();\n  v5 = cocos2d::CCDirector::convertToGL(v4, &v22.origin);\n  ((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&v25, v5);\n  p_m_nUpdateScriptHandler = &a1[-1].m_nUpdateScriptHandler;\n  v7 = cocos2d::CCNode::convertToWorldSpace((CCTextInputNode *)((char *)a1 - 320), &v22.origin);\n  ((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&v25, v7);\n  v8 = cocos2d::CCNode::convertToNodeSpace((CCTextInputNode *)((char *)a1 - 320), &v22.origin);\n  ((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&v25, v8);\n  v9 = (const struct cocos2d::CCPoint *)((__int64 (__fastcall *)(cocos2d::CCObject *))a1->m_pUserObject->cocos2d::CCLayer::cocos2d::CCNode::__vftable[3].setTag)(a1->m_pUserObject);\n  v10 = (float *)cocos2d::CCPoint::CCPoint(&v22.origin, v9);\n  cocos2d::CCRect::CCRect(&v24);\n  v11 = (*(__int64 (__fastcall **)(int *))(*(_QWORD *)&a1[-1].m_nUpdateScriptHandler + 200LL))(&a1[-1].m_nUpdateScriptHandler);\n  cocos2d::CCPoint::operator=(&v24, v11);\n  v12 = (*(__int64 (__fastcall **)(int *))(*(_QWORD *)&a1[-1].m_nUpdateScriptHandler + 304LL))(&a1[-1].m_nUpdateScriptHandler);\n  cocos2d::CCSize::operator=(&v24.size, v12);\n  v13 = *(_QWORD *)&a1[-1].m_nUpdateScriptHandler;\n  v24.origin.x = v24.origin.x - (float)(v24.size.width * *v10);\n  v24.origin.y = v24.origin.y - (float)(v24.size.height * v10[1]);\n  if ( (*(__int64 (__fastcall **)(int *))(v13 + 488))(&a1[-1].m_nUpdateScriptHandler) )\n  {\n    v14 = (*(__int64 (__fastcall **)(int *))(*(_QWORD *)p_m_nUpdateScriptHandler + 488LL))(&a1[-1].m_nUpdateScriptHandler);\n    v15 = (const struct cocos2d::CCPoint *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v14 + 200LL))(v14);\n    v16 = (const struct cocos2d::CCPoint *)cocos2d::CCPoint::CCPoint(&v22.origin, v15);\n  }\n  else\n  {\n    cocos2d::CCPoint::CCPoint(&v23, 0.0, 0.0);\n  }\n  cocos2d::CCPoint::CCPoint(&v26, v16);\n  cocos2d::CCPoint::operator+(&v24, &v22);\n  cocos2d::CCPoint::operator=(&v24, &v22);\n  if ( !cocos2d::CCRect::containsPoint(&v24, &v25) )\n    return 0;\n  m_pShaderProgram = a1->m_pShaderProgram;\n  if ( m_pShaderProgram )\n  {\n    if ( !((unsigned __int8 (__fastcall *)(cocos2d::CCGLProgram *, int *))m_pShaderProgram->encodeWithCoder)(\n            m_pShaderProgram,\n            &a1[-1].m_nUpdateScriptHandler) )\n      return 0;\n  }\n  LOBYTE(v17) = 1;\n  (*(void (__fastcall **)(int *, __int64))(*(_QWORD *)p_m_nUpdateScriptHandler + 1016LL))(\n    &a1[-1].m_nUpdateScriptHandler,\n    v17);\n  cocos2d::CCRect::CCRect(&v22, &v24);\n  v19 = (cocos2d::CCPoint)cocos2d::CCPoint::CCPoint(&v23, &v25);\n  CCTextInputNode::updateCursorPosition((CCTextInputNode *)((char *)a1 - 320), v19, v20);\n  return 1;\n}", "assembly": "; \n; CCTextInputNode::ccTouchBegan from 0x140051330 to 0x140051537 (519 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x1405323c0\n; > <???> @ 0x1406c4d94\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\nmov     [rsp-18h+arg_8], rbx                                           ; +0x0, 0x140051330\npush    rbp                                                            ; +0x5, 0x140051335\npush    rsi                                                            ; +0x6, 0x140051336\npush    rdi                                                            ; +0x7, 0x140051337\nmov     rbp, rsp                                                       ; +0x8, 0x140051338\nsub     rsp, 50h                                                       ; +0xb, 0x14005133b\nmov     rax, rdx                                                       ; +0xf, 0x14005133f\nmov     rsi, rcx                                                       ; +0x12, 0x140051342\nmov     rcx, rax                                                       ; +0x15, 0x140051345\nlea     rdx, [rbp+arg_0]                                               ; +0x18, 0x140051348\ncall    cs:?getLocationInView@CCTouch@cocos2d@@QEBA?AVCCPoint@2@XZ; cocos2d::CCTouch::getLocationInView(void) ; +0x1c, 0x14005134c\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x22, 0x140051352\nmov     rcx, rax                                                       ; +0x28, 0x140051358\nlea     r8, [rbp+arg_0]                                                ; +0x2b, 0x14005135b\nlea     rdx, [rbp+var_30]                                              ; +0x2f, 0x14005135f\ncall    cs:?convertToGL@CCDirector@cocos2d@@QEAA?AVCCPoint@2@AEBV32@@Z; cocos2d::CCDirector::convertToGL(cocos2d::CCPoint const &) ; +0x33, 0x140051363\nmov     rdx, rax                                                       ; +0x39, 0x140051369\nlea     rcx, [rbp+arg_0]                                               ; +0x3c, 0x14005136c\ncall    cs:??4CCPoint@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCPoint::operator=(cocos2d::CCPoint const &) ; +0x40, 0x140051370\nlea     rdi, [rsi-140h]                                                ; +0x46, 0x140051376\nmov     rcx, rdi                                                       ; +0x4d, 0x14005137d\nlea     r8, [rbp+arg_0]                                                ; +0x50, 0x140051380\nlea     rdx, [rbp+var_30]                                              ; +0x54, 0x140051384\ncall    cs:?convertToWorldSpace@CCNode@cocos2d@@QEAA?AVCCPoint@2@AEBV32@@Z; cocos2d::CCNode::convertToWorldSpace(cocos2d::CCPoint const &) ; +0x58, 0x140051388\nmov     rdx, rax                                                       ; +0x5e, 0x14005138e\nlea     rcx, [rbp+arg_0]                                               ; +0x61, 0x140051391\ncall    cs:??4CCPoint@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCPoint::operator=(cocos2d::CCPoint const &) ; +0x65, 0x140051395\nlea     r8, [rbp+arg_0]                                                ; +0x6b, 0x14005139b\nmov     rcx, rdi                                                       ; +0x6f, 0x14005139f\nlea     rdx, [rbp+var_30]                                              ; +0x72, 0x1400513a2\ncall    cs:?convertToNodeSpace@CCNode@cocos2d@@QEAA?AVCCPoint@2@AEBV32@@Z; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const &) ; +0x76, 0x1400513a6\nmov     rdx, rax                                                       ; +0x7c, 0x1400513ac\nlea     rcx, [rbp+arg_0]                                               ; +0x7f, 0x1400513af\ncall    cs:??4CCPoint@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCPoint::operator=(cocos2d::CCPoint const &) ; +0x83, 0x1400513b3\nmov     rcx, [rsi+0E8h]                                                ; +0x89, 0x1400513b9\nmov     rax, [rcx]                                                     ; +0x90, 0x1400513c0\ncall    qword ptr [rax+118h]                                           ; +0x93, 0x1400513c3\nmov     rdx, rax                                                       ; +0x99, 0x1400513c9\nlea     rcx, [rbp+var_30]                                              ; +0x9c, 0x1400513cc\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0xa0, 0x1400513d0\nlea     rcx, [rbp+var_18]                                              ; +0xa6, 0x1400513d6\nmov     rbx, rax                                                       ; +0xaa, 0x1400513da\ncall    cs:??0CCRect@cocos2d@@QEAA@XZ; cocos2d::CCRect::CCRect(void)   ; +0xad, 0x1400513dd\nmov     rdx, [rdi]                                                     ; +0xb3, 0x1400513e3\nmov     rcx, rdi                                                       ; +0xb6, 0x1400513e6\ncall    qword ptr [rdx+0C8h]                                           ; +0xb9, 0x1400513e9\nmov     rdx, rax                                                       ; +0xbf, 0x1400513ef\nlea     rcx, [rbp+var_18]                                              ; +0xc2, 0x1400513f2\ncall    cs:??4CCPoint@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCPoint::operator=(cocos2d::CCPoint const &) ; +0xc6, 0x1400513f6\nmov     rdx, [rdi]                                                     ; +0xcc, 0x1400513fc\nmov     rcx, rdi                                                       ; +0xcf, 0x1400513ff\ncall    qword ptr [rdx+130h]                                           ; +0xd2, 0x140051402\nmov     rdx, rax                                                       ; +0xd8, 0x140051408\nlea     rcx, [rbp+var_10]                                              ; +0xdb, 0x14005140b\ncall    cs:??4CCSize@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCSize::operator=(cocos2d::CCSize const &) ; +0xdf, 0x14005140f\nmovss   xmm1, [rbp+var_18]                                             ; +0xe5, 0x140051415\nmov     rcx, rdi                                                       ; +0xea, 0x14005141a\nmovss   xmm0, [rbp+var_10]                                             ; +0xed, 0x14005141d\nmulss   xmm0, dword ptr [rbx]                                          ; +0xf2, 0x140051422\nmov     rax, [rdi]                                                     ; +0xf6, 0x140051426\nsubss   xmm1, xmm0                                                     ; +0xf9, 0x140051429\nmovss   xmm0, [rbp+var_C]                                              ; +0xfd, 0x14005142d\nmovss   [rbp+var_18], xmm1                                             ; +0x102, 0x140051432\nmulss   xmm0, dword ptr [rbx+4]                                        ; +0x107, 0x140051437\nmovss   xmm1, [rbp+var_14]                                             ; +0x10c, 0x14005143c\nsubss   xmm1, xmm0                                                     ; +0x111, 0x140051441\nmovss   [rbp+var_14], xmm1                                             ; +0x115, 0x140051445\ncall    qword ptr [rax+1E8h]                                           ; +0x11a, 0x14005144a\ntest    rax, rax                                                       ; +0x120, 0x140051450\njz      short loc_14005147C                                            ; +0x123, 0x140051453\nmov     rax, [rdi]                                                     ; +0x125, 0x140051455\nmov     rcx, rdi                                                       ; +0x128, 0x140051458\ncall    qword ptr [rax+1E8h]                                           ; +0x12b, 0x14005145b\nmov     rcx, rax                                                       ; +0x131, 0x140051461\nmov     rdx, [rax]                                                     ; +0x134, 0x140051464\ncall    qword ptr [rdx+0C8h]                                           ; +0x137, 0x140051467\nmov     rdx, rax                                                       ; +0x13d, 0x14005146d\nlea     rcx, [rbp+var_30]                                              ; +0x140, 0x140051470\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x144, 0x140051474\njmp     short loc_14005148C                                            ; +0x14a, 0x14005147a\nxorps   xmm2, xmm2                                                     ; +0x14c, 0x14005147c\nlea     rcx, [rbp+var_20]                                              ; +0x14f, 0x14005147f\nxorps   xmm1, xmm1                                                     ; +0x153, 0x140051483\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x156, 0x140051486\nmov     rdx, rax                                                       ; +0x15c, 0x14005148c\nlea     rcx, [rbp+arg_18]                                              ; +0x15f, 0x14005148f\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x163, 0x140051493\nlea     r8, [rbp+arg_18]                                               ; +0x169, 0x140051499\nlea     rdx, [rbp+var_30]                                              ; +0x16d, 0x14005149d\nlea     rcx, [rbp+var_18]                                              ; +0x171, 0x1400514a1\ncall    cs:??HCCPoint@cocos2d@@QEBA?AV01@AEBV01@@Z; cocos2d::CCPoint::operator+(cocos2d::CCPoint const &) ; +0x175, 0x1400514a5\nlea     rdx, [rbp+var_30]                                              ; +0x17b, 0x1400514ab\nlea     rcx, [rbp+var_18]                                              ; +0x17f, 0x1400514af\ncall    cs:??4CCPoint@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCPoint::operator=(cocos2d::CCPoint const &) ; +0x183, 0x1400514b3\nlea     rdx, [rbp+arg_0]                                               ; +0x189, 0x1400514b9\nlea     rcx, [rbp+var_18]                                              ; +0x18d, 0x1400514bd\ncall    cs:?containsPoint@CCRect@cocos2d@@QEBA_NAEBVCCPoint@2@@Z; cocos2d::CCRect::containsPoint(cocos2d::CCPoint const &) ; +0x191, 0x1400514c1\ntest    al, al                                                         ; +0x197, 0x1400514c7\njz      short loc_140051528                                            ; +0x199, 0x1400514c9\nmov     rcx, [rsi+0F0h]                                                ; +0x19b, 0x1400514cb\ntest    rcx, rcx                                                       ; +0x1a2, 0x1400514d2\njz      short loc_1400514E4                                            ; +0x1a5, 0x1400514d5\nmov     rax, [rcx]                                                     ; +0x1a7, 0x1400514d7\nmov     rdx, rdi                                                       ; +0x1aa, 0x1400514da\ncall    qword ptr [rax+28h]                                            ; +0x1ad, 0x1400514dd\ntest    al, al                                                         ; +0x1b0, 0x1400514e0\njz      short loc_140051528                                            ; +0x1b2, 0x1400514e2\nmov     rax, [rdi]                                                     ; +0x1b4, 0x1400514e4\nmov     dl, 1                                                          ; +0x1b7, 0x1400514e7\nmov     rcx, rdi                                                       ; +0x1b9, 0x1400514e9\ncall    qword ptr [rax+3F8h]                                           ; +0x1bc, 0x1400514ec\nlea     rdx, [rbp+var_18]                                              ; +0x1c2, 0x1400514f2\nlea     rcx, [rbp+var_30]                                              ; +0x1c6, 0x1400514f6\ncall    cs:??0CCRect@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCRect::CCRect(cocos2d::CCRect const &) ; +0x1ca, 0x1400514fa\nlea     rdx, [rbp+arg_0]                                               ; +0x1d0, 0x140051500\nlea     rcx, [rbp+var_20]                                              ; +0x1d4, 0x140051504\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x1d8, 0x140051508\nmov     rdx, rax                                                       ; +0x1de, 0x14005150e\nmov     rcx, rdi                                                       ; +0x1e1, 0x140051511\ncall    CCTextInputNode__updateCursorPosition                          ; +0x1e4, 0x140051514\nmov     al, 1                                                          ; +0x1e9, 0x140051519\nmov     rbx, [rsp+50h+arg_8]                                           ; +0x1eb, 0x14005151b\nadd     rsp, 50h                                                       ; +0x1f0, 0x140051520\npop     rdi                                                            ; +0x1f4, 0x140051524\npop     rsi                                                            ; +0x1f5, 0x140051525\npop     rbp                                                            ; +0x1f6, 0x140051526\nretn                                                                   ; +0x1f7, 0x140051527\nmov     rbx, [rsp+50h+arg_8]                                           ; +0x1f8, 0x140051528\nxor     al, al                                                         ; +0x1fd, 0x14005152d\nadd     rsp, 50h                                                       ; +0x1ff, 0x14005152f\npop     rdi                                                            ; +0x203, 0x140051533\npop     rsi                                                            ; +0x204, 0x140051534\npop     rbp                                                            ; +0x205, 0x140051535\nretn                                                                   ; +0x206, 0x140051536", "xrefs": ["<???> @ 0x1405323c0", "<???> @ 0x1406c4d94"], "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"}