{"type": "func", "start": 5371351472, "end": 5371352043, "name": "GJPathsLayer::onPath", "pseudocode": "// \n// GJPathsLayer::onPath from 0x1402851b0 to 0x1402853eb (571 bytes)\n// \n// 3 xrefs:\n// > GJPathsLayer::init @ 0x140284fdd\n// > <???> @ 0x1406d1544\n// > <???> @ 0x1406d1550\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=5\nvoid GJPathsLayer::onPath(GJPathsLayer *a1, cocos2d::CCObject *a2)\n{\n  int v3; // edi\n  GJPathPage *v4; // rax\n  GameStatsManager *v5; // rbx\n  const char *v6; // rax\n  int Stat; // ebx\n  __int64 v8; // rcx\n  __int64 v9; // rbx\n  _QWORD *v10; // rax\n  bool isSpecialChestUnlocked; // bl\n  GJPathRewardPopup *v12; // rbx\n  void (*show)(FLAlertLayer *); // rdx\n  void *v14; // [rsp+20h] [rbp-78h]\n  void *v15; // [rsp+20h] [rbp-78h]\n  _BYTE v16[32]; // [rsp+28h] [rbp-70h] BYREF\n  _QWORD v17[4]; // [rsp+48h] [rbp-50h] BYREF\n  _QWORD v18[4]; // [rsp+68h] [rbp-30h] BYREF\n\n  v3 = a2->getTag(a2);\n  v4 = GJPathPage::create(v3, a1);\n  v4->m_noElasticity = 1;\n  v4->show(v4);\n  v5 = (GameStatsManager *)qword_1406C2EE8;\n  if ( !qword_1406C2EE8 )\n  {\n    v14 = operator new(0x3E0u);\n    qword_1406C2EE8 = sub_1401D0AE0((__int64)v14);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);\n    v5 = (GameStatsManager *)qword_1406C2EE8;\n  }\n  v6 = (const char *)GameToolbox::intToString(v18, v3 + 29);\n  if ( *((_QWORD *)v6 + 3) > 0xFu )\n    v6 = *(const char **)v6;\n  Stat = GameStatsManager::getStat(v5, v6);\n  sub_14003A830((__int64)v18);\n  if ( Stat >= 1000 )\n  {\n    v9 = qword_1406C2EE8;\n    if ( !qword_1406C2EE8 )\n    {\n      v15 = operator new(0x3E0u);\n      qword_1406C2EE8 = sub_1401D0AE0((__int64)v15);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);\n      v9 = qword_1406C2EE8;\n    }\n    GameStatsManager::getPathRewardKey(v8, v17, v3);\n    v10 = (_QWORD *)sub_14003BDB0((__int64)v16, (__int64)v17);\n    isSpecialChestUnlocked = GameStatsManager::isSpecialChestUnlocked(v9, v10);\n    sub_14003A830((__int64)v17);\n    if ( !isSpecialChestUnlocked )\n    {\n      v12 = (GJPathRewardPopup *)operator new(0x280u);\n      FLAlertLayer::FLAlertLayer(v12);\n      v12->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (GJPathRewardPopup_vtbl *)&GJPathRewardPopup::`vftable';\n      v12->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCTouchDelegate::__vftable = (cocos2d::CCTouchDelegate_vtbl *)&GJPathRewardPopup::`vftable';\n      v12->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCAccelerometerDelegate::__vftable = (cocos2d::CCAccelerometerDelegate_vtbl *)&GJPathRewardPopup::`vftable';\n      v12->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCKeypadDelegate::__vftable = (cocos2d::CCKeypadDelegate_vtbl *)&GJPathRewardPopup::`vftable';\n      v12->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCKeyboardDelegate::__vftable = (cocos2d::CCKeyboardDelegate_vtbl *)&GJPathRewardPopup::`vftable';\n      v12->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCMouseDelegate::__vftable = (cocos2d::CCMouseDelegate_vtbl *)&GJPathRewardPopup::`vftable';\n      v12->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCLayerRGBA::cocos2d::CCRGBAProtocol::__vftable = (cocos2d::CCRGBAProtocol_vtbl *)&GJPathRewardPopup::`vftable';\n      v12->FLAlertLayer::cocos2d::CCLayerColor::cocos2d::CCBlendProtocol::__vftable = (cocos2d::CCBlendProtocol_vtbl *)&GJPathRewardPopup::`vftable';\n      v12->m_pathNumber = 0;\n      if ( GJPathRewardPopup::init(v12, v3) )\n      {\n        cocos2d::CCObject::autorelease(v12);\n      }\n      else\n      {\n        ((void (__fastcall *)(GJPathRewardPopup *, __int64))v12->~GJPathRewardPopup)(v12, 1);\n        v12 = nullptr;\n      }\n      show = (void (*)(FLAlertLayer *))v12->show;\n      if ( show == FLAlertLayer::show )\n        FLAlertLayer::show(v12);\n      else\n        show(v12);\n    }\n  }\n}", "assembly": "; \n; GJPathsLayer::onPath from 0x1402851b0 to 0x1402853eb (571 bytes)\n; \n; 3 xrefs:\n; > GJPathsLayer::init @ 0x140284fdd\n; > <???> @ 0x1406d1544\n; > <???> @ 0x1406d1550\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_10], rbx                                              ; +0x0, 0x1402851b0\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x1402851b5\npush    rdi                                                            ; +0xa, 0x1402851ba\nsub     rsp, 90h                                                       ; +0xb, 0x1402851bb\nmov     rax, cs:__security_cookie                                      ; +0x12, 0x1402851c2\nxor     rax, rsp                                                       ; +0x19, 0x1402851c9\nmov     [rsp+98h+var_10], rax                                          ; +0x1c, 0x1402851cc\nmov     rbx, rcx                                                       ; +0x24, 0x1402851d4\nmov     rax, [rdx]                                                     ; +0x27, 0x1402851d7\nmov     rcx, rdx                                                       ; +0x2a, 0x1402851da\ncall    qword ptr [rax+38h]                                            ; +0x2d, 0x1402851dd\nmov     edi, eax                                                       ; +0x30, 0x1402851e0\nmov     rdx, rbx                                                       ; +0x32, 0x1402851e2\nmov     ecx, eax                                                       ; +0x35, 0x1402851e5\ncall    GJPathPage__create                                             ; +0x37, 0x1402851e7\nmov     byte ptr [rax+24Ch], 1                                         ; +0x3c, 0x1402851ec\nmov     rdx, [rax]                                                     ; +0x43, 0x1402851f3\nmov     rcx, rax                                                       ; +0x46, 0x1402851f6\ncall    qword ptr [rdx+410h]                                           ; +0x49, 0x1402851f9\nmov     rbx, cs:qword_1406C2EE8                                        ; +0x4f, 0x1402851ff\ntest    rbx, rbx                                                       ; +0x56, 0x140285206\njnz     short loc_14028523B                                            ; +0x59, 0x140285209\nmov     ecx, 3E0h; Size                                                ; +0x5b, 0x14028520b\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x60, 0x140285210\nmov     [rsp+98h+var_78], rax                                          ; +0x65, 0x140285215\nmov     rcx, rax                                                       ; +0x6a, 0x14028521a\ncall    sub_1401D0AE0                                                  ; +0x6d, 0x14028521d\nnop                                                                    ; +0x72, 0x140285222\nmov     cs:qword_1406C2EE8, rax                                        ; +0x73, 0x140285223\nmov     r8, [rax]                                                      ; +0x7a, 0x14028522a\nmov     rcx, rax                                                       ; +0x7d, 0x14028522d\ncall    qword ptr [r8+48h]                                             ; +0x80, 0x140285230\nmov     rbx, cs:qword_1406C2EE8                                        ; +0x84, 0x140285234\nlea     edx, [rdi+1Dh]                                                 ; +0x8b, 0x14028523b\nlea     rcx, [rsp+98h+var_30]                                          ; +0x8e, 0x14028523e\ncall    GameToolbox__intToString                                       ; +0x93, 0x140285243\nnop                                                                    ; +0x98, 0x140285248\ncmp     qword ptr [rax+18h], 0Fh                                       ; +0x99, 0x140285249\njbe     short loc_140285253                                            ; +0x9e, 0x14028524e\nmov     rax, [rax]                                                     ; +0xa0, 0x140285250\nmov     rdx, rax                                                       ; +0xa3, 0x140285253\nmov     rcx, rbx                                                       ; +0xa6, 0x140285256\ncall    GameStatsManager__getStat                                      ; +0xa9, 0x140285259\nmov     ebx, eax                                                       ; +0xae, 0x14028525e\nlea     rcx, [rsp+98h+var_30]                                          ; +0xb0, 0x140285260\ncall    sub_14003A830                                                  ; +0xb5, 0x140285265\ncmp     ebx, 3E8h                                                      ; +0xba, 0x14028526a\njl      loc_1402853C6                                                  ; +0xc0, 0x140285270\nmov     rbx, cs:qword_1406C2EE8                                        ; +0xc6, 0x140285276\ntest    rbx, rbx                                                       ; +0xcd, 0x14028527d\njnz     short loc_1402852B1                                            ; +0xd0, 0x140285280\nmov     ecx, 3E0h; Size                                                ; +0xd2, 0x140285282\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xd7, 0x140285287\nmov     [rsp+98h+var_78], rax                                          ; +0xdc, 0x14028528c\nmov     rcx, rax                                                       ; +0xe1, 0x140285291\ncall    sub_1401D0AE0                                                  ; +0xe4, 0x140285294\nnop                                                                    ; +0xe9, 0x140285299\nmov     cs:qword_1406C2EE8, rax                                        ; +0xea, 0x14028529a\nmov     rdx, [rax]                                                     ; +0xf1, 0x1402852a1\nmov     rcx, rax                                                       ; +0xf4, 0x1402852a4\ncall    qword ptr [rdx+48h]                                            ; +0xf7, 0x1402852a7\nmov     rbx, cs:qword_1406C2EE8                                        ; +0xfa, 0x1402852aa\nmov     r8d, edi                                                       ; +0x101, 0x1402852b1\nlea     rdx, [rsp+98h+var_50]                                          ; +0x104, 0x1402852b4\ncall    GameStatsManager__getPathRewardKey                             ; +0x109, 0x1402852b9\nnop                                                                    ; +0x10e, 0x1402852be\nlea     rdx, [rsp+98h+var_50]                                          ; +0x10f, 0x1402852bf\nlea     rcx, [rsp+98h+var_70]                                          ; +0x114, 0x1402852c4\ncall    sub_14003BDB0                                                  ; +0x119, 0x1402852c9\nmov     rdx, rax                                                       ; +0x11e, 0x1402852ce\nmov     rcx, rbx                                                       ; +0x121, 0x1402852d1\ncall    GameStatsManager__isSpecialChestUnlocked                       ; +0x124, 0x1402852d4\nmovzx   ebx, al                                                        ; +0x129, 0x1402852d9\nlea     rcx, [rsp+98h+var_50]                                          ; +0x12c, 0x1402852dc\ncall    sub_14003A830                                                  ; +0x131, 0x1402852e1\ntest    bl, bl                                                         ; +0x136, 0x1402852e6\njnz     loc_1402853C6                                                  ; +0x138, 0x1402852e8\nmov     ecx, 280h; Size                                                ; +0x13e, 0x1402852ee\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x143, 0x1402852f3\nmov     rbx, rax                                                       ; +0x148, 0x1402852f8\nmov     [rsp+98h+var_78], rax                                          ; +0x14b, 0x1402852fb\nmov     rcx, rax                                                       ; +0x150, 0x140285300\ncall    FLAlertLayer__FLAlertLayer                                     ; +0x153, 0x140285303\nlea     rax, ??_7GJPathRewardPopup@@6B@; const GJPathRewardPopup::`vftable' ; +0x158, 0x140285308\nmov     [rbx], rax                                                     ; +0x15f, 0x14028530f\nlea     rax, ??_7GJPathRewardPopup@@6B@_0; const GJPathRewardPopup::`vftable' ; +0x162, 0x140285312\nmov     [rbx+140h], rax                                                ; +0x169, 0x140285319\nlea     rax, ??_7GJPathRewardPopup@@6B@_1; const GJPathRewardPopup::`vftable' ; +0x170, 0x140285320\nmov     [rbx+148h], rax                                                ; +0x177, 0x140285327\nlea     rax, ??_7GJPathRewardPopup@@6B@_2; const GJPathRewardPopup::`vftable' ; +0x17e, 0x14028532e\nmov     [rbx+150h], rax                                                ; +0x185, 0x140285335\nlea     rax, ??_7GJPathRewardPopup@@6B@_3; const GJPathRewardPopup::`vftable' ; +0x18c, 0x14028533c\nmov     [rbx+158h], rax                                                ; +0x193, 0x140285343\nlea     rax, ??_7GJPathRewardPopup@@6B@_4; const GJPathRewardPopup::`vftable' ; +0x19a, 0x14028534a\nmov     [rbx+160h], rax                                                ; +0x1a1, 0x140285351\nlea     rax, ??_7GJPathRewardPopup@@6B@_5; const GJPathRewardPopup::`vftable' ; +0x1a8, 0x140285358\nmov     [rbx+198h], rax                                                ; +0x1af, 0x14028535f\nlea     rax, ??_7GJPathRewardPopup@@6B@_6; const GJPathRewardPopup::`vftable' ; +0x1b6, 0x140285366\nmov     [rbx+1B0h], rax                                                ; +0x1bd, 0x14028536d\nmov     dword ptr [rbx+278h], 0                                        ; +0x1c4, 0x140285374\nmov     edx, edi                                                       ; +0x1ce, 0x14028537e\nmov     rcx, rbx                                                       ; +0x1d0, 0x140285380\ncall    GJPathRewardPopup__init                                        ; +0x1d3, 0x140285383\nmov     rcx, rbx                                                       ; +0x1d8, 0x140285388\ntest    al, al                                                         ; +0x1db, 0x14028538b\njz      short loc_140285397                                            ; +0x1dd, 0x14028538d\ncall    cs:?autorelease@CCObject@cocos2d@@QEAAPEAV12@XZ; cocos2d::CCObject::autorelease(void) ; +0x1df, 0x14028538f\njmp     short loc_1402853A4                                            ; +0x1e5, 0x140285395\nmov     rax, [rbx]                                                     ; +0x1e7, 0x140285397\nmov     edx, 1                                                         ; +0x1ea, 0x14028539a\ncall    qword ptr [rax+8]                                              ; +0x1ef, 0x14028539f\nxor     ebx, ebx                                                       ; +0x1f2, 0x1402853a2\nmov     rax, [rbx]                                                     ; +0x1f4, 0x1402853a4\nmov     rdx, [rax+410h]                                                ; +0x1f7, 0x1402853a7\nlea     rax, FLAlertLayer__show                                        ; +0x1fe, 0x1402853ae\nmov     rcx, rbx                                                       ; +0x205, 0x1402853b5\ncmp     rdx, rax                                                       ; +0x208, 0x1402853b8\njnz     short loc_1402853C4                                            ; +0x20b, 0x1402853bb\ncall    FLAlertLayer__show                                             ; +0x20d, 0x1402853bd\njmp     short loc_1402853C6                                            ; +0x212, 0x1402853c2\ncall    rdx                                                            ; +0x214, 0x1402853c4\nmov     rcx, [rsp+98h+var_10]                                          ; +0x216, 0x1402853c6\nxor     rcx, rsp; StackCookie                                          ; +0x21e, 0x1402853ce\ncall    __security_check_cookie                                        ; +0x221, 0x1402853d1\nlea     r11, [rsp+98h+var_8]                                           ; +0x226, 0x1402853d6\nmov     rbx, [r11+20h]                                                 ; +0x22e, 0x1402853de\nmov     rsi, [r11+28h]                                                 ; +0x232, 0x1402853e2\nmov     rsp, r11                                                       ; +0x236, 0x1402853e6\npop     rdi                                                            ; +0x239, 0x1402853e9\nretn                                                                   ; +0x23a, 0x1402853ea", "xrefs": ["GJPathsLayer::init @ 0x140284fdd", "<???> @ 0x1406d1544", "<???> @ 0x1406d1550"], "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"}