{"type": "func", "start": 7220348, "end": 7220728, "name": "EditLevelLayer::onBack", "pseudocode": "// \n// EditLevelLayer::onBack from 0x6e2c7c to 0x6e2df8 (380 bytes)\n// \n// 5 xrefs:\n// > EditLevelLayer::onDelete @ 0x6e2e3c\n// > EditLevelLayer::keyBackClicked @ 0x6e2e44\n// > <???> @ 0x4f5d8\n// > EditLevelLayer::init @ 0x6e1064\n// > <???> @ 0x122a8d0\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 EditLevelLayer::onBack(EditLevelLayer *a1, cocos2d::CCObject *a2)\n{\n  GameLevelManager *v3; // x20\n  GameLevelManager *v4; // x0\n  cocos2d::CCScene *SearchScene; // x20\n  GJDifficulty *p_m_demonFilter; // x0\n  cocos2d::CCDirector *v7; // x21\n  cocos2d::CCTransitionFade *v8; // x0\n  SearchType v9; // w1\n  GJSearchObject *v10; // x0\n  unsigned int *p_m_searchMode; // x2\n  int m_searchMode; // w1\n  GJSearchObject *v13; // [xsp+40h] [xbp+40h] BYREF\n\n  if ( !cocos2d::CCDirector::sharedDirector()->m_bIsTransitioning )\n  {\n    EditLevelLayer::closeTextInputs(a1);\n    EditLevelLayer::verifyLevelName(a1);\n    a1->setKeypadEnabled(a1, 0);\n    v3 = GameLevelManager::sharedState();\n    v4 = GameLevelManager::sharedState();\n    sub_D18D28(&v13, &v4->m_searchKey);\n    SearchScene = GameLevelManager::getSearchScene(v3, (const char *)v13);\n    p_m_demonFilter = &v13[-1].m_demonFilter;\n    if ( &v13[-1].m_demonFilter != (GJDifficulty *)&qword_124B6B0 )\n    {\n      if ( &pthread_create )\n      {\n        p_m_searchMode = (unsigned int *)&v13[-1].m_searchMode;\n        do\n          m_searchMode = __ldaxr(p_m_searchMode);\n        while ( __stlxr(m_searchMode - 1, p_m_searchMode) );\n      }\n      else\n      {\n        m_searchMode = v13[-1].m_searchMode;\n        v13[-1].m_searchMode = m_searchMode - 1;\n      }\n      if ( m_searchMode <= 0 )\n        operator delete(p_m_demonFilter);\n    }\n    if ( GameLevelManager::sharedState()->m_returnToLocalLevels || !SearchScene )\n    {\n      GameLevelManager::sharedState()->m_returnToLocalLevels = 0;\n      v10 = (GJSearchObject *)GJSearchObject::create((GJSearchObject *)((char *)&qword_60 + 2), v9);\n      SearchScene = LevelBrowserLayer::scene(v10);\n    }\n    v7 = cocos2d::CCDirector::sharedDirector();\n    v8 = cocos2d::CCTransitionFade::create(0.5, SearchScene);\n    cocos2d::CCDirector::replaceScene(v7, v8);\n  }\n}", "assembly": "; \n; EditLevelLayer::onBack from 0x6e2c7c to 0x6e2df8 (380 bytes)\n; \n; 5 xrefs:\n; > EditLevelLayer::onDelete @ 0x6e2e3c\n; > EditLevelLayer::keyBackClicked @ 0x6e2e44\n; > <???> @ 0x4f5d8\n; > EditLevelLayer::init @ 0x6e1064\n; > <???> @ 0x122a8d0\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_50]!                                ; +0x0, 0x6e2c7c\nMOV             X29, SP                                                ; +0x4, 0x6e2c80\nSTP             X19, X20, [SP,#0x50+var_40]                            ; +0x8, 0x6e2c84\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x6e2c88\nMOV             X20, X0                                                ; +0x10, 0x6e2c8c\nSTR             X21, [SP,#0x50+var_30]                                 ; +0x14, 0x6e2c90\nLDR             X0, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x18, 0x6e2c94\nLDR             X0, [X0]; this                                         ; +0x1c, 0x6e2c98\nSTR             X0, [X29,#0x50+var_8]                                  ; +0x20, 0x6e2c9c\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x24, 0x6e2ca0\nLDRB            W0, [X0,#0xA8]                                         ; +0x28, 0x6e2ca4\nCBZ             W0, loc_6E2CD0                                         ; +0x2c, 0x6e2ca8\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x30, 0x6e2cac\nLDR             X1, [X29,#0x50+var_8]                                  ; +0x34, 0x6e2cb0\nLDR             X0, [X19]                                              ; +0x38, 0x6e2cb4\nCMP             X1, X0                                                 ; +0x3c, 0x6e2cb8\nB.NE            loc_6E2DC8                                             ; +0x40, 0x6e2cbc\nLDP             X19, X20, [SP,#0x50+var_40]                            ; +0x44, 0x6e2cc0\nLDR             X21, [SP,#0x50+var_30]                                 ; +0x48, 0x6e2cc4\nLDP             X29, X30, [SP+0x50+var_50],#0x50                       ; +0x4c, 0x6e2cc8\nRET                                                                    ; +0x50, 0x6e2ccc\nMOV             X0, X20; this                                          ; +0x54, 0x6e2cd0\nBL              _ZN14EditLevelLayer15closeTextInputsEv; EditLevelLayer::closeTextInputs(void) ; +0x58, 0x6e2cd4\nMOV             X0, X20; this                                          ; +0x5c, 0x6e2cd8\nBL              _ZN14EditLevelLayer15verifyLevelNameEv; EditLevelLayer::verifyLevelName(void) ; +0x60, 0x6e2cdc\nLDR             X2, [X20]                                              ; +0x64, 0x6e2ce0\nMOV             W1, #0                                                 ; +0x68, 0x6e2ce4\nMOV             X0, X20                                                ; +0x6c, 0x6e2ce8\nLDR             X2, [X2,#0x420]                                        ; +0x70, 0x6e2cec\nBLR             X2                                                     ; +0x74, 0x6e2cf0\nBL              _ZN16GameLevelManager11sharedStateEv; GameLevelManager::sharedState(void) ; +0x78, 0x6e2cf4\nMOV             X20, X0                                                ; +0x7c, 0x6e2cf8\nBL              _ZN16GameLevelManager11sharedStateEv; GameLevelManager::sharedState(void) ; +0x80, 0x6e2cfc\nADD             X1, X0, #0x2C0                                         ; +0x84, 0x6e2d00\nADD             X0, X29, #0x50+var_10                                  ; +0x88, 0x6e2d04\nBL              sub_D18D28                                             ; +0x8c, 0x6e2d08\nLDR             X1, [X29,#0x50+var_10]; GJSearchObject *               ; +0x90, 0x6e2d0c\nMOV             X0, X20; this                                          ; +0x94, 0x6e2d10\nBL              _ZN16GameLevelManager14getSearchSceneEPKc; GameLevelManager::getSearchScene(char const*) ; +0x98, 0x6e2d14\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x9c, 0x6e2d18\nLDR             X2, [X29,#0x50+var_10]                                 ; +0xa0, 0x6e2d1c\nMOV             X20, X0                                                ; +0xa4, 0x6e2d20\nSUB             X0, X2, #0x18; this                                    ; +0xa8, 0x6e2d24\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0xac, 0x6e2d28\nCMP             X0, X1                                                 ; +0xb0, 0x6e2d2c\nB.NE            loc_6E2D84                                             ; +0xb4, 0x6e2d30\nBL              _ZN16GameLevelManager11sharedStateEv; GameLevelManager::sharedState(void) ; +0xb8, 0x6e2d34\nLDRB            W0, [X0,#0x2D8]; this                                  ; +0xbc, 0x6e2d38\nCBNZ            W0, loc_6E2D68                                         ; +0xc0, 0x6e2d3c\nCBZ             X20, loc_6E2D68                                        ; +0xc4, 0x6e2d40\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0xc8, 0x6e2d44\nMOV             X21, X0                                                ; +0xcc, 0x6e2d48\nFMOV            S0, #0.5; float                                        ; +0xd0, 0x6e2d4c\nMOV             X0, X20; this                                          ; +0xd4, 0x6e2d50\nBL              _ZN7cocos2d16CCTransitionFade6createEfPNS_7CCSceneE; cocos2d::CCTransitionFade::create(float,cocos2d::CCScene *) ; +0xd8, 0x6e2d54\nMOV             X1, X0; lpsrc                                          ; +0xdc, 0x6e2d58\nMOV             X0, X21; this                                          ; +0xe0, 0x6e2d5c\nBL              _ZN7cocos2d10CCDirector12replaceSceneEPNS_7CCSceneE; cocos2d::CCDirector::replaceScene(cocos2d::CCScene *) ; +0xe4, 0x6e2d60\nB               loc_6E2CAC                                             ; +0xe8, 0x6e2d64\nBL              _ZN16GameLevelManager11sharedStateEv; GameLevelManager::sharedState(void) ; +0xec, 0x6e2d68\nSTRB            WZR, [X0,#0x2D8]                                       ; +0xf0, 0x6e2d6c\nMOV             W0, #0x62 ; 'b'                                        ; +0xf4, 0x6e2d70\nBL              _ZN14GJSearchObject6createE10SearchType; GJSearchObject::create(SearchType) ; +0xf8, 0x6e2d74\nBL              _ZN17LevelBrowserLayer5sceneEP14GJSearchObject; LevelBrowserLayer::scene(GJSearchObject *) ; +0xfc, 0x6e2d78\nMOV             X20, X0                                                ; +0x100, 0x6e2d7c\nB               loc_6E2D44                                             ; +0x104, 0x6e2d80\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x108, 0x6e2d84\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x10c, 0x6e2d88\nCBZ             X1, loc_6E2DB8                                         ; +0x110, 0x6e2d8c\nSUB             X2, X2, #8                                             ; +0x114, 0x6e2d90\nLDAXR           W1, [X2]                                               ; +0x118, 0x6e2d94\nSUB             W3, W1, #1                                             ; +0x11c, 0x6e2d98\nSTLXR           W4, W3, [X2]                                           ; +0x120, 0x6e2d9c\nCBNZ            W4, loc_6E2D94                                         ; +0x124, 0x6e2da0\nCMP             W1, WZR                                                ; +0x128, 0x6e2da4\nB.GT            loc_6E2D34                                             ; +0x12c, 0x6e2da8\nADD             X1, X29, #0x50+var_18                                  ; +0x130, 0x6e2dac\nBL              j__ZdlPv; operator delete(void *)                      ; +0x134, 0x6e2db0\nB               loc_6E2D34                                             ; +0x138, 0x6e2db4\nLDUR            W1, [X2,#-8]                                           ; +0x13c, 0x6e2db8\nSUB             W3, W1, #1                                             ; +0x140, 0x6e2dbc\nSTUR            W3, [X2,#-8]                                           ; +0x144, 0x6e2dc0\nB               loc_6E2DA4                                             ; +0x148, 0x6e2dc4\nBL              .__stack_chk_fail                                      ; +0x14c, 0x6e2dc8\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x150, 0x6e2dcc\nMOV             X19, X0                                                ; +0x154, 0x6e2dd0\nLDR             X0, [X29,#0x50+var_10]                                 ; +0x158, 0x6e2dd4\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x15c, 0x6e2dd8\nSUB             X0, X0, #0x18                                          ; +0x160, 0x6e2ddc\nCMP             X0, X1                                                 ; +0x164, 0x6e2de0\nB.EQ            loc_6E2DF0                                             ; +0x168, 0x6e2de4\nADD             X1, X29, #0x50+var_18                                  ; +0x16c, 0x6e2de8\nBL              sub_4DB8F0                                             ; +0x170, 0x6e2dec\nMOV             X0, X19                                                ; +0x174, 0x6e2df0\nBL              _Unwind_Resume                                         ; +0x178, 0x6e2df4", "xrefs": ["EditLevelLayer::onDelete @ 0x6e2e3c", "EditLevelLayer::keyBackClicked @ 0x6e2e44", "<???> @ 0x4f5d8", "EditLevelLayer::init @ 0x6e1064", "<???> @ 0x122a8d0"], "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"}