{"type": "func", "start": 5370627680, "end": 5370628063, "name": "GameStatsManager::trySelectActivePath", "pseudocode": "// \n// GameStatsManager::trySelectActivePath from 0x1401d4660 to 0x1401d47df (383 bytes)\n// \n// 4 xrefs:\n// > GameStatsManager::incrementStat @ 0x1401d45c3\n// > GJPathsLayer::init @ 0x140284ca9\n// > GJPathPage::init @ 0x140286f53\n// > <???> @ 0x1406cc360\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\nvoid GameStatsManager::trySelectActivePath(GameStatsManager *a1)\n{\n  GameStatsManager *m_activePath; // rcx\n  int v3; // ebx\n  const char *v4; // rax\n  int Stat; // ebx\n  int v6; // edi\n  const char *v7; // rax\n  int v8; // ebx\n  void *v9; // [rsp+20h] [rbp-38h]\n  void *v10; // [rsp+20h] [rbp-38h]\n  _QWORD v11[4]; // [rsp+28h] [rbp-30h] BYREF\n\n  m_activePath = (GameStatsManager *)(unsigned int)a1->m_activePath;\n  if ( (unsigned int)((_DWORD)m_activePath - 30) > 9 )\n    goto LABEL_8;\n  a1->m_activePath = (int)m_activePath;\n  v3 = (_DWORD)m_activePath - 24;\n  if ( !qword_1406C2EE8 )\n  {\n    v9 = operator new(0x3E0u);\n    qword_1406C2EE8 = sub_1401D0AE0((__int64)v9);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);\n  }\n  if ( !GameStatsManager::isItemUnlocked(m_activePath, GJItem, v3) )\n    goto LABEL_8;\n  v4 = (const char *)GameToolbox::intToString(v11, a1->m_activePath);\n  if ( *((_QWORD *)v4 + 3) > 0xFu )\n    v4 = *(const char **)v4;\n  Stat = GameStatsManager::getStat(a1, v4);\n  sub_14003A830((__int64)v11);\n  if ( Stat >= 1000 )\nLABEL_8:\n    a1->m_activePath = 0;\n  if ( !a1->m_activePath )\n  {\n    v6 = 30;\n    while ( 1 )\n    {\n      if ( !qword_1406C2EE8 )\n      {\n        v10 = operator new(0x3E0u);\n        qword_1406C2EE8 = sub_1401D0AE0((__int64)v10);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);\n      }\n      if ( GameStatsManager::isItemUnlocked(m_activePath, GJItem, v6 - 24) )\n      {\n        v7 = (const char *)GameToolbox::intToString(v11, v6);\n        if ( *((_QWORD *)v7 + 3) > 0xFu )\n          v7 = *(const char **)v7;\n        v8 = GameStatsManager::getStat(a1, v7);\n        sub_14003A830((__int64)v11);\n        if ( v8 < 1000 )\n          break;\n      }\n      if ( ++v6 > 39 )\n        return;\n    }\n    a1->m_activePath = v6;\n  }\n}", "assembly": "; \n; GameStatsManager::trySelectActivePath from 0x1401d4660 to 0x1401d47df (383 bytes)\n; \n; 4 xrefs:\n; > GameStatsManager::incrementStat @ 0x1401d45c3\n; > GJPathsLayer::init @ 0x140284ca9\n; > GJPathPage::init @ 0x140286f53\n; > <???> @ 0x1406cc360\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, 0x1401d4660\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x1401d4665\npush    rdi                                                            ; +0xa, 0x1401d466a\nsub     rsp, 50h                                                       ; +0xb, 0x1401d466b\nmov     rax, cs:__security_cookie                                      ; +0xf, 0x1401d466f\nxor     rax, rsp                                                       ; +0x16, 0x1401d4676\nmov     [rsp+58h+var_10], rax                                          ; +0x19, 0x1401d4679\nmov     rsi, rcx                                                       ; +0x1e, 0x1401d467e\nmov     ecx, [rcx+3DCh]                                                ; +0x21, 0x1401d4681\nlea     eax, [rcx-1Eh]                                                 ; +0x27, 0x1401d4687\ncmp     eax, 9                                                         ; +0x2a, 0x1401d468a\nja      loc_1401D4719                                                  ; +0x2d, 0x1401d468d\nmov     [rsi+3DCh], ecx                                                ; +0x33, 0x1401d4693\nlea     ebx, [rcx-18h]                                                 ; +0x39, 0x1401d4699\ncmp     cs:qword_1406C2EE8, 0                                          ; +0x3c, 0x1401d469c\njnz     short loc_1401D46CE                                            ; +0x44, 0x1401d46a4\nmov     ecx, 3E0h; Size                                                ; +0x46, 0x1401d46a6\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x4b, 0x1401d46ab\nmov     [rsp+58h+var_38], rax                                          ; +0x50, 0x1401d46b0\nmov     rcx, rax                                                       ; +0x55, 0x1401d46b5\ncall    sub_1401D0AE0                                                  ; +0x58, 0x1401d46b8\nnop                                                                    ; +0x5d, 0x1401d46bd\nmov     cs:qword_1406C2EE8, rax                                        ; +0x5e, 0x1401d46be\nmov     rdx, [rax]                                                     ; +0x65, 0x1401d46c5\nmov     rcx, rax                                                       ; +0x68, 0x1401d46c8\ncall    qword ptr [rdx+48h]                                            ; +0x6b, 0x1401d46cb\nmov     r8d, ebx                                                       ; +0x6e, 0x1401d46ce\nmov     edx, 0Ch                                                       ; +0x71, 0x1401d46d1\ncall    GameStatsManager__isItemUnlocked                               ; +0x76, 0x1401d46d6\ntest    al, al                                                         ; +0x7b, 0x1401d46db\njz      short loc_1401D4719                                            ; +0x7d, 0x1401d46dd\nmov     edx, [rsi+3DCh]                                                ; +0x7f, 0x1401d46df\nlea     rcx, [rsp+58h+var_30]                                          ; +0x85, 0x1401d46e5\ncall    GameToolbox__intToString                                       ; +0x8a, 0x1401d46ea\nnop                                                                    ; +0x8f, 0x1401d46ef\ncmp     qword ptr [rax+18h], 0Fh                                       ; +0x90, 0x1401d46f0\njbe     short loc_1401D46FA                                            ; +0x95, 0x1401d46f5\nmov     rax, [rax]                                                     ; +0x97, 0x1401d46f7\nmov     rdx, rax                                                       ; +0x9a, 0x1401d46fa\nmov     rcx, rsi                                                       ; +0x9d, 0x1401d46fd\ncall    GameStatsManager__getStat                                      ; +0xa0, 0x1401d4700\nmov     ebx, eax                                                       ; +0xa5, 0x1401d4705\nlea     rcx, [rsp+58h+var_30]                                          ; +0xa7, 0x1401d4707\ncall    sub_14003A830                                                  ; +0xac, 0x1401d470c\ncmp     ebx, 3E8h                                                      ; +0xb1, 0x1401d4711\njl      short loc_1401D4723                                            ; +0xb7, 0x1401d4717\nmov     dword ptr [rsi+3DCh], 0                                        ; +0xb9, 0x1401d4719\ncmp     dword ptr [rsi+3DCh], 0                                        ; +0xc3, 0x1401d4723\njnz     loc_1401D47C2                                                  ; +0xca, 0x1401d472a\nmov     edi, 1Eh                                                       ; +0xd0, 0x1401d4730\ncmp     cs:qword_1406C2EE8, 0                                          ; +0xd5, 0x1401d4735\njnz     short loc_1401D4767                                            ; +0xdd, 0x1401d473d\nmov     ecx, 3E0h; Size                                                ; +0xdf, 0x1401d473f\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xe4, 0x1401d4744\nmov     [rsp+58h+var_38], rax                                          ; +0xe9, 0x1401d4749\nmov     rcx, rax                                                       ; +0xee, 0x1401d474e\ncall    sub_1401D0AE0                                                  ; +0xf1, 0x1401d4751\nnop                                                                    ; +0xf6, 0x1401d4756\nmov     cs:qword_1406C2EE8, rax                                        ; +0xf7, 0x1401d4757\nmov     rdx, [rax]                                                     ; +0xfe, 0x1401d475e\nmov     rcx, rax                                                       ; +0x101, 0x1401d4761\ncall    qword ptr [rdx+48h]                                            ; +0x104, 0x1401d4764\nlea     r8d, [rdi-18h]                                                 ; +0x107, 0x1401d4767\nmov     edx, 0Ch                                                       ; +0x10b, 0x1401d476b\ncall    GameStatsManager__isItemUnlocked                               ; +0x110, 0x1401d4770\ntest    al, al                                                         ; +0x115, 0x1401d4775\njz      short loc_1401D47AF                                            ; +0x117, 0x1401d4777\nmov     edx, edi                                                       ; +0x119, 0x1401d4779\nlea     rcx, [rsp+58h+var_30]                                          ; +0x11b, 0x1401d477b\ncall    GameToolbox__intToString                                       ; +0x120, 0x1401d4780\nnop                                                                    ; +0x125, 0x1401d4785\ncmp     qword ptr [rax+18h], 0Fh                                       ; +0x126, 0x1401d4786\njbe     short loc_1401D4790                                            ; +0x12b, 0x1401d478b\nmov     rax, [rax]                                                     ; +0x12d, 0x1401d478d\nmov     rdx, rax                                                       ; +0x130, 0x1401d4790\nmov     rcx, rsi                                                       ; +0x133, 0x1401d4793\ncall    GameStatsManager__getStat                                      ; +0x136, 0x1401d4796\nmov     ebx, eax                                                       ; +0x13b, 0x1401d479b\nlea     rcx, [rsp+58h+var_30]                                          ; +0x13d, 0x1401d479d\ncall    sub_14003A830                                                  ; +0x142, 0x1401d47a2\ncmp     ebx, 3E8h                                                      ; +0x147, 0x1401d47a7\njl      short loc_1401D47BC                                            ; +0x14d, 0x1401d47ad\ninc     edi                                                            ; +0x14f, 0x1401d47af\ncmp     edi, 27h ; '''                                                 ; +0x151, 0x1401d47b1\njle     loc_1401D4735                                                  ; +0x154, 0x1401d47b4\njmp     short loc_1401D47C2                                            ; +0x15a, 0x1401d47ba\nmov     [rsi+3DCh], edi                                                ; +0x15c, 0x1401d47bc\nmov     rcx, [rsp+58h+var_10]                                          ; +0x162, 0x1401d47c2\nxor     rcx, rsp; StackCookie                                          ; +0x167, 0x1401d47c7\ncall    __security_check_cookie                                        ; +0x16a, 0x1401d47ca\nmov     rbx, [rsp+58h+arg_8]                                           ; +0x16f, 0x1401d47cf\nmov     rsi, [rsp+58h+arg_10]                                          ; +0x174, 0x1401d47d4\nadd     rsp, 50h                                                       ; +0x179, 0x1401d47d9\npop     rdi                                                            ; +0x17d, 0x1401d47dd\nretn                                                                   ; +0x17e, 0x1401d47de", "xrefs": ["GameStatsManager::incrementStat @ 0x1401d45c3", "GJPathsLayer::init @ 0x140284ca9", "GJPathPage::init @ 0x140286f53", "<???> @ 0x1406cc360"], "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"}