{"type": "func", "start": 5371020736, "end": 5371021245, "name": "GameLevelManager::onRateStarsCompleted", "pseudocode": "// \n// GameLevelManager::onRateStarsCompleted from 0x1402345c0 to 0x1402347bd (509 bytes)\n// \n// 2 xrefs:\n// > GameLevelManager::handleIt @ 0x140219a1c\n// > <???> @ 0x14091bf68\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:28:31 +0000\n// \n\n// Hidden C++ exception states: #wind=4\nvoid __fastcall GameLevelManager::onRateStarsCompleted(__int64 a1, const void **a2, const char *a3)\n{\n  const char *v6; // rcx\n  unsigned int v7; // r12d\n  const void *v8; // rcx\n  unsigned __int64 v9; // r15\n  size_t v10; // r8\n  int v11; // ebp\n  size_t v12; // rbx\n  cocos2d::CCString *v13; // rax\n  const char *CString; // rax\n  void *v15; // rcx\n  __int64 v16; // rcx\n  void *v17; // [rsp+30h] [rbp-78h]\n  __int128 Buf2; // [rsp+48h] [rbp-60h] BYREF\n  __int64 v19; // [rsp+58h] [rbp-50h]\n  unsigned __int64 v20; // [rsp+60h] [rbp-48h]\n\n  v6 = a3;\n  if ( *((_QWORD *)a3 + 3) > 0xFu )\n    v6 = *(const char **)a3;\n  v7 = atoi(v6);\n  Buf2 = 0;\n  v19 = 2;\n  v20 = 15;\n  strcpy((char *)&Buf2, \"-1\");\n  v8 = a2;\n  if ( (unsigned __int64)a2[3] > 0xF )\n    v8 = *a2;\n  v9 = (unsigned __int64)a2[2];\n  v10 = v9;\n  if ( v9 > 2 )\n    v10 = 2;\n  v11 = memcmp(v8, &Buf2, v10);\n  v12 = -1;\n  if ( !v11 )\n  {\n    if ( v9 >= 2 )\n      v11 = v9 > 2;\n    else\n      v11 = -1;\n  }\n  if ( v11 )\n  {\n    v16 = qword_14090BFE0;\n    if ( !qword_14090BFE0 )\n    {\n      v17 = operator new(0x3E8u);\n      qword_14090BFE0 = sub_1402D6480(v17);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFE0 + 72LL))(qword_14090BFE0);\n      v16 = qword_14090BFE0;\n    }\n    GameStatsManager::incrementStat(v16, \"11\", 1);\n  }\n  else\n  {\n    v13 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, v7);\n    CString = cocos2d::CCString::getCString(v13);\n    Buf2 = 0;\n    v19 = 0;\n    v20 = 0;\n    do\n      ++v12;\n    while ( CString[v12] );\n    sub_14003D230(&Buf2, CString, v12);\n    cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(a1 + 904), &Buf2);\n    if ( v20 > 0xF )\n    {\n      v15 = (void *)Buf2;\n      if ( v20 + 1 >= 0x1000 )\n      {\n        v15 = *(void **)(Buf2 - 8);\n        if ( (unsigned __int64)(Buf2 - (_QWORD)v15 - 8) > 0x1F )\n          invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n      }\n      j_j_free(v15);\n    }\n  }\n  sub_14003D310((__int64)a2);\n  sub_14003D310((__int64)a3);\n}", "assembly": "; \n; GameLevelManager::onRateStarsCompleted from 0x1402345c0 to 0x1402347bd (509 bytes)\n; \n; 2 xrefs:\n; > GameLevelManager::handleIt @ 0x140219a1c\n; > <???> @ 0x14091bf68\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:28:31 +0000\n; \nmov     [rsp+arg_18], rbx                                              ; +0x0, 0x1402345c0\npush    rbp                                                            ; +0x5, 0x1402345c5\npush    rsi                                                            ; +0x6, 0x1402345c6\npush    rdi                                                            ; +0x7, 0x1402345c7\npush    r12                                                            ; +0x8, 0x1402345c8\npush    r13                                                            ; +0xa, 0x1402345ca\npush    r14                                                            ; +0xc, 0x1402345cc\npush    r15                                                            ; +0xe, 0x1402345ce\nsub     rsp, 70h                                                       ; +0x10, 0x1402345d0\nmov     rax, cs:__security_cookie                                      ; +0x14, 0x1402345d4\nxor     rax, rsp                                                       ; +0x1b, 0x1402345db\nmov     [rsp+0A8h+var_40], rax                                         ; +0x1e, 0x1402345de\nmov     rdi, r8                                                        ; +0x23, 0x1402345e3\nmov     rsi, rdx                                                       ; +0x26, 0x1402345e6\nmov     r13, rcx                                                       ; +0x29, 0x1402345e9\nmov     [rsp+0A8h+var_70], rdx                                         ; +0x2c, 0x1402345ec\nmov     [rsp+0A8h+var_68], r8                                          ; +0x31, 0x1402345f1\nmov     rcx, r8                                                        ; +0x36, 0x1402345f6\ncmp     qword ptr [r8+18h], 0Fh                                        ; +0x39, 0x1402345f9\njbe     short loc_140234603                                            ; +0x3e, 0x1402345fe\nmov     rcx, [r8]; String                                              ; +0x40, 0x140234600\ncall    cs:atoi                                                        ; +0x43, 0x140234603\nmov     r12d, eax                                                      ; +0x49, 0x140234609\nxorps   xmm0, xmm0                                                     ; +0x4c, 0x14023460c\nmovups  [rsp+0A8h+Buf2], xmm0                                          ; +0x4f, 0x14023460f\nmov     eax, 2                                                         ; +0x54, 0x140234614\nmov     [rsp+0A8h+var_50], rax                                         ; +0x59, 0x140234619\nmov     r8d, 0Fh                                                       ; +0x5e, 0x14023461e\nmov     [rsp+0A8h+var_48], r8                                          ; +0x64, 0x140234624\nmovzx   ecx, word ptr cs:a1; \"-1\"                                      ; +0x69, 0x140234629\nmov     word ptr [rsp+0A8h+Buf2], cx                                   ; +0x70, 0x140234630\nmov     byte ptr [rsp+0A8h+Buf2+2], 0                                  ; +0x75, 0x140234635\nlea     rdx, [rsp+0A8h+Buf2]; Buf2                                     ; +0x7a, 0x14023463a\nmov     rcx, rsi                                                       ; +0x7f, 0x14023463f\ncmp     [rsi+18h], r8                                                  ; +0x82, 0x140234642\njbe     short loc_14023464B                                            ; +0x86, 0x140234646\nmov     rcx, [rsi]; Buf1                                               ; +0x88, 0x140234648\nmov     r15, [rsi+10h]                                                 ; +0x8b, 0x14023464b\nmov     r8, r15                                                        ; +0x8f, 0x14023464f\ncmp     rax, r15                                                       ; +0x92, 0x140234652\ncmovb   r8, rax; Size                                                  ; +0x95, 0x140234655\ncall    memcmp                                                         ; +0x99, 0x140234659\nmov     ebp, eax                                                       ; +0x9e, 0x14023465e\nmov     rbx, 0FFFFFFFFFFFFFFFFh                                        ; +0xa0, 0x140234660\ntest    eax, eax                                                       ; +0xa7, 0x140234667\njnz     short loc_14023467F                                            ; +0xa9, 0x140234669\ncmp     r15, 2                                                         ; +0xab, 0x14023466b\njnb     short loc_140234675                                            ; +0xaf, 0x14023466f\nmov     ebp, ebx                                                       ; +0xb1, 0x140234671\njmp     short loc_14023467F                                            ; +0xb3, 0x140234673\nxor     ebp, ebp                                                       ; +0xb5, 0x140234675\ncmp     r15, 2                                                         ; +0xb7, 0x140234677\nsetnbe  bpl                                                            ; +0xbb, 0x14023467b\ntest    ebp, ebp                                                       ; +0xbf, 0x14023467f\njnz     loc_140234736                                                  ; +0xc1, 0x140234681\nmov     edx, r12d                                                      ; +0xc7, 0x140234687\nlea     rcx, word_1406ED6F8                                            ; +0xca, 0x14023468a\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xd1, 0x140234691\nmov     rcx, rax                                                       ; +0xd7, 0x140234697\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0xda, 0x14023469a\nxorps   xmm0, xmm0                                                     ; +0xe0, 0x1402346a0\nmovups  [rsp+0A8h+Buf2], xmm0                                          ; +0xe3, 0x1402346a3\nxor     ebp, ebp                                                       ; +0xe8, 0x1402346a8\nmov     [rsp+0A8h+var_50], rbp                                         ; +0xea, 0x1402346aa\nmov     [rsp+0A8h+var_48], rbp                                         ; +0xef, 0x1402346af\ninc     rbx                                                            ; +0xf4, 0x1402346b4\ncmp     [rax+rbx], bpl                                                 ; +0xf7, 0x1402346b7\njnz     short loc_1402346B4                                            ; +0xfb, 0x1402346bb\nmov     r8, rbx                                                        ; +0xfd, 0x1402346bd\nmov     rdx, rax                                                       ; +0x100, 0x1402346c0\nlea     rcx, [rsp+0A8h+Buf2]                                           ; +0x103, 0x1402346c3\ncall    sub_14003D230                                                  ; +0x108, 0x1402346c8\nnop                                                                    ; +0x10d, 0x1402346cd\nlea     rdx, [rsp+0A8h+Buf2]                                           ; +0x10e, 0x1402346ce\nmov     rcx, [r13+388h]                                                ; +0x113, 0x1402346d3\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 &) ; +0x11a, 0x1402346da\nnop                                                                    ; +0x120, 0x1402346e0\nmov     rdx, [rsp+0A8h+var_48]                                         ; +0x121, 0x1402346e1\ncmp     rdx, 0Fh                                                       ; +0x126, 0x1402346e6\njbe     loc_140234787                                                  ; +0x12a, 0x1402346ea\ninc     rdx                                                            ; +0x130, 0x1402346f0\nmov     rcx, qword ptr [rsp+0A8h+Buf2]; Block                          ; +0x133, 0x1402346f3\nmov     rax, rcx                                                       ; +0x138, 0x1402346f8\ncmp     rdx, 1000h                                                     ; +0x13b, 0x1402346fb\njb      short loc_14023472F                                            ; +0x142, 0x140234702\nadd     rdx, 27h ; '''                                                 ; +0x144, 0x140234704\nmov     rcx, [rcx-8]                                                   ; +0x148, 0x140234708\nsub     rax, rcx                                                       ; +0x14c, 0x14023470c\nsub     rax, 8                                                         ; +0x14f, 0x14023470f\ncmp     rax, 1Fh                                                       ; +0x153, 0x140234713\njbe     short loc_14023472F                                            ; +0x157, 0x140234717\nmov     [rsp+0A8h+Reserved], rbp; Reserved                             ; +0x159, 0x140234719\nxor     r9d, r9d; LineNo                                               ; +0x15e, 0x14023471e\nxor     r8d, r8d; FileName                                             ; +0x161, 0x140234721\nxor     edx, edx; FunctionName                                         ; +0x164, 0x140234724\nxor     ecx, ecx; Expression                                           ; +0x166, 0x140234726\ncall    cs:_invoke_watson                                              ; +0x168, 0x140234728\ndb 0CCh                                                                ; +0x16e, 0x14023472e\ncall    j_j_free                                                       ; +0x16f, 0x14023472f\njmp     short loc_140234787                                            ; +0x174, 0x140234734\nmov     rcx, cs:qword_14090BFE0                                        ; +0x176, 0x140234736\ntest    rcx, rcx                                                       ; +0x17d, 0x14023473d\njnz     short loc_140234774                                            ; +0x180, 0x140234740\nmov     ecx, 3E8h; Size                                                ; +0x182, 0x140234742\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x187, 0x140234747\nmov     [rsp+0A8h+var_78], rax                                         ; +0x18c, 0x14023474c\nmov     rcx, rax                                                       ; +0x191, 0x140234751\ncall    sub_1402D6480                                                  ; +0x194, 0x140234754\nnop                                                                    ; +0x199, 0x140234759\nmov     cs:qword_14090BFE0, rax                                        ; +0x19a, 0x14023475a\nmov     rcx, [rax]                                                     ; +0x1a1, 0x140234761\nmov     rdx, [rcx+48h]                                                 ; +0x1a4, 0x140234764\nmov     rcx, rax                                                       ; +0x1a8, 0x140234768\ncall    rdx                                                            ; +0x1ab, 0x14023476b\nmov     rcx, cs:qword_14090BFE0                                        ; +0x1ad, 0x14023476d\nmov     r8d, 1                                                         ; +0x1b4, 0x140234774\nlea     rdx, a11; \"11\"                                                 ; +0x1ba, 0x14023477a\ncall    GameStatsManager__incrementStat                                ; +0x1c1, 0x140234781\nnop                                                                    ; +0x1c6, 0x140234786\nmov     rcx, rsi                                                       ; +0x1c7, 0x140234787\ncall    sub_14003D310                                                  ; +0x1ca, 0x14023478a\nnop                                                                    ; +0x1cf, 0x14023478f\nmov     rcx, rdi                                                       ; +0x1d0, 0x140234790\ncall    sub_14003D310                                                  ; +0x1d3, 0x140234793\nmov     rcx, [rsp+0A8h+var_40]                                         ; +0x1d8, 0x140234798\nxor     rcx, rsp; StackCookie                                          ; +0x1dd, 0x14023479d\ncall    __security_check_cookie                                        ; +0x1e0, 0x1402347a0\nmov     rbx, [rsp+0A8h+arg_18]                                         ; +0x1e5, 0x1402347a5\nadd     rsp, 70h                                                       ; +0x1ed, 0x1402347ad\npop     r15                                                            ; +0x1f1, 0x1402347b1\npop     r14                                                            ; +0x1f3, 0x1402347b3\npop     r13                                                            ; +0x1f5, 0x1402347b5\npop     r12                                                            ; +0x1f7, 0x1402347b7\npop     rdi                                                            ; +0x1f9, 0x1402347b9\npop     rsi                                                            ; +0x1fa, 0x1402347ba\npop     rbp                                                            ; +0x1fb, 0x1402347bb\nretn                                                                   ; +0x1fc, 0x1402347bc", "xrefs": ["GameLevelManager::handleIt @ 0x140219a1c", "<???> @ 0x14091bf68"], "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"}