{"type": "func", "start": 7562180, "end": 7562560, "name": "GJLevelList::removeLevelFromList", "pseudocode": "// \n// GJLevelList::removeLevelFromList from 0x7363c4 to 0x736540 (380 bytes)\n// \n// 2 xrefs:\n// > LevelListLayer::cellPerformedAction @ 0xa78b64\n// > <???> @ 0xb30e8\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 GJLevelList::removeLevelFromList(GJLevelList *a1, int a2)\n{\n  int *m_start; // x0\n  int *m_finish; // x3\n  int *v6; // x1\n  int v7; // t1\n  cocos2d::CCDictionary *m_levelsDict; // x22\n  char *v9; // x0\n  const void *v10; // x1\n  std::vector<int> *p_m_levels; // x22\n  unsigned int *v12; // x2\n  int v13; // w1\n  std::string v14; // [xsp+50h] [xbp+50h] BYREF\n\n  m_start = a1->m_levels.m_start;\n  m_finish = a1->m_levels.m_finish;\n  if ( m_start != m_finish )\n  {\n    if ( *m_start == a2 )\n    {\nLABEL_8:\n      v10 = m_start + 1;\n      p_m_levels = &a1->m_levels;\n      if ( m_start + 1 != m_finish )\n      {\n        p_m_levels = &a1->m_levels;\n        if ( ((char *)m_finish - (_BYTE *)v10) >> 2 )\n        {\n          memmove(m_start, v10, (char *)m_finish - (_BYTE *)v10);\n          m_finish = a1->m_levels.m_finish;\n        }\n      }\n      p_m_levels->m_finish = m_finish - 1;\n      GJLevelList::updateLevelsString(a1);\n    }\n    else\n    {\n      v6 = m_start + 1;\n      while ( 1 )\n      {\n        m_start = v6;\n        if ( v6 == m_finish )\n          break;\n        v7 = *v6++;\n        if ( v7 == a2 )\n          goto LABEL_8;\n      }\n    }\n  }\n  m_levelsDict = a1->m_levelsDict;\n  GameToolbox::intToString((__int64 *)&v14, (GameToolbox *)(unsigned int)a2);\n  cocos2d::CCDictionary::removeObjectForKey(m_levelsDict, &v14);\n  v9 = (char *)v14.m_data.m_data - 24;\n  if ( (__int64 *)v14.m_data.m_data - 3 != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v12 = (unsigned int *)((char *)v14.m_data.m_data - 8);\n      do\n        v13 = __ldaxr(v12);\n      while ( __stlxr(v13 - 1, v12) );\n    }\n    else\n    {\n      v13 = *((_DWORD *)v14.m_data.m_data - 2);\n      *((_DWORD *)v14.m_data.m_data - 2) = v13 - 1;\n    }\n    if ( v13 <= 0 )\n      operator delete(v9);\n  }\n  a1->m_modified = 1;\n}", "assembly": "; \n; GJLevelList::removeLevelFromList from 0x7363c4 to 0x736540 (380 bytes)\n; \n; 2 xrefs:\n; > LevelListLayer::cellPerformedAction @ 0xa78b64\n; > <???> @ 0xb30e8\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\nSTP             X29, X30, [SP,#var_60]!                                ; +0x0, 0x7363c4\nMOV             X29, SP                                                ; +0x4, 0x7363c8\nSTP             X21, X22, [SP,#0x60+var_40]                            ; +0x8, 0x7363cc\nADRP            X21, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x7363d0\nSTP             X19, X20, [SP,#0x60+var_50]                            ; +0x10, 0x7363d4\nMOV             X20, X0                                                ; +0x14, 0x7363d8\nMOV             W19, W1                                                ; +0x18, 0x7363dc\nLDR             X1, [X21,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1c, 0x7363e0\nLDR             X0, [X0,#0x140]; void *                                ; +0x20, 0x7363e4\nLDR             X3, [X20,#0x148]                                       ; +0x24, 0x7363e8\nLDR             X1, [X1]                                               ; +0x28, 0x7363ec\nSTR             X1, [X29,#0x60+var_8]                                  ; +0x2c, 0x7363f0\nCMP             X0, X3                                                 ; +0x30, 0x7363f4\nB.EQ            loc_736428                                             ; +0x34, 0x7363f8\nLDR             W1, [X0]                                               ; +0x38, 0x7363fc\nCMP             W1, W19                                                ; +0x3c, 0x736400\nB.EQ            loc_736490                                             ; +0x40, 0x736404\nADD             X1, X0, #4                                             ; +0x44, 0x736408\nB               loc_73641C                                             ; +0x48, 0x73640c\nLDR             W2, [X1],#4                                            ; +0x4c, 0x736410\nCMP             W2, W19                                                ; +0x50, 0x736414\nB.EQ            loc_736490                                             ; +0x54, 0x736418\nCMP             X1, X3                                                 ; +0x58, 0x73641c\nMOV             X0, X1                                                 ; +0x5c, 0x736420\nB.NE            loc_736410                                             ; +0x60, 0x736424\nADD             X1, X29, #0x60+var_10; int                             ; +0x64, 0x736428\nMOV             W0, W19; this                                          ; +0x68, 0x73642c\nMOV             X8, X1                                                 ; +0x6c, 0x736430\nLDR             X22, [X20,#0x1C0]                                      ; +0x70, 0x736434\nSTR             X1, [X29,#0x60+var_28]                                 ; +0x74, 0x736438\nBL              _ZN11GameToolbox11intToStringEi; GameToolbox::intToString(int) ; +0x78, 0x73643c\nLDR             X1, [X29,#0x60+var_28]                                 ; +0x7c, 0x736440\nMOV             X0, X22                                                ; +0x80, 0x736444\nBL              _ZN7cocos2d12CCDictionary18removeObjectForKeyERKSs; cocos2d::CCDictionary::removeObjectForKey(std::string const&) ; +0x84, 0x736448\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x88, 0x73644c\nLDR             X2, [X29,#0x60+var_10]                                 ; +0x8c, 0x736450\nSUB             X0, X2, #0x18; p                                       ; +0x90, 0x736454\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x94, 0x736458\nCMP             X0, X1                                                 ; +0x98, 0x73645c\nB.NE            loc_7364CC                                             ; +0x9c, 0x736460\nMOV             W0, #1                                                 ; +0xa0, 0x736464\nSTRB            W0, [X20,#0x18F]                                       ; +0xa4, 0x736468\nLDR             X1, [X29,#0x60+var_8]                                  ; +0xa8, 0x73646c\nLDR             X21, [X21,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0xac, 0x736470\nLDR             X0, [X21]                                              ; +0xb0, 0x736474\nCMP             X1, X0                                                 ; +0xb4, 0x736478\nB.NE            loc_736510                                             ; +0xb8, 0x73647c\nLDP             X19, X20, [SP,#0x60+var_50]                            ; +0xbc, 0x736480\nLDP             X21, X22, [SP,#0x60+var_40]                            ; +0xc0, 0x736484\nLDP             X29, X30, [SP+0x60+var_60],#0x60                       ; +0xc4, 0x736488\nRET                                                                    ; +0xc8, 0x73648c\nADD             X1, X0, #4; void *                                     ; +0xcc, 0x736490\nADD             X22, X20, #0x140                                       ; +0xd0, 0x736494\nCMP             X1, X3                                                 ; +0xd4, 0x736498\nB.EQ            loc_7364B8                                             ; +0xd8, 0x73649c\nSUB             X2, X3, X1; size_t                                     ; +0xdc, 0x7364a0\nADD             X22, X20, #0x140                                       ; +0xe0, 0x7364a4\nASR             X4, X2, #2                                             ; +0xe4, 0x7364a8\nCBZ             X4, loc_7364B8                                         ; +0xe8, 0x7364ac\nBL              .memmove                                               ; +0xec, 0x7364b0\nLDR             X3, [X22,#8]                                           ; +0xf0, 0x7364b4\nSUB             X3, X3, #4                                             ; +0xf4, 0x7364b8\nMOV             X0, X20; this                                          ; +0xf8, 0x7364bc\nSTR             X3, [X22,#8]                                           ; +0xfc, 0x7364c0\nBL              _ZN11GJLevelList18updateLevelsStringEv; GJLevelList::updateLevelsString(void) ; +0x100, 0x7364c4\nB               loc_736428                                             ; +0x104, 0x7364c8\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x108, 0x7364cc\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x10c, 0x7364d0\nCBZ             X1, loc_736500                                         ; +0x110, 0x7364d4\nSUB             X2, X2, #8                                             ; +0x114, 0x7364d8\nLDAXR           W1, [X2]                                               ; +0x118, 0x7364dc\nSUB             W3, W1, #1                                             ; +0x11c, 0x7364e0\nSTLXR           W4, W3, [X2]                                           ; +0x120, 0x7364e4\nCBNZ            W4, loc_7364DC                                         ; +0x124, 0x7364e8\nCMP             W1, WZR                                                ; +0x128, 0x7364ec\nB.GT            loc_736464                                             ; +0x12c, 0x7364f0\nADD             X1, X29, #0x60+var_18                                  ; +0x130, 0x7364f4\nBL              j__ZdlPv; operator delete(void *)                      ; +0x134, 0x7364f8\nB               loc_736464                                             ; +0x138, 0x7364fc\nLDUR            W1, [X2,#-8]                                           ; +0x13c, 0x736500\nSUB             W3, W1, #1                                             ; +0x140, 0x736504\nSTUR            W3, [X2,#-8]                                           ; +0x144, 0x736508\nB               loc_7364EC                                             ; +0x148, 0x73650c\nBL              .__stack_chk_fail                                      ; +0x14c, 0x736510\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x150, 0x736514\nMOV             X19, X0                                                ; +0x154, 0x736518\nLDR             X0, [X29,#0x60+var_10]                                 ; +0x158, 0x73651c\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x15c, 0x736520\nSUB             X0, X0, #0x18                                          ; +0x160, 0x736524\nCMP             X0, X1                                                 ; +0x164, 0x736528\nB.EQ            loc_736538                                             ; +0x168, 0x73652c\nADD             X1, X29, #0x60+var_18                                  ; +0x16c, 0x736530\nBL              sub_6EE220                                             ; +0x170, 0x736534\nMOV             X0, X19                                                ; +0x174, 0x736538\nBL              _Unwind_Resume                                         ; +0x178, 0x73653c", "xrefs": ["LevelListLayer::cellPerformedAction @ 0xa78b64", "<???> @ 0xb30e8"], "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"}