{"type": "func", "start": 5371731936, "end": 5371732382, "name": "GameStatsManager::completedStarLevel", "pseudocode": "// \n// GameStatsManager::completedStarLevel from 0x1402e1fe0 to 0x1402e219e (446 bytes)\n// \n// 5 xrefs:\n// > GameLevelManager::updateLevelRewards @ 0x14021df34\n// > GameManager::dataLoaded @ 0x140284009\n// > GameStatsManager::completedLevel @ 0x1402e1d16\n// > LevelInfoLayer::init @ 0x14041dcdd\n// > <???> @ 0x14091de88\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:29:49 +0000\n// \n\n// Hidden C++ exception states: #wind=1\nvoid __fastcall GameStatsManager::completedStarLevel(__int64 a1, __int64 a2)\n{\n  cocos2d::CCString *v4; // rax\n  const char *v5; // rcx\n  const char *CString; // rax\n  size_t v7; // r8\n  void *v8; // rcx\n  signed int v9; // r8d\n  const char *v10; // rdx\n  int v11; // eax\n  void *Block[2]; // [rsp+30h] [rbp-38h] BYREF\n  __int128 v13; // [rsp+40h] [rbp-28h]\n\n  if ( !GameStatsManager::hasCompletedStarLevel(a1, a2) && *(_DWORD *)(a2 + 1020) - *(_DWORD *)(a2 + 1024) > 0 )\n  {\n    if ( *(_DWORD *)(a2 + 992) - *(_DWORD *)(a2 + 996) <= 0 )\n    {\n      v5 = \"gstar_%i\";\n      if ( !*(_BYTE *)(a2 + 721) )\n        v5 = \"star_%i\";\n      v4 = cocos2d::CCString::createWithFormat(v5, (unsigned int)(*(_DWORD *)(a2 + 328) - *(_DWORD *)(a2 + 332)));\n    }\n    else\n    {\n      v4 = cocos2d::CCString::createWithFormat(\"%s%i\", \"dstar_\", *(_DWORD *)(a2 + 992) - *(_DWORD *)(a2 + 996));\n    }\n    CString = cocos2d::CCString::getCString(v4);\n    *(_OWORD *)Block = 0;\n    v13 = 0;\n    v7 = -1;\n    do\n      ++v7;\n    while ( CString[v7] );\n    sub_14003D230(Block, CString, v7);\n    cocos2d::CCDictionary::setObject(*(_QWORD *)(a1 + 712), *(_QWORD *)(a1 + 328), Block);\n    if ( *((_QWORD *)&v13 + 1) > 0xFu )\n    {\n      v8 = Block[0];\n      if ( (unsigned __int64)(*((_QWORD *)&v13 + 1) + 1LL) >= 0x1000 )\n      {\n        v8 = *((void **)Block[0] - 1);\n        if ( (unsigned __int64)((char *)Block[0] - (char *)v8 - 8) > 0x1F )\n          invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n      }\n      j_j_free(v8);\n    }\n    v9 = *(_DWORD *)(a2 + 1020) - *(_DWORD *)(a2 + 1024);\n    if ( v9 > 10 && *(_DWORD *)(a2 + 1220) != 1 )\n      v9 = 0;\n    v10 = \"6\";\n    if ( *(_DWORD *)(a2 + 972) == 5 )\n      v10 = \"28\";\n    GameStatsManager::incrementStat(a1, v10, v9);\n    v11 = *(_DWORD *)(a2 + 1020) - *(_DWORD *)(a2 + 1024);\n    if ( v11 == 8 || v11 == 9 )\n      GameStatsManager::incrementStat(a1, \"42\", 1u);\n  }\n}", "assembly": "; \n; GameStatsManager::completedStarLevel from 0x1402e1fe0 to 0x1402e219e (446 bytes)\n; \n; 5 xrefs:\n; > GameLevelManager::updateLevelRewards @ 0x14021df34\n; > GameManager::dataLoaded @ 0x140284009\n; > GameStatsManager::completedLevel @ 0x1402e1d16\n; > LevelInfoLayer::init @ 0x14041dcdd\n; > <???> @ 0x14091de88\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:29:49 +0000\n; \nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x1402e1fe0\npush    rdi                                                            ; +0x5, 0x1402e1fe5\nsub     rsp, 60h                                                       ; +0x6, 0x1402e1fe6\nmov     rax, cs:__security_cookie                                      ; +0xa, 0x1402e1fea\nxor     rax, rsp                                                       ; +0x11, 0x1402e1ff1\nmov     [rsp+68h+var_18], rax                                          ; +0x14, 0x1402e1ff4\nmov     rbx, rdx                                                       ; +0x19, 0x1402e1ff9\nmov     rdi, rcx                                                       ; +0x1c, 0x1402e1ffc\ncall    GameStatsManager__hasCompletedStarLevel                        ; +0x1f, 0x1402e1fff\ntest    al, al                                                         ; +0x24, 0x1402e2004\njnz     loc_1402E2183                                                  ; +0x26, 0x1402e2006\nmov     eax, [rbx+3FCh]                                                ; +0x2c, 0x1402e200c\nsub     eax, [rbx+400h]                                                ; +0x32, 0x1402e2012\ntest    eax, eax                                                       ; +0x38, 0x1402e2018\njle     loc_1402E2183                                                  ; +0x3a, 0x1402e201a\nmov     r8d, [rbx+3E0h]                                                ; +0x40, 0x1402e2020\nsub     r8d, [rbx+3E4h]                                                ; +0x47, 0x1402e2027\ntest    r8d, r8d                                                       ; +0x4e, 0x1402e202e\njle     short loc_1402E2049                                            ; +0x51, 0x1402e2031\nlea     rdx, aDstar; \"dstar_\"                                          ; +0x53, 0x1402e2033\nlea     rcx, aSI_3; \"%s%i\"                                             ; +0x5a, 0x1402e203a\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x61, 0x1402e2041\njmp     short loc_1402E2072                                            ; +0x67, 0x1402e2047\nmov     edx, [rbx+148h]                                                ; +0x69, 0x1402e2049\nsub     edx, [rbx+14Ch]                                                ; +0x6f, 0x1402e204f\ncmp     byte ptr [rbx+2D1h], 0                                         ; +0x75, 0x1402e2055\nlea     rcx, aGstarI; \"gstar_%i\"                                       ; +0x7c, 0x1402e205c\njnz     short loc_1402E206C                                            ; +0x83, 0x1402e2063\nlea     rcx, aStarI; \"star_%i\"                                         ; +0x85, 0x1402e2065\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x8c, 0x1402e206c\nmov     rcx, rax                                                       ; +0x92, 0x1402e2072\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x95, 0x1402e2075\nxorps   xmm0, xmm0                                                     ; +0x9b, 0x1402e207b\nmovups  xmmword ptr [rsp+68h+Block], xmm0                              ; +0x9e, 0x1402e207e\nxorps   xmm1, xmm1                                                     ; +0xa3, 0x1402e2083\nmovdqu  [rsp+68h+var_28], xmm1                                         ; +0xa6, 0x1402e2086\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0xac, 0x1402e208c\ninc     r8                                                             ; +0xb3, 0x1402e2093\ncmp     byte ptr [rax+r8], 0                                           ; +0xb6, 0x1402e2096\njnz     short loc_1402E2093                                            ; +0xbb, 0x1402e209b\nmov     rdx, rax                                                       ; +0xbd, 0x1402e209d\nlea     rcx, [rsp+68h+Block]                                           ; +0xc0, 0x1402e20a0\ncall    sub_14003D230                                                  ; +0xc5, 0x1402e20a5\nnop                                                                    ; +0xca, 0x1402e20aa\nlea     r8, [rsp+68h+Block]                                            ; +0xcb, 0x1402e20ab\nmov     rdx, [rdi+148h]                                                ; +0xd0, 0x1402e20b0\nmov     rcx, [rdi+2C8h]                                                ; +0xd7, 0x1402e20b7\ncall    cs:?setObject@CCDictionary@cocos2d@@QEAAXPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,std::string const &) ; +0xde, 0x1402e20be\nnop                                                                    ; +0xe4, 0x1402e20c4\nmov     rdx, qword ptr [rsp+68h+var_28+8]                              ; +0xe5, 0x1402e20c5\ncmp     rdx, 0Fh                                                       ; +0xea, 0x1402e20ca\njbe     short loc_1402E2116                                            ; +0xee, 0x1402e20ce\ninc     rdx                                                            ; +0xf0, 0x1402e20d0\nmov     rcx, [rsp+68h+Block]; Block                                    ; +0xf3, 0x1402e20d3\nmov     rax, rcx                                                       ; +0xf8, 0x1402e20d8\ncmp     rdx, 1000h                                                     ; +0xfb, 0x1402e20db\njb      short loc_1402E2111                                            ; +0x102, 0x1402e20e2\nadd     rdx, 27h ; '''                                                 ; +0x104, 0x1402e20e4\nmov     rcx, [rcx-8]                                                   ; +0x108, 0x1402e20e8\nsub     rax, rcx                                                       ; +0x10c, 0x1402e20ec\nsub     rax, 8                                                         ; +0x10f, 0x1402e20ef\ncmp     rax, 1Fh                                                       ; +0x113, 0x1402e20f3\njbe     short loc_1402E2111                                            ; +0x117, 0x1402e20f7\nxor     eax, eax                                                       ; +0x119, 0x1402e20f9\nmov     [rsp+68h+Reserved], rax; Reserved                              ; +0x11b, 0x1402e20fb\nxor     r9d, r9d; LineNo                                               ; +0x120, 0x1402e2100\nxor     r8d, r8d; FileName                                             ; +0x123, 0x1402e2103\nxor     edx, edx; FunctionName                                         ; +0x126, 0x1402e2106\nxor     ecx, ecx; Expression                                           ; +0x128, 0x1402e2108\ncall    cs:_invoke_watson                                              ; +0x12a, 0x1402e210a\ndb 0CCh                                                                ; +0x130, 0x1402e2110\ncall    j_j_free                                                       ; +0x131, 0x1402e2111\nmov     r8d, [rbx+3FCh]                                                ; +0x136, 0x1402e2116\nsub     r8d, [rbx+400h]                                                ; +0x13d, 0x1402e211d\ncmp     r8d, 0Ah                                                       ; +0x144, 0x1402e2124\njle     short loc_1402E2137                                            ; +0x148, 0x1402e2128\nxor     eax, eax                                                       ; +0x14a, 0x1402e212a\ncmp     dword ptr [rbx+4C4h], 1                                        ; +0x14c, 0x1402e212c\ncmovnz  r8d, eax                                                       ; +0x153, 0x1402e2133\nlea     rax, a28; \"28\"                                                 ; +0x157, 0x1402e2137\nlea     rdx, a6; \"6\"                                                   ; +0x15e, 0x1402e213e\ncmp     dword ptr [rbx+3CCh], 5                                        ; +0x165, 0x1402e2145\ncmovz   rdx, rax                                                       ; +0x16c, 0x1402e214c\nmov     rcx, rdi                                                       ; +0x170, 0x1402e2150\ncall    GameStatsManager__incrementStat                                ; +0x173, 0x1402e2153\nmov     eax, [rbx+3FCh]                                                ; +0x178, 0x1402e2158\nsub     eax, [rbx+400h]                                                ; +0x17e, 0x1402e215e\ncmp     eax, 8                                                         ; +0x184, 0x1402e2164\njz      short loc_1402E216E                                            ; +0x187, 0x1402e2167\ncmp     eax, 9                                                         ; +0x189, 0x1402e2169\njnz     short loc_1402E2183                                            ; +0x18c, 0x1402e216c\nmov     r8d, 1                                                         ; +0x18e, 0x1402e216e\nlea     rdx, a42; \"42\"                                                 ; +0x194, 0x1402e2174\nmov     rcx, rdi                                                       ; +0x19b, 0x1402e217b\ncall    GameStatsManager__incrementStat                                ; +0x19e, 0x1402e217e\nmov     rcx, [rsp+68h+var_18]                                          ; +0x1a3, 0x1402e2183\nxor     rcx, rsp; StackCookie                                          ; +0x1a8, 0x1402e2188\ncall    __security_check_cookie                                        ; +0x1ab, 0x1402e218b\nmov     rbx, [rsp+68h+arg_10]                                          ; +0x1b0, 0x1402e2190\nadd     rsp, 60h                                                       ; +0x1b8, 0x1402e2198\npop     rdi                                                            ; +0x1bc, 0x1402e219c\nretn                                                                   ; +0x1bd, 0x1402e219d", "xrefs": ["GameLevelManager::updateLevelRewards @ 0x14021df34", "GameManager::dataLoaded @ 0x140284009", "GameStatsManager::completedLevel @ 0x1402e1d16", "LevelInfoLayer::init @ 0x14041dcdd", "<???> @ 0x14091de88"], "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"}