{"type": "func", "start": 4295156064, "end": 4295156325, "name": "EditorUI::onCreate", "pseudocode": "// \n// EditorUI::onCreate from 0x10002e160 to 0x10002e265 (261 bytes)\n// \n// 1 xrefs:\n// > EditorUI::clickOnPosition @ 0x10002daf0\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; // r14d\n  LevelEditorLayer *m_editorLayer; // rax\n  int v3; // ecx\n  cocos2d::CCArray *SelectedObjects; // rax\n  UndoObject *v5; // rax\n\n  m_selectedObjectIndex = a1->m_selectedObjectIndex;\n  if ( !m_selectedObjectIndex )\n    return m_selectedObjectIndex != 0;\n  m_editorLayer = a1->m_editorLayer;\n  v3 = m_editorLayer->m_objectCount.random - m_editorLayer->m_objectCount.seed;\n  if ( v3 < 80000 )\n  {\n    if ( v3 < 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_100720070(a1->m_selectedObjects) )\n  {\n    SelectedObjects = EditorUI::getSelectedObjects(a1);\n    v5 = UndoObject::createWithArray(SelectedObjects, Select);\n    v5->m_redo = 1;\n    LevelEditorLayer::addToUndoList(a1->m_editorLayer, v5, 0);\n  }\n  EditorUI::onCreateObject(a1, a1->m_selectedObjectIndex);\n  return m_selectedObjectIndex != 0;\n}", "assembly": "; \n; EditorUI::onCreate from 0x10002e160 to 0x10002e265 (261 bytes)\n; \n; 1 xrefs:\n; > EditorUI::clickOnPosition @ 0x10002daf0\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\npush    rbp                                                            ; +0x0, 0x10002e160\nmov     rbp, rsp                                                       ; +0x1, 0x10002e161\npush    r14                                                            ; +0x4, 0x10002e164\npush    rbx                                                            ; +0x6, 0x10002e166\nmov     r14d, [rdi+4C0h]                                               ; +0x7, 0x10002e167\ntest    r14d, r14d                                                     ; +0xe, 0x10002e16e\njz      loc_10002E250                                                  ; +0x11, 0x10002e171\nmov     rbx, rdi                                                       ; +0x17, 0x10002e177\nmov     rax, [rdi+4E8h]                                                ; +0x1a, 0x10002e17a\nmov     ecx, [rax+3688h]                                               ; +0x21, 0x10002e181\nsub     ecx, [rax+368Ch]                                               ; +0x27, 0x10002e187\ncmp     ecx, 13880h                                                    ; +0x2d, 0x10002e18d\njl      short loc_10002E1B8                                            ; +0x33, 0x10002e193\ncmp     r14d, 1Fh                                                      ; +0x35, 0x10002e195\njz      short loc_10002E1FE                                            ; +0x39, 0x10002e199\nmov     rcx, [rax+790h]                                                ; +0x3b, 0x10002e19b\ncmp     byte ptr [rcx+441h], 0                                         ; +0x42, 0x10002e1a2\njnz     short loc_10002E1C0                                            ; +0x49, 0x10002e1a9\nmov     rdi, rbx                                                       ; +0x4b, 0x10002e1ab\ncall    EditorUI__showMaxError                                         ; +0x4e, 0x10002e1ae\njmp     loc_10002E250                                                  ; +0x53, 0x10002e1b3\ncmp     ecx, 9C40h                                                     ; +0x58, 0x10002e1b8\njl      short loc_10002E1DA                                            ; +0x5e, 0x10002e1be\ncmp     r14d, 1Fh                                                      ; +0x60, 0x10002e1c0\njz      short loc_10002E1FE                                            ; +0x64, 0x10002e1c4\nmov     rcx, [rax+790h]                                                ; +0x66, 0x10002e1c6\ncmp     byte ptr [rcx+440h], 0                                         ; +0x6d, 0x10002e1cd\njz      loc_10002E25B                                                  ; +0x74, 0x10002e1d4\ncmp     r14d, 531h                                                     ; +0x7a, 0x10002e1da\njnz     short loc_10002E1FE                                            ; +0x81, 0x10002e1e1\nmov     ecx, [rax+3614h]                                               ; +0x83, 0x10002e1e3\nsub     ecx, [rax+3618h]                                               ; +0x89, 0x10002e1e9\ncmp     ecx, 3                                                         ; +0x8f, 0x10002e1ef\njl      short loc_10002E1FE                                            ; +0x92, 0x10002e1f2\nmov     rdi, rbx                                                       ; +0x94, 0x10002e1f4\ncall    EditorUI__showMaxCoinError                                     ; +0x97, 0x10002e1f7\njmp     short loc_10002E250                                            ; +0x9c, 0x10002e1fc\ncmp     qword ptr [rbx+520h], 0                                        ; +0x9e, 0x10002e1fe\njnz     short loc_10002E218                                            ; +0xa6, 0x10002e206\nmov     rdi, [rbx+328h]                                                ; +0xa8, 0x10002e208\ncall    sub_100720070                                                  ; +0xaf, 0x10002e20f\ntest    eax, eax                                                       ; +0xb4, 0x10002e214\njz      short loc_10002E242                                            ; +0xb6, 0x10002e216\nmov     rdi, rbx                                                       ; +0xb8, 0x10002e218\ncall    EditorUI__getSelectedObjects                                   ; +0xbb, 0x10002e21b\nmov     rdi, rax                                                       ; +0xc0, 0x10002e220\nmov     esi, 6                                                         ; +0xc3, 0x10002e223\ncall    UndoObject__createWithArray                                    ; +0xc8, 0x10002e228\nmov     byte ptr [rax+50h], 1                                          ; +0xcd, 0x10002e22d\nmov     rdi, [rbx+4E8h]                                                ; +0xd1, 0x10002e231\nmov     rsi, rax                                                       ; +0xd8, 0x10002e238\nxor     edx, edx                                                       ; +0xdb, 0x10002e23b\ncall    LevelEditorLayer__addToUndoList                                ; +0xdd, 0x10002e23d\nmov     esi, [rbx+4C0h]                                                ; +0xe2, 0x10002e242\nmov     rdi, rbx                                                       ; +0xe8, 0x10002e248\ncall    EditorUI__onCreateObject                                       ; +0xeb, 0x10002e24b\ntest    r14d, r14d                                                     ; +0xf0, 0x10002e250\nsetnz   al                                                             ; +0xf3, 0x10002e253\npop     rbx                                                            ; +0xf6, 0x10002e256\npop     r14                                                            ; +0xf7, 0x10002e257\npop     rbp                                                            ; +0xf9, 0x10002e259\nretn                                                                   ; +0xfa, 0x10002e25a\nmov     rdi, rbx                                                       ; +0xfb, 0x10002e25b\ncall    EditorUI__showMaxBasicError                                    ; +0xfe, 0x10002e25e\njmp     short loc_10002E250                                            ; +0x103, 0x10002e263", "xrefs": ["EditorUI::clickOnPosition @ 0x10002daf0"], "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"}