{"type": "func", "start": 4848588, "end": 4848812, "name": "EditLevelLayer::onExportLevel", "pseudocode": "// \n// EditLevelLayer::onExportLevel from 0x49fbcc to 0x49fcac (224 bytes)\n// \n// 0 xrefs:\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\ncocos2d::CCArray *__fastcall EditLevelLayer::onExportLevel(EditLevelLayer *this, cocos2d::CCObject *a2)\n{\n  cocos2d::CCArray *result; // r0\n  LocalLevelManager *v4; // r4\n  LocalLevelManager *v5; // r0\n  ButtonSprite *v6; // r4\n  int *v7; // r5\n  void (__fastcall *v8)(EditLevelLayer *, int, int); // r9\n  int v9; // r0\n  int *v10; // r0\n  int v11[3]; // [sp+Ch] [bp-20h] BYREF\n  int v12; // [sp+18h] [bp-14h] BYREF\n  int v13; // [sp+1Ch] [bp-10h]\n  int v14; // [sp+20h] [bp-Ch]\n\n  result = *((cocos2d::CCArray **)this + 87);\n  if ( result )\n  {\n    v4 = (LocalLevelManager *)cocos2d::CCArray::createWithObject(result, a2);\n    v5 = (LocalLevelManager *)LocalLevelManager::sharedState(v4);\n    result = (cocos2d::CCArray *)LocalLevelManager::exportLevelsToFile(v5, v4);\n    v6 = result;\n    if ( (int)result <= 0 )\n    {\n      if ( result )\n        return result;\n      v7 = &v12;\n      v12 = 0;\n      v13 = 0;\n      v14 = 0;\n      std::string::__init(&v12, \"Failed to export level.\", 0x17u);\n      v10 = FLAlertLayer::create((int)v6, (cocos2d::CCLabelBMFont *)\"Error\", (int)&v12, (ButtonSprite *)\"OK\", v6);\n      (*(void (__fastcall **)(int *))(*v10 + 656))(v10);\n    }\n    else\n    {\n      v7 = v11;\n      v8 = *(void (__fastcall **)(EditLevelLayer *, int, int))(*(_DWORD *)this + 232);\n      memset(v11, 0, sizeof(v11));\n      std::string::__init(v11, \"Level exported!\", 0xFu);\n      v12 = 0;\n      v13 = 0;\n      v14 = 0;\n      std::string::__init(&v12, &unk_B6B226, 0);\n      v9 = TextAlertPopup::create(v11, 1056964608, 1058642330, 150, &v12);\n      v8(this, v9, 100);\n      std::string::~string((int)&v12);\n    }\n    return (cocos2d::CCArray *)std::string::~string((int)v7);\n  }\n  return result;\n}", "assembly": "; \n; EditLevelLayer::onExportLevel from 0x49fbcc to 0x49fcac (224 bytes)\n; \n; 0 xrefs:\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; \nLDR             R3, =(__stack_chk_guard_ptr - 0x49FBD6)                ; +0x0, 0x49fbcc\nPUSH.W          {R4-R9,LR}                                             ; +0x2, 0x49fbce\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0x6, 0x49fbd2\nLDR             R3, [R3]; __stack_chk_guard                            ; +0x8, 0x49fbd4\nMOV             R8, R0                                                 ; +0xa, 0x49fbd6\nLDR.W           R0, [R0,#0x15C]; this                                  ; +0xc, 0x49fbd8\nLDR             R2, [R3]                                               ; +0x10, 0x49fbdc\nSUB             SP, SP, #0x2C                                          ; +0x12, 0x49fbde\nMOV             R7, R3                                                 ; +0x14, 0x49fbe0\nSTR             R2, [SP,#0x2C+var_8]                                   ; +0x16, 0x49fbe2\nCMP             R0, #0                                                 ; +0x18, 0x49fbe4\nBEQ             loc_49FC9A                                             ; +0x1a, 0x49fbe6\nBL              _ZN7cocos2d7CCArray16createWithObjectEPNS_8CCObjectE; cocos2d::CCArray::createWithObject(cocos2d::CCObject *) ; +0x1c, 0x49fbe8\nMOV             R4, R0                                                 ; +0x20, 0x49fbec\nBL              _ZN17LocalLevelManager11sharedStateEv; LocalLevelManager::sharedState(void) ; +0x22, 0x49fbee\nMOV             R1, R4; cocos2d::CCArray *                             ; +0x26, 0x49fbf2\nBL              _ZN17LocalLevelManager18exportLevelsToFileEPN7cocos2d7CCArrayE; LocalLevelManager::exportLevelsToFile(cocos2d::CCArray *) ; +0x28, 0x49fbf4\nSUBS            R4, R0, #0                                             ; +0x2c, 0x49fbf8\nBLE             loc_49FC4E                                             ; +0x2e, 0x49fbfa\nLDR.W           R3, [R8]                                               ; +0x30, 0x49fbfc\nADD             R5, SP, #0x2C+var_20                                   ; +0x34, 0x49fc00\nLDR             R1, =(aLevelExported - 0x49FC0E); \"Level exported!\"    ; +0x36, 0x49fc02\nMOVS            R2, #0xF                                               ; +0x38, 0x49fc04\nMOV             R0, R5                                                 ; +0x3a, 0x49fc06\nMOVS            R4, #0                                                 ; +0x3c, 0x49fc08\nADD             R1, PC; \"Level exported!\"                              ; +0x3e, 0x49fc0a\nLDR.W           R9, [R3,#0xE8]                                         ; +0x40, 0x49fc0c\nSTR             R4, [SP,#0x2C+var_20]                                  ; +0x44, 0x49fc10\nADD             R6, SP, #0x2C+var_14                                   ; +0x46, 0x49fc12\nSTR             R4, [SP,#0x2C+var_1C]                                  ; +0x48, 0x49fc14\nSTR             R4, [SP,#0x2C+var_18]                                  ; +0x4a, 0x49fc16\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x4c, 0x49fc18\nLDR             R1, =(unk_B6B226 - 0x49FC28)                           ; +0x50, 0x49fc1c\nMOV             R0, R6                                                 ; +0x52, 0x49fc1e\nMOV             R2, R4                                                 ; +0x54, 0x49fc20\nSTR             R4, [SP,#0x2C+var_14]                                  ; +0x56, 0x49fc22\nADD             R1, PC; unk_B6B226                                     ; +0x58, 0x49fc24\nSTR             R4, [SP,#0x2C+var_10]                                  ; +0x5a, 0x49fc26\nSTR             R4, [SP,#0x2C+var_C]                                   ; +0x5c, 0x49fc28\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x5e, 0x49fc2a\nSTR             R6, [SP,#0x2C+var_2C]                                  ; +0x62, 0x49fc2e\nMOV             R0, R5                                                 ; +0x64, 0x49fc30\nMOV.W           R1, #0x3F000000                                        ; +0x66, 0x49fc32\nLDR             R2, =0x3F19999A                                        ; +0x6a, 0x49fc36\nMOVS            R3, #0x96                                              ; +0x6c, 0x49fc38\nBL              _ZN14TextAlertPopup6createENSt6__ndk112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEffiS6_; TextAlertPopup::create(std::string,float,float,int,std::string) ; +0x6e, 0x49fc3a\nMOV             R1, R0                                                 ; +0x72, 0x49fc3e\nMOVS            R2, #0x64 ; 'd'                                        ; +0x74, 0x49fc40\nMOV             R0, R8                                                 ; +0x76, 0x49fc42\nBLX             R9                                                     ; +0x78, 0x49fc44\nMOV             R0, R6                                                 ; +0x7a, 0x49fc46\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x7c, 0x49fc48\nB               loc_49FC7E                                             ; +0x80, 0x49fc4c\nBNE             loc_49FC9A                                             ; +0x82, 0x49fc4e\nADD             R5, SP, #0x2C+var_14                                   ; +0x84, 0x49fc50\nLDR             R1, =(aFailedToExport - 0x49FC5E); \"Failed to export level.\" ; +0x86, 0x49fc52\nMOVS            R2, #0x17                                              ; +0x88, 0x49fc54\nSTR             R4, [SP,#0x2C+var_14]                                  ; +0x8a, 0x49fc56\nMOV             R0, R5                                                 ; +0x8c, 0x49fc58\nADD             R1, PC; \"Failed to export level.\"                      ; +0x8e, 0x49fc5a\nSTR             R4, [SP,#0x2C+var_10]                                  ; +0x90, 0x49fc5c\nSTR             R4, [SP,#0x2C+var_C]                                   ; +0x92, 0x49fc5e\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x94, 0x49fc60\nLDR             R1, =(aError - 0x49FC72); \"Error\"                      ; +0x98, 0x49fc64\nMOV             R0, R4                                                 ; +0x9a, 0x49fc66\nLDR             R3, =(aOk - 0x49FC74); \"OK\"                            ; +0x9c, 0x49fc68\nMOV             R2, R5                                                 ; +0x9e, 0x49fc6a\nSTR             R4, [SP,#0x2C+var_2C]                                  ; +0xa0, 0x49fc6c\nADD             R1, PC; \"Error\"                                        ; +0xa2, 0x49fc6e\nADD             R3, PC; \"OK\"                                           ; +0xa4, 0x49fc70\nBL              _ZN12FLAlertLayer6createEP20FLAlertLayerProtocolPKcNSt6__ndk112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEES3_S3_; FLAlertLayer::create(FLAlertLayerProtocol *,char const*,std::string,char const*,char const*) ; +0xa6, 0x49fc72\nLDR             R3, [R0]                                               ; +0xaa, 0x49fc76\nLDR.W           R3, [R3,#0x290]                                        ; +0xac, 0x49fc78\nBLX             R3                                                     ; +0xb0, 0x49fc7c\nMOV             R0, R5                                                 ; +0xb2, 0x49fc7e\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xb4, 0x49fc80\nB               loc_49FC9A                                             ; +0xb8, 0x49fc84\nMOV             R0, R6                                                 ; +0xba, 0x49fc86\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xbc, 0x49fc88\nB               loc_49FC90                                             ; +0xc0, 0x49fc8c\nB               loc_49FC90                                             ; +0xc2, 0x49fc8e\nMOV             R0, R5                                                 ; +0xc4, 0x49fc90\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xc6, 0x49fc92\nBL              __cxa_end_cleanup                                      ; +0xca, 0x49fc96\nLDR             R2, [SP,#0x2C+var_8]                                   ; +0xce, 0x49fc9a\nLDR             R3, [R7]                                               ; +0xd0, 0x49fc9c\nCMP             R2, R3                                                 ; +0xd2, 0x49fc9e\nBEQ             loc_49FCA6                                             ; +0xd4, 0x49fca0\nBLX             __stack_chk_fail                                       ; +0xd6, 0x49fca2\nADD             SP, SP, #0x2C ; ','                                    ; +0xda, 0x49fca6\nPOP.W           {R4-R9,PC}                                             ; +0xdc, 0x49fca8", "xrefs": [], "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"}