{"type": "func", "start": 4299058052, "end": 4299058288, "name": "EditorUI::onCreate", "pseudocode": "// \n// EditorUI::onCreate from 0x1003e6b84 to 0x1003e6c70 (236 bytes)\n// \n// 1 xrefs:\n// > EditorUI::clickOnPosition @ 0x1003e6764\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nbool __fastcall EditorUI::onCreate(EditorUI *a1)\n{\n  int m_selectedObjectIndex; // w20\n  LevelEditorLayer *m_editorLayer; // x8\n  int v4; // w9\n\n  m_selectedObjectIndex = a1->m_selectedObjectIndex;\n  if ( !m_selectedObjectIndex )\n    return m_selectedObjectIndex != 0;\n  m_editorLayer = a1->m_editorLayer;\n  v4 = m_editorLayer->m_objectCount.random - m_editorLayer->m_objectCount.seed;\n  if ( v4 < 80000 )\n  {\n    if ( v4 < 40000 )\n      goto LABEL_9;\n  }\n  else\n  {\n    if ( m_selectedObjectIndex == 31 )\n      goto LABEL_12;\n    if ( !m_editorLayer->m_level->m_unlimitedObjectsEnabled )\n    {\n      EditorUI::showMaxError(a1);\n      return m_selectedObjectIndex != 0;\n    }\n  }\n  if ( m_selectedObjectIndex != 31 )\n  {\n    if ( !m_editorLayer->m_level->m_highObjectsEnabled )\n    {\n      EditorUI::showMaxBasicError(a1);\n      return m_selectedObjectIndex != 0;\n    }\nLABEL_9:\n    if ( m_selectedObjectIndex == 1329 && m_editorLayer->m_coinCount.random - m_editorLayer->m_coinCount.seed >= 3 )\n    {\n      EditorUI::showMaxCoinError(a1);\n      return m_selectedObjectIndex != 0;\n    }\n  }\nLABEL_12:\n  if ( a1->m_selectedObject || (unsigned int)sub_10024A36C((__int64)a1->m_selectedObjects) )\n    EditorUI::createUndoSelectObject(a1, 1);\n  EditorUI::onCreateObject(a1, a1->m_selectedObjectIndex);\n  return m_selectedObjectIndex != 0;\n}", "assembly": "; \n; EditorUI::onCreate from 0x1003e6b84 to 0x1003e6c70 (236 bytes)\n; \n; 1 xrefs:\n; > EditorUI::clickOnPosition @ 0x1003e6764\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nSTP             X20, X19, [SP,#-0x10+var_10]!                          ; +0x0, 0x1003e6b84\nSTP             X29, X30, [SP,#0x10+var_s0]                            ; +0x4, 0x1003e6b88\nADD             X29, SP, #0x10                                         ; +0x8, 0x1003e6b8c\nLDR             W20, [X0,#0x4C0]                                       ; +0xc, 0x1003e6b90\nCBZ             W20, loc_1003E6C50                                     ; +0x10, 0x1003e6b94\nMOV             X19, X0                                                ; +0x14, 0x1003e6b98\nLDR             X8, [X0,#0x4E8]                                        ; +0x18, 0x1003e6b9c\nLDR             W9, [X8,#0x36B8]                                       ; +0x1c, 0x1003e6ba0\nLDR             W10, [X8,#0x36BC]                                      ; +0x20, 0x1003e6ba4\nSUB             W9, W9, W10                                            ; +0x24, 0x1003e6ba8\nMOV             W10, #0x13880                                          ; +0x28, 0x1003e6bac\nCMP             W9, W10                                                ; +0x30, 0x1003e6bb4\nB.LT            loc_1003E6BDC                                          ; +0x34, 0x1003e6bb8\nCMP             W20, #0x1F                                             ; +0x38, 0x1003e6bbc\nB.EQ            loc_1003E6C24                                          ; +0x3c, 0x1003e6bc0\nLDR             X9, [X8,#0x790]                                        ; +0x40, 0x1003e6bc4\nLDRB            W9, [X9,#0x441]                                        ; +0x44, 0x1003e6bc8\nTBNZ            W9, #0, loc_1003E6BE8                                  ; +0x48, 0x1003e6bcc\nMOV             X0, X19                                                ; +0x4c, 0x1003e6bd0\nBL              EditorUI__showMaxError                                 ; +0x50, 0x1003e6bd4\nB               loc_1003E6C50                                          ; +0x54, 0x1003e6bd8\nMOV             W10, #0x9C40                                           ; +0x58, 0x1003e6bdc\nCMP             W9, W10                                                ; +0x5c, 0x1003e6be0\nB.LT            loc_1003E6BFC                                          ; +0x60, 0x1003e6be4\nCMP             W20, #0x1F                                             ; +0x64, 0x1003e6be8\nB.EQ            loc_1003E6C24                                          ; +0x68, 0x1003e6bec\nLDR             X9, [X8,#0x790]                                        ; +0x6c, 0x1003e6bf0\nLDRB            W9, [X9,#0x440]                                        ; +0x70, 0x1003e6bf4\nTBZ             W9, #0, loc_1003E6C64                                  ; +0x74, 0x1003e6bf8\nCMP             W20, #0x531                                            ; +0x78, 0x1003e6bfc\nB.NE            loc_1003E6C24                                          ; +0x7c, 0x1003e6c00\nLDR             W9, [X8,#0x3644]                                       ; +0x80, 0x1003e6c04\nLDR             W8, [X8,#0x3648]                                       ; +0x84, 0x1003e6c08\nSUB             W8, W9, W8                                             ; +0x88, 0x1003e6c0c\nCMP             W8, #3                                                 ; +0x8c, 0x1003e6c10\nB.LT            loc_1003E6C24                                          ; +0x90, 0x1003e6c14\nMOV             X0, X19                                                ; +0x94, 0x1003e6c18\nBL              EditorUI__showMaxCoinError                             ; +0x98, 0x1003e6c1c\nB               loc_1003E6C50                                          ; +0x9c, 0x1003e6c20\nLDR             X8, [X19,#0x520]                                       ; +0xa0, 0x1003e6c24\nCBNZ            X8, loc_1003E6C38                                      ; +0xa4, 0x1003e6c28\nLDR             X0, [X19,#0x328]                                       ; +0xa8, 0x1003e6c2c\nBL              sub_10024A36C                                          ; +0xac, 0x1003e6c30\nCBZ             W0, loc_1003E6C44                                      ; +0xb0, 0x1003e6c34\nMOV             X0, X19                                                ; +0xb4, 0x1003e6c38\nMOV             W1, #1                                                 ; +0xb8, 0x1003e6c3c\nBL              EditorUI__createUndoSelectObject                       ; +0xbc, 0x1003e6c40\nLDR             W1, [X19,#0x4C0]                                       ; +0xc0, 0x1003e6c44\nMOV             X0, X19                                                ; +0xc4, 0x1003e6c48\nBL              EditorUI__onCreateObject                               ; +0xc8, 0x1003e6c4c\nCMP             W20, #0                                                ; +0xcc, 0x1003e6c50\nCSET            W0, NE                                                 ; +0xd0, 0x1003e6c54\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0xd4, 0x1003e6c58\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0xd8, 0x1003e6c5c\nRET                                                                    ; +0xdc, 0x1003e6c60\nMOV             X0, X19                                                ; +0xe0, 0x1003e6c64\nBL              EditorUI__showMaxBasicError                            ; +0xe4, 0x1003e6c68\nB               loc_1003E6C50                                          ; +0xe8, 0x1003e6c6c", "xrefs": ["EditorUI::clickOnPosition @ 0x1003e6764"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}