{"type": "func", "start": 5372733136, "end": 5372733653, "name": "SecretRewardsLayer::onShop", "pseudocode": "// \n// SecretRewardsLayer::onShop from 0x1403d66d0 to 0x1403d68d5 (517 bytes)\n// \n// 2 xrefs:\n// > SecretRewardsLayer::init @ 0x1403d46b8\n// > <???> @ 0x1406d7d48\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=4\nvoid SecretRewardsLayer::onShop(SecretRewardsLayer *a1, cocos2d::CCObject *a2)\n{\n  int v3; // eax\n  ShopType v4; // ebx\n  GameManager *v5; // rcx\n  GameManager *v6; // rcx\n  GameManager *v7; // rcx\n  GameManager *v8; // rcx\n  struct cocos2d::CCScene *v9; // rax\n  struct cocos2d::CCTransitionMoveInT *v10; // rbx\n  __int64 v11; // rcx\n  cocos2d::CCDirector *v12; // rax\n  char v13; // al\n  void *v14; // [rsp+38h] [rbp+10h]\n  void *v15; // [rsp+38h] [rbp+10h]\n  void *v16; // [rsp+38h] [rbp+10h]\n  void *v17; // [rsp+38h] [rbp+10h]\n\n  v3 = a2->getTag(a2);\n  v4 = v3;\n  switch ( v3 )\n  {\n    case 1:\n      v8 = (GameManager *)qword_1406C2ED8;\n      if ( !qword_1406C2ED8 )\n      {\n        v17 = operator new(0x668u);\n        qword_1406C2ED8 = sub_14017AB00((__int64)v17);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n        v8 = (GameManager *)qword_1406C2ED8;\n      }\n      if ( !GameManager::getUGV(v8, \"11\") )\n      {\n        SecretRewardsLayer::showDialog01(a1);\n        return;\n      }\n      break;\n    case 2:\n      v7 = (GameManager *)qword_1406C2ED8;\n      if ( !qword_1406C2ED8 )\n      {\n        v16 = operator new(0x668u);\n        qword_1406C2ED8 = sub_14017AB00((__int64)v16);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n        v7 = (GameManager *)qword_1406C2ED8;\n      }\n      if ( !GameManager::getUGV(v7, (const char *)&word_140544448) )\n      {\n        SecretRewardsLayer::showDialog03(a1);\n        return;\n      }\n      break;\n    case 3:\n      v6 = (GameManager *)qword_1406C2ED8;\n      if ( !qword_1406C2ED8 )\n      {\n        v15 = operator new(0x668u);\n        qword_1406C2ED8 = sub_14017AB00((__int64)v15);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n        v6 = (GameManager *)qword_1406C2ED8;\n      }\n      if ( !GameManager::getUGV(v6, (const char *)&word_14055A64C) )\n      {\n        SecretRewardsLayer::showDialogMechanic(a1);\n        return;\n      }\n      break;\n    case 4:\n      v5 = (GameManager *)qword_1406C2ED8;\n      if ( !qword_1406C2ED8 )\n      {\n        v14 = operator new(0x668u);\n        qword_1406C2ED8 = sub_14017AB00((__int64)v14);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n        v5 = (GameManager *)qword_1406C2ED8;\n      }\n      if ( !GameManager::getUGV(v5, \"34\") )\n      {\n        SecretRewardsLayer::showDialogDiamond(a1);\n        return;\n      }\n      break;\n    default:\n      return;\n  }\n  v9 = GJShopLayer::scene(v4);\n  v10 = cocos2d::CCTransitionMoveInT::create(0.5, v9);\n  v12 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v11);\n  cocos2d::CCDirector::replaceScene(v12, v10);\n  if ( v13 )\n    a1->setKeypadEnabled(a1, 0);\n}", "assembly": "; \n; SecretRewardsLayer::onShop from 0x1403d66d0 to 0x1403d68d5 (517 bytes)\n; \n; 2 xrefs:\n; > SecretRewardsLayer::init @ 0x1403d46b8\n; > <???> @ 0x1406d7d48\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_0], rbx                                               ; +0x0, 0x1403d66d0\npush    rdi                                                            ; +0x5, 0x1403d66d5\nsub     rsp, 20h                                                       ; +0x6, 0x1403d66d6\nmov     rdi, rcx                                                       ; +0xa, 0x1403d66da\nmov     rax, [rdx]                                                     ; +0xd, 0x1403d66dd\nmov     rcx, rdx                                                       ; +0x10, 0x1403d66e0\ncall    qword ptr [rax+38h]                                            ; +0x13, 0x1403d66e3\nmov     ebx, eax                                                       ; +0x16, 0x1403d66e6\nmov     r8d, eax                                                       ; +0x18, 0x1403d66e8\nsub     r8d, 1                                                         ; +0x1b, 0x1403d66eb\njz      loc_1403D682E                                                  ; +0x1f, 0x1403d66ef\nsub     r8d, 1                                                         ; +0x25, 0x1403d66f5\njz      loc_1403D67D1                                                  ; +0x29, 0x1403d66f9\nsub     r8d, 1                                                         ; +0x2f, 0x1403d66ff\njz      short loc_1403D6770                                            ; +0x33, 0x1403d6703\ncmp     r8d, 1                                                         ; +0x35, 0x1403d6705\njnz     loc_1403D68CA                                                  ; +0x39, 0x1403d6709\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x3f, 0x1403d670f\ntest    rcx, rcx                                                       ; +0x46, 0x1403d6716\njnz     short loc_1403D674A                                            ; +0x49, 0x1403d6719\nmov     ecx, 668h; Size                                                ; +0x4b, 0x1403d671b\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x50, 0x1403d6720\nmov     [rsp+28h+arg_8], rax                                           ; +0x55, 0x1403d6725\nmov     rcx, rax                                                       ; +0x5a, 0x1403d672a\ncall    sub_14017AB00                                                  ; +0x5d, 0x1403d672d\nnop                                                                    ; +0x62, 0x1403d6732\nmov     cs:qword_1406C2ED8, rax                                        ; +0x63, 0x1403d6733\nmov     rdx, [rax]                                                     ; +0x6a, 0x1403d673a\nmov     rcx, rax                                                       ; +0x6d, 0x1403d673d\ncall    qword ptr [rdx+48h]                                            ; +0x70, 0x1403d6740\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x73, 0x1403d6743\nlea     rdx, a34; \"34\"                                                 ; +0x7a, 0x1403d674a\ncall    GameManager__getUGV                                            ; +0x81, 0x1403d6751\ntest    al, al                                                         ; +0x86, 0x1403d6756\njnz     loc_1403D688B                                                  ; +0x88, 0x1403d6758\nmov     rcx, rdi                                                       ; +0x8e, 0x1403d675e\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x91, 0x1403d6761\nadd     rsp, 20h                                                       ; +0x96, 0x1403d6766\npop     rdi                                                            ; +0x9a, 0x1403d676a\njmp     SecretRewardsLayer__showDialogDiamond                          ; +0x9b, 0x1403d676b\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xa0, 0x1403d6770\ntest    rcx, rcx                                                       ; +0xa7, 0x1403d6777\njnz     short loc_1403D67AB                                            ; +0xaa, 0x1403d677a\nmov     ecx, 668h; Size                                                ; +0xac, 0x1403d677c\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xb1, 0x1403d6781\nmov     [rsp+28h+arg_8], rax                                           ; +0xb6, 0x1403d6786\nmov     rcx, rax                                                       ; +0xbb, 0x1403d678b\ncall    sub_14017AB00                                                  ; +0xbe, 0x1403d678e\nnop                                                                    ; +0xc3, 0x1403d6793\nmov     cs:qword_1406C2ED8, rax                                        ; +0xc4, 0x1403d6794\nmov     rdx, [rax]                                                     ; +0xcb, 0x1403d679b\nmov     rcx, rax                                                       ; +0xce, 0x1403d679e\ncall    qword ptr [rdx+48h]                                            ; +0xd1, 0x1403d67a1\nmov     rcx, cs:qword_1406C2ED8                                        ; +0xd4, 0x1403d67a4\nlea     rdx, word_14055A64C                                            ; +0xdb, 0x1403d67ab\ncall    GameManager__getUGV                                            ; +0xe2, 0x1403d67b2\ntest    al, al                                                         ; +0xe7, 0x1403d67b7\njnz     loc_1403D688B                                                  ; +0xe9, 0x1403d67b9\nmov     rcx, rdi                                                       ; +0xef, 0x1403d67bf\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xf2, 0x1403d67c2\nadd     rsp, 20h                                                       ; +0xf7, 0x1403d67c7\npop     rdi                                                            ; +0xfb, 0x1403d67cb\njmp     SecretRewardsLayer__showDialogMechanic                         ; +0xfc, 0x1403d67cc\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x101, 0x1403d67d1\ntest    rcx, rcx                                                       ; +0x108, 0x1403d67d8\njnz     short loc_1403D680C                                            ; +0x10b, 0x1403d67db\nmov     ecx, 668h; Size                                                ; +0x10d, 0x1403d67dd\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x112, 0x1403d67e2\nmov     [rsp+28h+arg_8], rax                                           ; +0x117, 0x1403d67e7\nmov     rcx, rax                                                       ; +0x11c, 0x1403d67ec\ncall    sub_14017AB00                                                  ; +0x11f, 0x1403d67ef\nnop                                                                    ; +0x124, 0x1403d67f4\nmov     cs:qword_1406C2ED8, rax                                        ; +0x125, 0x1403d67f5\nmov     rdx, [rax]                                                     ; +0x12c, 0x1403d67fc\nmov     rcx, rax                                                       ; +0x12f, 0x1403d67ff\ncall    qword ptr [rdx+48h]                                            ; +0x132, 0x1403d6802\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x135, 0x1403d6805\nlea     rdx, word_140544448                                            ; +0x13c, 0x1403d680c\ncall    GameManager__getUGV                                            ; +0x143, 0x1403d6813\ntest    al, al                                                         ; +0x148, 0x1403d6818\njnz     short loc_1403D688B                                            ; +0x14a, 0x1403d681a\nmov     rcx, rdi                                                       ; +0x14c, 0x1403d681c\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x14f, 0x1403d681f\nadd     rsp, 20h                                                       ; +0x154, 0x1403d6824\npop     rdi                                                            ; +0x158, 0x1403d6828\njmp     SecretRewardsLayer__showDialog03                               ; +0x159, 0x1403d6829\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x15e, 0x1403d682e\ntest    rcx, rcx                                                       ; +0x165, 0x1403d6835\njnz     short loc_1403D6869                                            ; +0x168, 0x1403d6838\nmov     ecx, 668h; Size                                                ; +0x16a, 0x1403d683a\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x16f, 0x1403d683f\nmov     [rsp+28h+arg_8], rax                                           ; +0x174, 0x1403d6844\nmov     rcx, rax                                                       ; +0x179, 0x1403d6849\ncall    sub_14017AB00                                                  ; +0x17c, 0x1403d684c\nnop                                                                    ; +0x181, 0x1403d6851\nmov     cs:qword_1406C2ED8, rax                                        ; +0x182, 0x1403d6852\nmov     rdx, [rax]                                                     ; +0x189, 0x1403d6859\nmov     rcx, rax                                                       ; +0x18c, 0x1403d685c\ncall    qword ptr [rdx+48h]                                            ; +0x18f, 0x1403d685f\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x192, 0x1403d6862\nlea     rdx, a11; \"11\"                                                 ; +0x199, 0x1403d6869\ncall    GameManager__getUGV                                            ; +0x1a0, 0x1403d6870\ntest    al, al                                                         ; +0x1a5, 0x1403d6875\njnz     short loc_1403D688B                                            ; +0x1a7, 0x1403d6877\nmov     rcx, rdi                                                       ; +0x1a9, 0x1403d6879\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x1ac, 0x1403d687c\nadd     rsp, 20h                                                       ; +0x1b1, 0x1403d6881\npop     rdi                                                            ; +0x1b5, 0x1403d6885\njmp     SecretRewardsLayer__showDialog01                               ; +0x1b6, 0x1403d6886\nmov     ecx, ebx                                                       ; +0x1bb, 0x1403d688b\ncall    GJShopLayer__scene                                             ; +0x1bd, 0x1403d688d\nmov     rdx, rax                                                       ; +0x1c2, 0x1403d6892\nmovss   xmm0, cs:dword_140622B08                                       ; +0x1c5, 0x1403d6895\ncall    cs:?create@CCTransitionMoveInT@cocos2d@@SAPEAV12@MPEAVCCScene@2@@Z; cocos2d::CCTransitionMoveInT::create(float,cocos2d::CCScene *) ; +0x1cd, 0x1403d689d\nmov     rbx, rax                                                       ; +0x1d3, 0x1403d68a3\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x1d6, 0x1403d68a6\nmov     rcx, rax                                                       ; +0x1dc, 0x1403d68ac\nmov     rdx, rbx                                                       ; +0x1df, 0x1403d68af\ncall    cs:?replaceScene@CCDirector@cocos2d@@QEAA_NPEAVCCScene@2@@Z; cocos2d::CCDirector::replaceScene(cocos2d::CCScene *) ; +0x1e2, 0x1403d68b2\ntest    al, al                                                         ; +0x1e8, 0x1403d68b8\njz      short loc_1403D68CA                                            ; +0x1ea, 0x1403d68ba\nmov     rax, [rdi]                                                     ; +0x1ec, 0x1403d68bc\nxor     edx, edx                                                       ; +0x1ef, 0x1403d68bf\nmov     rcx, rdi                                                       ; +0x1f1, 0x1403d68c1\ncall    qword ptr [rax+3D0h]                                           ; +0x1f4, 0x1403d68c4\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x1fa, 0x1403d68ca\nadd     rsp, 20h                                                       ; +0x1ff, 0x1403d68cf\npop     rdi                                                            ; +0x203, 0x1403d68d3\nretn                                                                   ; +0x204, 0x1403d68d4", "xrefs": ["SecretRewardsLayer::init @ 0x1403d46b8", "<???> @ 0x1406d7d48"], "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"}