{"type": "func", "start": 4295597616, "end": 4295597968, "name": "GameLevelManager::limitSavedLevels", "pseudocode": "// \n// GameLevelManager::limitSavedLevels from 0x100099e30 to 0x100099f90 (352 bytes)\n// \n// 2 xrefs:\n// > GameLevelManager::encodeDataTo @ 0x10009ae00\n// > GameLevelManager::dataLoaded @ 0x10009bbd0\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::limitSavedLevels(GameLevelManager *a1)\n{\n  cocos2d::CCArray *SavedLevels; // x21\n  GameManager *v3; // x0\n  int v4; // w20\n  GameManager *v5; // x0\n  int v6; // w23\n  __int64 i; // x20\n  GameManager *v8; // x0\n  cocos2d::CCArray *v9; // x21\n  unsigned int v10; // w24\n  int v11; // w25\n  int v12; // w0\n  cocos2d::CCString *v13; // x0\n  char *CString; // x0\n  cocos2d::CCDictionary *m_gauntletLevels; // x22\n  __int64 v16; // x22\n  void *__p[2]; // [xsp+8h] [xbp-58h] BYREF\n  char v18; // [xsp+1Fh] [xbp-41h]\n\n  SavedLevels = GameLevelManager::getSavedLevels(a1, 0, 0);\n  v3 = GameManager::sharedState();\n  if ( GameManager::getGameVariable(v3, \"0042\") )\n    v4 = 100;\n  else\n    v4 = 10;\n  v5 = GameManager::sharedState();\n  if ( GameManager::getGameVariable(v5, \"0119\") )\n    v6 = -1;\n  else\n    v6 = v4;\n  for ( i = 0; (unsigned int)i < (unsigned int)sub_10024A36C(SavedLevels); i = (unsigned int)(i + 1) )\n    *(_BYTE *)(sub_10024A388(SavedLevels, i) + 992) = (int)i > v6;\n  v8 = GameManager::sharedState();\n  if ( !GameManager::getGameVariable(v8, \"0127\") )\n  {\n    v9 = cocos2d::CCDictionary::allKeys(a1->m_gauntletLevels);\n    if ( (unsigned int)sub_10024A36C(v9) )\n    {\n      v10 = 0;\n      v11 = -1;\n      do\n      {\n        v12 = sub_10024A36C(v9);\n        v13 = (cocos2d::CCString *)sub_10024A388(v9, (unsigned int)(v12 + v11));\n        CString = (char *)cocos2d::CCString::getCString(v13);\n        m_gauntletLevels = a1->m_gauntletLevels;\n        sub_100009900(__p, CString);\n        v16 = cocos2d::CCDictionary::objectForKey_1(m_gauntletLevels, __p);\n        if ( v18 < 0 )\n          operator delete(__p[0]);\n        *(_BYTE *)(v16 + 992) = (int)i > v6;\n        LODWORD(i) = i + 1;\n        ++v10;\n        --v11;\n      }\n      while ( v10 < (unsigned int)sub_10024A36C(v9) );\n    }\n  }\n}", "assembly": "; \n; GameLevelManager::limitSavedLevels from 0x100099e30 to 0x100099f90 (352 bytes)\n; \n; 2 xrefs:\n; > GameLevelManager::encodeDataTo @ 0x10009ae00\n; > GameLevelManager::dataLoaded @ 0x10009bbd0\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\nSUB             SP, SP, #0x70                                          ; +0x0, 0x100099e30\nSTP             X26, X25, [SP,#0x60+var_40]                            ; +0x4, 0x100099e34\nSTP             X24, X23, [SP,#0x60+var_30]                            ; +0x8, 0x100099e38\nSTP             X22, X21, [SP,#0x60+var_20]                            ; +0xc, 0x100099e3c\nSTP             X20, X19, [SP,#0x60+var_10]                            ; +0x10, 0x100099e40\nSTP             X29, X30, [SP,#0x60+var_s0]                            ; +0x14, 0x100099e44\nADD             X29, SP, #0x60                                         ; +0x18, 0x100099e48\nMOV             X19, X0                                                ; +0x1c, 0x100099e4c\nMOV             W1, #0                                                 ; +0x20, 0x100099e50\nMOV             W2, #0                                                 ; +0x24, 0x100099e54\nBL              GameLevelManager__getSavedLevels                       ; +0x28, 0x100099e58\nMOV             X21, X0                                                ; +0x2c, 0x100099e5c\nBL              GameManager__sharedState                               ; +0x30, 0x100099e60\nADRL            X1, a0042; \"0042\"                                      ; +0x34, 0x100099e64\nBL              GameManager__getGameVariable                           ; +0x3c, 0x100099e6c\nCMP             W0, #0                                                 ; +0x40, 0x100099e70\nMOV             W8, #0xA                                               ; +0x44, 0x100099e74\nMOV             W9, #0x64 ; 'd'                                        ; +0x48, 0x100099e78\nCSEL            W20, W9, W8, NE                                        ; +0x4c, 0x100099e7c\nBL              GameManager__sharedState                               ; +0x50, 0x100099e80\nADRL            X1, a0119; \"0119\"                                      ; +0x54, 0x100099e84\nBL              GameManager__getGameVariable                           ; +0x5c, 0x100099e8c\nCMP             W0, #0                                                 ; +0x60, 0x100099e90\nCSINV           W23, W20, WZR, EQ                                      ; +0x64, 0x100099e94\nMOV             X0, X21                                                ; +0x68, 0x100099e98\nBL              sub_10024A36C                                          ; +0x6c, 0x100099e9c\nMOV             W20, #0                                                ; +0x70, 0x100099ea0\nCBZ             W0, loc_100099ED4                                      ; +0x74, 0x100099ea4\nMOV             X0, X21                                                ; +0x78, 0x100099ea8\nMOV             X1, X20                                                ; +0x7c, 0x100099eac\nBL              sub_10024A388                                          ; +0x80, 0x100099eb0\nCMP             W20, W23                                               ; +0x84, 0x100099eb4\nCSET            W8, GT                                                 ; +0x88, 0x100099eb8\nSTRB            W8, [X0,#0x3E0]                                        ; +0x8c, 0x100099ebc\nADD             W20, W20, #1                                           ; +0x90, 0x100099ec0\nMOV             X0, X21                                                ; +0x94, 0x100099ec4\nBL              sub_10024A36C                                          ; +0x98, 0x100099ec8\nCMP             W20, W0                                                ; +0x9c, 0x100099ecc\nB.CC            loc_100099EA8                                          ; +0xa0, 0x100099ed0\nBL              GameManager__sharedState                               ; +0xa4, 0x100099ed4\nADRL            X1, a0127; \"0127\"                                      ; +0xa8, 0x100099ed8\nBL              GameManager__getGameVariable                           ; +0xb0, 0x100099ee0\nTBNZ            W0, #0, loc_100099F74                                  ; +0xb4, 0x100099ee4\nLDR             X0, [X19,#0x1F0]                                       ; +0xb8, 0x100099ee8\nBL              cocos2d__CCDictionary__allKeys                         ; +0xbc, 0x100099eec\nMOV             X21, X0                                                ; +0xc0, 0x100099ef0\nBL              sub_10024A36C                                          ; +0xc4, 0x100099ef4\nCBZ             W0, loc_100099F74                                      ; +0xc8, 0x100099ef8\nMOV             W24, #0                                                ; +0xcc, 0x100099efc\nMOV             W25, #0xFFFFFFFF                                       ; +0xd0, 0x100099f00\nMOV             X0, X21                                                ; +0xd4, 0x100099f04\nBL              sub_10024A36C                                          ; +0xd8, 0x100099f08\nADD             W1, W0, W25                                            ; +0xdc, 0x100099f0c\nMOV             X0, X21                                                ; +0xe0, 0x100099f10\nBL              sub_10024A388                                          ; +0xe4, 0x100099f14\nBL              cocos2d__CCString__getCString                          ; +0xe8, 0x100099f18\nMOV             X1, X0; __s                                            ; +0xec, 0x100099f1c\nLDR             X22, [X19,#0x1F0]                                      ; +0xf0, 0x100099f20\nADD             X0, SP, #0x60+__p; int                                 ; +0xf4, 0x100099f24\nBL              sub_100009900                                          ; +0xf8, 0x100099f28\nADD             X1, SP, #0x60+__p                                      ; +0xfc, 0x100099f2c\nMOV             X0, X22                                                ; +0x100, 0x100099f30\nBL              cocos2d__CCDictionary__objectForKey_1                  ; +0x104, 0x100099f34\nMOV             X22, X0                                                ; +0x108, 0x100099f38\nLDRSB           W8, [SP,#0x60+var_41]                                  ; +0x10c, 0x100099f3c\nTBZ             W8, #0x1F, loc_100099F4C                               ; +0x110, 0x100099f40\nLDR             X0, [SP,#0x60+__p]; __p                                ; +0x114, 0x100099f44\nBL              __ZdlPv; operator delete(void *)                       ; +0x118, 0x100099f48\nCMP             W20, W23                                               ; +0x11c, 0x100099f4c\nCSET            W8, GT                                                 ; +0x120, 0x100099f50\nSTRB            W8, [X22,#0x3E0]                                       ; +0x124, 0x100099f54\nADD             W20, W20, #1                                           ; +0x128, 0x100099f58\nADD             W24, W24, #1                                           ; +0x12c, 0x100099f5c\nMOV             X0, X21                                                ; +0x130, 0x100099f60\nBL              sub_10024A36C                                          ; +0x134, 0x100099f64\nSUB             W25, W25, #1                                           ; +0x138, 0x100099f68\nCMP             W24, W0                                                ; +0x13c, 0x100099f6c\nB.CC            loc_100099F04                                          ; +0x140, 0x100099f70\nLDP             X29, X30, [SP,#0x60+var_s0]                            ; +0x144, 0x100099f74\nLDP             X20, X19, [SP,#0x60+var_10]                            ; +0x148, 0x100099f78\nLDP             X22, X21, [SP,#0x60+var_20]                            ; +0x14c, 0x100099f7c\nLDP             X24, X23, [SP,#0x60+var_30]                            ; +0x150, 0x100099f80\nLDP             X26, X25, [SP,#0x60+var_40]                            ; +0x154, 0x100099f84\nADD             SP, SP, #0x70 ; 'p'                                    ; +0x158, 0x100099f88\nRET                                                                    ; +0x15c, 0x100099f8c", "xrefs": ["GameLevelManager::encodeDataTo @ 0x10009ae00", "GameLevelManager::dataLoaded @ 0x10009bbd0"], "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"}