{"type": "func", "start": 5372595456, "end": 5372596030, "name": "GJShopLayer::ccTouchBegan", "pseudocode": "// \n// GJShopLayer::ccTouchBegan from 0x1403b4d00 to 0x1403b4f3e (574 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x140780a30\n// > <???> @ 0x140923c48\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:31:24 +0000\n// \n\n// Hidden C++ exception states: #wind=3\nchar __fastcall GJShopLayer::ccTouchBegan(__int64 a1, __int64 a2)\n{\n  __int64 v4; // rax\n  float v5; // xmm6_4\n  float *v6; // rax\n  __int64 v7; // rcx\n  __int64 v8; // rcx\n  char v9; // cl\n  __int64 v10; // rax\n  void *v11; // [rsp+30h] [rbp-58h]\n  _BYTE v12[16]; // [rsp+38h] [rbp-50h] BYREF\n  __int128 v13; // [rsp+48h] [rbp-40h] BYREF\n  __int64 v14; // [rsp+58h] [rbp-30h]\n  __int64 v15; // [rsp+60h] [rbp-28h]\n  char v16; // [rsp+90h] [rbp+8h] BYREF\n  __int128 *v17; // [rsp+A8h] [rbp+20h] BYREF\n\n  if ( *(_DWORD *)(a1 + 136) )\n    return 0;\n  cocos2d::CCTouch::getLocation(a2, &v16);\n  cocos2d::CCNode::convertToNodeSpace(a1 - 320, &v17, &v16);\n  cocos2d::CCPoint::operator=(&v16, v4);\n  v5 = (float)(*(float *)((*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 200) + 200LL))(*(_QWORD *)(a1 + 200))\n                        + 4)\n             - 45.0)\n     + 10.0;\n  v6 = (float *)(*(__int64 (__fastcall **)(_QWORD))(**(_QWORD **)(a1 + 200) + 200LL))(*(_QWORD *)(a1 + 200));\n  cocos2d::CCRect::CCRect((cocos2d::CCRect *)v12, *v6 - 40.0, v5, 80.0, 90.0);\n  if ( cocos2d::CCRect::containsPoint((cocos2d::CCRect *)v12, (const struct cocos2d::CCPoint *)&v16)\n    && !*(_BYTE *)(*(_QWORD *)(a1 + 200) + 757LL) )\n  {\n    v7 = qword_14090BFD0;\n    if ( !qword_14090BFD0 )\n    {\n      v17 = (__int128 *)operator new(0x6E8u);\n      qword_14090BFD0 = GameManager::GameManager((__int64)v17);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n      v7 = qword_14090BFD0;\n    }\n    if ( !GameManager::getUGV(v7, &word_14075A9CC) )\n      goto LABEL_12;\n    v17 = &v13;\n    v13 = 0;\n    v14 = 4;\n    v15 = 15;\n    strcpy((char *)&v13, \"0022\");\n    v8 = qword_14090BFE0;\n    if ( !qword_14090BFE0 )\n    {\n      v11 = operator new(0x3E8u);\n      qword_14090BFE0 = sub_1402D6480((__int64)v11);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);\n      v8 = qword_14090BFE0;\n    }\n    if ( GameStatsManager::isSpecialChestUnlocked(v8, &v13) )\nLABEL_12:\n      v9 = 0;\n    else\n      v9 = 1;\n    v10 = *(_QWORD *)(a1 + 200);\n    if ( *(int *)(v10 + 760) >= 5 || v9 )\n    {\n      *(_DWORD *)(v10 + 760) = 2;\n      GJShopLayer::showReactMessage((_DWORD *)(a1 - 320));\n      if ( *(_DWORD *)(a1 + 208) == 9 )\n        *(_DWORD *)(*(_QWORD *)(a1 + 200) + 760LL) = 0;\n    }\n    else\n    {\n      AnimatedShopKeeper::playReactAnimation(*(_QWORD *)(a1 + 200));\n    }\n  }\n  return 1;\n}", "assembly": "; \n; GJShopLayer::ccTouchBegan from 0x1403b4d00 to 0x1403b4f3e (574 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x140780a30\n; > <???> @ 0x140923c48\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:31:24 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x1403b4d00\npush    rdi                                                            ; +0x5, 0x1403b4d05\nsub     rsp, 80h                                                       ; +0x6, 0x1403b4d06\nmovaps  [rsp+88h+var_18], xmm6                                         ; +0xd, 0x1403b4d0d\nmov     rax, rdx                                                       ; +0x12, 0x1403b4d12\nmov     rbx, rcx                                                       ; +0x15, 0x1403b4d15\ncmp     dword ptr [rcx+88h], 0                                         ; +0x18, 0x1403b4d18\njz      short loc_1403B4D28                                            ; +0x1f, 0x1403b4d1f\nxor     al, al                                                         ; +0x21, 0x1403b4d21\njmp     loc_1403B4F28                                                  ; +0x23, 0x1403b4d23\nlea     rdx, [rsp+88h+arg_0]                                           ; +0x28, 0x1403b4d28\nmov     rcx, rax                                                       ; +0x30, 0x1403b4d30\ncall    cs:?getLocation@CCTouch@cocos2d@@QEBA?AVCCPoint@2@XZ; cocos2d::CCTouch::getLocation(void) ; +0x33, 0x1403b4d33\nlea     r8, [rsp+88h+arg_0]                                            ; +0x39, 0x1403b4d39\nlea     rdx, [rsp+88h+arg_18]                                          ; +0x41, 0x1403b4d41\nlea     rcx, [rbx-140h]                                                ; +0x49, 0x1403b4d49\ncall    cs:?convertToNodeSpace@CCNode@cocos2d@@QEAA?AVCCPoint@2@AEBV32@@Z; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const &) ; +0x50, 0x1403b4d50\nmov     rdx, rax                                                       ; +0x56, 0x1403b4d56\nlea     rcx, [rsp+88h+arg_0]                                           ; +0x59, 0x1403b4d59\ncall    cs:??4CCPoint@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCPoint::operator=(cocos2d::CCPoint const &) ; +0x61, 0x1403b4d61\nmov     rcx, [rbx+0C8h]                                                ; +0x67, 0x1403b4d67\nmov     rax, [rcx]                                                     ; +0x6e, 0x1403b4d6e\ncall    qword ptr [rax+0C8h]                                           ; +0x71, 0x1403b4d71\nmovss   xmm6, dword ptr [rax+4]                                        ; +0x77, 0x1403b4d77\nsubss   xmm6, cs:dword_140835690                                       ; +0x7c, 0x1403b4d7c\naddss   xmm6, cs:flt_1408354EC                                         ; +0x84, 0x1403b4d84\nmov     rcx, [rbx+0C8h]                                                ; +0x8c, 0x1403b4d8c\nmov     rax, [rcx]                                                     ; +0x93, 0x1403b4d93\ncall    qword ptr [rax+0C8h]                                           ; +0x96, 0x1403b4d96\nmovss   xmm1, dword ptr [rax]                                          ; +0x9c, 0x1403b4d9c\nsubss   xmm1, cs:dword_140835674                                       ; +0xa0, 0x1403b4da0\nmovss   xmm0, cs:flt_140835780                                         ; +0xa8, 0x1403b4da8\nmovss   [rsp+88h+var_68], xmm0                                         ; +0xb0, 0x1403b4db0\nmovss   xmm3, cs:dword_14083574C                                       ; +0xb6, 0x1403b4db6\nmovaps  xmm2, xmm6                                                     ; +0xbe, 0x1403b4dbe\nlea     rcx, [rsp+88h+var_50]                                          ; +0xc1, 0x1403b4dc1\ncall    cs:??0CCRect@cocos2d@@QEAA@MMMM@Z; cocos2d::CCRect::CCRect(float,float,float,float) ; +0xc6, 0x1403b4dc6\nlea     rdx, [rsp+88h+arg_0]                                           ; +0xcc, 0x1403b4dcc\nlea     rcx, [rsp+88h+var_50]                                          ; +0xd4, 0x1403b4dd4\ncall    cs:?containsPoint@CCRect@cocos2d@@QEBA_NAEBVCCPoint@2@@Z; cocos2d::CCRect::containsPoint(cocos2d::CCPoint const &) ; +0xd9, 0x1403b4dd9\ntest    al, al                                                         ; +0xdf, 0x1403b4ddf\njz      loc_1403B4F26                                                  ; +0xe1, 0x1403b4de1\nmov     rax, [rbx+0C8h]                                                ; +0xe7, 0x1403b4de7\ncmp     byte ptr [rax+2F5h], 0                                         ; +0xee, 0x1403b4dee\njnz     loc_1403B4F26                                                  ; +0xf5, 0x1403b4df5\nmov     rcx, cs:qword_14090BFD0                                        ; +0xfb, 0x1403b4dfb\ntest    rcx, rcx                                                       ; +0x102, 0x1403b4e02\njnz     short loc_1403B4E3C                                            ; +0x105, 0x1403b4e05\nmov     ecx, 6E8h; Size                                                ; +0x107, 0x1403b4e07\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x10c, 0x1403b4e0c\nmov     [rsp+88h+arg_18], rax                                          ; +0x111, 0x1403b4e11\nmov     rcx, rax                                                       ; +0x119, 0x1403b4e19\ncall    GameManager__GameManager                                       ; +0x11c, 0x1403b4e1c\nnop                                                                    ; +0x121, 0x1403b4e21\nmov     cs:qword_14090BFD0, rax                                        ; +0x122, 0x1403b4e22\nmov     rcx, [rax]                                                     ; +0x129, 0x1403b4e29\nmov     rdx, [rcx+48h]                                                 ; +0x12c, 0x1403b4e2c\nmov     rcx, rax                                                       ; +0x130, 0x1403b4e30\ncall    rdx                                                            ; +0x133, 0x1403b4e33\nmov     rcx, cs:qword_14090BFD0                                        ; +0x135, 0x1403b4e35\nlea     rdx, word_14075A9CC                                            ; +0x13c, 0x1403b4e3c\ncall    GameManager__getUGV                                            ; +0x143, 0x1403b4e43\ntest    al, al                                                         ; +0x148, 0x1403b4e48\njz      loc_1403B4ED6                                                  ; +0x14a, 0x1403b4e4a\nlea     rax, [rsp+88h+var_40]                                          ; +0x150, 0x1403b4e50\nmov     [rsp+88h+arg_18], rax                                          ; +0x155, 0x1403b4e55\nxorps   xmm0, xmm0                                                     ; +0x15d, 0x1403b4e5d\nmovups  [rsp+88h+var_40], xmm0                                         ; +0x160, 0x1403b4e60\nmov     [rsp+88h+var_30], 4                                            ; +0x165, 0x1403b4e65\nmov     [rsp+88h+var_28], 0Fh                                          ; +0x16e, 0x1403b4e6e\nmov     eax, cs:dword_140767460                                        ; +0x177, 0x1403b4e77\nmov     dword ptr [rsp+88h+var_40], eax                                ; +0x17d, 0x1403b4e7d\nmov     byte ptr [rsp+88h+var_40+4], 0                                 ; +0x181, 0x1403b4e81\nmov     rcx, cs:qword_14090BFE0                                        ; +0x186, 0x1403b4e86\ntest    rcx, rcx                                                       ; +0x18d, 0x1403b4e8d\njnz     short loc_1403B4EC4                                            ; +0x190, 0x1403b4e90\nmov     ecx, 3E8h; Size                                                ; +0x192, 0x1403b4e92\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x197, 0x1403b4e97\nmov     [rsp+88h+var_58], rax                                          ; +0x19c, 0x1403b4e9c\nmov     rcx, rax                                                       ; +0x1a1, 0x1403b4ea1\ncall    sub_1402D6480                                                  ; +0x1a4, 0x1403b4ea4\nnop                                                                    ; +0x1a9, 0x1403b4ea9\nmov     cs:qword_14090BFE0, rax                                        ; +0x1aa, 0x1403b4eaa\nmov     rcx, [rax]                                                     ; +0x1b1, 0x1403b4eb1\nmov     rdx, [rcx+48h]                                                 ; +0x1b4, 0x1403b4eb4\nmov     rcx, rax                                                       ; +0x1b8, 0x1403b4eb8\ncall    rdx                                                            ; +0x1bb, 0x1403b4ebb\nmov     rcx, cs:qword_14090BFE0                                        ; +0x1bd, 0x1403b4ebd\nlea     rdx, [rsp+88h+var_40]                                          ; +0x1c4, 0x1403b4ec4\ncall    GameStatsManager__isSpecialChestUnlocked                       ; +0x1c9, 0x1403b4ec9\ntest    al, al                                                         ; +0x1ce, 0x1403b4ece\njnz     short loc_1403B4ED6                                            ; +0x1d0, 0x1403b4ed0\nmov     cl, 1                                                          ; +0x1d2, 0x1403b4ed2\njmp     short loc_1403B4ED8                                            ; +0x1d4, 0x1403b4ed4\nxor     cl, cl                                                         ; +0x1d6, 0x1403b4ed6\nmov     rax, [rbx+0C8h]                                                ; +0x1d8, 0x1403b4ed8\ncmp     dword ptr [rax+2F8h], 5                                        ; +0x1df, 0x1403b4edf\njge     short loc_1403B4EF6                                            ; +0x1e6, 0x1403b4ee6\ntest    cl, cl                                                         ; +0x1e8, 0x1403b4ee8\njnz     short loc_1403B4EF6                                            ; +0x1ea, 0x1403b4eea\nmov     rcx, rax                                                       ; +0x1ec, 0x1403b4eec\ncall    AnimatedShopKeeper__playReactAnimation                         ; +0x1ef, 0x1403b4eef\njmp     short loc_1403B4F26                                            ; +0x1f4, 0x1403b4ef4\nmov     dword ptr [rax+2F8h], 2                                        ; +0x1f6, 0x1403b4ef6\nlea     rcx, [rbx-140h]                                                ; +0x200, 0x1403b4f00\ncall    GJShopLayer__showReactMessage                                  ; +0x207, 0x1403b4f07\ncmp     dword ptr [rbx+0D0h], 9                                        ; +0x20c, 0x1403b4f0c\njnz     short loc_1403B4F26                                            ; +0x213, 0x1403b4f13\nmov     rax, [rbx+0C8h]                                                ; +0x215, 0x1403b4f15\nmov     dword ptr [rax+2F8h], 0                                        ; +0x21c, 0x1403b4f1c\nmov     al, 1                                                          ; +0x226, 0x1403b4f26\nmov     rbx, [rsp+88h+arg_8]                                           ; +0x228, 0x1403b4f28\nmovaps  xmm6, [rsp+88h+var_18]                                         ; +0x230, 0x1403b4f30\nadd     rsp, 80h                                                       ; +0x235, 0x1403b4f35\npop     rdi                                                            ; +0x23c, 0x1403b4f3c\nretn                                                                   ; +0x23d, 0x1403b4f3d", "xrefs": ["<???> @ 0x140780a30", "<???> @ 0x140923c48"], "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"}