{"type": "func", "start": 4847556, "end": 4847866, "name": "EditLevelLayer::onTest", "pseudocode": "// \n// EditLevelLayer::onTest from 0x49f7c4 to 0x49f8fa (310 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\nint __fastcall EditLevelLayer::onTest(PlayLayer **this, cocos2d::CCObject *a2)\n{\n  int result; // r0\n  int v4; // r0\n  int v5; // r3\n  int v6; // r3\n  int v7; // r2\n  int v8; // r3\n  int v9; // r3\n  GameManager *v10; // r0\n  bool v11; // r2\n  cocos2d::CCDirector *PersistentCheckpoint; // r0\n  float v13; // r6\n  cocos2d::CCArray *v14; // r0\n  int v15; // r0\n  cocos2d::CCDirector *v16; // r4\n  cocos2d::CCScene *v17; // r2\n  cocos2d::CCScene *v18; // r0\n  int *v19; // r4\n  int v20[3]; // [sp+8h] [bp-10h] BYREF\n\n  result = cocos2d::CCDirector::sharedDirector((cocos2d::CCDirector *)this);\n  if ( !*(_BYTE *)(result + 140) )\n  {\n    v4 = (int)*(this + 87);\n    v5 = *(unsigned __int8 *)(v4 + 1148);\n    if ( (v5 & 1) != 0 )\n      v6 = *(_DWORD *)(v4 + 1152);\n    else\n      v6 = v5 >> 1;\n    if ( v6 && (*(_DWORD *)(v4 + 1172) != *(_DWORD *)(v4 + 612) || *(_DWORD *)(v4 + 1176) != 4) )\n      GJGameLevel::clearPlatformerSave((GJGameLevel *)v4);\n    if ( !*((_BYTE *)this + 384)\n      && ((v7 = (int)*(this + 87), v8 = *(unsigned __int8 *)(v7 + 1148), (v8 & 1) != 0)\n        ? (v9 = *(_DWORD *)(v7 + 1152))\n        : (v9 = v8 >> 1),\n          v9) )\n    {\n      memset(v20, 0, sizeof(v20));\n      std::string::__init(\n        v20,\n        \"There is a <cg>saved</c> <cy>checkpoint</c> for this level.\\nDo you want to <cl>load</c> it?\",\n        0x5Bu);\n      v19 = FLAlertLayer::create(\n              (int)(this + 80),\n              (cocos2d::CCLabelBMFont *)\"Load Save\",\n              (int)v20,\n              (ButtonSprite *)\"New Game\",\n              (ButtonSprite *)\"Load Save\",\n              380.0);\n      std::string::~string((int)v20);\n      FLAlertLayer::addCloseButton((const cocos2d::CCPoint **)v19);\n      *((_BYTE *)v19 + 516) = 1;\n      (*(void (__fastcall **)(int *, int))(*v19 + 36))(v19, 11);\n      return (*(int (__fastcall **)(int *))(*v19 + 656))(v19);\n    }\n    else\n    {\n      v10 = (GameManager *)EditLevelLayer::closeTextInputs(this);\n      *(_DWORD *)(GameManager::sharedState(v10) + 508) = 3;\n      PersistentCheckpoint = PlayLayer::scene(*(this + 87), nullptr, v11);\n      v13 = *(float *)&PersistentCheckpoint;\n      if ( *((_BYTE *)this + 384) )\n      {\n        v14 = (cocos2d::CCArray *)(*(int (__fastcall **)(cocos2d::CCDirector *))(*(_DWORD *)PersistentCheckpoint + 244))(PersistentCheckpoint);\n        v15 = cocos2d::CCArray::objectAtIndex(v14, 0);\n        PersistentCheckpoint = (cocos2d::CCDirector *)PlayLayer::loadPersistentCheckpoint(v15, (int)*(this + 87) + 1148);\n        *((_BYTE *)this + 384) = 0;\n      }\n      v16 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(PersistentCheckpoint);\n      v18 = (cocos2d::CCScene *)cocos2d::CCTransitionFade::create((cocos2d::CCTransitionFade *)0x3F000000, v13, v17);\n      return cocos2d::CCDirector::replaceScene(v16, v18);\n    }\n  }\n  return result;\n}", "assembly": "; \n; EditLevelLayer::onTest from 0x49f7c4 to 0x49f8fa (310 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; \nPUSH            {R4-R6,LR}                                             ; +0x0, 0x49f7c4\nSUB             SP, SP, #0x18                                          ; +0x2, 0x49f7c6\nLDR             R5, =(__stack_chk_guard_ptr - 0x49F7D0)                ; +0x4, 0x49f7c8\nMOV             R4, R0                                                 ; +0x6, 0x49f7ca\nADD             R5, PC; __stack_chk_guard_ptr                          ; +0x8, 0x49f7cc\nLDR             R5, [R5]; __stack_chk_guard                            ; +0xa, 0x49f7ce\nLDR             R3, [R5]                                               ; +0xc, 0x49f7d0\nSTR             R3, [SP,#0x18+var_4]                                   ; +0xe, 0x49f7d2\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x10, 0x49f7d4\nLDRB.W          R3, [R0,#0x8C]                                         ; +0x14, 0x49f7d8\nCMP             R3, #0                                                 ; +0x18, 0x49f7dc\nBNE.W           loc_49F8EA                                             ; +0x1a, 0x49f7de\nLDR.W           R0, [R4,#0x15C]; this                                  ; +0x1e, 0x49f7e2\nLDRB.W          R3, [R0,#0x47C]                                        ; +0x22, 0x49f7e6\nLSLS            R6, R3, #0x1F                                          ; +0x26, 0x49f7ea\nITE PL                                                                 ; +0x28, 0x49f7ec\nASRPL           R3, R3, #1                                             ; +0x2a, 0x49f7ee\nLDRMI.W         R3, [R0,#0x480]                                        ; +0x2c, 0x49f7f0\nCBZ             R3, loc_49F80A                                         ; +0x30, 0x49f7f4\nLDR.W           R2, [R0,#0x494]                                        ; +0x32, 0x49f7f6\nLDR.W           R3, [R0,#0x264]                                        ; +0x36, 0x49f7fa\nCMP             R2, R3                                                 ; +0x3a, 0x49f7fe\nBNE             loc_49F826                                             ; +0x3c, 0x49f800\nLDR.W           R3, [R0,#0x498]                                        ; +0x3e, 0x49f802\nCMP             R3, #4                                                 ; +0x42, 0x49f806\nBNE             loc_49F826                                             ; +0x44, 0x49f808\nLDRB.W          R3, [R4,#0x180]                                        ; +0x46, 0x49f80a\nCBNZ            R3, loc_49F82C                                         ; +0x4a, 0x49f80e\nLDR.W           R2, [R4,#0x15C]                                        ; +0x4c, 0x49f810\nLDRB.W          R3, [R2,#0x47C]                                        ; +0x50, 0x49f814\nLSLS            R1, R3, #0x1F                                          ; +0x54, 0x49f818\nITE PL                                                                 ; +0x56, 0x49f81a\nASRPL           R3, R3, #1                                             ; +0x58, 0x49f81c\nLDRMI.W         R3, [R2,#0x480]                                        ; +0x5a, 0x49f81e\nCBNZ            R3, loc_49F888                                         ; +0x5e, 0x49f822\nB               loc_49F82C                                             ; +0x60, 0x49f824\nBL              _ZN11GJGameLevel19clearPlatformerSaveEv; GJGameLevel::clearPlatformerSave(void) ; +0x62, 0x49f826\nB               loc_49F80A                                             ; +0x66, 0x49f82a\nMOV             R0, R4; this                                           ; +0x68, 0x49f82c\nBL              _ZN14EditLevelLayer15closeTextInputsEv; EditLevelLayer::closeTextInputs(void) ; +0x6a, 0x49f82e\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x6e, 0x49f832\nMOVS            R3, #3                                                 ; +0x72, 0x49f836\nMOVS            R1, #0; GJGameLevel *                                  ; +0x74, 0x49f838\nSTR.W           R3, [R0,#0x1FC]                                        ; +0x76, 0x49f83a\nLDR.W           R0, [R4,#0x15C]; this                                  ; +0x7a, 0x49f83e\nBL              _ZN9PlayLayer5sceneEP11GJGameLevelb; PlayLayer::scene(GJGameLevel *,bool) ; +0x7e, 0x49f842\nLDRB.W          R3, [R4,#0x180]                                        ; +0x82, 0x49f846\nMOV             R6, R0                                                 ; +0x86, 0x49f84a\nCBZ             R3, loc_49F86E                                         ; +0x88, 0x49f84c\nLDR             R3, [R6]                                               ; +0x8a, 0x49f84e\nLDR.W           R3, [R3,#0xF4]                                         ; +0x8c, 0x49f850\nBLX             R3                                                     ; +0x90, 0x49f854\nMOVS            R1, #0; unsigned int                                   ; +0x92, 0x49f856\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x94, 0x49f858\nLDR.W           R1, [R4,#0x15C]                                        ; +0x98, 0x49f85c\nADDW            R1, R1, #0x47C                                         ; +0x9c, 0x49f860\nBL              _ZN9PlayLayer24loadPersistentCheckpointERNSt6__ndk112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE; PlayLayer::loadPersistentCheckpoint(std::string &) ; +0xa0, 0x49f864\nMOVS            R3, #0                                                 ; +0xa4, 0x49f868\nSTRB.W          R3, [R4,#0x180]                                        ; +0xa6, 0x49f86a\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0xaa, 0x49f86e\nMOV             R1, R6; float                                          ; +0xae, 0x49f872\nMOV             R4, R0                                                 ; +0xb0, 0x49f874\nMOV.W           R0, #0x3F000000; this                                  ; +0xb2, 0x49f876\nBL              _ZN7cocos2d16CCTransitionFade6createEfPNS_7CCSceneE; cocos2d::CCTransitionFade::create(float,cocos2d::CCScene *) ; +0xb6, 0x49f87a\nMOV             R1, R0; lpsrc                                          ; +0xba, 0x49f87e\nMOV             R0, R4; this                                           ; +0xbc, 0x49f880\nBL              _ZN7cocos2d10CCDirector12replaceSceneEPNS_7CCSceneE; cocos2d::CCDirector::replaceScene(cocos2d::CCScene *) ; +0xbe, 0x49f882\nB               loc_49F8EA                                             ; +0xc2, 0x49f886\nADD             R6, SP, #0x18+var_10                                   ; +0xc4, 0x49f888\nLDR             R1, =(aThereIsACgSave - 0x49F896); \"There is a <cg>saved</c> <cy>checkpoint\"... ; +0xc6, 0x49f88a\nMOVS            R2, #0x5B ; '['                                        ; +0xc8, 0x49f88c\nMOVS            R3, #0                                                 ; +0xca, 0x49f88e\nMOV             R0, R6                                                 ; +0xcc, 0x49f890\nADD             R1, PC; \"There is a <cg>saved</c> <cy>checkpoint\"...   ; +0xce, 0x49f892\nSTR             R3, [SP,#0x18+var_10]                                  ; +0xd0, 0x49f894\nSTR             R3, [SP,#0x18+var_C]                                   ; +0xd2, 0x49f896\nSTR             R3, [SP,#0x18+var_8]                                   ; +0xd4, 0x49f898\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0xd6, 0x49f89a\nLDR             R3, flt_49F8FC                                         ; +0xda, 0x49f89e\nADD.W           R0, R4, #0x140; int                                    ; +0xdc, 0x49f8a0\nLDR             R1, =(aLoadSave - 0x49F8AE); \"Load Save\"               ; +0xe0, 0x49f8a4\nMOV             R2, R6; int                                            ; +0xe2, 0x49f8a6\nSTR             R3, [SP,#0x18+var_14]; float                           ; +0xe4, 0x49f8a8\nADD             R1, PC; \"Load Save\"                                    ; +0xe6, 0x49f8aa\nLDR             R3, =(aNewGame - 0x49F8B4); \"New Game\"                 ; +0xe8, 0x49f8ac\nSTR             R1, [SP,#0x18+var_18]; int                             ; +0xea, 0x49f8ae\nADD             R3, PC; \"New Game\"                                     ; +0xec, 0x49f8b0\nBL              _ZN12FLAlertLayer6createEP20FLAlertLayerProtocolPKcNSt6__ndk112basic_stringIcNS4_11char_traitsIcEENS4_9allocatorIcEEEES3_S3_f; FLAlertLayer::create(FLAlertLayerProtocol *,char const*,std::string,char const*,char const*,float) ; +0xee, 0x49f8b2\nMOV             R4, R0                                                 ; +0xf2, 0x49f8b6\nMOV             R0, R6                                                 ; +0xf4, 0x49f8b8\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xf6, 0x49f8ba\nMOV             R0, R4; this                                           ; +0xfa, 0x49f8be\nBL              _ZN12FLAlertLayer14addCloseButtonEv; FLAlertLayer::addCloseButton(void) ; +0xfc, 0x49f8c0\nMOVS            R3, #1                                                 ; +0x100, 0x49f8c4\nSTRB.W          R3, [R4,#0x204]                                        ; +0x102, 0x49f8c6\nMOV             R0, R4                                                 ; +0x106, 0x49f8ca\nLDR             R3, [R4]                                               ; +0x108, 0x49f8cc\nMOVS            R1, #0xB                                               ; +0x10a, 0x49f8ce\nLDR             R3, [R3,#0x24]                                         ; +0x10c, 0x49f8d0\nBLX             R3                                                     ; +0x10e, 0x49f8d2\nLDR             R3, [R4]                                               ; +0x110, 0x49f8d4\nMOV             R0, R4                                                 ; +0x112, 0x49f8d6\nLDR.W           R3, [R3,#0x290]                                        ; +0x114, 0x49f8d8\nBLX             R3                                                     ; +0x118, 0x49f8dc\nB               loc_49F8EA                                             ; +0x11a, 0x49f8de\nMOV             R0, R6                                                 ; +0x11c, 0x49f8e0\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x11e, 0x49f8e2\nBL              __cxa_end_cleanup                                      ; +0x122, 0x49f8e6\nLDR             R2, [SP,#0x18+var_4]                                   ; +0x126, 0x49f8ea\nLDR             R3, [R5]                                               ; +0x128, 0x49f8ec\nCMP             R2, R3                                                 ; +0x12a, 0x49f8ee\nBEQ             loc_49F8F6                                             ; +0x12c, 0x49f8f0\nBLX             __stack_chk_fail                                       ; +0x12e, 0x49f8f2\nADD             SP, SP, #0x18                                          ; +0x132, 0x49f8f6\nPOP             {R4-R6,PC}                                             ; +0x134, 0x49f8f8", "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"}