{"type": "func", "start": 5370062560, "end": 5370063168, "name": "GameLevelManager::cleanupDailyLevels", "pseudocode": "// \n// GameLevelManager::cleanupDailyLevels from 0x14014a6e0 to 0x14014a940 (608 bytes)\n// \n// 2 xrefs:\n// > GameLevelManager::encodeDataTo @ 0x14014af6b\n// > <???> @ 0x1406ca740\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=1\nvoid GameLevelManager::cleanupDailyLevels(GameLevelManager *a1)\n{\n  cocos2d::CCArray *v2; // r12\n  int v3; // r15d\n  int v4; // ebp\n  int v5; // r14d\n  unsigned int i; // esi\n  unsigned int v7; // eax\n  cocos2d::CCString *v8; // rax\n  const char *CString; // rax\n  const char *v10; // rbx\n  size_t v11; // r8\n  __int64 v12; // rdi\n  void *v13; // rcx\n  int v14; // eax\n  size_t v15; // r8\n  void *v16; // rcx\n  __int128 v17; // [rsp+20h] [rbp-58h] BYREF\n  __int64 v18; // [rsp+30h] [rbp-48h]\n  unsigned __int64 v19; // [rsp+38h] [rbp-40h]\n\n  v2 = cocos2d::CCDictionary::allKeys(a1->m_dailyLevels);\n  v3 = 0;\n  v4 = 0;\n  v5 = 0;\n  for ( i = 0; i < cocos2d::CCArray::count(v2); ++i )\n  {\n    v7 = cocos2d::CCArray::count(v2);\n    v8 = (cocos2d::CCString *)cocos2d::CCArray::objectAtIndex(v2, v7 + -1 - i);\n    CString = cocos2d::CCString::getCString(v8);\n    v10 = CString;\n    v17 = 0;\n    v18 = 0;\n    v19 = 0;\n    v11 = -1;\n    do\n      ++v11;\n    while ( CString[v11] );\n    sub_14003A930(&v17, CString, v11);\n    v12 = cocos2d::CCDictionary::objectForKey(a1->m_dailyLevels, &v17);\n    if ( v19 > 0xF )\n    {\n      v13 = (void *)v17;\n      if ( v19 + 1 >= 0x1000 )\n      {\n        v13 = *(void **)(v17 - 8);\n        if ( (unsigned __int64)(v17 - (_QWORD)v13 - 8) > 0x1F )\n          invalid_parameter_noinfo_noreturn();\n      }\n      j_j_free(v13);\n    }\n    v18 = 0;\n    v19 = 15;\n    LOBYTE(v17) = 0;\n    v14 = *(_DWORD *)(v12 + 876) - *(_DWORD *)(v12 + 880);\n    if ( v14 > 100000 )\n    {\n      if ( v14 > 200000 )\n      {\n        if ( v14 < v5 )\n        {\nLABEL_16:\n          *(_WORD *)(v12 + 1072) = 257;\n          if ( *(_DWORD *)(v12 + 820) - *(_DWORD *)(v12 + 824) <= 0 )\n          {\n            v17 = 0;\n            v18 = 0;\n            v19 = 0;\n            v15 = -1;\n            do\n              ++v15;\n            while ( v10[v15] );\n            sub_14003A930(&v17, v10, v15);\n            cocos2d::CCDictionary::removeObjectForKey(a1->m_dailyLevels, &v17);\n            if ( v19 > 0xF )\n            {\n              v16 = (void *)v17;\n              if ( v19 + 1 >= 0x1000 )\n              {\n                v16 = *(void **)(v17 - 8);\n                if ( (unsigned __int64)(v17 - (_QWORD)v16 - 8) > 0x1F )\n                  invalid_parameter_noinfo_noreturn();\n              }\n              j_j_free(v16);\n            }\n          }\n          continue;\n        }\n        v5 = *(_DWORD *)(v12 + 876) - *(_DWORD *)(v12 + 880);\n      }\n      else\n      {\n        if ( v14 < v4 )\n          goto LABEL_16;\n        v4 = *(_DWORD *)(v12 + 876) - *(_DWORD *)(v12 + 880);\n      }\n    }\n    else\n    {\n      if ( v14 < v3 )\n        goto LABEL_16;\n      v3 = *(_DWORD *)(v12 + 876) - *(_DWORD *)(v12 + 880);\n    }\n  }\n}", "assembly": "; \n; GameLevelManager::cleanupDailyLevels from 0x14014a6e0 to 0x14014a940 (608 bytes)\n; \n; 2 xrefs:\n; > GameLevelManager::encodeDataTo @ 0x14014af6b\n; > <???> @ 0x1406ca740\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_8], rbx                                               ; +0x0, 0x14014a6e0\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x14014a6e5\nmov     [rsp+arg_18], rsi                                              ; +0xa, 0x14014a6ea\npush    rdi                                                            ; +0xf, 0x14014a6ef\npush    r12                                                            ; +0x10, 0x14014a6f0\npush    r13                                                            ; +0x12, 0x14014a6f2\npush    r14                                                            ; +0x14, 0x14014a6f4\npush    r15                                                            ; +0x16, 0x14014a6f6\nsub     rsp, 50h                                                       ; +0x18, 0x14014a6f8\nmov     rax, cs:__security_cookie                                      ; +0x1c, 0x14014a6fc\nxor     rax, rsp                                                       ; +0x23, 0x14014a703\nmov     [rsp+78h+var_38], rax                                          ; +0x26, 0x14014a706\nmov     r13, rcx                                                       ; +0x2b, 0x14014a70b\nmov     rcx, [rcx+1B8h]                                                ; +0x2e, 0x14014a70e\ncall    cs:?allKeys@CCDictionary@cocos2d@@QEAAPEAVCCArray@2@XZ; cocos2d::CCDictionary::allKeys(void) ; +0x35, 0x14014a715\nmov     r12, rax                                                       ; +0x3b, 0x14014a71b\nxor     r15d, r15d                                                     ; +0x3e, 0x14014a71e\nxor     ebp, ebp                                                       ; +0x41, 0x14014a721\nxor     r14d, r14d                                                     ; +0x43, 0x14014a723\nxor     esi, esi                                                       ; +0x46, 0x14014a726\nmov     rcx, rax                                                       ; +0x48, 0x14014a728\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x4b, 0x14014a72b\ntest    eax, eax                                                       ; +0x51, 0x14014a731\njz      loc_14014A907                                                  ; +0x53, 0x14014a733\nnop     dword ptr [rax+00000000h]                                      ; +0x59, 0x14014a739\nmov     rcx, r12                                                       ; +0x60, 0x14014a740\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x63, 0x14014a743\nmov     edx, 0FFFFFFFFh                                                ; +0x69, 0x14014a749\nsub     edx, esi                                                       ; +0x6e, 0x14014a74e\nadd     edx, eax                                                       ; +0x70, 0x14014a750\nmov     rcx, r12                                                       ; +0x72, 0x14014a752\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x75, 0x14014a755\nmov     rcx, rax                                                       ; +0x7b, 0x14014a75b\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x7e, 0x14014a75e\nmov     rbx, rax                                                       ; +0x84, 0x14014a764\nxorps   xmm0, xmm0                                                     ; +0x87, 0x14014a767\nmovups  [rsp+78h+var_58], xmm0                                         ; +0x8a, 0x14014a76a\nmov     [rsp+78h+var_48], 0                                            ; +0x8f, 0x14014a76f\nmov     [rsp+78h+var_40], 0                                            ; +0x98, 0x14014a778\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0xa1, 0x14014a781\nnop     dword ptr [rax+rax+00000000h]                                  ; +0xa8, 0x14014a788\ninc     r8                                                             ; +0xb0, 0x14014a790\ncmp     byte ptr [rax+r8], 0                                           ; +0xb3, 0x14014a793\njnz     short loc_14014A790                                            ; +0xb8, 0x14014a798\nmov     rdx, rbx                                                       ; +0xba, 0x14014a79a\nlea     rcx, [rsp+78h+var_58]                                          ; +0xbd, 0x14014a79d\ncall    sub_14003A930                                                  ; +0xc2, 0x14014a7a2\nnop                                                                    ; +0xc7, 0x14014a7a7\nlea     rdx, [rsp+78h+var_58]                                          ; +0xc8, 0x14014a7a8\nmov     rcx, [r13+1B8h]                                                ; +0xcd, 0x14014a7ad\ncall    cs:?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::objectForKey(std::string const &) ; +0xd4, 0x14014a7b4\nmov     rdi, rax                                                       ; +0xda, 0x14014a7ba\nmov     rdx, [rsp+78h+var_40]                                          ; +0xdd, 0x14014a7bd\ncmp     rdx, 0Fh                                                       ; +0xe2, 0x14014a7c2\njbe     short loc_14014A7FA                                            ; +0xe6, 0x14014a7c6\ninc     rdx                                                            ; +0xe8, 0x14014a7c8\nmov     rcx, qword ptr [rsp+78h+var_58]                                ; +0xeb, 0x14014a7cb\nmov     rax, rcx                                                       ; +0xf0, 0x14014a7d0\ncmp     rdx, 1000h                                                     ; +0xf3, 0x14014a7d3\njb      short loc_14014A7F5                                            ; +0xfa, 0x14014a7da\nadd     rdx, 27h ; '''                                                 ; +0xfc, 0x14014a7dc\nmov     rcx, [rcx-8]; Block                                            ; +0x100, 0x14014a7e0\nsub     rax, rcx                                                       ; +0x104, 0x14014a7e4\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x107, 0x14014a7e7\ncmp     rax, 1Fh                                                       ; +0x10b, 0x14014a7eb\nja      loc_14014A932                                                  ; +0x10f, 0x14014a7ef\ncall    j_j_free                                                       ; +0x115, 0x14014a7f5\nmov     [rsp+78h+var_48], 0                                            ; +0x11a, 0x14014a7fa\nmov     [rsp+78h+var_40], 0Fh                                          ; +0x123, 0x14014a803\nmov     byte ptr [rsp+78h+var_58], 0                                   ; +0x12c, 0x14014a80c\nmov     eax, [rdi+36Ch]                                                ; +0x131, 0x14014a811\nsub     eax, [rdi+370h]                                                ; +0x137, 0x14014a817\ncmp     eax, 186A0h                                                    ; +0x13d, 0x14014a81d\njg      short loc_14014A831                                            ; +0x142, 0x14014a822\ncmp     eax, r15d                                                      ; +0x144, 0x14014a824\njl      short loc_14014A850                                            ; +0x147, 0x14014a827\nmov     r15d, eax                                                      ; +0x149, 0x14014a829\njmp     loc_14014A8F4                                                  ; +0x14c, 0x14014a82c\ncmp     eax, 30D40h                                                    ; +0x151, 0x14014a831\njg      short loc_14014A843                                            ; +0x156, 0x14014a836\ncmp     eax, ebp                                                       ; +0x158, 0x14014a838\njl      short loc_14014A850                                            ; +0x15a, 0x14014a83a\nmov     ebp, eax                                                       ; +0x15c, 0x14014a83c\njmp     loc_14014A8F4                                                  ; +0x15e, 0x14014a83e\ncmp     eax, r14d                                                      ; +0x163, 0x14014a843\njl      short loc_14014A850                                            ; +0x166, 0x14014a846\nmov     r14d, eax                                                      ; +0x168, 0x14014a848\njmp     loc_14014A8F4                                                  ; +0x16b, 0x14014a84b\nmov     word ptr [rdi+430h], 101h                                      ; +0x170, 0x14014a850\nmov     eax, [rdi+334h]                                                ; +0x179, 0x14014a859\nsub     eax, [rdi+338h]                                                ; +0x17f, 0x14014a85f\ntest    eax, eax                                                       ; +0x185, 0x14014a865\njg      loc_14014A8F4                                                  ; +0x187, 0x14014a867\nxorps   xmm0, xmm0                                                     ; +0x18d, 0x14014a86d\nmovups  [rsp+78h+var_58], xmm0                                         ; +0x190, 0x14014a870\nmov     [rsp+78h+var_48], 0                                            ; +0x195, 0x14014a875\nmov     [rsp+78h+var_40], 0                                            ; +0x19e, 0x14014a87e\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x1a7, 0x14014a887\nxchg    ax, ax                                                         ; +0x1ae, 0x14014a88e\ninc     r8                                                             ; +0x1b0, 0x14014a890\ncmp     byte ptr [rbx+r8], 0                                           ; +0x1b3, 0x14014a893\njnz     short loc_14014A890                                            ; +0x1b8, 0x14014a898\nmov     rdx, rbx                                                       ; +0x1ba, 0x14014a89a\nlea     rcx, [rsp+78h+var_58]                                          ; +0x1bd, 0x14014a89d\ncall    sub_14003A930                                                  ; +0x1c2, 0x14014a8a2\nnop                                                                    ; +0x1c7, 0x14014a8a7\nlea     rdx, [rsp+78h+var_58]                                          ; +0x1c8, 0x14014a8a8\nmov     rcx, [r13+1B8h]                                                ; +0x1cd, 0x14014a8ad\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 &) ; +0x1d4, 0x14014a8b4\nnop                                                                    ; +0x1da, 0x14014a8ba\nmov     rdx, [rsp+78h+var_40]                                          ; +0x1db, 0x14014a8bb\ncmp     rdx, 0Fh                                                       ; +0x1e0, 0x14014a8c0\njbe     short loc_14014A8F4                                            ; +0x1e4, 0x14014a8c4\ninc     rdx                                                            ; +0x1e6, 0x14014a8c6\nmov     rcx, qword ptr [rsp+78h+var_58]                                ; +0x1e9, 0x14014a8c9\nmov     rax, rcx                                                       ; +0x1ee, 0x14014a8ce\ncmp     rdx, 1000h                                                     ; +0x1f1, 0x14014a8d1\njb      short loc_14014A8EF                                            ; +0x1f8, 0x14014a8d8\nadd     rdx, 27h ; '''                                                 ; +0x1fa, 0x14014a8da\nmov     rcx, [rcx-8]; Block                                            ; +0x1fe, 0x14014a8de\nsub     rax, rcx                                                       ; +0x202, 0x14014a8e2\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x205, 0x14014a8e5\ncmp     rax, 1Fh                                                       ; +0x209, 0x14014a8e9\nja      short loc_14014A939                                            ; +0x20d, 0x14014a8ed\ncall    j_j_free                                                       ; +0x20f, 0x14014a8ef\ninc     esi                                                            ; +0x214, 0x14014a8f4\nmov     rcx, r12                                                       ; +0x216, 0x14014a8f6\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x219, 0x14014a8f9\ncmp     esi, eax                                                       ; +0x21f, 0x14014a8ff\njb      loc_14014A740                                                  ; +0x221, 0x14014a901\nmov     rcx, [rsp+78h+var_38]                                          ; +0x227, 0x14014a907\nxor     rcx, rsp; StackCookie                                          ; +0x22c, 0x14014a90c\ncall    __security_check_cookie                                        ; +0x22f, 0x14014a90f\nlea     r11, [rsp+78h+var_28]                                          ; +0x234, 0x14014a914\nmov     rbx, [r11+38h]                                                 ; +0x239, 0x14014a919\nmov     rbp, [r11+40h]                                                 ; +0x23d, 0x14014a91d\nmov     rsi, [r11+48h]                                                 ; +0x241, 0x14014a921\nmov     rsp, r11                                                       ; +0x245, 0x14014a925\npop     r15                                                            ; +0x248, 0x14014a928\npop     r14                                                            ; +0x24a, 0x14014a92a\npop     r13                                                            ; +0x24c, 0x14014a92c\npop     r12                                                            ; +0x24e, 0x14014a92e\npop     rdi                                                            ; +0x250, 0x14014a930\nretn                                                                   ; +0x251, 0x14014a931\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x252, 0x14014a932\ndb 0CCh                                                                ; +0x258, 0x14014a938\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x259, 0x14014a939\nalign 20h                                                              ; +0x25f, 0x14014a93f", "xrefs": ["GameLevelManager::encodeDataTo @ 0x14014af6b", "<???> @ 0x1406ca740"], "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"}