{"type": "func", "start": 4300499456, "end": 4300499768, "name": "GameLevelManager::markLevelAsRatedDemon", "pseudocode": "// \n// GameLevelManager::markLevelAsRatedDemon from 0x100546a00 to 0x100546b38 (312 bytes)\n// \n// 1 xrefs:\n// > GameLevelManager::rateDemon @ 0x100547989\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::markLevelAsRatedDemon(GameLevelManager *a1, int a2)\n{\n  double v2; // xmm0_8\n  cocos2d::CCDictionary *m_ratedDemons; // 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_ratedDemons) >= 0x3E8 )\n  {\n    cocos2d::CCDictionary::getFirstKey(__dst, (__int64)a1->m_ratedDemons);\n    cocos2d::CCDictionary::removeObjectForKey_1((__int64)a1->m_ratedDemons, (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_ratedDemons = a1->m_ratedDemons;\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_ratedDemons;\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_ratedDemons = 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_ratedDemons, 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::markLevelAsRatedDemon from 0x100546a00 to 0x100546b38 (312 bytes)\n; \n; 1 xrefs:\n; > GameLevelManager::rateDemon @ 0x100547989\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, 0x100546a00\nmov     rbp, rsp                                                       ; +0x1, 0x100546a01\npush    r15                                                            ; +0x4, 0x100546a04\npush    r14                                                            ; +0x6, 0x100546a06\npush    r13                                                            ; +0x8, 0x100546a08\npush    r12                                                            ; +0xa, 0x100546a0a\npush    rbx                                                            ; +0xc, 0x100546a0c\nsub     rsp, 28h                                                       ; +0xd, 0x100546a0d\nmov     r15d, esi                                                      ; +0x11, 0x100546a11\nmov     r14, rdi                                                       ; +0x14, 0x100546a14\nmov     rdi, [rdi+1A0h]                                                ; +0x17, 0x100546a17\ncall    cocos2d__CCDictionary__count                                   ; +0x1e, 0x100546a1e\ncmp     eax, 3E8h                                                      ; +0x23, 0x100546a23\njb      short loc_100546A5B                                            ; +0x28, 0x100546a28\nmov     rsi, [r14+1A0h]                                                ; +0x2a, 0x100546a2a\nlea     rbx, [rbp+__dst]                                               ; +0x31, 0x100546a31\nmov     rdi, rbx; this                                                 ; +0x35, 0x100546a35\ncall    cocos2d__CCDictionary__getFirstKey                             ; +0x38, 0x100546a38\nmov     rdi, [r14+1A0h]                                                ; +0x3d, 0x100546a3d\nmov     rsi, rbx                                                       ; +0x44, 0x100546a44\ncall    cocos2d__CCDictionary__removeObjectForKey_1                    ; +0x47, 0x100546a47\ntest    byte ptr [rbp+__dst], 1                                        ; +0x4c, 0x100546a4c\njz      short loc_100546A5B                                            ; +0x50, 0x100546a50\nmov     rdi, [rbp+__p]; __p                                            ; +0x52, 0x100546a52\ncall    __ZdlPv; operator delete(void *)                               ; +0x56, 0x100546a56\nmov     rbx, [r14+1A0h]                                                ; +0x5b, 0x100546a5b\nmov     r14, [r14+3A8h]                                                ; +0x62, 0x100546a62\nlea     rdi, aI; \"%i\"                                                  ; +0x69, 0x100546a69\nmov     esi, r15d                                                      ; +0x70, 0x100546a70\nxor     eax, eax                                                       ; +0x73, 0x100546a73\ncall    sub_1007AB580                                                  ; +0x75, 0x100546a75\nmov     rdi, rax                                                       ; +0x7a, 0x100546a7a\ncall    cocos2d__CCString__getCString                                  ; +0x7d, 0x100546a7d\nmov     r12, rax                                                       ; +0x82, 0x100546a82\nmov     rdi, rax; __s                                                  ; +0x85, 0x100546a85\ncall    _strlen                                                        ; +0x88, 0x100546a88\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x8d, 0x100546a8d\njnb     loc_100546B33                                                  ; +0x91, 0x100546a91\nmov     r15, rax                                                       ; +0x97, 0x100546a97\ncmp     rax, 17h                                                       ; +0x9a, 0x100546a9a\njnb     short loc_100546AB2                                            ; +0x9e, 0x100546a9e\nlea     eax, [r15+r15]                                                 ; +0xa0, 0x100546aa0\nmov     byte ptr [rbp+__dst], al                                       ; +0xa4, 0x100546aa4\nlea     r13, [rbp+__dst+1]                                             ; +0xa7, 0x100546aa7\ntest    r15, r15                                                       ; +0xab, 0x100546aab\njnz     short loc_100546AF2                                            ; +0xae, 0x100546aae\njmp     short loc_100546B00                                            ; +0xb0, 0x100546ab0\nmov     rax, r15                                                       ; +0xb2, 0x100546ab2\nor      rax, 7                                                         ; +0xb5, 0x100546ab5\nlea     rcx, [rax+1]                                                   ; +0xb9, 0x100546ab9\ncmp     rax, 17h                                                       ; +0xbd, 0x100546abd\nmov     [rbp+var_48], r14                                              ; +0xc1, 0x100546ac1\nmov     r14, rbx                                                       ; +0xc5, 0x100546ac5\nmov     ebx, 1Ah                                                       ; +0xc8, 0x100546ac8\ncmovnz  rbx, rcx                                                       ; +0xcd, 0x100546acd\nmov     rdi, rbx; __sz                                                 ; +0xd1, 0x100546ad1\ncall    __Znwm; operator new(ulong)                                    ; +0xd4, 0x100546ad4\nmov     r13, rax                                                       ; +0xd9, 0x100546ad9\nmov     [rbp+__p], rax                                                 ; +0xdc, 0x100546adc\ninc     rbx                                                            ; +0xe0, 0x100546ae0\nmov     [rbp+__dst], rbx                                               ; +0xe3, 0x100546ae3\nmov     rbx, r14                                                       ; +0xe7, 0x100546ae7\nmov     r14, [rbp+var_48]                                              ; +0xea, 0x100546aea\nmov     [rbp+var_38], r15                                              ; +0xee, 0x100546aee\nmov     rdi, r13; __dst                                                ; +0xf2, 0x100546af2\nmov     rsi, r12; __src                                                ; +0xf5, 0x100546af5\nmov     rdx, r15; __len                                                ; +0xf8, 0x100546af8\ncall    _memmove                                                       ; +0xfb, 0x100546afb\nmov     byte ptr [r13+r15+0], 0                                        ; +0x100, 0x100546b00\nlea     rdx, [rbp+__dst]                                               ; +0x106, 0x100546b06\nmov     rdi, rbx                                                       ; +0x10a, 0x100546b0a\nmov     rsi, r14                                                       ; +0x10d, 0x100546b0d\ncall    cocos2d__CCDictionary__setObject_1                             ; +0x110, 0x100546b10\ntest    byte ptr [rbp+__dst], 1                                        ; +0x115, 0x100546b15\njz      short loc_100546B24                                            ; +0x119, 0x100546b19\nmov     rdi, [rbp+__p]; __p                                            ; +0x11b, 0x100546b1b\ncall    __ZdlPv; operator delete(void *)                               ; +0x11f, 0x100546b1f\nadd     rsp, 28h                                                       ; +0x124, 0x100546b24\npop     rbx                                                            ; +0x128, 0x100546b28\npop     r12                                                            ; +0x129, 0x100546b29\npop     r13                                                            ; +0x12b, 0x100546b2b\npop     r14                                                            ; +0x12d, 0x100546b2d\npop     r15                                                            ; +0x12f, 0x100546b2f\npop     rbp                                                            ; +0x131, 0x100546b31\nretn                                                                   ; +0x132, 0x100546b32\ncall    sub_100006BF0                                                  ; +0x133, 0x100546b33", "xrefs": ["GameLevelManager::rateDemon @ 0x100547989"], "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"}