{"type": "func", "start": 5369820144, "end": 5369820645, "name": "EditorUI::onCreate", "pseudocode": "// \n// EditorUI::onCreate from 0x14010f3f0 to 0x14010f5e5 (501 bytes)\n// \n// 2 xrefs:\n// > EditorUI::clickOnPosition @ 0x1400e2759\n// > <???> @ 0x1406c8e5c\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\n// Hidden C++ exception states: #wind=1\nbool EditorUI::onCreate(EditorUI *a1)\n{\n  int m_selectedObjectIndex; // edx\n  LevelEditorLayer *m_editorLayer; // rcx\n  int v5; // eax\n  cocos2d::CCString *v6; // rax\n  int v7; // edi\n  const char *CString; // rax\n  size_t v9; // r8\n  __int64 v10; // rax\n  FLAlertLayer *v11; // rbx\n  __int128 v12; // [rsp+50h] [rbp-48h] BYREF\n  __int64 v13; // [rsp+60h] [rbp-38h]\n  __int64 v14; // [rsp+68h] [rbp-30h]\n  _BYTE v15[32]; // [rsp+70h] [rbp-28h] BYREF\n\n  m_selectedObjectIndex = a1->m_selectedObjectIndex;\n  if ( !m_selectedObjectIndex )\n    return 0;\n  m_editorLayer = a1->m_editorLayer;\n  v5 = m_editorLayer->m_objectCount.random - m_editorLayer->m_objectCount.seed;\n  if ( v5 < 80000 )\n  {\n    if ( v5 < 40000 )\n    {\nLABEL_11:\n      if ( m_selectedObjectIndex == 1329 && m_editorLayer->m_coinCount.random - m_editorLayer->m_coinCount.seed >= 3 )\n      {\n        if ( !a1->m_alertShown )\n        {\n          a1->m_alertShown = 1;\n          v6 = cocos2d::CCString::createWithFormat(\"You cannot add more than <cy>3</c> <cg>coins</c> in a single level.\");\n          v7 = (_DWORD)a1 + 408;\n          if ( !a1 )\n            v7 = 0;\n          CString = cocos2d::CCString::getCString(v6);\n          v12 = 0;\n          v13 = 0;\n          v14 = 0;\n          v9 = -1;\n          do\n            ++v9;\n          while ( CString[v9] );\n          sub_14003A930(&v12, CString, v9);\n          v10 = sub_14003BDB0((__int64)v15, (__int64)&v12);\n          v11 = FLAlertLayer::create(v7, (int)\"Max Coins\", v10, (__int64)\"OK\", 0, 1133903872, 0, 0, 1065353216);\n          sub_14003A830((__int64)&v12);\n          v11->setTag(v11, 122);\n          v11->show(v11);\n        }\n        return 1;\n      }\nLABEL_19:\n      if ( a1->m_selectedObject || cocos2d::CCArray::count(a1->m_selectedObjects) )\n        EditorUI::createUndoSelectObject(a1, 1);\n      EditorUI::onCreateObject(a1, a1->m_selectedObjectIndex);\n      return 1;\n    }\n    if ( m_selectedObjectIndex == 31 )\n      goto LABEL_19;\nLABEL_9:\n    if ( !m_editorLayer->m_level->m_highObjectsEnabled )\n    {\n      EditorUI::showMaxBasicError(a1);\n      return 1;\n    }\n    goto LABEL_11;\n  }\n  if ( m_selectedObjectIndex == 31 )\n    goto LABEL_19;\n  if ( m_editorLayer->m_level->m_unlimitedObjectsEnabled )\n    goto LABEL_9;\n  EditorUI::showMaxError(a1);\n  return 1;\n}", "assembly": "; \n; EditorUI::onCreate from 0x14010f3f0 to 0x14010f5e5 (501 bytes)\n; \n; 2 xrefs:\n; > EditorUI::clickOnPosition @ 0x1400e2759\n; > <???> @ 0x1406c8e5c\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\nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x14010f3f0\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x14010f3f5\npush    rdi                                                            ; +0xa, 0x14010f3fa\nsub     rsp, 90h                                                       ; +0xb, 0x14010f3fb\nmov     rbx, rcx                                                       ; +0x12, 0x14010f402\nmov     edx, [rcx+4D8h]                                                ; +0x15, 0x14010f405\ntest    edx, edx                                                       ; +0x1b, 0x14010f40b\njnz     short loc_14010F416                                            ; +0x1d, 0x14010f40d\nxor     al, al                                                         ; +0x1f, 0x14010f40f\njmp     loc_14010F5D0                                                  ; +0x21, 0x14010f411\nmov     rcx, [rcx+500h]                                                ; +0x26, 0x14010f416\nmov     eax, [rcx+38B8h]                                               ; +0x2d, 0x14010f41d\nsub     eax, [rcx+38BCh]                                               ; +0x33, 0x14010f423\ncmp     eax, 13880h                                                    ; +0x39, 0x14010f429\njl      short loc_14010F456                                            ; +0x3e, 0x14010f42e\ncmp     edx, 1Fh                                                       ; +0x40, 0x14010f430\njz      loc_14010F59B                                                  ; +0x43, 0x14010f433\nmov     rax, [rcx+878h]                                                ; +0x49, 0x14010f439\ncmp     byte ptr [rax+4A1h], 0                                         ; +0x50, 0x14010f440\njnz     short loc_14010F466                                            ; +0x57, 0x14010f447\nmov     rcx, rbx                                                       ; +0x59, 0x14010f449\ncall    EditorUI__showMaxError                                         ; +0x5c, 0x14010f44c\njmp     loc_14010F5CE                                                  ; +0x61, 0x14010f451\ncmp     eax, 9C40h                                                     ; +0x66, 0x14010f456\njl      short loc_14010F483                                            ; +0x6b, 0x14010f45b\ncmp     edx, 1Fh                                                       ; +0x6d, 0x14010f45d\njz      loc_14010F59B                                                  ; +0x70, 0x14010f460\nmov     rax, [rcx+878h]                                                ; +0x76, 0x14010f466\ncmp     byte ptr [rax+4A0h], 0                                         ; +0x7d, 0x14010f46d\njnz     short loc_14010F483                                            ; +0x84, 0x14010f474\nmov     rcx, rbx                                                       ; +0x86, 0x14010f476\ncall    EditorUI__showMaxBasicError                                    ; +0x89, 0x14010f479\njmp     loc_14010F5CE                                                  ; +0x8e, 0x14010f47e\ncmp     edx, 531h                                                      ; +0x93, 0x14010f483\njnz     loc_14010F59B                                                  ; +0x99, 0x14010f489\nmov     eax, [rcx+3844h]                                               ; +0x9f, 0x14010f48f\nsub     eax, [rcx+3848h]                                               ; +0xa5, 0x14010f495\ncmp     eax, 3                                                         ; +0xab, 0x14010f49b\njl      loc_14010F59B                                                  ; +0xae, 0x14010f49e\ncmp     byte ptr [rbx+268h], 0                                         ; +0xb4, 0x14010f4a4\njnz     loc_14010F5CE                                                  ; +0xbb, 0x14010f4ab\nmov     byte ptr [rbx+268h], 1                                         ; +0xc1, 0x14010f4b1\nlea     rcx, aYouCannotAddMo; \"You cannot add more than <cy>3</c> <cg>\"... ; +0xc8, 0x14010f4b8\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xcf, 0x14010f4bf\nlea     rdi, [rbx+198h]                                                ; +0xd5, 0x14010f4c5\nxor     esi, esi                                                       ; +0xdc, 0x14010f4cc\ntest    rbx, rbx                                                       ; +0xde, 0x14010f4ce\ncmovz   rdi, rsi                                                       ; +0xe1, 0x14010f4d1\nmov     rcx, rax                                                       ; +0xe5, 0x14010f4d5\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0xe8, 0x14010f4d8\nxorps   xmm0, xmm0                                                     ; +0xee, 0x14010f4de\nmovups  [rsp+98h+var_48], xmm0                                         ; +0xf1, 0x14010f4e1\nmov     [rsp+98h+var_38], rsi                                          ; +0xf6, 0x14010f4e6\nmov     [rsp+98h+var_30], rsi                                          ; +0xfb, 0x14010f4eb\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x100, 0x14010f4f0\ninc     r8                                                             ; +0x107, 0x14010f4f7\ncmp     [rax+r8], sil                                                  ; +0x10a, 0x14010f4fa\njnz     short loc_14010F4F7                                            ; +0x10e, 0x14010f4fe\nmov     rdx, rax                                                       ; +0x110, 0x14010f500\nlea     rcx, [rsp+98h+var_48]                                          ; +0x113, 0x14010f503\ncall    sub_14003A930                                                  ; +0x118, 0x14010f508\nlea     rax, [rsp+98h+var_48]                                          ; +0x11d, 0x14010f50d\nmov     [rsp+98h+arg_0], rax                                           ; +0x122, 0x14010f512\nlea     rdx, [rsp+98h+var_48]                                          ; +0x12a, 0x14010f51a\nlea     rcx, [rsp+98h+var_28]                                          ; +0x12f, 0x14010f51f\ncall    sub_14003BDB0                                                  ; +0x134, 0x14010f524\nmovss   xmm0, cs:flt_140622C24                                         ; +0x139, 0x14010f529\nmovss   [rsp+98h+var_58], xmm0                                         ; +0x141, 0x14010f531\nxorps   xmm1, xmm1                                                     ; +0x147, 0x14010f537\nmovss   [rsp+98h+var_60], xmm1                                         ; +0x14a, 0x14010f53a\nmov     [rsp+98h+var_68], 0                                            ; +0x150, 0x14010f540\nmovss   xmm0, cs:dword_14062343C                                       ; +0x155, 0x14010f545\nmovss   [rsp+98h+var_70], xmm0                                         ; +0x15d, 0x14010f54d\nmov     [rsp+98h+var_78], rsi                                          ; +0x163, 0x14010f553\nlea     r9, aOk; \"OK\"                                                  ; +0x168, 0x14010f558\nmov     r8, rax                                                        ; +0x16f, 0x14010f55f\nlea     rdx, aMaxCoins_0; \"Max Coins\"                                  ; +0x172, 0x14010f562\nmov     rcx, rdi                                                       ; +0x179, 0x14010f569\ncall    FLAlertLayer__create                                           ; +0x17c, 0x14010f56c\nmov     rbx, rax                                                       ; +0x181, 0x14010f571\nlea     rcx, [rsp+98h+var_48]                                          ; +0x184, 0x14010f574\ncall    sub_14003A830                                                  ; +0x189, 0x14010f579\nmov     r8, [rbx]                                                      ; +0x18e, 0x14010f57e\nmov     edx, 7Ah ; 'z'                                                 ; +0x191, 0x14010f581\nmov     rcx, rbx                                                       ; +0x196, 0x14010f586\ncall    qword ptr [r8+40h]                                             ; +0x199, 0x14010f589\nmov     rdx, [rbx]                                                     ; +0x19d, 0x14010f58d\nmov     rcx, rbx                                                       ; +0x1a0, 0x14010f590\ncall    qword ptr [rdx+410h]                                           ; +0x1a3, 0x14010f593\njmp     short loc_14010F5CE                                            ; +0x1a9, 0x14010f599\ncmp     qword ptr [rbx+538h], 0                                        ; +0x1ab, 0x14010f59b\njnz     short loc_14010F5B6                                            ; +0x1b3, 0x14010f5a3\nmov     rcx, [rbx+340h]                                                ; +0x1b5, 0x14010f5a5\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x1bc, 0x14010f5ac\ntest    eax, eax                                                       ; +0x1c2, 0x14010f5b2\njz      short loc_14010F5C0                                            ; +0x1c4, 0x14010f5b4\nmov     dl, 1                                                          ; +0x1c6, 0x14010f5b6\nmov     rcx, rbx                                                       ; +0x1c8, 0x14010f5b8\ncall    EditorUI__createUndoSelectObject                               ; +0x1cb, 0x14010f5bb\nmov     edx, [rbx+4D8h]                                                ; +0x1d0, 0x14010f5c0\nmov     rcx, rbx                                                       ; +0x1d6, 0x14010f5c6\ncall    EditorUI__onCreateObject                                       ; +0x1d9, 0x14010f5c9\nmov     al, 1                                                          ; +0x1de, 0x14010f5ce\nlea     r11, [rsp+98h+var_8]                                           ; +0x1e0, 0x14010f5d0\nmov     rbx, [r11+20h]                                                 ; +0x1e8, 0x14010f5d8\nmov     rsi, [r11+28h]                                                 ; +0x1ec, 0x14010f5dc\nmov     rsp, r11                                                       ; +0x1f0, 0x14010f5e0\npop     rdi                                                            ; +0x1f3, 0x14010f5e3\nretn                                                                   ; +0x1f4, 0x14010f5e4", "xrefs": ["EditorUI::clickOnPosition @ 0x1400e2759", "<???> @ 0x1406c8e5c"], "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"}