{"type": "func", "start": 4295552252, "end": 4295552736, "name": "GameLevelManager::onGetLevelSaveDataCompleted", "pseudocode": "// \n// GameLevelManager::onGetLevelSaveDataCompleted from 0x10008ecfc to 0x10008eee0 (484 bytes)\n// \n// 1 xrefs:\n// > GameLevelManager::handleIt @ 0x10008937c\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::onGetLevelSaveDataCompleted(GameLevelManager *a1, __int64 a2, const char *a3)\n{\n  bool v5; // w0\n  bool v6; // w21\n  __int64 v7; // x21\n  cocos2d::CCArray *v8; // x20\n  unsigned int i; // w21\n  cocos2d::CCString *v10; // x0\n  int v11; // w22\n  cocos2d::CCString *v12; // x0\n  int v13; // w23\n  GJGameLevel *SavedLevel; // x0\n  GJGameLevel *v15; // x22\n  float v16; // s0\n  _BOOL4 v17; // w23\n  GameLevelManager *v18; // x0\n  float v19; // s0\n  GameLevelManager *v20; // x0\n  void *v21[2]; // [xsp+0h] [xbp-60h] BYREF\n  char v22; // [xsp+17h] [xbp-49h]\n  std::string __p; // [xsp+18h] [xbp-48h] BYREF\n\n  if ( a3[23] < 0 )\n    a3 = *(const char **)a3;\n  GameLevelManager::removeDLFromActive(a1, a3);\n  sub_100009900(&__p, \"-1\");\n  v5 = sub_1000045BC((_QWORD *)a2, &__p);\n  v6 = v5;\n  if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )\n  {\n    operator delete(__p.__r_.__value_.__l.__data_);\n    if ( v6 )\n      return;\n  }\n  else if ( v5 )\n  {\n    return;\n  }\n  v7 = *(char *)(a2 + 23);\n  if ( v7 < 0 )\n  {\n    if ( strlen(*(const char **)a2) < 0x29 )\n      return;\n    v7 = *(_QWORD *)(a2 + 8);\n  }\n  else if ( strlen((const char *)a2) < 0x29 )\n  {\n    return;\n  }\n  std::string::basic_string(&__p, (const std::string *)a2, 0x14u, v7 - 40, (std::allocator<char> *)v21);\n  cocos2d::ZipUtils::decompressString(v21, &__p, 0, 11);\n  v8 = (cocos2d::CCArray *)sub_100093338(v21, \",\");\n  for ( i = 1; i < (unsigned int)sub_10024A36C(v8); i += 2 )\n  {\n    v10 = cocos2d::CCArray::stringAtIndex(v8, i - 1);\n    v11 = cocos2d::CCString::intValue(v10);\n    v12 = cocos2d::CCArray::stringAtIndex(v8, i);\n    v13 = cocos2d::CCString::intValue(v12);\n    if ( (unsigned int)(v13 - 1) <= 9 )\n    {\n      SavedLevel = GameLevelManager::getSavedLevel(a1, v11);\n      v15 = SavedLevel;\n      if ( SavedLevel )\n      {\n        SavedLevel->m_stars.value = v13;\n        v16 = vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0;\n        v15->m_stars.seed = (int)v16;\n        v15->m_stars.random = v13 + (int)v16;\n        v17 = v13 == 10;\n        v15->m_demon.value = v17;\n        v18 = (GameLevelManager *)rand();\n        v19 = vcvts_n_f32_s32((unsigned int)v18, 0x1Fu) * 1000.0;\n        v15->m_demon.seed = (int)v19;\n        v15->m_demon.random = (int)v19 + v17;\n        GameLevelManager::verifyLevelState(v18, v15);\n        GameLevelManager::updateLevelRewards(v20, v15);\n      }\n    }\n  }\n  if ( v22 < 0 )\n    operator delete(v21[0]);\n  if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 )\n    operator delete(__p.__r_.__value_.__l.__data_);\n}", "assembly": "; \n; GameLevelManager::onGetLevelSaveDataCompleted from 0x10008ecfc to 0x10008eee0 (484 bytes)\n; \n; 1 xrefs:\n; > GameLevelManager::handleIt @ 0x10008937c\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, 0x10008ecfc\nSTP             X24, X23, [SP,#0x60+var_30]                            ; +0x4, 0x10008ed00\nSTP             X22, X21, [SP,#0x60+var_20]                            ; +0x8, 0x10008ed04\nSTP             X20, X19, [SP,#0x60+var_10]                            ; +0xc, 0x10008ed08\nSTP             X29, X30, [SP,#0x60+var_s0]                            ; +0x10, 0x10008ed0c\nADD             X29, SP, #0x60                                         ; +0x14, 0x10008ed10\nMOV             X20, X1                                                ; +0x18, 0x10008ed14\nMOV             X19, X0                                                ; +0x1c, 0x10008ed18\nLDRSB           W8, [X2,#0x17]                                         ; +0x20, 0x10008ed1c\nTBZ             W8, #0x1F, loc_10008ED28                               ; +0x24, 0x10008ed20\nLDR             X2, [X2]                                               ; +0x28, 0x10008ed24\nMOV             X0, X19                                                ; +0x2c, 0x10008ed28\nMOV             X1, X2                                                 ; +0x30, 0x10008ed2c\nBL              GameLevelManager__removeDLFromActive                   ; +0x34, 0x10008ed30\nADRL            X1, a1_0; \"-1\"                                         ; +0x38, 0x10008ed34\nADD             X0, SP, #0x60+__p; int                                 ; +0x40, 0x10008ed3c\nBL              sub_100009900                                          ; +0x44, 0x10008ed40\nADD             X1, SP, #0x60+__p                                      ; +0x48, 0x10008ed44\nMOV             X0, X20                                                ; +0x4c, 0x10008ed48\nBL              sub_1000045BC                                          ; +0x50, 0x10008ed4c\nMOV             X21, X0                                                ; +0x54, 0x10008ed50\nLDRSB           W8, [SP,#0x60+var_31]                                  ; +0x58, 0x10008ed54\nTBNZ            W8, #0x1F, loc_10008ED64                               ; +0x5c, 0x10008ed58\nTBZ             W21, #0, loc_10008ED70                                 ; +0x60, 0x10008ed5c\nB               loc_10008EEC8                                          ; +0x64, 0x10008ed60\nLDR             X0, [SP,#0x60+__p]; __p                                ; +0x68, 0x10008ed64\nBL              __ZdlPv; operator delete(void *)                       ; +0x6c, 0x10008ed68\nTBNZ            W21, #0, loc_10008EEC8                                 ; +0x70, 0x10008ed6c\nLDRSB           X21, [X20,#0x17]                                       ; +0x74, 0x10008ed70\nTBNZ            X21, #0x3F, loc_10008ED8C ; '?'                        ; +0x78, 0x10008ed74\nMOV             X0, X20; __s                                           ; +0x7c, 0x10008ed78\nBL              _strlen                                                ; +0x80, 0x10008ed7c\nCMP             X0, #0x29 ; ')'                                        ; +0x84, 0x10008ed80\nB.CS            loc_10008EDA0                                          ; +0x88, 0x10008ed84\nB               loc_10008EEC8                                          ; +0x8c, 0x10008ed88\nLDR             X0, [X20]; __s                                         ; +0x90, 0x10008ed8c\nBL              _strlen                                                ; +0x94, 0x10008ed90\nCMP             X0, #0x29 ; ')'                                        ; +0x98, 0x10008ed94\nB.CC            loc_10008EEC8                                          ; +0x9c, 0x10008ed98\nLDR             X21, [X20,#8]                                          ; +0xa0, 0x10008ed9c\nSUB             X3, X21, #0x28 ; '('; __n                              ; +0xa4, 0x10008eda0\nADD             X0, SP, #0x60+__p; this                                ; +0xa8, 0x10008eda4\nMOV             X4, SP; __a                                            ; +0xac, 0x10008eda8\nMOV             X1, X20; __str                                         ; +0xb0, 0x10008edac\nMOV             W2, #0x14; __pos                                       ; +0xb4, 0x10008edb0\nBL              __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_mmRKS4_; std::string::basic_string(std::string const&,ulong,ulong,std::allocator<char> const&) ; +0xb8, 0x10008edb4\nMOV             X8, SP                                                 ; +0xbc, 0x10008edb8\nADD             X0, SP, #0x60+__p                                      ; +0xc0, 0x10008edbc\nMOV             W1, #0                                                 ; +0xc4, 0x10008edc0\nMOV             W2, #0xB                                               ; +0xc8, 0x10008edc4\nBL              cocos2d__ZipUtils__decompressString                    ; +0xcc, 0x10008edc8\nADRL            X1, asc_1006B434F; \",\"                                 ; +0xd0, 0x10008edcc\nMOV             X0, SP                                                 ; +0xd8, 0x10008edd4\nBL              sub_100093338                                          ; +0xdc, 0x10008edd8\nMOV             X20, X0                                                ; +0xe0, 0x10008eddc\nMOV             W21, #1                                                ; +0xe4, 0x10008ede0\nMOV             W24, #0x447A0000                                       ; +0xe8, 0x10008ede4\nMOV             X0, X20                                                ; +0xec, 0x10008ede8\nBL              sub_10024A36C                                          ; +0xf0, 0x10008edec\nCMP             W21, W0                                                ; +0xf4, 0x10008edf0\nB.CS            loc_10008EEA8                                          ; +0xf8, 0x10008edf4\nSUB             W1, W21, #1                                            ; +0xfc, 0x10008edf8\nMOV             X0, X20                                                ; +0x100, 0x10008edfc\nBL              cocos2d__CCArray__stringAtIndex                        ; +0x104, 0x10008ee00\nBL              cocos2d__CCString__intValue                            ; +0x108, 0x10008ee04\nMOV             X22, X0                                                ; +0x10c, 0x10008ee08\nMOV             X0, X20                                                ; +0x110, 0x10008ee0c\nMOV             X1, X21                                                ; +0x114, 0x10008ee10\nBL              cocos2d__CCArray__stringAtIndex                        ; +0x118, 0x10008ee14\nBL              cocos2d__CCString__intValue                            ; +0x11c, 0x10008ee18\nMOV             X23, X0                                                ; +0x120, 0x10008ee1c\nSUB             W8, W0, #1                                             ; +0x124, 0x10008ee20\nCMP             W8, #9                                                 ; +0x128, 0x10008ee24\nB.HI            loc_10008EEA0                                          ; +0x12c, 0x10008ee28\nMOV             X0, X19                                                ; +0x130, 0x10008ee2c\nMOV             X1, X22                                                ; +0x134, 0x10008ee30\nBL              GameLevelManager__getSavedLevel                        ; +0x138, 0x10008ee34\nMOV             X22, X0                                                ; +0x13c, 0x10008ee38\nCBZ             X0, loc_10008EEA0                                      ; +0x140, 0x10008ee3c\nSTR             W23, [X22,#0x348]                                      ; +0x144, 0x10008ee40\nBL              _rand                                                  ; +0x148, 0x10008ee44\nSCVTF           S0, W0, #0x1F                                          ; +0x14c, 0x10008ee48\nFMOV            S1, W24                                                ; +0x150, 0x10008ee4c\nFMUL            S0, S0, S1                                             ; +0x154, 0x10008ee50\nFCVTZS          W8, S0                                                 ; +0x158, 0x10008ee54\nSTR             W8, [X22,#0x344]                                       ; +0x15c, 0x10008ee58\nADD             W8, W23, W8                                            ; +0x160, 0x10008ee5c\nSTR             W8, [X22,#0x340]                                       ; +0x164, 0x10008ee60\nCMP             W23, #0xA                                              ; +0x168, 0x10008ee64\nCSET            W23, EQ                                                ; +0x16c, 0x10008ee68\nSTR             W23, [X22,#0x338]                                      ; +0x170, 0x10008ee6c\nBL              _rand                                                  ; +0x174, 0x10008ee70\nSCVTF           S0, W0, #0x1F                                          ; +0x178, 0x10008ee74\nFMOV            S1, W24                                                ; +0x17c, 0x10008ee78\nFMUL            S0, S0, S1                                             ; +0x180, 0x10008ee7c\nFCVTZS          W8, S0                                                 ; +0x184, 0x10008ee80\nSTR             W8, [X22,#0x334]                                       ; +0x188, 0x10008ee84\nADD             W8, W8, W23                                            ; +0x18c, 0x10008ee88\nSTR             W8, [X22,#0x330]                                       ; +0x190, 0x10008ee8c\nMOV             X1, X22                                                ; +0x194, 0x10008ee90\nBL              GameLevelManager__verifyLevelState                     ; +0x198, 0x10008ee94\nMOV             X1, X22                                                ; +0x19c, 0x10008ee98\nBL              GameLevelManager__updateLevelRewards                   ; +0x1a0, 0x10008ee9c\nADD             W21, W21, #2                                           ; +0x1a4, 0x10008eea0\nB               loc_10008EDE8                                          ; +0x1a8, 0x10008eea4\nLDRSB           W8, [SP,#0x60+var_49]                                  ; +0x1ac, 0x10008eea8\nTBZ             W8, #0x1F, loc_10008EEB8                               ; +0x1b0, 0x10008eeac\nLDR             X0, [SP,#0x60+var_60]; __p                             ; +0x1b4, 0x10008eeb0\nBL              __ZdlPv; operator delete(void *)                       ; +0x1b8, 0x10008eeb4\nLDRSB           W8, [SP,#0x60+var_31]                                  ; +0x1bc, 0x10008eeb8\nTBZ             W8, #0x1F, loc_10008EEC8                               ; +0x1c0, 0x10008eebc\nLDR             X0, [SP,#0x60+__p]; __p                                ; +0x1c4, 0x10008eec0\nBL              __ZdlPv; operator delete(void *)                       ; +0x1c8, 0x10008eec4\nLDP             X29, X30, [SP,#0x60+var_s0]                            ; +0x1cc, 0x10008eec8\nLDP             X20, X19, [SP,#0x60+var_10]                            ; +0x1d0, 0x10008eecc\nLDP             X22, X21, [SP,#0x60+var_20]                            ; +0x1d4, 0x10008eed0\nLDP             X24, X23, [SP,#0x60+var_30]                            ; +0x1d8, 0x10008eed4\nADD             SP, SP, #0x70 ; 'p'                                    ; +0x1dc, 0x10008eed8\nRET                                                                    ; +0x1e0, 0x10008eedc", "xrefs": ["GameLevelManager::handleIt @ 0x10008937c"], "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"}