{"type": "func", "start": 4300360736, "end": 4300361088, "name": "GameLevelManager::onRateStarsCompleted", "pseudocode": "// \n// GameLevelManager::onRateStarsCompleted from 0x100524c20 to 0x100524d80 (352 bytes)\n// \n// 1 xrefs:\n// > GameLevelManager::handleIt @ 0x10051ee5b\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 12:31:45 +0000\n// \n\nvoid __fastcall GameLevelManager::onRateStarsCompleted(__int64 a1, unsigned __int8 *a2, __int64 a3)\n{\n  const char *v4; // rdx\n  const void *v5; // rdi\n  unsigned __int64 v6; // rcx\n  char *v7; // rbx\n  size_t v8; // rdx\n  __int64 v9; // r14\n  __int64 v10; // rax\n  const char *CString; // r12\n  size_t v12; // rax\n  size_t v13; // r15\n  __int64 v14; // rax\n  size_t v15; // r13\n  _QWORD __s2[2]; // [rsp+0h] [rbp-40h] BYREF\n  void *__p; // [rsp+10h] [rbp-30h]\n\n  if ( (*(_BYTE *)a3 & 1) != 0 )\n    v4 = *(const char **)(a3 + 16);\n  else\n    v4 = (const char *)(a3 + 1);\n  atoi(v4);\n  *(_WORD *)((char *)__s2 + 1) = 12589;\n  BYTE3(__s2[0]) = 0;\n  v5 = a2 + 1;\n  v6 = *a2 >> 1;\n  if ( (*a2 & 1) != 0 )\n    v5 = *((const void **)a2 + 2);\n  v7 = (char *)__s2 + 1;\n  if ( (*a2 & 1) != 0 )\n    v6 = *((_QWORD *)a2 + 1);\n  v8 = 2;\n  if ( v6 < 2 )\n    v8 = v6;\n  if ( (v6 != 2) | (memcmp(v5, (char *)__s2 + 1, v8) != 0) )\n  {\n    v14 = GameStatsManager::sharedState();\n    GameStatsManager::incrementStat_1(v14, (__int64)\"11\");\n    return;\n  }\n  v9 = *(_QWORD *)(a1 + 808);\n  v10 = sub_10088E820(\"%i\", __s2[0]);\n  CString = (const char *)cocos2d::CCString::getCString(v10);\n  v12 = strlen(CString);\n  if ( v12 >= 0xFFFFFFFFFFFFFFF8LL )\n    sub_100003630();\n  v13 = v12;\n  if ( v12 >= 0x17 )\n  {\n    v15 = 26;\n    if ( (v12 | 7) != 0x17 )\n      v15 = (v12 | 7) + 1;\n    v7 = (char *)operator new(v15);\n    __p = v7;\n    __s2[0] = v15 + 1;\n    __s2[1] = v13;\n    goto LABEL_19;\n  }\n  LOBYTE(__s2[0]) = 2 * v12;\n  if ( v12 )\nLABEL_19:\n    memmove(v7, CString, v13);\n  v7[v13] = 0;\n  cocos2d::CCDictionary::removeObjectForKey(v9, (char *)__s2);\n  if ( (__s2[0] & 1) != 0 )\n    operator delete(__p);\n}", "assembly": "; \n; GameLevelManager::onRateStarsCompleted from 0x100524c20 to 0x100524d80 (352 bytes)\n; \n; 1 xrefs:\n; > GameLevelManager::handleIt @ 0x10051ee5b\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 12:31:45 +0000\n; \npush    rbp                                                            ; +0x0, 0x100524c20\nmov     rbp, rsp                                                       ; +0x1, 0x100524c21\npush    r15                                                            ; +0x4, 0x100524c24\npush    r14                                                            ; +0x6, 0x100524c26\npush    r13                                                            ; +0x8, 0x100524c28\npush    r12                                                            ; +0xa, 0x100524c2a\npush    rbx                                                            ; +0xc, 0x100524c2c\nsub     rsp, 18h                                                       ; +0xd, 0x100524c2d\nmov     r12, rsi                                                       ; +0x11, 0x100524c31\nmov     r14, rdi                                                       ; +0x14, 0x100524c34\ntest    byte ptr [rdx], 1                                              ; +0x17, 0x100524c37\njnz     short loc_100524C41                                            ; +0x1a, 0x100524c3a\ninc     rdx                                                            ; +0x1c, 0x100524c3c\njmp     short loc_100524C45                                            ; +0x1f, 0x100524c3f\nmov     rdx, [rdx+10h]                                                 ; +0x21, 0x100524c41\nmov     rdi, rdx; char *                                               ; +0x25, 0x100524c45\ncall    _atoi                                                          ; +0x28, 0x100524c48\nmov     r15d, eax                                                      ; +0x2d, 0x100524c4d\nmov     word ptr [rbp+__s2+1], 312Dh                                   ; +0x30, 0x100524c50\nmov     byte ptr [rbp+__s2+3], 0                                       ; +0x36, 0x100524c56\nmovzx   eax, byte ptr [r12]                                            ; +0x3a, 0x100524c5a\nlea     rdi, [r12+1]                                                   ; +0x3f, 0x100524c5f\nmov     ecx, eax                                                       ; +0x44, 0x100524c64\nshr     ecx, 1                                                         ; +0x46, 0x100524c66\ntest    al, 1                                                          ; +0x48, 0x100524c68\ncmovnz  rdi, [r12+10h]; __s1                                           ; +0x4a, 0x100524c6a\nlea     rbx, [rbp+__s2+1]                                              ; +0x50, 0x100524c70\ncmovnz  rcx, [r12+8]                                                   ; +0x54, 0x100524c74\ncmp     rcx, 2                                                         ; +0x5a, 0x100524c7a\nmov     edx, 2                                                         ; +0x5e, 0x100524c7e\ncmovb   rdx, rcx; __n                                                  ; +0x63, 0x100524c83\nsetnz   r12b                                                           ; +0x67, 0x100524c87\nmov     rsi, rbx; __s2                                                 ; +0x6b, 0x100524c8b\ncall    _memcmp                                                        ; +0x6e, 0x100524c8e\ntest    eax, eax                                                       ; +0x73, 0x100524c93\nsetnz   al                                                             ; +0x75, 0x100524c95\nor      al, r12b                                                       ; +0x78, 0x100524c98\njnz     short loc_100524CE9                                            ; +0x7b, 0x100524c9b\nmov     r14, [r14+328h]                                                ; +0x7d, 0x100524c9d\nlea     rdi, aI_14; \"%i\"                                               ; +0x84, 0x100524ca4\nmov     esi, r15d                                                      ; +0x8b, 0x100524cab\nxor     eax, eax                                                       ; +0x8e, 0x100524cae\ncall    sub_10088E820                                                  ; +0x90, 0x100524cb0\nmov     rdi, rax                                                       ; +0x95, 0x100524cb5\ncall    cocos2d__CCString__getCString                                  ; +0x98, 0x100524cb8\nmov     r12, rax                                                       ; +0x9d, 0x100524cbd\nmov     rdi, rax; __s                                                  ; +0xa0, 0x100524cc0\ncall    _strlen                                                        ; +0xa3, 0x100524cc3\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xa8, 0x100524cc8\njnb     loc_100524D7B                                                  ; +0xac, 0x100524ccc\nmov     r15, rax                                                       ; +0xb2, 0x100524cd2\ncmp     rax, 17h                                                       ; +0xb5, 0x100524cd5\njnb     short loc_100524D0B                                            ; +0xb9, 0x100524cd9\nlea     eax, [r15+r15]                                                 ; +0xbb, 0x100524cdb\nmov     byte ptr [rbp+__s2], al                                        ; +0xbf, 0x100524cdf\ntest    r15, r15                                                       ; +0xc2, 0x100524ce2\njnz     short loc_100524D3E                                            ; +0xc5, 0x100524ce5\njmp     short loc_100524D4C                                            ; +0xc7, 0x100524ce7\ncall    GameStatsManager__sharedState                                  ; +0xc9, 0x100524ce9\nlea     rsi, a11_0; \"11\"                                               ; +0xce, 0x100524cee\nmov     rdi, rax                                                       ; +0xd5, 0x100524cf5\nadd     rsp, 18h                                                       ; +0xd8, 0x100524cf8\npop     rbx                                                            ; +0xdc, 0x100524cfc\npop     r12                                                            ; +0xdd, 0x100524cfd\npop     r13                                                            ; +0xdf, 0x100524cff\npop     r14                                                            ; +0xe1, 0x100524d01\npop     r15                                                            ; +0xe3, 0x100524d03\npop     rbp                                                            ; +0xe5, 0x100524d05\njmp     GameStatsManager__incrementStat_1                              ; +0xe6, 0x100524d06\nmov     rax, r15                                                       ; +0xeb, 0x100524d0b\nor      rax, 7                                                         ; +0xee, 0x100524d0e\nlea     rcx, [rax+1]                                                   ; +0xf2, 0x100524d12\ncmp     rax, 17h                                                       ; +0xf6, 0x100524d16\nmov     r13d, 1Ah                                                      ; +0xfa, 0x100524d1a\ncmovnz  r13, rcx                                                       ; +0x100, 0x100524d20\nmov     rdi, r13; __sz                                                 ; +0x104, 0x100524d24\ncall    __Znwm; operator new(ulong)                                    ; +0x107, 0x100524d27\nmov     rbx, rax                                                       ; +0x10c, 0x100524d2c\nmov     [rbp+__p], rax                                                 ; +0x10f, 0x100524d2f\ninc     r13                                                            ; +0x113, 0x100524d33\nmov     [rbp+__s2], r13                                                ; +0x116, 0x100524d36\nmov     [rbp+var_38], r15                                              ; +0x11a, 0x100524d3a\nmov     rdi, rbx; __dst                                                ; +0x11e, 0x100524d3e\nmov     rsi, r12; __src                                                ; +0x121, 0x100524d41\nmov     rdx, r15; __len                                                ; +0x124, 0x100524d44\ncall    _memmove                                                       ; +0x127, 0x100524d47\nmov     byte ptr [rbx+r15], 0                                          ; +0x12c, 0x100524d4c\nlea     rsi, [rbp+__s2]                                                ; +0x131, 0x100524d51\nmov     rdi, r14                                                       ; +0x135, 0x100524d55\ncall    cocos2d__CCDictionary__removeObjectForKey                      ; +0x138, 0x100524d58\ntest    byte ptr [rbp+__s2], 1                                         ; +0x13d, 0x100524d5d\njz      short loc_100524D6C                                            ; +0x141, 0x100524d61\nmov     rdi, [rbp+__p]; __p                                            ; +0x143, 0x100524d63\ncall    __ZdlPv; operator delete(void *)                               ; +0x147, 0x100524d67\nadd     rsp, 18h                                                       ; +0x14c, 0x100524d6c\npop     rbx                                                            ; +0x150, 0x100524d70\npop     r12                                                            ; +0x151, 0x100524d71\npop     r13                                                            ; +0x153, 0x100524d73\npop     r14                                                            ; +0x155, 0x100524d75\npop     r15                                                            ; +0x157, 0x100524d77\npop     rbp                                                            ; +0x159, 0x100524d79\nretn                                                                   ; +0x15a, 0x100524d7a\ncall    sub_100003630                                                  ; +0x15b, 0x100524d7b", "xrefs": ["GameLevelManager::handleIt @ 0x10051ee5b"], "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"}