{"type": "func", "start": 5371733072, "end": 5371733744, "name": "GameStatsManager::uncompleteLevel", "pseudocode": "// \n// GameStatsManager::uncompleteLevel from 0x1402e2450 to 0x1402e26f0 (672 bytes)\n// \n// 2 xrefs:\n// > GameLevelManager::onGetLevelSaveDataCompleted @ 0x14022c5d0\n// > <???> @ 0x14091dea0\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=2\nvoid __fastcall GameStatsManager::uncompleteLevel(__int64 a1, __int64 a2)\n{\n  __int64 v3; // rsi\n  int v4; // eax\n  char v5; // r9\n  cocos2d::CCString *v6; // rax\n  const char *v7; // rcx\n  const char *CString; // rax\n  size_t v9; // rbx\n  size_t v10; // r8\n  void *v11; // rcx\n  cocos2d::CCString *v12; // rax\n  const char *v13; // rcx\n  const char *v14; // rax\n  void *v15; // rcx\n  void *Block[2]; // [rsp+48h] [rbp-50h] BYREF\n  __int128 v17; // [rsp+58h] [rbp-40h]\n  _QWORD v18[4]; // [rsp+68h] [rbp-30h] BYREF\n\n  v3 = a1;\n  v4 = *(_DWORD *)(a2 + 992) - *(_DWORD *)(a2 + 996);\n  v5 = *(_DWORD *)(a2 + 1220) != 1 && v4 <= 0;\n  LOBYTE(a1) = *(_DWORD *)(a2 + 992) - *(_DWORD *)(a2 + 996) > 0;\n  GameStatsManager::getLevelKey(\n    a1,\n    v18,\n    *(_DWORD *)(a2 + 328) - *(_DWORD *)(a2 + 332),\n    v5,\n    a1,\n    *(_BYTE *)(a2 + 721),\n    v4 > 200000);\n  cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(v3 + 712), v18);\n  if ( *(_DWORD *)(a2 + 992) - *(_DWORD *)(a2 + 996) <= 0 )\n  {\n    v7 = \"gstar_%i\";\n    if ( !*(_BYTE *)(a2 + 721) )\n      v7 = \"star_%i\";\n    v6 = cocos2d::CCString::createWithFormat(v7, (unsigned int)(*(_DWORD *)(a2 + 328) - *(_DWORD *)(a2 + 332)));\n  }\n  else\n  {\n    v6 = cocos2d::CCString::createWithFormat(\"%s%i\", \"dstar_\", *(_DWORD *)(a2 + 992) - *(_DWORD *)(a2 + 996));\n  }\n  CString = cocos2d::CCString::getCString(v6);\n  *(_OWORD *)Block = 0;\n  v17 = 0;\n  v9 = -1;\n  v10 = -1;\n  do\n    ++v10;\n  while ( CString[v10] );\n  sub_14003D230(Block, CString, v10);\n  cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(v3 + 712), Block);\n  if ( *((_QWORD *)&v17 + 1) > 0xFu )\n  {\n    v11 = Block[0];\n    if ( (unsigned __int64)(*((_QWORD *)&v17 + 1) + 1LL) >= 0x1000 )\n    {\n      v11 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v11 - 8) > 0x1F )\n        invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n    }\n    j_j_free(v11);\n  }\n  if ( *(_DWORD *)(a2 + 992) - *(_DWORD *)(a2 + 996) <= 0 )\n  {\n    v13 = \"gdemon_%i\";\n    if ( !*(_BYTE *)(a2 + 721) )\n      v13 = \"demon_%i\";\n    v12 = cocos2d::CCString::createWithFormat(v13);\n  }\n  else\n  {\n    v12 = cocos2d::CCString::createWithFormat(\"ddemon_%i\");\n  }\n  v14 = cocos2d::CCString::getCString(v12);\n  *(_OWORD *)Block = 0;\n  v17 = 0;\n  do\n    ++v9;\n  while ( v14[v9] );\n  sub_14003D230(Block, v14, v9);\n  cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(v3 + 712), Block);\n  if ( *((_QWORD *)&v17 + 1) > 0xFu )\n  {\n    v15 = Block[0];\n    if ( (unsigned __int64)(*((_QWORD *)&v17 + 1) + 1LL) >= 0x1000 )\n    {\n      v15 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v15 - 8) > 0x1F )\n        invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n    }\n    j_j_free(v15);\n  }\n  sub_14003D310((__int64)v18);\n}", "assembly": "; \n; GameStatsManager::uncompleteLevel from 0x1402e2450 to 0x1402e26f0 (672 bytes)\n; \n; 2 xrefs:\n; > GameLevelManager::onGetLevelSaveDataCompleted @ 0x14022c5d0\n; > <???> @ 0x14091dea0\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, 0x1402e2450\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x1402e2455\npush    rdi                                                            ; +0xa, 0x1402e245a\nsub     rsp, 90h                                                       ; +0xb, 0x1402e245b\nmov     rax, cs:__security_cookie                                      ; +0x12, 0x1402e2462\nxor     rax, rsp                                                       ; +0x19, 0x1402e2469\nmov     [rsp+98h+var_10], rax                                          ; +0x1c, 0x1402e246c\nmov     rdi, rdx                                                       ; +0x24, 0x1402e2474\nmov     rsi, rcx                                                       ; +0x27, 0x1402e2477\nmov     eax, [rdx+3E0h]                                                ; +0x2a, 0x1402e247a\nsub     eax, [rdx+3E4h]                                                ; +0x30, 0x1402e2480\ntest    eax, eax                                                       ; +0x36, 0x1402e2486\nsetnle  cl                                                             ; +0x38, 0x1402e2488\ncmp     dword ptr [rdx+4C4h], 1                                        ; +0x3b, 0x1402e248b\njz      short loc_1402E249D                                            ; +0x42, 0x1402e2492\ntest    eax, eax                                                       ; +0x44, 0x1402e2494\njg      short loc_1402E249D                                            ; +0x46, 0x1402e2496\nmov     r9b, 1                                                         ; +0x48, 0x1402e2498\njmp     short loc_1402E24A0                                            ; +0x4b, 0x1402e249b\nxor     r9b, r9b                                                       ; +0x4d, 0x1402e249d\ncmp     eax, 30D40h                                                    ; +0x50, 0x1402e24a0\nsetnle  al                                                             ; +0x55, 0x1402e24a5\nmov     r8d, [rdx+148h]                                                ; +0x58, 0x1402e24a8\nsub     r8d, [rdx+14Ch]                                                ; +0x5f, 0x1402e24af\nmov     [rsp+98h+var_68], al                                           ; +0x66, 0x1402e24b6\nmovzx   eax, byte ptr [rdx+2D1h]                                       ; +0x6a, 0x1402e24ba\nmov     [rsp+98h+var_70], al                                           ; +0x71, 0x1402e24c1\nmov     byte ptr [rsp+98h+Reserved], cl                                ; +0x75, 0x1402e24c5\nlea     rdx, [rsp+98h+var_30]                                          ; +0x79, 0x1402e24c9\ncall    GameStatsManager__getLevelKey                                  ; +0x7e, 0x1402e24ce\nnop                                                                    ; +0x83, 0x1402e24d3\nlea     rdx, [rsp+98h+var_30]                                          ; +0x84, 0x1402e24d4\nmov     rcx, [rsi+2C8h]                                                ; +0x89, 0x1402e24d9\ncall    cs:?removeObjectForKey@CCDictionary@cocos2d@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::removeObjectForKey(std::string const &) ; +0x90, 0x1402e24e0\nmov     r8d, [rdi+3E0h]                                                ; +0x96, 0x1402e24e6\nsub     r8d, [rdi+3E4h]                                                ; +0x9d, 0x1402e24ed\ntest    r8d, r8d                                                       ; +0xa4, 0x1402e24f4\njle     short loc_1402E250F                                            ; +0xa7, 0x1402e24f7\nlea     rdx, aDstar; \"dstar_\"                                          ; +0xa9, 0x1402e24f9\nlea     rcx, aSI_3; \"%s%i\"                                             ; +0xb0, 0x1402e2500\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xb7, 0x1402e2507\njmp     short loc_1402E2538                                            ; +0xbd, 0x1402e250d\nmov     edx, [rdi+148h]                                                ; +0xbf, 0x1402e250f\nsub     edx, [rdi+14Ch]                                                ; +0xc5, 0x1402e2515\ncmp     byte ptr [rdi+2D1h], 0                                         ; +0xcb, 0x1402e251b\nlea     rcx, aGstarI; \"gstar_%i\"                                       ; +0xd2, 0x1402e2522\njnz     short loc_1402E2532                                            ; +0xd9, 0x1402e2529\nlea     rcx, aStarI; \"star_%i\"                                         ; +0xdb, 0x1402e252b\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xe2, 0x1402e2532\nmov     rcx, rax                                                       ; +0xe8, 0x1402e2538\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0xeb, 0x1402e253b\nxorps   xmm0, xmm0                                                     ; +0xf1, 0x1402e2541\nmovups  xmmword ptr [rsp+98h+Block], xmm0                              ; +0xf4, 0x1402e2544\nxorps   xmm1, xmm1                                                     ; +0xf9, 0x1402e2549\nmovdqu  [rsp+98h+var_40], xmm1                                         ; +0xfc, 0x1402e254c\nmov     rbx, 0FFFFFFFFFFFFFFFFh                                        ; +0x102, 0x1402e2552\nmov     r8, rbx                                                        ; +0x109, 0x1402e2559\nnop     dword ptr [rax+00h]                                            ; +0x10c, 0x1402e255c\ninc     r8                                                             ; +0x110, 0x1402e2560\ncmp     byte ptr [rax+r8], 0                                           ; +0x113, 0x1402e2563\njnz     short loc_1402E2560                                            ; +0x118, 0x1402e2568\nmov     rdx, rax                                                       ; +0x11a, 0x1402e256a\nlea     rcx, [rsp+98h+Block]                                           ; +0x11d, 0x1402e256d\ncall    sub_14003D230                                                  ; +0x122, 0x1402e2572\nnop                                                                    ; +0x127, 0x1402e2577\nlea     rdx, [rsp+98h+Block]                                           ; +0x128, 0x1402e2578\nmov     rcx, [rsi+2C8h]                                                ; +0x12d, 0x1402e257d\ncall    cs:?removeObjectForKey@CCDictionary@cocos2d@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::removeObjectForKey(std::string const &) ; +0x134, 0x1402e2584\nnop                                                                    ; +0x13a, 0x1402e258a\nmov     rdx, qword ptr [rsp+98h+var_40+8]                              ; +0x13b, 0x1402e258b\ncmp     rdx, 0Fh                                                       ; +0x140, 0x1402e2590\njbe     short loc_1402E25DE                                            ; +0x144, 0x1402e2594\ninc     rdx                                                            ; +0x146, 0x1402e2596\nmov     rcx, [rsp+98h+Block]; Block                                    ; +0x149, 0x1402e2599\nmov     rax, rcx                                                       ; +0x14e, 0x1402e259e\ncmp     rdx, 1000h                                                     ; +0x151, 0x1402e25a1\njb      short loc_1402E25D9                                            ; +0x158, 0x1402e25a8\nadd     rdx, 27h ; '''                                                 ; +0x15a, 0x1402e25aa\nmov     rcx, [rcx-8]                                                   ; +0x15e, 0x1402e25ae\nsub     rax, rcx                                                       ; +0x162, 0x1402e25b2\nsub     rax, 8                                                         ; +0x165, 0x1402e25b5\ncmp     rax, 1Fh                                                       ; +0x169, 0x1402e25b9\njbe     short loc_1402E25D9                                            ; +0x16d, 0x1402e25bd\nmov     [rsp+98h+Reserved], 0; Reserved                                ; +0x16f, 0x1402e25bf\nxor     r9d, r9d; LineNo                                               ; +0x178, 0x1402e25c8\nxor     r8d, r8d; FileName                                             ; +0x17b, 0x1402e25cb\nxor     edx, edx; FunctionName                                         ; +0x17e, 0x1402e25ce\nxor     ecx, ecx; Expression                                           ; +0x180, 0x1402e25d0\ncall    cs:_invoke_watson                                              ; +0x182, 0x1402e25d2\ndb 0CCh                                                                ; +0x188, 0x1402e25d8\ncall    j_j_free                                                       ; +0x189, 0x1402e25d9\nmov     edx, [rdi+3E0h]                                                ; +0x18e, 0x1402e25de\nsub     edx, [rdi+3E4h]                                                ; +0x194, 0x1402e25e4\ntest    edx, edx                                                       ; +0x19a, 0x1402e25ea\njle     short loc_1402E25F7                                            ; +0x19c, 0x1402e25ec\nlea     rcx, aDdemonI; \"ddemon_%i\"                                     ; +0x19e, 0x1402e25ee\njmp     short loc_1402E261A                                            ; +0x1a5, 0x1402e25f5\nmov     edx, [rdi+148h]                                                ; +0x1a7, 0x1402e25f7\nsub     edx, [rdi+14Ch]                                                ; +0x1ad, 0x1402e25fd\ncmp     byte ptr [rdi+2D1h], 0                                         ; +0x1b3, 0x1402e2603\nlea     rcx, aGdemonI; \"gdemon_%i\"                                     ; +0x1ba, 0x1402e260a\njnz     short loc_1402E261A                                            ; +0x1c1, 0x1402e2611\nlea     rcx, aDemonI; \"demon_%i\"                                       ; +0x1c3, 0x1402e2613\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x1ca, 0x1402e261a\nmov     rcx, rax                                                       ; +0x1d0, 0x1402e2620\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x1d3, 0x1402e2623\nxorps   xmm0, xmm0                                                     ; +0x1d9, 0x1402e2629\nmovups  xmmword ptr [rsp+98h+Block], xmm0                              ; +0x1dc, 0x1402e262c\nxorps   xmm1, xmm1                                                     ; +0x1e1, 0x1402e2631\nmovdqu  [rsp+98h+var_40], xmm1                                         ; +0x1e4, 0x1402e2634\nnop     word ptr [rax+rax+00h]                                         ; +0x1ea, 0x1402e263a\ninc     rbx                                                            ; +0x1f0, 0x1402e2640\ncmp     byte ptr [rax+rbx], 0                                          ; +0x1f3, 0x1402e2643\njnz     short loc_1402E2640                                            ; +0x1f7, 0x1402e2647\nmov     r8, rbx                                                        ; +0x1f9, 0x1402e2649\nmov     rdx, rax                                                       ; +0x1fc, 0x1402e264c\nlea     rcx, [rsp+98h+Block]                                           ; +0x1ff, 0x1402e264f\ncall    sub_14003D230                                                  ; +0x204, 0x1402e2654\nnop                                                                    ; +0x209, 0x1402e2659\nlea     rdx, [rsp+98h+Block]                                           ; +0x20a, 0x1402e265a\nmov     rcx, [rsi+2C8h]                                                ; +0x20f, 0x1402e265f\ncall    cs:?removeObjectForKey@CCDictionary@cocos2d@@QEAAXAEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::removeObjectForKey(std::string const &) ; +0x216, 0x1402e2666\nnop                                                                    ; +0x21c, 0x1402e266c\nmov     rdx, qword ptr [rsp+98h+var_40+8]                              ; +0x21d, 0x1402e266d\ncmp     rdx, 0Fh                                                       ; +0x222, 0x1402e2672\njbe     short loc_1402E26C1                                            ; +0x226, 0x1402e2676\ninc     rdx                                                            ; +0x228, 0x1402e2678\nmov     rcx, [rsp+98h+Block]; Block                                    ; +0x22b, 0x1402e267b\nmov     rax, rcx                                                       ; +0x230, 0x1402e2680\ncmp     rdx, 1000h                                                     ; +0x233, 0x1402e2683\njb      short loc_1402E26BB                                            ; +0x23a, 0x1402e268a\nadd     rdx, 27h ; '''                                                 ; +0x23c, 0x1402e268c\nmov     rcx, [rcx-8]                                                   ; +0x240, 0x1402e2690\nsub     rax, rcx                                                       ; +0x244, 0x1402e2694\nsub     rax, 8                                                         ; +0x247, 0x1402e2697\ncmp     rax, 1Fh                                                       ; +0x24b, 0x1402e269b\njbe     short loc_1402E26BB                                            ; +0x24f, 0x1402e269f\nmov     [rsp+98h+Reserved], 0; Reserved                                ; +0x251, 0x1402e26a1\nxor     r9d, r9d; LineNo                                               ; +0x25a, 0x1402e26aa\nxor     r8d, r8d; FileName                                             ; +0x25d, 0x1402e26ad\nxor     edx, edx; FunctionName                                         ; +0x260, 0x1402e26b0\nxor     ecx, ecx; Expression                                           ; +0x262, 0x1402e26b2\ncall    cs:_invoke_watson                                              ; +0x264, 0x1402e26b4\ndb 0CCh                                                                ; +0x26a, 0x1402e26ba\ncall    j_j_free                                                       ; +0x26b, 0x1402e26bb\nnop                                                                    ; +0x270, 0x1402e26c0\nlea     rcx, [rsp+98h+var_30]                                          ; +0x271, 0x1402e26c1\ncall    sub_14003D310                                                  ; +0x276, 0x1402e26c6\nmov     rcx, [rsp+98h+var_10]                                          ; +0x27b, 0x1402e26cb\nxor     rcx, rsp; StackCookie                                          ; +0x283, 0x1402e26d3\ncall    __security_check_cookie                                        ; +0x286, 0x1402e26d6\nlea     r11, [rsp+98h+var_8]                                           ; +0x28b, 0x1402e26db\nmov     rbx, [r11+20h]                                                 ; +0x293, 0x1402e26e3\nmov     rsi, [r11+28h]                                                 ; +0x297, 0x1402e26e7\nmov     rsp, r11                                                       ; +0x29b, 0x1402e26eb\npop     rdi                                                            ; +0x29e, 0x1402e26ee\nretn                                                                   ; +0x29f, 0x1402e26ef", "xrefs": ["GameLevelManager::onGetLevelSaveDataCompleted @ 0x14022c5d0", "<???> @ 0x14091dea0"], "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"}