{"type": "func", "start": 5281036, "end": 5281318, "name": "EditorPauseLayer::FLAlert_Clicked", "pseudocode": "// \n// EditorPauseLayer::FLAlert_Clicked from 0x50950c to 0x509626 (282 bytes)\n// \n// 1 xrefs:\n// > `non-virtual thunk to'EditorPauseLayer::FLAlert_Clicked @ 0x50964c\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:51:26 +0000\n// \n\nchar **__fastcall EditorPauseLayer::FLAlert_Clicked(LevelEditorLayer **this, FLAlertLayer *a2, int a3)\n{\n  char **result; // r0\n  GameManager *v7; // r0\n  cocos2d::CCObject *v8; // r1\n  LocalLevelManager *v9; // r4\n  LocalLevelManager *v10; // r0\n  ButtonSprite *v11; // r4\n  int *v12; // r0\n  int *v13; // r0\n  int v14; // [sp+8h] [bp-14h] BYREF\n  int v15; // [sp+Ch] [bp-10h]\n  int v16; // [sp+10h] [bp-Ch]\n\n  if ( (*(int (__fastcall **)(FLAlertLayer *))(*(_DWORD *)a2 + 32))(a2) == 1 && a3 )\n    return EditorPauseLayer::onExitEditor(this, nullptr);\n  if ( (*(int (__fastcall **)(FLAlertLayer *))(*(_DWORD *)a2 + 32))(a2) == 3 && a3 )\n    return (char **)EditorPauseLayer::saveLevel((EditorPauseLayer *)this);\n  if ( (*(int (__fastcall **)(FLAlertLayer *))(*(_DWORD *)a2 + 32))(a2) == 4 && a3 )\n  {\n    v7 = (GameManager *)GameManager::sharedState((GameManager *)&byte_4);\n    return (char **)GameManager::openEditorGuide(v7);\n  }\n  result = (char **)(*(int (__fastcall **)(FLAlertLayer *))(*(_DWORD *)a2 + 32))(a2);\n  if ( result == (char **)&byte_5 && a3 )\n  {\n    EditorPauseLayer::saveLevel((EditorPauseLayer *)this);\n    v9 = (LocalLevelManager *)cocos2d::CCArray::createWithObject(*((cocos2d::CCArray **)*(this + 114) + 352), v8);\n    v10 = (LocalLevelManager *)LocalLevelManager::sharedState(v9);\n    result = (char **)LocalLevelManager::exportLevelsToFile(v10, v9);\n    v11 = (ButtonSprite *)result;\n    if ( (int)result <= 0 )\n    {\n      if ( result )\n        return result;\n      v14 = 0;\n      v15 = 0;\n      v16 = 0;\n      std::string::__init(&v14, \"Failed to export level.\", 0x17u);\n      v13 = FLAlertLayer::create(\n              (int)v11,\n              (cocos2d::CCLabelBMFont *)\"Error\",\n              (int)&v14,\n              (ButtonSprite *)\"OK\",\n              v11,\n              300.0);\n      (*(void (__fastcall **)(int *))(*v13 + 656))(v13);\n    }\n    else\n    {\n      v14 = 0;\n      v15 = 0;\n      v16 = 0;\n      std::string::__init(&v14, \"Level exported!\", 0xFu);\n      v12 = FLAlertLayer::create(\n              0,\n              (cocos2d::CCLabelBMFont *)\"Exported\",\n              (int)&v14,\n              (ButtonSprite *)\"OK\",\n              nullptr,\n              300.0);\n      (*(void (__fastcall **)(int *))(*v12 + 656))(v12);\n    }\n    return (char **)std::string::~string((int)&v14);\n  }\n  return result;\n}", "assembly": "; \n; EditorPauseLayer::FLAlert_Clicked from 0x50950c to 0x509626 (282 bytes)\n; \n; 1 xrefs:\n; > `non-virtual thunk to'EditorPauseLayer::FLAlert_Clicked @ 0x50964c\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:51:26 +0000\n; \nPUSH            {R4-R7,LR}                                             ; +0x0, 0x50950c\nSUB             SP, SP, #0x1C                                          ; +0x2, 0x50950e\nLDR             R7, =(__stack_chk_guard_ptr - 0x50951C)                ; +0x4, 0x509510\nMOV             R5, R0                                                 ; +0x6, 0x509512\nMOV             R0, R1                                                 ; +0x8, 0x509514\nMOV             R4, R1                                                 ; +0xa, 0x509516\nADD             R7, PC; __stack_chk_guard_ptr                          ; +0xc, 0x509518\nLDR             R7, [R7]; __stack_chk_guard                            ; +0xe, 0x50951a\nMOV             R6, R2                                                 ; +0x10, 0x50951c\nLDR             R3, [R7]                                               ; +0x12, 0x50951e\nSTR             R3, [SP,#0x1C+var_8]                                   ; +0x14, 0x509520\nLDR             R3, [R1]                                               ; +0x16, 0x509522\nLDR             R3, [R3,#0x20]                                         ; +0x18, 0x509524\nBLX             R3                                                     ; +0x1a, 0x509526\nCMP             R0, #1                                                 ; +0x1c, 0x509528\nBNE             loc_50952E                                             ; +0x1e, 0x50952a\nCBNZ            R6, loc_509544                                         ; +0x20, 0x50952c\nLDR             R3, [R4]                                               ; +0x22, 0x50952e\nMOV             R0, R4                                                 ; +0x24, 0x509530\nLDR             R3, [R3,#0x20]                                         ; +0x26, 0x509532\nBLX             R3                                                     ; +0x28, 0x509534\nCMP             R0, #3                                                 ; +0x2a, 0x509536\nBNE             loc_50954E                                             ; +0x2c, 0x509538\nCBZ             R6, loc_50954E                                         ; +0x2e, 0x50953a\nMOV             R0, R5; this                                           ; +0x30, 0x50953c\nBL              _ZN16EditorPauseLayer9saveLevelEv; EditorPauseLayer::saveLevel(void) ; +0x32, 0x50953e\nB               loc_509616                                             ; +0x36, 0x509542\nMOV             R0, R5; this                                           ; +0x38, 0x509544\nMOVS            R1, #0; cocos2d::CCObject *                            ; +0x3a, 0x509546\nBL              _ZN16EditorPauseLayer12onExitEditorEPN7cocos2d8CCObjectE; EditorPauseLayer::onExitEditor(cocos2d::CCObject *) ; +0x3c, 0x509548\nB               loc_509616                                             ; +0x40, 0x50954c\nLDR             R3, [R4]                                               ; +0x42, 0x50954e\nMOV             R0, R4                                                 ; +0x44, 0x509550\nLDR             R3, [R3,#0x20]                                         ; +0x46, 0x509552\nBLX             R3                                                     ; +0x48, 0x509554\nCMP             R0, #4                                                 ; +0x4a, 0x509556\nBNE             loc_509566                                             ; +0x4c, 0x509558\nCBZ             R6, loc_509566                                         ; +0x4e, 0x50955a\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x50, 0x50955c\nBL              _ZN11GameManager15openEditorGuideEv; GameManager::openEditorGuide(void) ; +0x54, 0x509560\nB               loc_509616                                             ; +0x58, 0x509564\nLDR             R3, [R4]                                               ; +0x5a, 0x509566\nMOV             R0, R4                                                 ; +0x5c, 0x509568\nLDR             R3, [R3,#0x20]                                         ; +0x5e, 0x50956a\nBLX             R3                                                     ; +0x60, 0x50956c\nCMP             R0, #5                                                 ; +0x62, 0x50956e\nBNE             loc_509616                                             ; +0x64, 0x509570\nCMP             R6, #0                                                 ; +0x66, 0x509572\nBEQ             loc_509616                                             ; +0x68, 0x509574\nMOV             R0, R5; this                                           ; +0x6a, 0x509576\nBL              _ZN16EditorPauseLayer9saveLevelEv; EditorPauseLayer::saveLevel(void) ; +0x6c, 0x509578\nLDR.W           R3, [R5,#0x1C8]                                        ; +0x70, 0x50957c\nLDR.W           R0, [R3,#0x580]; this                                  ; +0x74, 0x509580\nBL              _ZN7cocos2d7CCArray16createWithObjectEPNS_8CCObjectE; cocos2d::CCArray::createWithObject(cocos2d::CCObject *) ; +0x78, 0x509584\nMOV             R4, R0                                                 ; +0x7c, 0x509588\nBL              _ZN17LocalLevelManager11sharedStateEv; LocalLevelManager::sharedState(void) ; +0x7e, 0x50958a\nMOV             R1, R4; cocos2d::CCArray *                             ; +0x82, 0x50958e\nBL              _ZN17LocalLevelManager18exportLevelsToFileEPN7cocos2d7CCArrayE; LocalLevelManager::exportLevelsToFile(cocos2d::CCArray *) ; +0x84, 0x509590\nSUBS            R4, R0, #0                                             ; +0x88, 0x509594\nBLE             loc_5095CE                                             ; +0x8a, 0x509596\nADD             R5, SP, #0x1C+var_14                                   ; +0x8c, 0x509598\nLDR             R1, =(aLevelExported - 0x5095A6); \"Level exported!\"    ; +0x8e, 0x50959a\nMOVS            R2, #0xF                                               ; +0x90, 0x50959c\nMOVS            R4, #0                                                 ; +0x92, 0x50959e\nMOV             R0, R5                                                 ; +0x94, 0x5095a0\nADD             R1, PC; \"Level exported!\"                              ; +0x96, 0x5095a2\nSTR             R4, [SP,#0x1C+var_14]                                  ; +0x98, 0x5095a4\nSTR             R4, [SP,#0x1C+var_10]                                  ; +0x9a, 0x5095a6\nSTR             R4, [SP,#0x1C+var_C]                                   ; +0x9c, 0x5095a8\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x9e, 0x5095aa\nLDR             R3, flt_509628                                         ; +0xa2, 0x5095ae\nMOV             R0, R4; int                                            ; +0xa4, 0x5095b0\nLDR             R1, =(aExported - 0x5095BE); \"Exported\"                ; +0xa6, 0x5095b2\nMOV             R2, R5; int                                            ; +0xa8, 0x5095b4\nSTR             R4, [SP,#0x1C+var_1C]; int                             ; +0xaa, 0x5095b6\nSTR             R3, [SP,#0x1C+var_18]; float                           ; +0xac, 0x5095b8\nADD             R1, PC; \"Exported\"                                     ; +0xae, 0x5095ba\nLDR             R3, =(aOk - 0x5095C2); \"OK\"                            ; +0xb0, 0x5095bc\nADD             R3, PC; \"OK\"                                           ; +0xb2, 0x5095be\nBL              _ZN12FLAlertLayer6createEP20FLAlertLayerProtocolPKcNSt6__ndk112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEES3_S3_f; FLAlertLayer::create(FLAlertLayerProtocol *,char const*,std::string,char const*,char const*,float) ; +0xb4, 0x5095c0\nLDR             R3, [R0]                                               ; +0xb8, 0x5095c4\nLDR.W           R3, [R3,#0x290]                                        ; +0xba, 0x5095c6\nBLX             R3                                                     ; +0xbe, 0x5095ca\nB               loc_509602                                             ; +0xc0, 0x5095cc\nBNE             loc_509616                                             ; +0xc2, 0x5095ce\nADD             R5, SP, #0x1C+var_14                                   ; +0xc4, 0x5095d0\nLDR             R1, =(aFailedToExport - 0x5095DE); \"Failed to export level.\" ; +0xc6, 0x5095d2\nMOVS            R2, #0x17                                              ; +0xc8, 0x5095d4\nSTR             R4, [SP,#0x1C+var_14]                                  ; +0xca, 0x5095d6\nMOV             R0, R5                                                 ; +0xcc, 0x5095d8\nADD             R1, PC; \"Failed to export level.\"                      ; +0xce, 0x5095da\nSTR             R4, [SP,#0x1C+var_10]                                  ; +0xd0, 0x5095dc\nSTR             R4, [SP,#0x1C+var_C]                                   ; +0xd2, 0x5095de\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0xd4, 0x5095e0\nLDR             R3, flt_509628                                         ; +0xd8, 0x5095e4\nMOV             R0, R4; int                                            ; +0xda, 0x5095e6\nLDR             R1, =(aError - 0x5095F4); \"Error\"                      ; +0xdc, 0x5095e8\nMOV             R2, R5; int                                            ; +0xde, 0x5095ea\nSTR             R4, [SP,#0x1C+var_1C]; int                             ; +0xe0, 0x5095ec\nSTR             R3, [SP,#0x1C+var_18]; float                           ; +0xe2, 0x5095ee\nADD             R1, PC; \"Error\"                                        ; +0xe4, 0x5095f0\nLDR             R3, =(aOk - 0x5095F8); \"OK\"                            ; +0xe6, 0x5095f2\nADD             R3, PC; \"OK\"                                           ; +0xe8, 0x5095f4\nBL              _ZN12FLAlertLayer6createEP20FLAlertLayerProtocolPKcNSt6__ndk112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEES3_S3_f; FLAlertLayer::create(FLAlertLayerProtocol *,char const*,std::string,char const*,char const*,float) ; +0xea, 0x5095f6\nLDR             R3, [R0]                                               ; +0xee, 0x5095fa\nLDR.W           R3, [R3,#0x290]                                        ; +0xf0, 0x5095fc\nBLX             R3                                                     ; +0xf4, 0x509600\nMOV             R0, R5                                                 ; +0xf6, 0x509602\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xf8, 0x509604\nB               loc_509616                                             ; +0xfc, 0x509608\nB               loc_50960C                                             ; +0xfe, 0x50960a\nMOV             R0, R5                                                 ; +0x100, 0x50960c\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x102, 0x50960e\nBL              __cxa_end_cleanup                                      ; +0x106, 0x509612\nLDR             R2, [SP,#0x1C+var_8]                                   ; +0x10a, 0x509616\nLDR             R3, [R7]                                               ; +0x10c, 0x509618\nCMP             R2, R3                                                 ; +0x10e, 0x50961a\nBEQ             loc_509622                                             ; +0x110, 0x50961c\nBLX             __stack_chk_fail                                       ; +0x112, 0x50961e\nADD             SP, SP, #0x1C                                          ; +0x116, 0x509622\nPOP             {R4-R7,PC}                                             ; +0x118, 0x509624", "xrefs": ["`non-virtual thunk to'EditorPauseLayer::FLAlert_Clicked @ 0x50964c"], "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"}