{"type": "func", "start": 5370102096, "end": 5370102588, "name": "GameLevelManager::onRateStarsCompleted", "pseudocode": "// \n// GameLevelManager::onRateStarsCompleted from 0x140154150 to 0x14015433c (492 bytes)\n// \n// 2 xrefs:\n// > GameLevelManager::handleIt @ 0x140143218\n// > <???> @ 0x1406ca8d8\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=4\nvoid __fastcall GameLevelManager::onRateStarsCompleted(__int64 a1, const void **a2, const char *a3)\n{\n  const char *v6; // rcx\n  const void *v7; // rcx\n  unsigned __int64 v8; // r15\n  size_t v9; // r8\n  int v10; // ebp\n  size_t v11; // rbx\n  cocos2d::CCString *v12; // rax\n  const char *CString; // rax\n  void *v14; // rcx\n  GameStatsManager *v15; // rcx\n  int v16; // [rsp+20h] [rbp-78h]\n  void *v17; // [rsp+20h] [rbp-78h]\n  __int128 Buf2; // [rsp+38h] [rbp-60h] BYREF\n  __int64 v19; // [rsp+48h] [rbp-50h]\n  unsigned __int64 v20; // [rsp+50h] [rbp-48h]\n\n  v6 = a3;\n  if ( *((_QWORD *)a3 + 3) > 0xFu )\n    v6 = *(const char **)a3;\n  v16 = atoi(v6);\n  Buf2 = 0;\n  v19 = 2;\n  v20 = 15;\n  strcpy((char *)&Buf2, \"-1\");\n  v7 = a2;\n  if ( (unsigned __int64)a2[3] > 0xF )\n    v7 = *a2;\n  v8 = (unsigned __int64)a2[2];\n  v9 = v8;\n  if ( v8 > 2 )\n    v9 = 2;\n  v10 = memcmp(v7, &Buf2, v9);\n  v11 = -1;\n  if ( !v10 )\n  {\n    if ( v8 >= 2 )\n      v10 = v8 > 2;\n    else\n      v10 = -1;\n  }\n  if ( v10 )\n  {\n    v15 = (GameStatsManager *)qword_1406C2EE8;\n    if ( !qword_1406C2EE8 )\n    {\n      v17 = operator new(0x3E0u);\n      qword_1406C2EE8 = sub_1401D0AE0(v17);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2EE8 + 72LL))(qword_1406C2EE8);\n      v15 = (GameStatsManager *)qword_1406C2EE8;\n    }\n    GameStatsManager::incrementStat(v15, \"11\", 1);\n  }\n  else\n  {\n    v12 = cocos2d::CCString::createWithFormat(\"%i\", v16);\n    CString = cocos2d::CCString::getCString(v12);\n    Buf2 = 0;\n    v19 = 0;\n    v20 = 0;\n    do\n      ++v11;\n    while ( CString[v11] );\n    sub_14003A930(&Buf2, CString, v11);\n    cocos2d::CCDictionary::removeObjectForKey(*(_QWORD *)(a1 + 400), &Buf2);\n    if ( v20 > 0xF )\n    {\n      v14 = (void *)Buf2;\n      if ( v20 + 1 >= 0x1000 )\n      {\n        v14 = *(void **)(Buf2 - 8);\n        if ( (unsigned __int64)(Buf2 - (_QWORD)v14 - 8) > 0x1F )\n          invalid_parameter_noinfo_noreturn();\n      }\n      j_j_free(v14);\n    }\n  }\n  sub_14003A830((__int64)a2);\n  sub_14003A830((__int64)a3);\n}", "assembly": "; \n; GameLevelManager::onRateStarsCompleted from 0x140154150 to 0x14015433c (492 bytes)\n; \n; 2 xrefs:\n; > GameLevelManager::handleIt @ 0x140143218\n; > <???> @ 0x1406ca8d8\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_18], rbx                                              ; +0x0, 0x140154150\npush    rbp                                                            ; +0x5, 0x140154155\npush    rsi                                                            ; +0x6, 0x140154156\npush    rdi                                                            ; +0x7, 0x140154157\npush    r12                                                            ; +0x8, 0x140154158\npush    r13                                                            ; +0xa, 0x14015415a\npush    r14                                                            ; +0xc, 0x14015415c\npush    r15                                                            ; +0xe, 0x14015415e\nsub     rsp, 60h                                                       ; +0x10, 0x140154160\nmov     rax, cs:__security_cookie                                      ; +0x14, 0x140154164\nxor     rax, rsp                                                       ; +0x1b, 0x14015416b\nmov     [rsp+98h+var_40], rax                                          ; +0x1e, 0x14015416e\nmov     rdi, r8                                                        ; +0x23, 0x140154173\nmov     rsi, rdx                                                       ; +0x26, 0x140154176\nmov     r13, rcx                                                       ; +0x29, 0x140154179\nmov     [rsp+98h+var_70], rdx                                          ; +0x2c, 0x14015417c\nmov     [rsp+98h+var_68], r8                                           ; +0x31, 0x140154181\nmov     rcx, r8                                                        ; +0x36, 0x140154186\ncmp     qword ptr [r8+18h], 0Fh                                        ; +0x39, 0x140154189\njbe     short loc_140154193                                            ; +0x3e, 0x14015418e\nmov     rcx, [r8]; String                                              ; +0x40, 0x140154190\ncall    cs:atoi                                                        ; +0x43, 0x140154193\nmov     dword ptr [rsp+98h+var_78], eax                                ; +0x49, 0x140154199\nxorps   xmm0, xmm0                                                     ; +0x4d, 0x14015419d\nmovups  [rsp+98h+Buf2], xmm0                                           ; +0x50, 0x1401541a0\nmov     eax, 2                                                         ; +0x55, 0x1401541a5\nmov     [rsp+98h+var_50], rax                                          ; +0x5a, 0x1401541aa\nmov     r8d, 0Fh                                                       ; +0x5f, 0x1401541af\nmov     [rsp+98h+var_48], r8                                           ; +0x65, 0x1401541b5\nmovzx   ecx, cs:word_1405334A0                                         ; +0x6a, 0x1401541ba\nmov     word ptr [rsp+98h+Buf2], cx                                    ; +0x71, 0x1401541c1\nmov     byte ptr [rsp+98h+Buf2+2], 0                                   ; +0x76, 0x1401541c6\nlea     rdx, [rsp+98h+Buf2]; Buf2                                      ; +0x7b, 0x1401541cb\nmov     rcx, rsi                                                       ; +0x80, 0x1401541d0\ncmp     [rsi+18h], r8                                                  ; +0x83, 0x1401541d3\njbe     short loc_1401541DC                                            ; +0x87, 0x1401541d7\nmov     rcx, [rsi]; Buf1                                               ; +0x89, 0x1401541d9\nmov     r15, [rsi+10h]                                                 ; +0x8c, 0x1401541dc\nmov     r8, r15                                                        ; +0x90, 0x1401541e0\ncmp     rax, r15                                                       ; +0x93, 0x1401541e3\ncmovb   r8, rax; Size                                                  ; +0x96, 0x1401541e6\ncall    memcmp                                                         ; +0x9a, 0x1401541ea\nmov     ebp, eax                                                       ; +0x9f, 0x1401541ef\nmov     rbx, 0FFFFFFFFFFFFFFFFh                                        ; +0xa1, 0x1401541f1\ntest    eax, eax                                                       ; +0xa8, 0x1401541f8\njnz     short loc_140154210                                            ; +0xaa, 0x1401541fa\ncmp     r15, 2                                                         ; +0xac, 0x1401541fc\njnb     short loc_140154206                                            ; +0xb0, 0x140154200\nmov     ebp, ebx                                                       ; +0xb2, 0x140154202\njmp     short loc_140154210                                            ; +0xb4, 0x140154204\nxor     ebp, ebp                                                       ; +0xb6, 0x140154206\ncmp     r15, 2                                                         ; +0xb8, 0x140154208\nsetnbe  bpl                                                            ; +0xbc, 0x14015420c\ntest    ebp, ebp                                                       ; +0xc0, 0x140154210\njnz     loc_1401542B8                                                  ; +0xc2, 0x140154212\nmov     edx, dword ptr [rsp+98h+var_78]                                ; +0xc8, 0x140154218\nlea     rcx, aI_11; \"%i\"                                               ; +0xcc, 0x14015421c\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xd3, 0x140154223\nmov     rcx, rax                                                       ; +0xd9, 0x140154229\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0xdc, 0x14015422c\nxorps   xmm0, xmm0                                                     ; +0xe2, 0x140154232\nmovups  [rsp+98h+Buf2], xmm0                                           ; +0xe5, 0x140154235\nxor     ecx, ecx                                                       ; +0xea, 0x14015423a\nmov     [rsp+98h+var_50], rcx                                          ; +0xec, 0x14015423c\nmov     [rsp+98h+var_48], rcx                                          ; +0xf1, 0x140154241\ninc     rbx                                                            ; +0xf6, 0x140154246\ncmp     [rax+rbx], cl                                                  ; +0xf9, 0x140154249\njnz     short loc_140154246                                            ; +0xfc, 0x14015424c\nmov     r8, rbx                                                        ; +0xfe, 0x14015424e\nmov     rdx, rax                                                       ; +0x101, 0x140154251\nlea     rcx, [rsp+98h+Buf2]                                            ; +0x104, 0x140154254\ncall    sub_14003A930                                                  ; +0x109, 0x140154259\nnop                                                                    ; +0x10e, 0x14015425e\nlea     rdx, [rsp+98h+Buf2]                                            ; +0x10f, 0x14015425f\nmov     rcx, [r13+190h]                                                ; +0x114, 0x140154264\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 &) ; +0x11b, 0x14015426b\nnop                                                                    ; +0x121, 0x140154271\nmov     rdx, [rsp+98h+var_48]                                          ; +0x122, 0x140154272\ncmp     rdx, 0Fh                                                       ; +0x127, 0x140154277\njbe     loc_140154306                                                  ; +0x12b, 0x14015427b\ninc     rdx                                                            ; +0x131, 0x140154281\nmov     rcx, qword ptr [rsp+98h+Buf2]; Block                           ; +0x134, 0x140154284\nmov     rax, rcx                                                       ; +0x139, 0x140154289\ncmp     rdx, 1000h                                                     ; +0x13c, 0x14015428c\njb      short loc_1401542B1                                            ; +0x143, 0x140154293\nadd     rdx, 27h ; '''                                                 ; +0x145, 0x140154295\nmov     rcx, [rcx-8]                                                   ; +0x149, 0x140154299\nsub     rax, rcx                                                       ; +0x14d, 0x14015429d\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x150, 0x1401542a0\ncmp     rax, 1Fh                                                       ; +0x154, 0x1401542a4\njbe     short loc_1401542B1                                            ; +0x158, 0x1401542a8\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x15a, 0x1401542aa\ndb 0CCh                                                                ; +0x160, 0x1401542b0\ncall    j_j_free                                                       ; +0x161, 0x1401542b1\njmp     short loc_140154306                                            ; +0x166, 0x1401542b6\nmov     rcx, cs:qword_1406C2EE8                                        ; +0x168, 0x1401542b8\ntest    rcx, rcx                                                       ; +0x16f, 0x1401542bf\njnz     short loc_1401542F3                                            ; +0x172, 0x1401542c2\nmov     ecx, 3E0h; Size                                                ; +0x174, 0x1401542c4\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x179, 0x1401542c9\nmov     [rsp+98h+var_78], rax                                          ; +0x17e, 0x1401542ce\nmov     rcx, rax                                                       ; +0x183, 0x1401542d3\ncall    sub_1401D0AE0                                                  ; +0x186, 0x1401542d6\nnop                                                                    ; +0x18b, 0x1401542db\nmov     cs:qword_1406C2EE8, rax                                        ; +0x18c, 0x1401542dc\nmov     rdx, [rax]                                                     ; +0x193, 0x1401542e3\nmov     rcx, rax                                                       ; +0x196, 0x1401542e6\ncall    qword ptr [rdx+48h]                                            ; +0x199, 0x1401542e9\nmov     rcx, cs:qword_1406C2EE8                                        ; +0x19c, 0x1401542ec\nmov     r8d, 1                                                         ; +0x1a3, 0x1401542f3\nlea     rdx, a11; \"11\"                                                 ; +0x1a9, 0x1401542f9\ncall    GameStatsManager__incrementStat                                ; +0x1b0, 0x140154300\nnop                                                                    ; +0x1b5, 0x140154305\nmov     rcx, rsi                                                       ; +0x1b6, 0x140154306\ncall    sub_14003A830                                                  ; +0x1b9, 0x140154309\nnop                                                                    ; +0x1be, 0x14015430e\nmov     rcx, rdi                                                       ; +0x1bf, 0x14015430f\ncall    sub_14003A830                                                  ; +0x1c2, 0x140154312\nmov     rcx, [rsp+98h+var_40]                                          ; +0x1c7, 0x140154317\nxor     rcx, rsp; StackCookie                                          ; +0x1cc, 0x14015431c\ncall    __security_check_cookie                                        ; +0x1cf, 0x14015431f\nmov     rbx, [rsp+98h+arg_18]                                          ; +0x1d4, 0x140154324\nadd     rsp, 60h                                                       ; +0x1dc, 0x14015432c\npop     r15                                                            ; +0x1e0, 0x140154330\npop     r14                                                            ; +0x1e2, 0x140154332\npop     r13                                                            ; +0x1e4, 0x140154334\npop     r12                                                            ; +0x1e6, 0x140154336\npop     rdi                                                            ; +0x1e8, 0x140154338\npop     rsi                                                            ; +0x1e9, 0x140154339\npop     rbp                                                            ; +0x1ea, 0x14015433a\nretn                                                                   ; +0x1eb, 0x14015433b", "xrefs": ["GameLevelManager::handleIt @ 0x140143218", "<???> @ 0x1406ca8d8"], "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"}