{"type": "func", "start": 5370220432, "end": 5370220719, "name": "GJMapPack::completedMaps", "pseudocode": "// \n// GJMapPack::completedMaps from 0x140170f90 to 0x1401710af (287 bytes)\n// \n// 8 xrefs:\n// > MapPackCell::loadFromMapPack @ 0x1400b1ff6\n// > MapPackCell::loadFromMapPack @ 0x1400b226f\n// > MapPackCell::loadFromMapPack @ 0x1400b22f5\n// > GauntletSelectLayer::onPlay @ 0x1401faccf\n// > GauntletNode::generateNode @ 0x1401fd20f\n// > GauntletNode::generateNode @ 0x1401fd3dd\n// > GJAccountManager::onSyncAccountCompleted @ 0x1402034ef\n// > <???> @ 0x1406cae9c\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=2\nint GJMapPack::completedMaps(GJMapPack *a1)\n{\n  cocos2d::CCArray *m_levels; // rcx\n  int v4; // ebx\n  unsigned int v5; // edi\n  int v6; // r14d\n  cocos2d::CCString *v7; // rax\n  int v8; // ebp\n  GameStatsManager *v9; // rcx\n  void *v10; // [rsp+40h] [rbp+8h]\n  void *v11; // [rsp+48h] [rbp+10h]\n\n  m_levels = a1->m_levels;\n  if ( !m_levels )\n    return 0;\n  v4 = 0;\n  v5 = 0;\n  if ( cocos2d::CCArray::count(m_levels) )\n  {\n    do\n    {\n      v6 = v4;\n      v7 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(a1->m_levels, v5);\n      v8 = cocos2d::CCString::intValue(v7);\n      v9 = (GameStatsManager *)qword_1406C2EE8;\n      if ( a1->m_isGauntlet )\n      {\n        if ( !qword_1406C2EE8 )\n        {\n          v10 = operator new(0x3E0u);\n          qword_1406C2EE8 = sub_1401D0AE0(v10);\n          (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);\n          v9 = (GameStatsManager *)qword_1406C2EE8;\n        }\n        ++v4;\n        if ( !GameStatsManager::hasCompletedGauntletLevel(v9, v8) )\n          v4 = v6;\n      }\n      else\n      {\n        if ( !qword_1406C2EE8 )\n        {\n          v11 = operator new(0x3E0u);\n          qword_1406C2EE8 = sub_1401D0AE0(v11);\n          (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);\n          v9 = (GameStatsManager *)qword_1406C2EE8;\n        }\n        if ( GameStatsManager::hasCompletedOnlineLevel(v9, v8) )\n          ++v4;\n      }\n      ++v5;\n    }\n    while ( v5 < cocos2d::CCArray::count(a1->m_levels) );\n  }\n  return v4;\n}", "assembly": "; \n; GJMapPack::completedMaps from 0x140170f90 to 0x1401710af (287 bytes)\n; \n; 8 xrefs:\n; > MapPackCell::loadFromMapPack @ 0x1400b1ff6\n; > MapPackCell::loadFromMapPack @ 0x1400b226f\n; > MapPackCell::loadFromMapPack @ 0x1400b22f5\n; > GauntletSelectLayer::onPlay @ 0x1401faccf\n; > GauntletNode::generateNode @ 0x1401fd20f\n; > GauntletNode::generateNode @ 0x1401fd3dd\n; > GJAccountManager::onSyncAccountCompleted @ 0x1402034ef\n; > <???> @ 0x1406cae9c\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, 0x140170f90\nmov     [rsp+arg_18], rbp                                              ; +0x5, 0x140170f95\npush    rsi                                                            ; +0xa, 0x140170f9a\npush    rdi                                                            ; +0xb, 0x140170f9b\npush    r14                                                            ; +0xc, 0x140170f9c\nsub     rsp, 20h                                                       ; +0xe, 0x140170f9e\nmov     rsi, rcx                                                       ; +0x12, 0x140170fa2\nmov     rcx, [rcx+140h]                                                ; +0x15, 0x140170fa5\ntest    rcx, rcx                                                       ; +0x1c, 0x140170fac\njnz     short loc_140170FB8                                            ; +0x1f, 0x140170faf\nxor     eax, eax                                                       ; +0x21, 0x140170fb1\njmp     loc_14017109C                                                  ; +0x23, 0x140170fb3\nxor     ebx, ebx                                                       ; +0x28, 0x140170fb8\nmov     edi, ebx                                                       ; +0x2a, 0x140170fba\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x2c, 0x140170fbc\ntest    eax, eax                                                       ; +0x32, 0x140170fc2\njz      loc_14017109A                                                  ; +0x34, 0x140170fc4\nnop     word ptr [rax+rax+00h]                                         ; +0x3a, 0x140170fca\nmov     r14d, ebx                                                      ; +0x40, 0x140170fd0\nmov     edx, edi                                                       ; +0x43, 0x140170fd3\nmov     rcx, [rsi+140h]                                                ; +0x45, 0x140170fd5\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x4c, 0x140170fdc\nmov     rcx, rax                                                       ; +0x52, 0x140170fe2\ncall    cs:?intValue@CCString@cocos2d@@QEBAHXZ; cocos2d::CCString::intValue(void) ; +0x55, 0x140170fe5\nmov     ebp, eax                                                       ; +0x5b, 0x140170feb\nmov     rcx, cs:qword_1406C2EE8                                        ; +0x5d, 0x140170fed\ncmp     byte ptr [rsi+1A4h], 0                                         ; +0x64, 0x140170ff4\njz      short loc_140171042                                            ; +0x6b, 0x140170ffb\ntest    rcx, rcx                                                       ; +0x6d, 0x140170ffd\njnz     short loc_140171031                                            ; +0x70, 0x140171000\nmov     ecx, 3E0h; Size                                                ; +0x72, 0x140171002\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x77, 0x140171007\nmov     [rsp+38h+arg_0], rax                                           ; +0x7c, 0x14017100c\nmov     rcx, rax                                                       ; +0x81, 0x140171011\ncall    sub_1401D0AE0                                                  ; +0x84, 0x140171014\nnop                                                                    ; +0x89, 0x140171019\nmov     cs:qword_1406C2EE8, rax                                        ; +0x8a, 0x14017101a\nmov     rdx, [rax]                                                     ; +0x91, 0x140171021\nmov     rcx, rax                                                       ; +0x94, 0x140171024\ncall    qword ptr [rdx+48h]                                            ; +0x97, 0x140171027\nmov     rcx, cs:qword_1406C2EE8                                        ; +0x9a, 0x14017102a\nmov     edx, ebp                                                       ; +0xa1, 0x140171031\ncall    GameStatsManager__hasCompletedGauntletLevel                    ; +0xa3, 0x140171033\ninc     ebx                                                            ; +0xa8, 0x140171038\ntest    al, al                                                         ; +0xaa, 0x14017103a\ncmovz   ebx, r14d                                                      ; +0xac, 0x14017103c\njmp     short loc_140171083                                            ; +0xb0, 0x140171040\ntest    rcx, rcx                                                       ; +0xb2, 0x140171042\njnz     short loc_140171076                                            ; +0xb5, 0x140171045\nmov     ecx, 3E0h; Size                                                ; +0xb7, 0x140171047\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xbc, 0x14017104c\nmov     [rsp+38h+arg_8], rax                                           ; +0xc1, 0x140171051\nmov     rcx, rax                                                       ; +0xc6, 0x140171056\ncall    sub_1401D0AE0                                                  ; +0xc9, 0x140171059\nnop                                                                    ; +0xce, 0x14017105e\nmov     cs:qword_1406C2EE8, rax                                        ; +0xcf, 0x14017105f\nmov     rdx, [rax]                                                     ; +0xd6, 0x140171066\nmov     rcx, rax                                                       ; +0xd9, 0x140171069\ncall    qword ptr [rdx+48h]                                            ; +0xdc, 0x14017106c\nmov     rcx, cs:qword_1406C2EE8                                        ; +0xdf, 0x14017106f\nmov     edx, ebp                                                       ; +0xe6, 0x140171076\ncall    GameStatsManager__hasCompletedOnlineLevel                      ; +0xe8, 0x140171078\ntest    al, al                                                         ; +0xed, 0x14017107d\njz      short loc_140171083                                            ; +0xef, 0x14017107f\ninc     ebx                                                            ; +0xf1, 0x140171081\ninc     edi                                                            ; +0xf3, 0x140171083\nmov     rcx, [rsi+140h]                                                ; +0xf5, 0x140171085\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xfc, 0x14017108c\ncmp     edi, eax                                                       ; +0x102, 0x140171092\njb      loc_140170FD0                                                  ; +0x104, 0x140171094\nmov     eax, ebx                                                       ; +0x10a, 0x14017109a\nmov     rbx, [rsp+38h+arg_10]                                          ; +0x10c, 0x14017109c\nmov     rbp, [rsp+38h+arg_18]                                          ; +0x111, 0x1401710a1\nadd     rsp, 20h                                                       ; +0x116, 0x1401710a6\npop     r14                                                            ; +0x11a, 0x1401710aa\npop     rdi                                                            ; +0x11c, 0x1401710ac\npop     rsi                                                            ; +0x11d, 0x1401710ad\nretn                                                                   ; +0x11e, 0x1401710ae", "xrefs": ["MapPackCell::loadFromMapPack @ 0x1400b1ff6", "MapPackCell::loadFromMapPack @ 0x1400b226f", "MapPackCell::loadFromMapPack @ 0x1400b22f5", "GauntletSelectLayer::onPlay @ 0x1401faccf", "GauntletNode::generateNode @ 0x1401fd20f", "GauntletNode::generateNode @ 0x1401fd3dd", "GJAccountManager::onSyncAccountCompleted @ 0x1402034ef", "<???> @ 0x1406cae9c"], "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"}