{"type": "func", "start": 4850764, "end": 4850958, "name": "EditLevelLayer::onEdit", "pseudocode": "// \n// EditLevelLayer::onEdit from 0x4a044c to 0x4a050e (194 bytes)\n// \n// 1 xrefs:\n// > EditLevelLayer::FLAlert_Clicked @ 0x4a21f6\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:49:49 +0000\n// \n\nint __fastcall EditLevelLayer::onEdit(LevelEditorLayer **this, cocos2d::CCObject *a2)\n{\n  int result; // r0\n  unsigned int v4; // r5\n  GameManager *v5; // r0\n  int v6; // r1\n  int v7; // r2\n  FMODAudioEngine *v8; // r0\n  int v9; // r9\n  cocos2d::CCDirector *v10; // r0\n  cocos2d::CCDirector *v11; // r5\n  bool v12; // r2\n  AppDelegate *v13; // r0\n  cocos2d::CCScene *v14; // r2\n  cocos2d::CCScene *v15; // r0\n  unsigned __int8 v16[12]; // [sp+18h] [bp-14h] BYREF\n\n  result = cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)this);\n  if ( !*(_BYTE *)(result + 140) )\n  {\n    v4 = *((unsigned __int8 *)this + 360);\n    if ( !*((_BYTE *)this + 360) )\n    {\n      EditLevelLayer::closeTextInputs(this);\n      v5 = (GameManager *)(*((int (__fastcall **)(LevelEditorLayer **, unsigned int))*this + 134))(this, v4);\n      *((_BYTE *)this + 360) = 1;\n      *(_DWORD *)(GameManager::sharedState(v5) + 508) = 3;\n      v8 = EditLevelLayer::verifyLevelName((EditLevelLayer *)this, v6, v7, 3);\n      v9 = FMODAudioEngine::sharedEngine(v8);\n      GJGameLevel::getAudioFileName((GJGameLevel *)v16);\n      FMODAudioEngine::loadMusic(v9, v16, 1.0, 0, 1.0, 1, v4, v4, v4);\n      v10 = (cocos2d::CCDirector *)std::string::~string((int)v16);\n      v11 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v10);\n      v13 = LevelEditorLayer::scene(*(this + 87), nullptr, v12);\n      v15 = (cocos2d::CCScene *)cocos2d::CCTransitionFade::create(\n                                  (cocos2d::CCTransitionFade *)0x3F000000,\n                                  *(float *)&v13,\n                                  v14);\n      return cocos2d::CCDirector::replaceScene(v11, v15);\n    }\n  }\n  return result;\n}", "assembly": "; \n; EditLevelLayer::onEdit from 0x4a044c to 0x4a050e (194 bytes)\n; \n; 1 xrefs:\n; > EditLevelLayer::FLAlert_Clicked @ 0x4a21f6\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:49:49 +0000\n; \nPUSH.W          {R4-R9,LR}                                             ; +0x0, 0x4a044c\nSUB             SP, SP, #0x2C                                          ; +0x4, 0x4a0450\nLDR             R7, =(__stack_chk_guard_ptr - 0x4A045A)                ; +0x6, 0x4a0452\nMOV             R4, R0                                                 ; +0x8, 0x4a0454\nADD             R7, PC; __stack_chk_guard_ptr                          ; +0xa, 0x4a0456\nLDR             R7, [R7]; __stack_chk_guard                            ; +0xc, 0x4a0458\nLDR             R3, [R7]                                               ; +0xe, 0x4a045a\nSTR             R3, [SP,#0x2C+var_8]                                   ; +0x10, 0x4a045c\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x12, 0x4a045e\nLDRB.W          R3, [R0,#0x8C]                                         ; +0x16, 0x4a0462\nCMP             R3, #0                                                 ; +0x1a, 0x4a0466\nBNE             loc_4A04FC                                             ; +0x1c, 0x4a0468\nLDRB.W          R5, [R4,#0x168]                                        ; +0x1e, 0x4a046a\nCMP             R5, #0                                                 ; +0x22, 0x4a046e\nBNE             loc_4A04FC                                             ; +0x24, 0x4a0470\nMOV             R0, R4; this                                           ; +0x26, 0x4a0472\nMOV.W           R8, #1                                                 ; +0x28, 0x4a0474\nBL              _ZN14EditLevelLayer15closeTextInputsEv; EditLevelLayer::closeTextInputs(void) ; +0x2c, 0x4a0478\nLDR             R3, [R4]                                               ; +0x30, 0x4a047c\nMOV             R1, R5                                                 ; +0x32, 0x4a047e\nMOV             R0, R4                                                 ; +0x34, 0x4a0480\nADD             R6, SP, #0x2C+var_14                                   ; +0x36, 0x4a0482\nLDR.W           R3, [R3,#0x218]                                        ; +0x38, 0x4a0484\nBLX             R3                                                     ; +0x3c, 0x4a0488\nSTRB.W          R8, [R4,#0x168]                                        ; +0x3e, 0x4a048a\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x42, 0x4a048e\nMOVS            R3, #3                                                 ; +0x46, 0x4a0492\nSTR.W           R3, [R0,#0x1FC]                                        ; +0x48, 0x4a0494\nMOV             R0, R4; this                                           ; +0x4c, 0x4a0498\nBL              _ZN14EditLevelLayer15verifyLevelNameEv; EditLevelLayer::verifyLevelName(void) ; +0x4e, 0x4a049a\nBL              _ZN15FMODAudioEngine12sharedEngineEv; FMODAudioEngine::sharedEngine(void) ; +0x52, 0x4a049e\nLDR.W           R1, [R4,#0x15C]                                        ; +0x56, 0x4a04a2\nMOV             R9, R0                                                 ; +0x5a, 0x4a04a6\nMOV             R0, R6; this                                           ; +0x5c, 0x4a04a8\nBL              _ZN11GJGameLevel16getAudioFileNameEv; GJGameLevel::getAudioFileName(void) ; +0x5e, 0x4a04aa\nMOV.W           R2, #0x3F800000; int                                   ; +0x62, 0x4a04ae\nSTR.W           R8, [SP,#0x2C+var_28]; char                            ; +0x66, 0x4a04b2\nMOV             R0, R9; int                                            ; +0x6a, 0x4a04b6\nSTR             R2, [SP,#0x2C+var_2C]; float                           ; +0x6c, 0x4a04b8\nMOV             R1, R6; int                                            ; +0x6e, 0x4a04ba\nSTR             R5, [SP,#0x2C+var_24]; int                             ; +0x70, 0x4a04bc\nMOVS            R3, #0; int                                            ; +0x72, 0x4a04be\nSTR             R5, [SP,#0x2C+var_20]; int                             ; +0x74, 0x4a04c0\nSTR             R5, [SP,#0x2C+var_1C]; char                            ; +0x76, 0x4a04c2\nBL              _ZN15FMODAudioEngine9loadMusicENSt6__ndk112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEfffbiib; FMODAudioEngine::loadMusic(std::string,float,float,float,bool,int,int,bool) ; +0x78, 0x4a04c4\nMOV             R0, R6                                                 ; +0x7c, 0x4a04c8\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x7e, 0x4a04ca\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x82, 0x4a04ce\nMOVS            R1, #0; GJGameLevel *                                  ; +0x86, 0x4a04d2\nMOV             R5, R0                                                 ; +0x88, 0x4a04d4\nLDR.W           R0, [R4,#0x15C]; this                                  ; +0x8a, 0x4a04d6\nBL              _ZN16LevelEditorLayer5sceneEP11GJGameLevelb; LevelEditorLayer::scene(GJGameLevel *,bool) ; +0x8e, 0x4a04da\nMOV             R1, R0; float                                          ; +0x92, 0x4a04de\nMOV.W           R0, #0x3F000000; this                                  ; +0x94, 0x4a04e0\nBL              _ZN7cocos2d16CCTransitionFade6createEfPNS_7CCSceneE; cocos2d::CCTransitionFade::create(float,cocos2d::CCScene *) ; +0x98, 0x4a04e4\nMOV             R1, R0; lpsrc                                          ; +0x9c, 0x4a04e8\nMOV             R0, R5; this                                           ; +0x9e, 0x4a04ea\nBL              _ZN7cocos2d10CCDirector12replaceSceneEPNS_7CCSceneE; cocos2d::CCDirector::replaceScene(cocos2d::CCScene *) ; +0xa0, 0x4a04ec\nB               loc_4A04FC                                             ; +0xa4, 0x4a04f0\nMOV             R0, R6                                                 ; +0xa6, 0x4a04f2\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xa8, 0x4a04f4\nBL              __cxa_end_cleanup                                      ; +0xac, 0x4a04f8\nLDR             R2, [SP,#0x2C+var_8]                                   ; +0xb0, 0x4a04fc\nLDR             R3, [R7]                                               ; +0xb2, 0x4a04fe\nCMP             R2, R3                                                 ; +0xb4, 0x4a0500\nBEQ             loc_4A0508                                             ; +0xb6, 0x4a0502\nBLX             __stack_chk_fail                                       ; +0xb8, 0x4a0504\nADD             SP, SP, #0x2C ; ','                                    ; +0xbc, 0x4a0508\nPOP.W           {R4-R9,PC}                                             ; +0xbe, 0x4a050a", "xrefs": ["EditLevelLayer::FLAlert_Clicked @ 0x4a21f6"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}