{"type": "func", "start": 4296090768, "end": 4296090984, "name": "EditLevelLayer::onClone", "pseudocode": "// \n// EditLevelLayer::onClone from 0x100112490 to 0x100112568 (216 bytes)\n// \n// 1 xrefs:\n// > EditLevelLayer::FLAlert_Clicked @ 0x100112290\n// \n// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!\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 10:59:09 +0000\n// \n\n__int64 __fastcall EditLevelLayer::onClone(__int64 a1)\n{\n  __int64 result; // x0\n  __int64 v3; // x0\n  _DWORD *NewLevel; // x20\n  int v5; // w19\n  __int64 v6; // x0\n  float v7; // s0\n  int v8; // w19\n  __int64 v9; // x0\n  void *v10; // x1\n\n  result = cocos2d::CCDirector::sharedDirector(a1);\n  if ( (*(_BYTE *)(result + 176) & 1) == 0 && (*(_BYTE *)(a1 + 496) & 1) == 0 )\n  {\n    v3 = (*(__int64 (__fastcall **)(__int64, _QWORD))(*(_QWORD *)a1 + 1072LL))(a1, 0);\n    *(_BYTE *)(a1 + 496) = 1;\n    *(_DWORD *)(GameManager::sharedState(v3) + 708) = 2;\n    GameLevelManager::sharedState();\n    NewLevel = (_DWORD *)GameLevelManager::createNewLevel();\n    GJGameLevel::copyLevelInfo((__int64)NewLevel, *(_QWORD *)(a1 + 472));\n    EditLevelLayer::verifyLevelName(a1);\n    v5 = *(_DWORD *)(*(_QWORD *)(a1 + 472) + 988LL) - *(_DWORD *)(*(_QWORD *)(a1 + 472) + 992LL);\n    NewLevel[249] = v5;\n    v6 = rand();\n    v7 = vcvts_n_f32_s32(v6, 0x1Fu) * 1000.0;\n    NewLevel[248] = (int)v7;\n    NewLevel[247] = v5 + (int)v7;\n    v8 = cocos2d::CCDirector::sharedDirector(v6);\n    v9 = EditLevelLayer::scene((__int64)NewLevel);\n    v10 = (void *)cocos2d::CCTransitionFade::create_1(v9, 0.5);\n    return cocos2d::CCDirector::replaceScene(v8, v10);\n  }\n  return result;\n}", "assembly": "; \n; EditLevelLayer::onClone from 0x100112490 to 0x100112568 (216 bytes)\n; \n; 1 xrefs:\n; > EditLevelLayer::FLAlert_Clicked @ 0x100112290\n; \n; This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!\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 10:59:09 +0000\n; \nSTP             X20, X19, [SP,#-0x10+var_10]!                          ; +0x0, 0x100112490\nSTP             X29, X30, [SP,#0x10+var_s0]                            ; +0x4, 0x100112494\nADD             X29, SP, #0x10                                         ; +0x8, 0x100112498\nMOV             X19, X0                                                ; +0xc, 0x10011249c\nBL              cocos2d__CCDirector__sharedDirector                    ; +0x10, 0x1001124a0\nLDRB            W8, [X0,#0xB0]                                         ; +0x14, 0x1001124a4\nTBNZ            W8, #0, loc_1001124B4                                  ; +0x18, 0x1001124a8\nLDRB            W8, [X19,#0x1F0]                                       ; +0x1c, 0x1001124ac\nTBZ             W8, #0, loc_1001124C0                                  ; +0x20, 0x1001124b0\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x24, 0x1001124b4\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x28, 0x1001124b8\nRET                                                                    ; +0x2c, 0x1001124bc\nLDR             X8, [X19]                                              ; +0x30, 0x1001124c0\nLDR             X8, [X8,#0x430]                                        ; +0x34, 0x1001124c4\nMOV             X0, X19                                                ; +0x38, 0x1001124c8\nMOV             W1, #0                                                 ; +0x3c, 0x1001124cc\nBLR             X8                                                     ; +0x40, 0x1001124d0\nMOV             W8, #1                                                 ; +0x44, 0x1001124d4\nSTRB            W8, [X19,#0x1F0]                                       ; +0x48, 0x1001124d8\nBL              GameManager__sharedState                               ; +0x4c, 0x1001124dc\nMOV             W8, #2                                                 ; +0x50, 0x1001124e0\nSTR             W8, [X0,#0x2C4]                                        ; +0x54, 0x1001124e4\nBL              GameLevelManager__sharedState                          ; +0x58, 0x1001124e8\nBL              GameLevelManager__createNewLevel                       ; +0x5c, 0x1001124ec\nMOV             X20, X0                                                ; +0x60, 0x1001124f0\nLDR             X1, [X19,#0x1D8]                                       ; +0x64, 0x1001124f4\nBL              GJGameLevel__copyLevelInfo                             ; +0x68, 0x1001124f8\nMOV             X0, X19                                                ; +0x6c, 0x1001124fc\nBL              EditLevelLayer__verifyLevelName                        ; +0x70, 0x100112500\nLDR             X8, [X19,#0x1D8]                                       ; +0x74, 0x100112504\nLDR             W9, [X8,#0x3DC]                                        ; +0x78, 0x100112508\nLDR             W8, [X8,#0x3E0]                                        ; +0x7c, 0x10011250c\nSUB             W19, W9, W8                                            ; +0x80, 0x100112510\nSTR             W19, [X20,#0x3E4]                                      ; +0x84, 0x100112514\nBL              _rand                                                  ; +0x88, 0x100112518\nSCVTF           S0, W0, #0x1F                                          ; +0x8c, 0x10011251c\nMOV             W8, #0x447A0000                                        ; +0x90, 0x100112520\nFMOV            S1, W8                                                 ; +0x94, 0x100112524\nFMUL            S0, S0, S1                                             ; +0x98, 0x100112528\nFCVTZS          W8, S0                                                 ; +0x9c, 0x10011252c\nSTR             W8, [X20,#0x3E0]                                       ; +0xa0, 0x100112530\nADD             W8, W19, W8                                            ; +0xa4, 0x100112534\nSTR             W8, [X20,#0x3DC]                                       ; +0xa8, 0x100112538\nBL              cocos2d__CCDirector__sharedDirector                    ; +0xac, 0x10011253c\nMOV             X19, X0                                                ; +0xb0, 0x100112540\nMOV             X0, X20                                                ; +0xb4, 0x100112544\nBL              EditLevelLayer__scene                                  ; +0xb8, 0x100112548\nFMOV            S0, #0.5                                               ; +0xbc, 0x10011254c\nBL              cocos2d__CCTransitionFade__create_1                    ; +0xc0, 0x100112550\nMOV             X1, X0; lpsrc                                          ; +0xc4, 0x100112554\nMOV             X0, X19; int                                           ; +0xc8, 0x100112558\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0xcc, 0x10011255c\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0xd0, 0x100112560\nB               cocos2d__CCDirector__replaceScene                      ; +0xd4, 0x100112564", "xrefs": ["EditLevelLayer::FLAlert_Clicked @ 0x100112290"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "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"}