; ; cocos2d::CCMenu::itemForTouch from 0x180059640 to 0x180059840 (512 bytes) ; ; 8 xrefs: ; > cocos2d::CCMenu::ccTouchBegan @ 0x180058fe1 ; > cocos2d::CCMenu::ccTouchBegan @ 0x180058ffb ; > cocos2d::CCMenu::ccTouchMoved @ 0x1800590d4 ; > cocos2d::CCMenu::ccTouchMoved @ 0x1800590ee ; > cocos2d::CCMenu::itemForTouch @ 0x180059613 ; > cocos2d::CCMenu::itemForTouch @ 0x180059626 ; > @ 0x1801438a8 ; > @ 0x1801b2b5c ; ; This function is hookable on this platform! ; ; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA ; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings ; mov r11, rsp ; +0x0, 0x180059640 mov [r11+10h], rbx ; +0x3, 0x180059643 mov [r11+18h], rbp ; +0x7, 0x180059647 push rsi ; +0xb, 0x18005964b push rdi ; +0xc, 0x18005964c push r14 ; +0xd, 0x18005964d sub rsp, 70h ; +0xf, 0x18005964f mov rax, rdx ; +0x13, 0x180059653 movaps [rsp+88h+var_28], xmm6 ; +0x16, 0x180059656 mov rbx, rcx ; +0x1b, 0x18005965b movaps [rsp+88h+var_38], xmm7 ; +0x1e, 0x18005965e mov rcx, rax ; +0x23, 0x180059663 movaps xmmword ptr [r11-48h], xmm8 ; +0x26, 0x180059666 lea rdx, [r11+8] ; +0x2b, 0x18005966b movzx ebp, r8b ; +0x2f, 0x18005966f call ?getLocation@CCTouch@cocos2d@@QEBA?AVCCPoint@2@XZ; cocos2d::CCTouch::getLocation(void) ; +0x33, 0x180059673 mov rcx, [rbx+0D0h]; this ; +0x38, 0x180059678 test rcx, rcx ; +0x3f, 0x18005967f jz loc_180059815 ; +0x42, 0x180059682 call ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x48, 0x180059688 test eax, eax ; +0x4d, 0x18005968d jz loc_180059815 ; +0x4f, 0x18005968f mov rax, [rbx+0D0h] ; +0x55, 0x180059695 test rax, rax ; +0x5c, 0x18005969c jz loc_180059815 ; +0x5f, 0x18005969f mov rdi, [rax+38h] ; +0x65, 0x1800596a5 mov eax, [rdi] ; +0x69, 0x1800596a9 test eax, eax ; +0x6b, 0x1800596ab jz loc_180059815 ; +0x6d, 0x1800596ad mov rdi, [rdi+10h] ; +0x73, 0x1800596b3 lea rsi, [rax-1] ; +0x77, 0x1800596b7 lea rsi, [rdi+rsi*8] ; +0x7b, 0x1800596bb cmp rdi, rsi ; +0x7f, 0x1800596bf ja loc_180059815 ; +0x82, 0x1800596c2 movss xmm6, cs:flt_1800E61A8 ; +0x88, 0x1800596c8 xor r14d, r14d ; +0x90, 0x1800596d0 movsd xmm8, cs:depth ; +0x93, 0x1800596d3 movsd xmm7, cs:qword_1800E6558 ; +0x9c, 0x1800596dc mov rcx, [rdi] ; +0xa4, 0x1800596e4 test rcx, rcx ; +0xa7, 0x1800596e7 jz loc_180059815 ; +0xaa, 0x1800596ea lea r9, ??_R0?AVCCMenuItem@cocos2d@@@8; cocos2d::CCMenuItem `RTTI Type Descriptor' ; +0xb0, 0x1800596f0 mov [rsp+88h+var_68], r14d ; +0xb7, 0x1800596f7 lea r8, ??_R0?AVCCObject@cocos2d@@@8; cocos2d::CCObject `RTTI Type Descriptor' ; +0xbc, 0x1800596fc xor edx, edx ; +0xc3, 0x180059703 call __RTDynamicCast ; +0xc5, 0x180059705 mov rbx, rax ; +0xca, 0x18005970a test rax, rax ; +0xcd, 0x18005970d jz loc_180059808 ; +0xd0, 0x180059710 mov rdx, [rax] ; +0xd6, 0x180059716 mov rcx, rax ; +0xd9, 0x180059719 call qword ptr [rdx+148h] ; +0xdc, 0x18005971c test al, al ; +0xe2, 0x180059722 jz loc_180059808 ; +0xe4, 0x180059724 mov rdx, [rbx] ; +0xea, 0x18005972a mov rcx, rbx ; +0xed, 0x18005972d call qword ptr [rdx+390h] ; +0xf0, 0x180059730 test al, al ; +0xf6, 0x180059736 jz loc_180059808 ; +0xf8, 0x180059738 lea r8, [rsp+88h+arg_0] ; +0xfe, 0x18005973e mov rcx, rbx ; +0x106, 0x180059746 lea rdx, [rsp+88h+arg_18] ; +0x109, 0x180059749 call ?convertToNodeSpace@CCNode@cocos2d@@QEAA?AVCCPoint@2@AEBV32@@Z; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const &) ; +0x111, 0x180059751 lea rdx, [rsp+88h+var_58] ; +0x116, 0x180059756 mov rcx, rbx ; +0x11b, 0x18005975b call ?rect@CCMenuItem@cocos2d@@QEAA?AVCCRect@2@XZ; cocos2d::CCMenuItem::rect(void) ; +0x11e, 0x18005975e lea rdx, dword_1801A83D8 ; +0x123, 0x180059763 lea rcx, [rsp+88h+var_58] ; +0x12a, 0x18005976a call ??4CCSize@cocos2d@@QEAAAEAV01@AEBVCCPoint@1@@Z; cocos2d::CCSize::operator=(cocos2d::CCPoint const &) ; +0x12f, 0x18005976f test bpl, bpl ; +0x134, 0x180059774 jz short loc_1800597F2 ; +0x137, 0x180059777 movss xmm5, dword ptr [rbx+174h] ; +0x139, 0x180059779 comiss xmm5, xmm6 ; +0x141, 0x180059781 jbe short loc_1800597F2 ; +0x144, 0x180059784 movss xmm4, [rsp+88h+var_50] ; +0x146, 0x180059786 movss xmm1, [rsp+88h+var_58] ; +0x14c, 0x18005978c movss xmm2, [rsp+88h+var_54] ; +0x152, 0x180059792 cvtps2pd xmm1, xmm1 ; +0x158, 0x180059798 cvtps2pd xmm0, xmm4 ; +0x15b, 0x18005979b cvtps2pd xmm3, xmm5 ; +0x15e, 0x18005979e cvtps2pd xmm2, xmm2 ; +0x161, 0x1800597a1 subsd xmm3, xmm8 ; +0x164, 0x1800597a4 mulss xmm4, xmm5 ; +0x169, 0x1800597a9 movss [rsp+88h+var_50], xmm4 ; +0x16d, 0x1800597ad mulsd xmm0, xmm3 ; +0x173, 0x1800597b3 mulsd xmm0, xmm7 ; +0x177, 0x1800597b7 subsd xmm1, xmm0 ; +0x17b, 0x1800597bb cvtpd2ps xmm0, xmm1 ; +0x17f, 0x1800597bf movss xmm1, [rsp+88h+var_4C] ; +0x183, 0x1800597c3 movss [rsp+88h+var_58], xmm0 ; +0x189, 0x1800597c9 cvtps2pd xmm0, xmm1 ; +0x18f, 0x1800597cf mulss xmm1, xmm5 ; +0x192, 0x1800597d2 mulsd xmm0, xmm3 ; +0x196, 0x1800597d6 movss [rsp+88h+var_4C], xmm1 ; +0x19a, 0x1800597da mulsd xmm0, xmm7 ; +0x1a0, 0x1800597e0 subsd xmm2, xmm0 ; +0x1a4, 0x1800597e4 cvtpd2ps xmm0, xmm2 ; +0x1a8, 0x1800597e8 movss [rsp+88h+var_54], xmm0 ; +0x1ac, 0x1800597ec lea rdx, [rsp+88h+arg_18]; struct cocos2d::CCPoint * ; +0x1b2, 0x1800597f2 lea rcx, [rsp+88h+var_58]; this ; +0x1ba, 0x1800597fa call ?containsPoint@CCRect@cocos2d@@QEBA_NAEBVCCPoint@2@@Z; cocos2d::CCRect::containsPoint(cocos2d::CCPoint const &) ; +0x1bf, 0x1800597ff test al, al ; +0x1c4, 0x180059804 jnz short loc_18005983B ; +0x1c6, 0x180059806 add rdi, 8 ; +0x1c8, 0x180059808 cmp rdi, rsi ; +0x1cc, 0x18005980c jbe loc_1800596E4 ; +0x1cf, 0x18005980f xor eax, eax ; +0x1d5, 0x180059815 movaps xmm6, [rsp+88h+var_28] ; +0x1d7, 0x180059817 lea r11, [rsp+88h+var_18] ; +0x1dc, 0x18005981c mov rbx, [r11+28h] ; +0x1e1, 0x180059821 mov rbp, [r11+30h] ; +0x1e5, 0x180059825 movaps xmm8, xmmword ptr [r11-30h] ; +0x1e9, 0x180059829 movaps xmm7, [rsp+88h+var_38] ; +0x1ee, 0x18005982e mov rsp, r11 ; +0x1f3, 0x180059833 pop r14 ; +0x1f6, 0x180059836 pop rdi ; +0x1f8, 0x180059838 pop rsi ; +0x1f9, 0x180059839 retn ; +0x1fa, 0x18005983a mov rax, rbx ; +0x1fb, 0x18005983b jmp short loc_180059817 ; +0x1fe, 0x18005983e