{"type": "func", "start": 6442823376, "end": 6442823721, "name": "cocos2d::CCMenu::ccTouchBegan", "pseudocode": "// \n// cocos2d::CCMenu::ccTouchBegan from 0x18005aed0 to 0x18005b029 (345 bytes)\n// \n// 3 xrefs:\n// > <???> @ 0x1800fd558\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801bcd18\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\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:21:48 +0000\n// \n\nchar __fastcall cocos2d::CCMenu::ccTouchBegan(\n        cocos2d::CCMenu *this,\n        struct cocos2d::CCTouch *a2,\n        struct cocos2d::CCEvent *a3)\n{\n  cocos2d::CCMenu *v3; // rsi\n  __int64 v6; // rbx\n  __int64 Location; // rbp\n  __int64 v8; // rbx\n  __int64 v9; // rax\n  struct cocos2d::CCMenuItem *v10; // rcx\n  char v12; // [rsp+50h] [rbp+8h] BYREF\n\n  v3 = (cocos2d::CCMenu *)((char *)this - 320);\n  if ( !*((_DWORD *)this + 29) && *((_BYTE *)this - 34) && *((_BYTE *)this + 112) )\n  {\n    v6 = *((_QWORD *)this - 13);\n    if ( v6 )\n    {\n      while ( (*(unsigned __int8 (__fastcall **)(__int64, struct cocos2d::CCTouch *, struct cocos2d::CCEvent *))(*(_QWORD *)v6 + 344LL))(\n                v6,\n                a2,\n                a3) )\n      {\n        v6 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v6 + 504LL))(v6);\n        if ( !v6 )\n          goto LABEL_7;\n      }\n    }\n    else\n    {\nLABEL_7:\n      Location = cocos2d::CCTouch::getLocation(a2, &v12);\n      if ( v3 && (v8 = (*(__int64 (__fastcall **)(cocos2d::CCMenu *))(*(_QWORD *)v3 + 504LL))(v3)) != 0 )\n      {\n        while ( 1 )\n        {\n          v9 = _RTDynamicCast(\n                 v8,\n                 0,\n                 &cocos2d::CCNode `RTTI Type Descriptor',\n                 &cocos2d::CCTouchClipper `RTTI Type Descriptor',\n                 0);\n          if ( v9 )\n          {\n            if ( !(*(unsigned __int8 (__fastcall **)(__int64, __int64))(*(_QWORD *)v9 + 8LL))(v9, Location) )\n              break;\n          }\n          v8 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v8 + 504LL))(v8);\n          if ( !v8 )\n            goto LABEL_12;\n        }\n      }\n      else\n      {\nLABEL_12:\n        v10 = cocos2d::CCMenu::itemForTouch(v3, a2, 0);\n        if ( !v10 )\n          v10 = cocos2d::CCMenu::itemForTouch(v3, a2, 1);\n        *((_QWORD *)this + 15) = v10;\n        if ( v10 )\n        {\n          *((_DWORD *)this + 29) = 1;\n          (*(void (__fastcall **)(struct cocos2d::CCMenuItem *))(*(_QWORD *)v10 + 896LL))(v10);\n          return 1;\n        }\n      }\n    }\n  }\n  return 0;\n}", "assembly": "; \n; cocos2d::CCMenu::ccTouchBegan from 0x18005aed0 to 0x18005b029 (345 bytes)\n; \n; 3 xrefs:\n; > <???> @ 0x1800fd558\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801bcd18\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\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:21:48 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x18005aed0\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x18005aed5\nmov     [rsp+arg_18], rsi                                              ; +0xa, 0x18005aeda\npush    rdi                                                            ; +0xf, 0x18005aedf\npush    r14                                                            ; +0x10, 0x18005aee0\npush    r15                                                            ; +0x12, 0x18005aee2\nsub     rsp, 30h                                                       ; +0x14, 0x18005aee4\ncmp     dword ptr [rcx+74h], 0                                         ; +0x18, 0x18005aee8\nlea     rsi, [rcx-140h]                                                ; +0x1c, 0x18005aeec\nmov     r14, rdx                                                       ; +0x23, 0x18005aef3\nmov     rdi, rcx                                                       ; +0x26, 0x18005aef6\njnz     loc_18005B00E                                                  ; +0x29, 0x18005aef9\ncmp     byte ptr [rcx-22h], 0                                          ; +0x2f, 0x18005aeff\njz      loc_18005B00E                                                  ; +0x33, 0x18005af03\ncmp     byte ptr [rcx+70h], 0                                          ; +0x39, 0x18005af09\njz      loc_18005B00E                                                  ; +0x3d, 0x18005af0d\nmov     rbx, [rcx-68h]                                                 ; +0x43, 0x18005af13\ntest    rbx, rbx                                                       ; +0x47, 0x18005af17\njz      short loc_18005AF48                                            ; +0x4a, 0x18005af1a\nnop     dword ptr [rax+00h]                                            ; +0x4c, 0x18005af1c\nmov     rax, [rbx]                                                     ; +0x50, 0x18005af20\nmov     rcx, rbx                                                       ; +0x53, 0x18005af23\ncall    qword ptr [rax+158h]                                           ; +0x56, 0x18005af26\ntest    al, al                                                         ; +0x5c, 0x18005af2c\njz      loc_18005B00E                                                  ; +0x5e, 0x18005af2e\nmov     rax, [rbx]                                                     ; +0x64, 0x18005af34\nmov     rcx, rbx                                                       ; +0x67, 0x18005af37\ncall    qword ptr [rax+1F8h]                                           ; +0x6a, 0x18005af3a\nmov     rbx, rax                                                       ; +0x70, 0x18005af40\ntest    rax, rax                                                       ; +0x73, 0x18005af43\njnz     short loc_18005AF20                                            ; +0x76, 0x18005af46\nlea     rdx, [rsp+48h+arg_0]                                           ; +0x78, 0x18005af48\nmov     rcx, r14                                                       ; +0x7d, 0x18005af4d\ncall    ?getLocation@CCTouch@cocos2d@@QEBA?AVCCPoint@2@XZ; cocos2d::CCTouch::getLocation(void) ; +0x80, 0x18005af50\nmov     rbp, rax                                                       ; +0x85, 0x18005af55\ntest    rsi, rsi                                                       ; +0x88, 0x18005af58\njz      short loc_18005AFCA                                            ; +0x8b, 0x18005af5b\nmov     rcx, [rsi]                                                     ; +0x8d, 0x18005af5d\nmov     rdx, [rcx+1F8h]                                                ; +0x90, 0x18005af60\nmov     rcx, rsi                                                       ; +0x97, 0x18005af67\ncall    rdx                                                            ; +0x9a, 0x18005af6a\nmov     rbx, rax                                                       ; +0x9c, 0x18005af6c\ntest    rax, rax                                                       ; +0x9f, 0x18005af6f\njz      short loc_18005AFCA                                            ; +0xa2, 0x18005af72\nxor     r15d, r15d                                                     ; +0xa4, 0x18005af74\nnop     word ptr [rax+rax+00000000h]                                   ; +0xa7, 0x18005af77\nlea     r9, ??_R0?AVCCTouchClipper@cocos2d@@@8; cocos2d::CCTouchClipper `RTTI Type Descriptor' ; +0xb0, 0x18005af80\nmov     [rsp+48h+var_28], r15d                                         ; +0xb7, 0x18005af87\nlea     r8, ??_R0?AVCCNode@cocos2d@@@8; cocos2d::CCNode `RTTI Type Descriptor' ; +0xbc, 0x18005af8c\nxor     edx, edx                                                       ; +0xc3, 0x18005af93\nmov     rcx, rbx                                                       ; +0xc5, 0x18005af95\ncall    __RTDynamicCast                                                ; +0xc8, 0x18005af98\ntest    rax, rax                                                       ; +0xcd, 0x18005af9d\njz      short loc_18005AFB6                                            ; +0xd0, 0x18005afa0\nmov     rcx, [rax]                                                     ; +0xd2, 0x18005afa2\nmov     rdx, rbp                                                       ; +0xd5, 0x18005afa5\nmov     r8, [rcx+8]                                                    ; +0xd8, 0x18005afa8\nmov     rcx, rax                                                       ; +0xdc, 0x18005afac\ncall    r8                                                             ; +0xdf, 0x18005afaf\ntest    al, al                                                         ; +0xe2, 0x18005afb2\njz      short loc_18005B00E                                            ; +0xe4, 0x18005afb4\nmov     rax, [rbx]                                                     ; +0xe6, 0x18005afb6\nmov     rcx, rbx                                                       ; +0xe9, 0x18005afb9\ncall    qword ptr [rax+1F8h]                                           ; +0xec, 0x18005afbc\nmov     rbx, rax                                                       ; +0xf2, 0x18005afc2\ntest    rax, rax                                                       ; +0xf5, 0x18005afc5\njnz     short loc_18005AF80                                            ; +0xf8, 0x18005afc8\nxor     r8d, r8d; bool                                                 ; +0xfa, 0x18005afca\nmov     rdx, r14; struct cocos2d::CCTouch *                            ; +0xfd, 0x18005afcd\nmov     rcx, rsi; this                                                 ; +0x100, 0x18005afd0\ncall    ?itemForTouch@CCMenu@cocos2d@@IEAAPEAVCCMenuItem@2@PEAVCCTouch@2@_N@Z; cocos2d::CCMenu::itemForTouch(cocos2d::CCTouch *,bool) ; +0x103, 0x18005afd3\nmov     rcx, rax                                                       ; +0x108, 0x18005afd8\ntest    rax, rax                                                       ; +0x10b, 0x18005afdb\njnz     short loc_18005AFF1                                            ; +0x10e, 0x18005afde\nmov     r8b, 1; bool                                                   ; +0x110, 0x18005afe0\nmov     rdx, r14; struct cocos2d::CCTouch *                            ; +0x113, 0x18005afe3\nmov     rcx, rsi; this                                                 ; +0x116, 0x18005afe6\ncall    ?itemForTouch@CCMenu@cocos2d@@IEAAPEAVCCMenuItem@2@PEAVCCTouch@2@_N@Z; cocos2d::CCMenu::itemForTouch(cocos2d::CCTouch *,bool) ; +0x119, 0x18005afe9\nmov     rcx, rax                                                       ; +0x11e, 0x18005afee\nmov     [rdi+78h], rcx                                                 ; +0x121, 0x18005aff1\ntest    rcx, rcx                                                       ; +0x125, 0x18005aff5\njz      short loc_18005B00E                                            ; +0x128, 0x18005aff8\nmov     dword ptr [rdi+74h], 1                                         ; +0x12a, 0x18005affa\nmov     rax, [rcx]                                                     ; +0x131, 0x18005b001\ncall    qword ptr [rax+380h]                                           ; +0x134, 0x18005b004\nmov     al, 1                                                          ; +0x13a, 0x18005b00a\njmp     short loc_18005B010                                            ; +0x13c, 0x18005b00c\nxor     al, al                                                         ; +0x13e, 0x18005b00e\nmov     rbx, [rsp+48h+arg_8]                                           ; +0x140, 0x18005b010\nmov     rbp, [rsp+48h+arg_10]                                          ; +0x145, 0x18005b015\nmov     rsi, [rsp+48h+arg_18]                                          ; +0x14a, 0x18005b01a\nadd     rsp, 30h                                                       ; +0x14f, 0x18005b01f\npop     r15                                                            ; +0x153, 0x18005b023\npop     r14                                                            ; +0x155, 0x18005b025\npop     rdi                                                            ; +0x157, 0x18005b027\nretn                                                                   ; +0x158, 0x18005b028", "xrefs": ["<???> @ 0x1800fd558", "<???> @ 0x18014cf68", "<???> @ 0x1801bcd18"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "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"}