{"type": "func", "start": 5370099344, "end": 5370099626, "name": "GameLevelManager::markLevelAsDownloaded", "pseudocode": "// \n// GameLevelManager::markLevelAsDownloaded from 0x140153690 to 0x1401537aa (282 bytes)\n// \n// 3 xrefs:\n// > GameLevelManager::processOnDownloadLevelCompleted @ 0x140153486\n// > LevelListLayer::loadLevelsFinished @ 0x14030698e\n// > <???> @ 0x1406ca8a8\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::markLevelAsDownloaded(GameLevelManager *a1, int a2)\n{\n  cocos2d::CCString *v4; // rax\n  const char *CString; // rax\n  size_t v6; // r8\n  void *v7; // rcx\n  void *Block[2]; // [rsp+20h] [rbp-38h] BYREF\n  __int128 v9; // [rsp+30h] [rbp-28h]\n\n  if ( cocos2d::CCDictionary::count(a1->m_downloadedLevels) >= 0x64 )\n  {\n    cocos2d::CCDictionary::getFirstKey(a1->m_downloadedLevels, Block);\n    cocos2d::CCDictionary::removeObjectForKey(a1->m_downloadedLevels, Block);\n    sub_14003A830((__int64)Block);\n  }\n  v4 = cocos2d::CCString::createWithFormat(\"%i\", a2);\n  CString = cocos2d::CCString::getCString(v4);\n  *(_OWORD *)Block = 0;\n  v9 = 0;\n  v6 = -1;\n  do\n    ++v6;\n  while ( CString[v6] );\n  sub_14003A930(Block, CString, v6);\n  cocos2d::CCDictionary::setObject(a1->m_downloadedLevels, a1->m_trueString, Block);\n  if ( *((_QWORD *)&v9 + 1) > 0xFu )\n  {\n    v7 = Block[0];\n    if ( (unsigned __int64)(*((_QWORD *)&v9 + 1) + 1LL) >= 0x1000 )\n    {\n      v7 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v7 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v7);\n  }\n}", "assembly": "; \n; GameLevelManager::markLevelAsDownloaded from 0x140153690 to 0x1401537aa (282 bytes)\n; \n; 3 xrefs:\n; > GameLevelManager::processOnDownloadLevelCompleted @ 0x140153486\n; > LevelListLayer::loadLevelsFinished @ 0x14030698e\n; > <???> @ 0x1406ca8a8\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_10], rbx                                              ; +0x0, 0x140153690\npush    rdi                                                            ; +0x5, 0x140153695\nsub     rsp, 50h                                                       ; +0x6, 0x140153696\nmov     rax, cs:__security_cookie                                      ; +0xa, 0x14015369a\nxor     rax, rsp                                                       ; +0x11, 0x1401536a1\nmov     [rsp+58h+var_18], rax                                          ; +0x14, 0x1401536a4\nmov     edi, edx                                                       ; +0x19, 0x1401536a9\nmov     rbx, rcx                                                       ; +0x1b, 0x1401536ab\nmov     rcx, [rcx+180h]                                                ; +0x1e, 0x1401536ae\ncall    cs:?count@CCDictionary@cocos2d@@QEAAIXZ; cocos2d::CCDictionary::count(void) ; +0x25, 0x1401536b5\ncmp     eax, 64h ; 'd'                                                 ; +0x2b, 0x1401536bb\njb      short loc_1401536F0                                            ; +0x2e, 0x1401536be\nlea     rdx, [rsp+58h+Block]                                           ; +0x30, 0x1401536c0\nmov     rcx, [rbx+180h]                                                ; +0x35, 0x1401536c5\ncall    cs:?getFirstKey@CCDictionary@cocos2d@@QEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ; cocos2d::CCDictionary::getFirstKey(void) ; +0x3c, 0x1401536cc\nnop                                                                    ; +0x42, 0x1401536d2\nlea     rdx, [rsp+58h+Block]                                           ; +0x43, 0x1401536d3\nmov     rcx, [rbx+180h]                                                ; +0x48, 0x1401536d8\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 &) ; +0x4f, 0x1401536df\nnop                                                                    ; +0x55, 0x1401536e5\nlea     rcx, [rsp+58h+Block]                                           ; +0x56, 0x1401536e6\ncall    sub_14003A830                                                  ; +0x5b, 0x1401536eb\nmov     edx, edi                                                       ; +0x60, 0x1401536f0\nlea     rcx, aI_11; \"%i\"                                               ; +0x62, 0x1401536f2\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x69, 0x1401536f9\nmov     rcx, rax                                                       ; +0x6f, 0x1401536ff\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x72, 0x140153702\nxorps   xmm0, xmm0                                                     ; +0x78, 0x140153708\nmovups  xmmword ptr [rsp+58h+Block], xmm0                              ; +0x7b, 0x14015370b\nxorps   xmm1, xmm1                                                     ; +0x80, 0x140153710\nmovdqu  [rsp+58h+var_28], xmm1                                         ; +0x83, 0x140153713\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x89, 0x140153719\ninc     r8                                                             ; +0x90, 0x140153720\ncmp     byte ptr [rax+r8], 0                                           ; +0x93, 0x140153723\njnz     short loc_140153720                                            ; +0x98, 0x140153728\nmov     rdx, rax                                                       ; +0x9a, 0x14015372a\nlea     rcx, [rsp+58h+Block]                                           ; +0x9d, 0x14015372d\ncall    sub_14003A930                                                  ; +0xa2, 0x140153732\nnop                                                                    ; +0xa7, 0x140153737\nlea     r8, [rsp+58h+Block]                                            ; +0xa8, 0x140153738\nmov     rdx, [rbx+3B0h]                                                ; +0xad, 0x14015373d\nmov     rcx, [rbx+180h]                                                ; +0xb4, 0x140153744\ncall    cs:?setObject@CCDictionary@cocos2d@@QEAAXPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::setObject(cocos2d::CCObject *,std::string const &) ; +0xbb, 0x14015374b\nnop                                                                    ; +0xc1, 0x140153751\nmov     rdx, qword ptr [rsp+58h+var_28+8]                              ; +0xc2, 0x140153752\ncmp     rdx, 0Fh                                                       ; +0xc7, 0x140153757\njbe     short loc_140153792                                            ; +0xcb, 0x14015375b\ninc     rdx                                                            ; +0xcd, 0x14015375d\nmov     rcx, [rsp+58h+Block]; Block                                    ; +0xd0, 0x140153760\nmov     rax, rcx                                                       ; +0xd5, 0x140153765\ncmp     rdx, 1000h                                                     ; +0xd8, 0x140153768\njb      short loc_14015378D                                            ; +0xdf, 0x14015376f\nadd     rdx, 27h ; '''                                                 ; +0xe1, 0x140153771\nmov     rcx, [rcx-8]                                                   ; +0xe5, 0x140153775\nsub     rax, rcx                                                       ; +0xe9, 0x140153779\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xec, 0x14015377c\ncmp     rax, 1Fh                                                       ; +0xf0, 0x140153780\njbe     short loc_14015378D                                            ; +0xf4, 0x140153784\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xf6, 0x140153786\ndb 0CCh                                                                ; +0xfc, 0x14015378c\ncall    j_j_free                                                       ; +0xfd, 0x14015378d\nmov     rcx, [rsp+58h+var_18]                                          ; +0x102, 0x140153792\nxor     rcx, rsp; StackCookie                                          ; +0x107, 0x140153797\ncall    __security_check_cookie                                        ; +0x10a, 0x14015379a\nmov     rbx, [rsp+58h+arg_10]                                          ; +0x10f, 0x14015379f\nadd     rsp, 50h                                                       ; +0x114, 0x1401537a4\npop     rdi                                                            ; +0x118, 0x1401537a8\nretn                                                                   ; +0x119, 0x1401537a9", "xrefs": ["GameLevelManager::processOnDownloadLevelCompleted @ 0x140153486", "LevelListLayer::loadLevelsFinished @ 0x14030698e", "<???> @ 0x1406ca8a8"], "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"}