{"type": "func", "start": 4300499072, "end": 4300499384, "name": "GameLevelManager::markLevelAsRatedStars", "pseudocode": "// \n// GameLevelManager::markLevelAsRatedStars from 0x100546880 to 0x1005469b8 (312 bytes)\n// \n// 1 xrefs:\n// > GameLevelManager::rateStars @ 0x100545f1f\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\nvoid __fastcall GameLevelManager::markLevelAsRatedStars(GameLevelManager *a1, int a2)\n{\n  double v2; // xmm0_8\n  cocos2d::CCDictionary *m_ratedLevels; // rbx\n  cocos2d::CCString *m_trueString; // r14\n  cocos2d::CCString *v5; // rax\n  const char *CString; // r12\n  size_t v7; // rax\n  std::string::size_type v8; // r15\n  char *data; // r13\n  cocos2d::CCDictionary *v10; // r14\n  size_t v11; // rbx\n  char v12; // [rsp+0h] [rbp-50h]\n  cocos2d::CCString *v13; // [rsp+8h] [rbp-48h]\n  std::string __dst[2]; // [rsp+10h] [rbp-40h] BYREF\n\n  if ( cocos2d::CCDictionary::count(a1->m_ratedLevels) >= 0x3E8 )\n  {\n    cocos2d::CCDictionary::getFirstKey(__dst, (__int64)a1->m_ratedLevels);\n    cocos2d::CCDictionary::removeObjectForKey_1((__int64)a1->m_ratedLevels, (char *)__dst);\n    if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )\n      operator delete(__dst[0].__r_.__value_.__l.__data_);\n  }\n  m_ratedLevels = a1->m_ratedLevels;\n  m_trueString = a1->m_trueString;\n  v5 = (cocos2d::CCString *)sub_1007AB580(\"%i\", v12);\n  CString = cocos2d::CCString::getCString(v5);\n  v7 = strlen(CString);\n  if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )\n    sub_100006BF0(v2);\n  v8 = v7;\n  if ( v7 >= 0x17 )\n  {\n    v13 = m_trueString;\n    v10 = m_ratedLevels;\n    v11 = 26;\n    if ( (v7 | 7) != 0x17 )\n      v11 = (v7 | 7) + 1;\n    data = (char *)operator new(v11);\n    __dst[0].__r_.__value_.__r.__words[2] = (std::string::size_type)data;\n    __dst[0].__r_.__value_.__r.__words[0] = v11 + 1;\n    m_ratedLevels = v10;\n    m_trueString = v13;\n    __dst[0].__r_.__value_.__l.__size_ = v8;\n    goto LABEL_11;\n  }\n  __dst[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v7);\n  data = __dst[0].__r_.__value_.__s.__data_;\n  if ( v7 )\nLABEL_11:\n    memmove(data, CString, v8);\n  data[v8] = 0;\n  cocos2d::CCDictionary::setObject_1((__int64)m_ratedLevels, m_trueString, (char *)__dst);\n  if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )\n    operator delete(__dst[0].__r_.__value_.__l.__data_);\n}", "assembly": "; \n; GameLevelManager::markLevelAsRatedStars from 0x100546880 to 0x1005469b8 (312 bytes)\n; \n; 1 xrefs:\n; > GameLevelManager::rateStars @ 0x100545f1f\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\npush    rbp                                                            ; +0x0, 0x100546880\nmov     rbp, rsp                                                       ; +0x1, 0x100546881\npush    r15                                                            ; +0x4, 0x100546884\npush    r14                                                            ; +0x6, 0x100546886\npush    r13                                                            ; +0x8, 0x100546888\npush    r12                                                            ; +0xa, 0x10054688a\npush    rbx                                                            ; +0xc, 0x10054688c\nsub     rsp, 28h                                                       ; +0xd, 0x10054688d\nmov     r15d, esi                                                      ; +0x11, 0x100546891\nmov     r14, rdi                                                       ; +0x14, 0x100546894\nmov     rdi, [rdi+198h]                                                ; +0x17, 0x100546897\ncall    cocos2d__CCDictionary__count                                   ; +0x1e, 0x10054689e\ncmp     eax, 3E8h                                                      ; +0x23, 0x1005468a3\njb      short loc_1005468DB                                            ; +0x28, 0x1005468a8\nmov     rsi, [r14+198h]                                                ; +0x2a, 0x1005468aa\nlea     rbx, [rbp+__dst]                                               ; +0x31, 0x1005468b1\nmov     rdi, rbx; this                                                 ; +0x35, 0x1005468b5\ncall    cocos2d__CCDictionary__getFirstKey                             ; +0x38, 0x1005468b8\nmov     rdi, [r14+198h]                                                ; +0x3d, 0x1005468bd\nmov     rsi, rbx                                                       ; +0x44, 0x1005468c4\ncall    cocos2d__CCDictionary__removeObjectForKey_1                    ; +0x47, 0x1005468c7\ntest    byte ptr [rbp+__dst], 1                                        ; +0x4c, 0x1005468cc\njz      short loc_1005468DB                                            ; +0x50, 0x1005468d0\nmov     rdi, [rbp+__p]; __p                                            ; +0x52, 0x1005468d2\ncall    __ZdlPv; operator delete(void *)                               ; +0x56, 0x1005468d6\nmov     rbx, [r14+198h]                                                ; +0x5b, 0x1005468db\nmov     r14, [r14+3A8h]                                                ; +0x62, 0x1005468e2\nlea     rdi, aI; \"%i\"                                                  ; +0x69, 0x1005468e9\nmov     esi, r15d                                                      ; +0x70, 0x1005468f0\nxor     eax, eax                                                       ; +0x73, 0x1005468f3\ncall    sub_1007AB580                                                  ; +0x75, 0x1005468f5\nmov     rdi, rax                                                       ; +0x7a, 0x1005468fa\ncall    cocos2d__CCString__getCString                                  ; +0x7d, 0x1005468fd\nmov     r12, rax                                                       ; +0x82, 0x100546902\nmov     rdi, rax; __s                                                  ; +0x85, 0x100546905\ncall    _strlen                                                        ; +0x88, 0x100546908\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x8d, 0x10054690d\njnb     loc_1005469B3                                                  ; +0x91, 0x100546911\nmov     r15, rax                                                       ; +0x97, 0x100546917\ncmp     rax, 17h                                                       ; +0x9a, 0x10054691a\njnb     short loc_100546932                                            ; +0x9e, 0x10054691e\nlea     eax, [r15+r15]                                                 ; +0xa0, 0x100546920\nmov     byte ptr [rbp+__dst], al                                       ; +0xa4, 0x100546924\nlea     r13, [rbp+__dst+1]                                             ; +0xa7, 0x100546927\ntest    r15, r15                                                       ; +0xab, 0x10054692b\njnz     short loc_100546972                                            ; +0xae, 0x10054692e\njmp     short loc_100546980                                            ; +0xb0, 0x100546930\nmov     rax, r15                                                       ; +0xb2, 0x100546932\nor      rax, 7                                                         ; +0xb5, 0x100546935\nlea     rcx, [rax+1]                                                   ; +0xb9, 0x100546939\ncmp     rax, 17h                                                       ; +0xbd, 0x10054693d\nmov     [rbp+var_48], r14                                              ; +0xc1, 0x100546941\nmov     r14, rbx                                                       ; +0xc5, 0x100546945\nmov     ebx, 1Ah                                                       ; +0xc8, 0x100546948\ncmovnz  rbx, rcx                                                       ; +0xcd, 0x10054694d\nmov     rdi, rbx; __sz                                                 ; +0xd1, 0x100546951\ncall    __Znwm; operator new(ulong)                                    ; +0xd4, 0x100546954\nmov     r13, rax                                                       ; +0xd9, 0x100546959\nmov     [rbp+__p], rax                                                 ; +0xdc, 0x10054695c\ninc     rbx                                                            ; +0xe0, 0x100546960\nmov     [rbp+__dst], rbx                                               ; +0xe3, 0x100546963\nmov     rbx, r14                                                       ; +0xe7, 0x100546967\nmov     r14, [rbp+var_48]                                              ; +0xea, 0x10054696a\nmov     [rbp+var_38], r15                                              ; +0xee, 0x10054696e\nmov     rdi, r13; __dst                                                ; +0xf2, 0x100546972\nmov     rsi, r12; __src                                                ; +0xf5, 0x100546975\nmov     rdx, r15; __len                                                ; +0xf8, 0x100546978\ncall    _memmove                                                       ; +0xfb, 0x10054697b\nmov     byte ptr [r13+r15+0], 0                                        ; +0x100, 0x100546980\nlea     rdx, [rbp+__dst]                                               ; +0x106, 0x100546986\nmov     rdi, rbx                                                       ; +0x10a, 0x10054698a\nmov     rsi, r14                                                       ; +0x10d, 0x10054698d\ncall    cocos2d__CCDictionary__setObject_1                             ; +0x110, 0x100546990\ntest    byte ptr [rbp+__dst], 1                                        ; +0x115, 0x100546995\njz      short loc_1005469A4                                            ; +0x119, 0x100546999\nmov     rdi, [rbp+__p]; __p                                            ; +0x11b, 0x10054699b\ncall    __ZdlPv; operator delete(void *)                               ; +0x11f, 0x10054699f\nadd     rsp, 28h                                                       ; +0x124, 0x1005469a4\npop     rbx                                                            ; +0x128, 0x1005469a8\npop     r12                                                            ; +0x129, 0x1005469a9\npop     r13                                                            ; +0x12b, 0x1005469ab\npop     r14                                                            ; +0x12d, 0x1005469ad\npop     r15                                                            ; +0x12f, 0x1005469af\npop     rbp                                                            ; +0x131, 0x1005469b1\nretn                                                                   ; +0x132, 0x1005469b2\ncall    sub_100006BF0                                                  ; +0x133, 0x1005469b3", "xrefs": ["GameLevelManager::rateStars @ 0x100545f1f"], "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"}