{"type": "func", "start": 5371521360, "end": 5371521928, "name": "GJShopLayer::ccTouchBegan", "pseudocode": "// \n// GJShopLayer::ccTouchBegan from 0x1402ae950 to 0x1402aeb88 (568 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x14057e268\n// > <???> @ 0x1406d2288\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\n// Hidden C++ exception states: #wind=3\nbool GJShopLayer::ccTouchBegan(GJShopLayer *a1, cocos2d::CCTouch *a2, cocos2d::CCEvent *a3)\n{\n  struct cocos2d::CCPoint v5; // rax\n  float v6; // xmm6_4\n  float *v7; // rax\n  GameManager *v8; // rcx\n  __int64 v9; // rcx\n  char v10; // cl\n  cocos2d::CCGridBase *m_pGrid; // rax\n  void *v12; // [rsp+30h] [rbp-58h]\n  cocos2d::CCRect v13; // [rsp+38h] [rbp-50h] BYREF\n  __int128 v14; // [rsp+48h] [rbp-40h] BYREF\n  __int64 v15; // [rsp+58h] [rbp-30h]\n  __int64 v16; // [rsp+60h] [rbp-28h]\n  struct cocos2d::CCPoint v17; // [rsp+90h] [rbp+8h] BYREF\n  __int128 *v18; // [rsp+A8h] [rbp+20h] BYREF\n\n  if ( LODWORD(a1->m_sAdditionalTransform.ty) )\n    return 0;\n  cocos2d::CCTouch::getLocation(a2);\n  v5 = cocos2d::CCNode::convertToNodeSpace((GJShopLayer *)((char *)a1 - 320), (const struct cocos2d::CCPoint *)&v18);\n  ((void (__fastcall *)(_QWORD, _QWORD))cocos2d::CCPoint::operator=)(&v17, v5);\n  v6 = *(float *)(((__int64 (__fastcall *)(cocos2d::CCGridBase *))a1->m_pGrid->cocos2d::CCLayer::cocos2d::CCNode::__vftable[2].~CCGridBase)(a1->m_pGrid)\n                + 4);\n  v7 = (float *)((__int64 (__fastcall *)(cocos2d::CCGridBase *))a1->m_pGrid->cocos2d::CCLayer::cocos2d::CCNode::__vftable[2].~CCGridBase)(a1->m_pGrid);\n  cocos2d::CCRect::CCRect(&v13, *v7 - 40.0, (float)(v6 - 45.0) + 10.0, 80.0, 90.0);\n  if ( cocos2d::CCRect::containsPoint(&v13, &v17) && !BYTE1(a1->m_pGrid[6].m_uUnknown) )\n  {\n    v8 = (GameManager *)qword_1406C2ED8;\n    if ( !qword_1406C2ED8 )\n    {\n      v18 = (__int128 *)operator new(0x668u);\n      qword_1406C2ED8 = sub_14017AB00((__int64)v18);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n      v8 = (GameManager *)qword_1406C2ED8;\n    }\n    if ( !GameManager::getUGV(v8, (const char *)&word_14055A648) )\n      goto LABEL_12;\n    v18 = &v14;\n    v14 = 0;\n    v15 = 4;\n    v16 = 15;\n    strcpy((char *)&v14, \"0022\");\n    v9 = qword_1406C2EE8;\n    if ( !qword_1406C2EE8 )\n    {\n      v12 = operator new(0x3E0u);\n      qword_1406C2EE8 = sub_1401D0AE0((__int64)v12);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);\n      v9 = qword_1406C2EE8;\n    }\n    if ( GameStatsManager::isSpecialChestUnlocked(v9, &v14) )\nLABEL_12:\n      v10 = 0;\n    else\n      v10 = 1;\n    m_pGrid = a1->m_pGrid;\n    if ( m_pGrid[6].m_unknown2 >= 5 || v10 )\n    {\n      m_pGrid[6].m_unknown2 = 2;\n      GJShopLayer::showReactMessage((GJShopLayer *)((char *)a1 - 320));\n      if ( LODWORD(a1->m_pChildren) == 9 )\n        a1->m_pGrid[6].m_unknown2 = 0;\n    }\n    else\n    {\n      AnimatedShopKeeper::playReactAnimation((AnimatedShopKeeper *)a1->m_pGrid);\n    }\n  }\n  return 1;\n}", "assembly": "; \n; GJShopLayer::ccTouchBegan from 0x1402ae950 to 0x1402aeb88 (568 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x14057e268\n; > <???> @ 0x1406d2288\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+arg_8], rbx                                               ; +0x0, 0x1402ae950\npush    rdi                                                            ; +0x5, 0x1402ae955\nsub     rsp, 80h                                                       ; +0x6, 0x1402ae956\nmovaps  [rsp+88h+var_18], xmm6                                         ; +0xd, 0x1402ae95d\nmov     rax, rdx                                                       ; +0x12, 0x1402ae962\nmov     rbx, rcx                                                       ; +0x15, 0x1402ae965\ncmp     dword ptr [rcx+88h], 0                                         ; +0x18, 0x1402ae968\njz      short loc_1402AE978                                            ; +0x1f, 0x1402ae96f\nxor     al, al                                                         ; +0x21, 0x1402ae971\njmp     loc_1402AEB72                                                  ; +0x23, 0x1402ae973\nlea     rdx, [rsp+88h+arg_0]                                           ; +0x28, 0x1402ae978\nmov     rcx, rax                                                       ; +0x30, 0x1402ae980\ncall    cs:?getLocation@CCTouch@cocos2d@@QEBA?AVCCPoint@2@XZ; cocos2d::CCTouch::getLocation(void) ; +0x33, 0x1402ae983\nlea     r8, [rsp+88h+arg_0]                                            ; +0x39, 0x1402ae989\nlea     rdx, [rsp+88h+arg_18]                                          ; +0x41, 0x1402ae991\nlea     rcx, [rbx-140h]                                                ; +0x49, 0x1402ae999\ncall    cs:?convertToNodeSpace@CCNode@cocos2d@@QEAA?AVCCPoint@2@AEBV32@@Z; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const &) ; +0x50, 0x1402ae9a0\nmov     rdx, rax                                                       ; +0x56, 0x1402ae9a6\nlea     rcx, [rsp+88h+arg_0]                                           ; +0x59, 0x1402ae9a9\ncall    cs:??4CCPoint@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCPoint::operator=(cocos2d::CCPoint const &) ; +0x61, 0x1402ae9b1\nmov     rcx, [rbx+0C8h]                                                ; +0x67, 0x1402ae9b7\nmov     rax, [rcx]                                                     ; +0x6e, 0x1402ae9be\ncall    qword ptr [rax+0C8h]                                           ; +0x71, 0x1402ae9c1\nmovss   xmm6, dword ptr [rax+4]                                        ; +0x77, 0x1402ae9c7\nmov     rcx, [rbx+0C8h]                                                ; +0x7c, 0x1402ae9cc\nmov     rax, [rcx]                                                     ; +0x83, 0x1402ae9d3\ncall    qword ptr [rax+0C8h]                                           ; +0x86, 0x1402ae9d6\nsubss   xmm6, cs:dword_1406231D0                                       ; +0x8c, 0x1402ae9dc\naddss   xmm6, cs:flt_14062307C                                         ; +0x94, 0x1402ae9e4\nmovss   xmm1, dword ptr [rax]                                          ; +0x9c, 0x1402ae9ec\nsubss   xmm1, cs:dword_1406231B0                                       ; +0xa0, 0x1402ae9f0\nmovss   xmm0, cs:dword_140623294                                       ; +0xa8, 0x1402ae9f8\nmovss   [rsp+88h+var_68], xmm0                                         ; +0xb0, 0x1402aea00\nmovss   xmm3, cs:dword_14062326C                                       ; +0xb6, 0x1402aea06\nmovaps  xmm2, xmm6                                                     ; +0xbe, 0x1402aea0e\nlea     rcx, [rsp+88h+var_50]                                          ; +0xc1, 0x1402aea11\ncall    cs:??0CCRect@cocos2d@@QEAA@MMMM@Z; cocos2d::CCRect::CCRect(float,float,float,float) ; +0xc6, 0x1402aea16\nlea     rdx, [rsp+88h+arg_0]                                           ; +0xcc, 0x1402aea1c\nlea     rcx, [rsp+88h+var_50]                                          ; +0xd4, 0x1402aea24\ncall    cs:?containsPoint@CCRect@cocos2d@@QEBA_NAEBVCCPoint@2@@Z; cocos2d::CCRect::containsPoint(cocos2d::CCPoint const &) ; +0xd9, 0x1402aea29\ntest    al, al                                                         ; +0xdf, 0x1402aea2f\njz      loc_1402AEB70                                                  ; +0xe1, 0x1402aea31\nmov     rax, [rbx+0C8h]                                                ; +0xe7, 0x1402aea37\ncmp     byte ptr [rax+2F5h], 0                                         ; +0xee, 0x1402aea3e\njnz     loc_1402AEB70                                                  ; +0xf5, 0x1402aea45\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xfb, 0x1402aea4b\ntest    rcx, rcx                                                       ; +0x102, 0x1402aea52\njnz     short loc_1402AEA89                                            ; +0x105, 0x1402aea55\nmov     ecx, 668h; Size                                                ; +0x107, 0x1402aea57\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x10c, 0x1402aea5c\nmov     [rsp+88h+arg_18], rax                                          ; +0x111, 0x1402aea61\nmov     rcx, rax                                                       ; +0x119, 0x1402aea69\ncall    sub_14017AB00                                                  ; +0x11c, 0x1402aea6c\nnop                                                                    ; +0x121, 0x1402aea71\nmov     cs:qword_1406C2ED8, rax                                        ; +0x122, 0x1402aea72\nmov     rdx, [rax]                                                     ; +0x129, 0x1402aea79\nmov     rcx, rax                                                       ; +0x12c, 0x1402aea7c\ncall    qword ptr [rdx+48h]                                            ; +0x12f, 0x1402aea7f\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x132, 0x1402aea82\nlea     rdx, word_14055A648                                            ; +0x139, 0x1402aea89\ncall    GameManager__getUGV                                            ; +0x140, 0x1402aea90\ntest    al, al                                                         ; +0x145, 0x1402aea95\njz      loc_1402AEB20                                                  ; +0x147, 0x1402aea97\nlea     rax, [rsp+88h+var_40]                                          ; +0x14d, 0x1402aea9d\nmov     [rsp+88h+arg_18], rax                                          ; +0x152, 0x1402aeaa2\nxorps   xmm0, xmm0                                                     ; +0x15a, 0x1402aeaaa\nmovups  [rsp+88h+var_40], xmm0                                         ; +0x15d, 0x1402aeaad\nmov     [rsp+88h+var_30], 4                                            ; +0x162, 0x1402aeab2\nmov     [rsp+88h+var_28], 0Fh                                          ; +0x16b, 0x1402aeabb\nmov     eax, cs:dword_1405628D0                                        ; +0x174, 0x1402aeac4\nmov     dword ptr [rsp+88h+var_40], eax                                ; +0x17a, 0x1402aeaca\nmov     byte ptr [rsp+88h+var_40+4], 0                                 ; +0x17e, 0x1402aeace\nmov     rcx, cs:qword_1406C2EE8                                        ; +0x183, 0x1402aead3\ntest    rcx, rcx                                                       ; +0x18a, 0x1402aeada\njnz     short loc_1402AEB0E                                            ; +0x18d, 0x1402aeadd\nmov     ecx, 3E0h; Size                                                ; +0x18f, 0x1402aeadf\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x194, 0x1402aeae4\nmov     [rsp+88h+var_58], rax                                          ; +0x199, 0x1402aeae9\nmov     rcx, rax                                                       ; +0x19e, 0x1402aeaee\ncall    sub_1401D0AE0                                                  ; +0x1a1, 0x1402aeaf1\nnop                                                                    ; +0x1a6, 0x1402aeaf6\nmov     cs:qword_1406C2EE8, rax                                        ; +0x1a7, 0x1402aeaf7\nmov     rdx, [rax]                                                     ; +0x1ae, 0x1402aeafe\nmov     rcx, rax                                                       ; +0x1b1, 0x1402aeb01\ncall    qword ptr [rdx+48h]                                            ; +0x1b4, 0x1402aeb04\nmov     rcx, cs:qword_1406C2EE8                                        ; +0x1b7, 0x1402aeb07\nlea     rdx, [rsp+88h+var_40]                                          ; +0x1be, 0x1402aeb0e\ncall    GameStatsManager__isSpecialChestUnlocked                       ; +0x1c3, 0x1402aeb13\ntest    al, al                                                         ; +0x1c8, 0x1402aeb18\njnz     short loc_1402AEB20                                            ; +0x1ca, 0x1402aeb1a\nmov     cl, 1                                                          ; +0x1cc, 0x1402aeb1c\njmp     short loc_1402AEB22                                            ; +0x1ce, 0x1402aeb1e\nxor     cl, cl                                                         ; +0x1d0, 0x1402aeb20\nmov     rax, [rbx+0C8h]                                                ; +0x1d2, 0x1402aeb22\ncmp     dword ptr [rax+2F8h], 5                                        ; +0x1d9, 0x1402aeb29\njge     short loc_1402AEB40                                            ; +0x1e0, 0x1402aeb30\ntest    cl, cl                                                         ; +0x1e2, 0x1402aeb32\njnz     short loc_1402AEB40                                            ; +0x1e4, 0x1402aeb34\nmov     rcx, rax                                                       ; +0x1e6, 0x1402aeb36\ncall    AnimatedShopKeeper__playReactAnimation                         ; +0x1e9, 0x1402aeb39\njmp     short loc_1402AEB70                                            ; +0x1ee, 0x1402aeb3e\nmov     dword ptr [rax+2F8h], 2                                        ; +0x1f0, 0x1402aeb40\nlea     rcx, [rbx-140h]                                                ; +0x1fa, 0x1402aeb4a\ncall    GJShopLayer__showReactMessage                                  ; +0x201, 0x1402aeb51\ncmp     dword ptr [rbx+0D0h], 9                                        ; +0x206, 0x1402aeb56\njnz     short loc_1402AEB70                                            ; +0x20d, 0x1402aeb5d\nmov     rax, [rbx+0C8h]                                                ; +0x20f, 0x1402aeb5f\nmov     dword ptr [rax+2F8h], 0                                        ; +0x216, 0x1402aeb66\nmov     al, 1                                                          ; +0x220, 0x1402aeb70\nmov     rbx, [rsp+88h+arg_8]                                           ; +0x222, 0x1402aeb72\nmovaps  xmm6, [rsp+88h+var_18]                                         ; +0x22a, 0x1402aeb7a\nadd     rsp, 80h                                                       ; +0x22f, 0x1402aeb7f\npop     rdi                                                            ; +0x236, 0x1402aeb86\nretn                                                                   ; +0x237, 0x1402aeb87", "xrefs": ["<???> @ 0x14057e268", "<???> @ 0x1406d2288"], "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"}