{"type": "func", "start": 7219940, "end": 7220348, "name": "EditLevelLayer::onEdit", "pseudocode": "// \n// EditLevelLayer::onEdit from 0x6e2ae4 to 0x6e2c7c (408 bytes)\n// \n// 4 xrefs:\n// > EditLevelLayer::FLAlert_Clicked @ 0x6e3150\n// > <???> @ 0xacd28\n// > EditLevelLayer::init @ 0x6e0b04\n// > <???> @ 0x122dfa8\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::onEdit(EditLevelLayer *a1, cocos2d::CCObject *a2)\n{\n  FMODAudioEngine *v3; // x23\n  void *v4; // x0\n  cocos2d::CCDirector *v5; // x21\n  cocos2d::CCScene *v6; // x0\n  cocos2d::CCTransitionFade *v7; // x0\n  unsigned int *v8; // x2\n  int v9; // w1\n  __int64 v10; // [xsp+60h] [xbp+60h] BYREF\n\n  if ( !cocos2d::CCDirector::sharedDirector()->m_bIsTransitioning && !a1->m_exiting )\n  {\n    EditLevelLayer::closeTextInputs(a1);\n    a1->setKeypadEnabled(a1, 0);\n    a1->m_exiting = 1;\n    GameManager::sharedState()->m_sceneEnum = 3;\n    EditLevelLayer::verifyLevelName(a1);\n    v3 = FMODAudioEngine::sharedEngine();\n    GJGameLevel::getAudioFileName(&v10, a1->m_level);\n    FMODAudioEngine::loadMusic((__int64)v3, &v10, 1u, 0, 0, 0, 1.0, 0.0, 1.0);\n    v4 = (void *)(v10 - 24);\n    if ( (__int64 *)(v10 - 24) != &qword_124B6B0 )\n    {\n      if ( &pthread_create )\n      {\n        v8 = (unsigned int *)(v10 - 8);\n        do\n          v9 = __ldaxr(v8);\n        while ( __stlxr(v9 - 1, v8) );\n      }\n      else\n      {\n        v9 = *(_DWORD *)(v10 - 8);\n        *(_DWORD *)(v10 - 8) = v9 - 1;\n      }\n      if ( v9 <= 0 )\n        operator delete(v4);\n    }\n    v5 = cocos2d::CCDirector::sharedDirector();\n    v6 = LevelEditorLayer::scene(a1->m_level, 0);\n    v7 = cocos2d::CCTransitionFade::create(0.5, v6);\n    cocos2d::CCDirector::replaceScene(v5, v7);\n  }\n}", "assembly": "; \n; EditLevelLayer::onEdit from 0x6e2ae4 to 0x6e2c7c (408 bytes)\n; \n; 4 xrefs:\n; > EditLevelLayer::FLAlert_Clicked @ 0x6e3150\n; > <???> @ 0xacd28\n; > EditLevelLayer::init @ 0x6e0b04\n; > <???> @ 0x122dfa8\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_70]!                                ; +0x0, 0x6e2ae4\nMOV             X29, SP                                                ; +0x4, 0x6e2ae8\nSTP             X19, X20, [SP,#0x70+var_60]                            ; +0x8, 0x6e2aec\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x6e2af0\nMOV             X20, X0                                                ; +0x10, 0x6e2af4\nSTP             X21, X22, [SP,#0x70+var_50]                            ; +0x14, 0x6e2af8\nSTR             X23, [SP,#0x70+var_40]                                 ; +0x18, 0x6e2afc\nLDR             X0, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1c, 0x6e2b00\nLDR             X0, [X0]; this                                         ; +0x20, 0x6e2b04\nSTR             X0, [X29,#0x70+var_8]                                  ; +0x24, 0x6e2b08\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x28, 0x6e2b0c\nLDRB            W0, [X0,#0xA8]                                         ; +0x2c, 0x6e2b10\nCBNZ            W0, loc_6E2B20                                         ; +0x30, 0x6e2b14\nLDRB            W0, [X20,#0x1E0]                                       ; +0x34, 0x6e2b18\nCBZ             W0, loc_6E2B48                                         ; +0x38, 0x6e2b1c\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x3c, 0x6e2b20\nLDR             X1, [X29,#0x70+var_8]                                  ; +0x40, 0x6e2b24\nLDR             X0, [X19]                                              ; +0x44, 0x6e2b28\nCMP             X1, X0                                                 ; +0x48, 0x6e2b2c\nB.NE            loc_6E2C4C                                             ; +0x4c, 0x6e2b30\nLDP             X19, X20, [SP,#0x70+var_60]                            ; +0x50, 0x6e2b34\nLDP             X21, X22, [SP,#0x70+var_50]                            ; +0x54, 0x6e2b38\nLDR             X23, [SP,#0x70+var_40]                                 ; +0x58, 0x6e2b3c\nLDP             X29, X30, [SP+0x70+var_70],#0x70                       ; +0x5c, 0x6e2b40\nRET                                                                    ; +0x60, 0x6e2b44\nMOV             X0, X20; this                                          ; +0x64, 0x6e2b48\nMOV             W22, #1                                                ; +0x68, 0x6e2b4c\nADD             X21, X29, #0x70+var_10                                 ; +0x6c, 0x6e2b50\nBL              _ZN14EditLevelLayer15closeTextInputsEv; EditLevelLayer::closeTextInputs(void) ; +0x70, 0x6e2b54\nLDR             X2, [X20]                                              ; +0x74, 0x6e2b58\nMOV             W1, #0                                                 ; +0x78, 0x6e2b5c\nMOV             X0, X20                                                ; +0x7c, 0x6e2b60\nLDR             X2, [X2,#0x420]                                        ; +0x80, 0x6e2b64\nBLR             X2                                                     ; +0x84, 0x6e2b68\nSTRB            W22, [X20,#0x1E0]                                      ; +0x88, 0x6e2b6c\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x8c, 0x6e2b70\nMOV             W1, #3                                                 ; +0x90, 0x6e2b74\nSTR             W1, [X0,#0x25C]                                        ; +0x94, 0x6e2b78\nMOV             X0, X20; this                                          ; +0x98, 0x6e2b7c\nBL              _ZN14EditLevelLayer15verifyLevelNameEv; EditLevelLayer::verifyLevelName(void) ; +0x9c, 0x6e2b80\nBL              _ZN15FMODAudioEngine12sharedEngineEv; FMODAudioEngine::sharedEngine(void) ; +0xa0, 0x6e2b84\nMOV             X23, X0                                                ; +0xa4, 0x6e2b88\nLDR             X0, [X20,#0x1C8]; this                                 ; +0xa8, 0x6e2b8c\nMOV             X8, X21                                                ; +0xac, 0x6e2b90\nSTR             X21, [X29,#0x70+var_28]                                ; +0xb0, 0x6e2b94\nBL              _ZN11GJGameLevel16getAudioFileNameEv; GJGameLevel::getAudioFileName(void) ; +0xb4, 0x6e2b98\nFMOV            S0, #1.0                                               ; +0xb8, 0x6e2b9c\nLDR             X1, [X29,#0x70+var_28]                                 ; +0xbc, 0x6e2ba0\nFMOV            S1, WZR                                                ; +0xc0, 0x6e2ba4\nMOV             X0, X23                                                ; +0xc4, 0x6e2ba8\nFMOV            S2, S0                                                 ; +0xc8, 0x6e2bac\nMOV             W2, W22                                                ; +0xcc, 0x6e2bb0\nMOV             W3, #0                                                 ; +0xd0, 0x6e2bb4\nMOV             W4, #0                                                 ; +0xd4, 0x6e2bb8\nMOV             W5, #0                                                 ; +0xd8, 0x6e2bbc\nBL              _ZN15FMODAudioEngine9loadMusicESsfffbiib; FMODAudioEngine::loadMusic(std::string,float,float,float,bool,int,int,bool) ; +0xdc, 0x6e2bc0\nADRP            X1, #off_122EFE8@PAGE                                  ; +0xe0, 0x6e2bc4\nLDR             X2, [X29,#0x70+var_10]                                 ; +0xe4, 0x6e2bc8\nSUB             X0, X2, #0x18; this                                    ; +0xe8, 0x6e2bcc\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0xec, 0x6e2bd0\nCMP             X0, X1                                                 ; +0xf0, 0x6e2bd4\nB.NE            loc_6E2C08                                             ; +0xf4, 0x6e2bd8\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0xf8, 0x6e2bdc\nMOV             X21, X0                                                ; +0xfc, 0x6e2be0\nLDR             X0, [X20,#0x1C8]; this                                 ; +0x100, 0x6e2be4\nMOV             W1, #0; GJGameLevel *                                  ; +0x104, 0x6e2be8\nBL              _ZN16LevelEditorLayer5sceneEP11GJGameLevelb; LevelEditorLayer::scene(GJGameLevel *,bool) ; +0x108, 0x6e2bec\nFMOV            S0, #0.5; float                                        ; +0x10c, 0x6e2bf0\nBL              _ZN7cocos2d16CCTransitionFade6createEfPNS_7CCSceneE; cocos2d::CCTransitionFade::create(float,cocos2d::CCScene *) ; +0x110, 0x6e2bf4\nMOV             X1, X0; lpsrc                                          ; +0x114, 0x6e2bf8\nMOV             X0, X21; this                                          ; +0x118, 0x6e2bfc\nBL              _ZN7cocos2d10CCDirector12replaceSceneEPNS_7CCSceneE; cocos2d::CCDirector::replaceScene(cocos2d::CCScene *) ; +0x11c, 0x6e2c00\nB               loc_6E2B20                                             ; +0x120, 0x6e2c04\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x124, 0x6e2c08\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x128, 0x6e2c0c\nCBZ             X1, loc_6E2C3C                                         ; +0x12c, 0x6e2c10\nSUB             X2, X2, #8                                             ; +0x130, 0x6e2c14\nLDAXR           W1, [X2]                                               ; +0x134, 0x6e2c18\nSUB             W3, W1, #1                                             ; +0x138, 0x6e2c1c\nSTLXR           W4, W3, [X2]                                           ; +0x13c, 0x6e2c20\nCBNZ            W4, loc_6E2C18                                         ; +0x140, 0x6e2c24\nCMP             W1, WZR                                                ; +0x144, 0x6e2c28\nB.GT            loc_6E2BDC                                             ; +0x148, 0x6e2c2c\nADD             X1, X29, #0x70+var_18                                  ; +0x14c, 0x6e2c30\nBL              j__ZdlPv; operator delete(void *)                      ; +0x150, 0x6e2c34\nB               loc_6E2BDC                                             ; +0x154, 0x6e2c38\nLDUR            W1, [X2,#-8]                                           ; +0x158, 0x6e2c3c\nSUB             W3, W1, #1                                             ; +0x15c, 0x6e2c40\nSTUR            W3, [X2,#-8]                                           ; +0x160, 0x6e2c44\nB               loc_6E2C28                                             ; +0x164, 0x6e2c48\nBL              .__stack_chk_fail                                      ; +0x168, 0x6e2c4c\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x16c, 0x6e2c50\nMOV             X19, X0                                                ; +0x170, 0x6e2c54\nLDR             X0, [X29,#0x70+var_10]                                 ; +0x174, 0x6e2c58\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x178, 0x6e2c5c\nSUB             X0, X0, #0x18                                          ; +0x17c, 0x6e2c60\nCMP             X0, X1                                                 ; +0x180, 0x6e2c64\nB.EQ            loc_6E2C74                                             ; +0x184, 0x6e2c68\nADD             X1, X29, #0x70+var_18                                  ; +0x188, 0x6e2c6c\nBL              sub_4DB8F0                                             ; +0x18c, 0x6e2c70\nMOV             X0, X19                                                ; +0x190, 0x6e2c74\nBL              _Unwind_Resume                                         ; +0x194, 0x6e2c78", "xrefs": ["EditLevelLayer::FLAlert_Clicked @ 0x6e3150", "<???> @ 0xacd28", "EditLevelLayer::init @ 0x6e0b04", "<???> @ 0x122dfa8"], "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"}