{"type": "func", "start": 5370487904, "end": 5370488512, "name": "EditorUI::onCreate", "pseudocode": "// \n// EditorUI::onCreate from 0x1401b2460 to 0x1401b26c0 (608 bytes)\n// \n// 2 xrefs:\n// > EditorUI::clickOnPosition @ 0x1401ada8e\n// > <???> @ 0x140919fac\n// \n// This function is hookable on this platform (idp: pc, 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 11:27:56 +0000\n// \n\n// Hidden C++ exception states: #wind=1\nchar __fastcall EditorUI::onCreate(__int64 a1, __int64 a2)\n{\n  int v3; // r11d\n  __int64 v5; // r10\n  int v6; // eax\n  int v7; // eax\n  int v8; // eax\n  cocos2d::CCString *v9; // rax\n  int v10; // edi\n  const char *CString; // rax\n  size_t v12; // r8\n  __int64 v13; // rax\n  cocos2d::CCObject *v14; // rbx\n  __int64 Object; // rax\n  __int64 v16; // rcx\n  __int128 v17; // [rsp+50h] [rbp-48h] BYREF\n  __int64 v18; // [rsp+60h] [rbp-38h]\n  __int64 v19; // [rsp+68h] [rbp-30h]\n  _BYTE v20[32]; // [rsp+70h] [rbp-28h] BYREF\n\n  v3 = *(_DWORD *)(a1 + 1392);\n  if ( !v3 )\n    return 0;\n  v5 = *(_QWORD *)(a1 + 1512);\n  if ( !*(_DWORD *)(v5 + 15240) )\n    goto LABEL_10;\n  v6 = *(__int16 *)(v5 + 14866);\n  a2 = 9999;\n  if ( v6 < 9999 )\n    a2 = (unsigned int)v6;\n  if ( (int)a2 < 0 )\n    a2 = 0;\n  v7 = *(_DWORD *)(*(_QWORD *)(v5 + 15208) + 4 * ((unsigned __int64)(unsigned int)a2 >> 5));\n  if ( !_bittest(&v7, a2 & 0x1F) )\n  {\nLABEL_10:\n    v8 = *(_DWORD *)(v5 + 14928) - *(_DWORD *)(v5 + 14932);\n    if ( v8 < 80000 )\n    {\n      if ( v8 < 40000 )\n      {\nLABEL_18:\n        if ( v3 == 1329 && *(_DWORD *)(v5 + 14812) - *(_DWORD *)(v5 + 14816) >= 3 )\n        {\n          if ( !*(_BYTE *)(a1 + 680) )\n          {\n            *(_BYTE *)(a1 + 680) = 1;\n            v9 = cocos2d::CCString::createWithFormat(\"You cannot add more than <cy>3</c> <cg>coins</c> in a single level.\");\n            v10 = a1 + 408;\n            if ( !a1 )\n              v10 = 0;\n            CString = cocos2d::CCString::getCString(v9);\n            v17 = 0;\n            v18 = 0;\n            v19 = 0;\n            v12 = -1;\n            do\n              ++v12;\n            while ( CString[v12] );\n            sub_14003D230(&v17, CString, v12);\n            v13 = sub_14003F4F0((__int64)v20, (__int64)&v17);\n            v14 = FLAlertLayer::create(v10, (int)\"Max Coins\", v13, (__int64)\"OK\", 0, 1133903872, 0, 0, 1065353216);\n            sub_14003D310((__int64)&v17);\n            (*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v14 + 64LL))(v14, 122);\n            (*(void (__fastcall **)(cocos2d::CCObject *))(*(_QWORD *)v14 + 1064LL))(v14);\n          }\n          return 1;\n        }\nLABEL_26:\n        if ( *(_QWORD *)(a1 + 1568) || cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 944)) )\n        {\n          LOBYTE(a2) = 1;\n          EditorUI::createUndoSelectObject(a1, a2);\n        }\n        Object = EditorUI::onCreateObject(a1, *(unsigned int *)(a1 + 1392));\n        if ( Object )\n          EditorUI::playSoundForCreatedObject(v16, Object);\n        return 1;\n      }\n      if ( v3 == 31 )\n        goto LABEL_26;\n    }\n    else\n    {\n      if ( v3 == 31 )\n        goto LABEL_26;\n      if ( !*(_BYTE *)(*(_QWORD *)(v5 + 2168) + 1297LL) )\n      {\n        EditorUI::showMaxError(a1);\n        return 1;\n      }\n    }\n    if ( !*(_BYTE *)(*(_QWORD *)(v5 + 2168) + 1296LL) )\n    {\n      EditorUI::showMaxBasicError(a1);\n      return 1;\n    }\n    goto LABEL_18;\n  }\n  EditorUI::showLockedLayerAlert(a1);\n  return 1;\n}", "assembly": "; \n; EditorUI::onCreate from 0x1401b2460 to 0x1401b26c0 (608 bytes)\n; \n; 2 xrefs:\n; > EditorUI::clickOnPosition @ 0x1401ada8e\n; > <???> @ 0x140919fac\n; \n; This function is hookable on this platform (idp: pc, 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 11:27:56 +0000\n; \nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x1401b2460\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x1401b2465\npush    rdi                                                            ; +0xa, 0x1401b246a\nsub     rsp, 90h                                                       ; +0xb, 0x1401b246b\nmov     rbx, rcx                                                       ; +0x12, 0x1401b2472\nmov     r11d, [rcx+570h]                                               ; +0x15, 0x1401b2475\ntest    r11d, r11d                                                     ; +0x1c, 0x1401b247c\njnz     short loc_1401B2488                                            ; +0x1f, 0x1401b247f\nxor     al, al                                                         ; +0x21, 0x1401b2481\njmp     loc_1401B26AB                                                  ; +0x23, 0x1401b2483\nmov     r10, [rcx+5E8h]                                                ; +0x28, 0x1401b2488\nxor     esi, esi                                                       ; +0x2f, 0x1401b248f\ncmp     [r10+3B88h], esi                                               ; +0x31, 0x1401b2491\njz      short loc_1401B24DC                                            ; +0x38, 0x1401b2498\nmovsx   eax, word ptr [r10+3A12h]                                      ; +0x3a, 0x1401b249a\nmov     edx, 270Fh                                                     ; +0x42, 0x1401b24a2\ncmp     eax, edx                                                       ; +0x47, 0x1401b24a7\ncmovl   edx, eax                                                       ; +0x49, 0x1401b24a9\ntest    edx, edx                                                       ; +0x4c, 0x1401b24ac\ncmovs   edx, esi                                                       ; +0x4e, 0x1401b24ae\nmov     eax, edx                                                       ; +0x51, 0x1401b24b1\nmov     r9d, edx                                                       ; +0x53, 0x1401b24b3\nshr     r9, 5                                                          ; +0x56, 0x1401b24b6\nmov     r8, [r10+3B68h]                                                ; +0x5a, 0x1401b24ba\nand     al, 1Fh                                                        ; +0x61, 0x1401b24c1\nmovzx   ecx, al                                                        ; +0x63, 0x1401b24c3\nmov     eax, [r8+r9*4]                                                 ; +0x66, 0x1401b24c6\nbt      eax, ecx                                                       ; +0x6a, 0x1401b24ca\njnb     short loc_1401B24DC                                            ; +0x6d, 0x1401b24cd\nmov     rcx, rbx                                                       ; +0x6f, 0x1401b24cf\ncall    EditorUI__showLockedLayerAlert                                 ; +0x72, 0x1401b24d2\njmp     loc_1401B26A9                                                  ; +0x77, 0x1401b24d7\nmov     eax, [r10+3A50h]                                               ; +0x7c, 0x1401b24dc\nsub     eax, [r10+3A54h]                                               ; +0x83, 0x1401b24e3\ncmp     eax, 13880h                                                    ; +0x8a, 0x1401b24ea\njl      short loc_1401B2518                                            ; +0x8f, 0x1401b24ef\ncmp     r11d, 1Fh                                                      ; +0x91, 0x1401b24f1\njz      loc_1401B266A                                                  ; +0x95, 0x1401b24f5\nmov     rax, [r10+878h]                                                ; +0x9b, 0x1401b24fb\ncmp     [rax+511h], sil                                                ; +0xa2, 0x1401b2502\njnz     short loc_1401B2529                                            ; +0xa9, 0x1401b2509\nmov     rcx, rbx                                                       ; +0xab, 0x1401b250b\ncall    EditorUI__showMaxError                                         ; +0xae, 0x1401b250e\njmp     loc_1401B26A9                                                  ; +0xb3, 0x1401b2513\ncmp     eax, 9C40h                                                     ; +0xb8, 0x1401b2518\njl      short loc_1401B2546                                            ; +0xbd, 0x1401b251d\ncmp     r11d, 1Fh                                                      ; +0xbf, 0x1401b251f\njz      loc_1401B266A                                                  ; +0xc3, 0x1401b2523\nmov     rax, [r10+878h]                                                ; +0xc9, 0x1401b2529\ncmp     [rax+510h], sil                                                ; +0xd0, 0x1401b2530\njnz     short loc_1401B2546                                            ; +0xd7, 0x1401b2537\nmov     rcx, rbx                                                       ; +0xd9, 0x1401b2539\ncall    EditorUI__showMaxBasicError                                    ; +0xdc, 0x1401b253c\njmp     loc_1401B26A9                                                  ; +0xe1, 0x1401b2541\ncmp     r11d, 531h                                                     ; +0xe6, 0x1401b2546\njnz     loc_1401B266A                                                  ; +0xed, 0x1401b254d\nmov     eax, [r10+39DCh]                                               ; +0xf3, 0x1401b2553\nsub     eax, [r10+39E0h]                                               ; +0xfa, 0x1401b255a\ncmp     eax, 3                                                         ; +0x101, 0x1401b2561\njl      loc_1401B266A                                                  ; +0x104, 0x1401b2564\ncmp     [rbx+2A8h], sil                                                ; +0x10a, 0x1401b256a\njnz     loc_1401B26A9                                                  ; +0x111, 0x1401b2571\nmov     byte ptr [rbx+2A8h], 1                                         ; +0x117, 0x1401b2577\nlea     rcx, aYouCannotAddMo; \"You cannot add more than <cy>3</c> <cg>\"... ; +0x11e, 0x1401b257e\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x125, 0x1401b2585\nlea     rdi, [rbx+198h]                                                ; +0x12b, 0x1401b258b\ntest    rbx, rbx                                                       ; +0x132, 0x1401b2592\ncmovz   rdi, rsi                                                       ; +0x135, 0x1401b2595\nmov     rcx, rax                                                       ; +0x139, 0x1401b2599\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x13c, 0x1401b259c\nxorps   xmm0, xmm0                                                     ; +0x142, 0x1401b25a2\nmovups  [rsp+98h+var_48], xmm0                                         ; +0x145, 0x1401b25a5\nmov     [rsp+98h+var_38], rsi                                          ; +0x14a, 0x1401b25aa\nmov     [rsp+98h+var_30], rsi                                          ; +0x14f, 0x1401b25af\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x154, 0x1401b25b4\nnop     dword ptr [rax+rax+00h]                                        ; +0x15b, 0x1401b25bb\ninc     r8                                                             ; +0x160, 0x1401b25c0\ncmp     [rax+r8], sil                                                  ; +0x163, 0x1401b25c3\njnz     short loc_1401B25C0                                            ; +0x167, 0x1401b25c7\nmov     rdx, rax                                                       ; +0x169, 0x1401b25c9\nlea     rcx, [rsp+98h+var_48]                                          ; +0x16c, 0x1401b25cc\ncall    sub_14003D230                                                  ; +0x171, 0x1401b25d1\nlea     rax, [rsp+98h+var_48]                                          ; +0x176, 0x1401b25d6\nmov     [rsp+98h+arg_0], rax                                           ; +0x17b, 0x1401b25db\nlea     rdx, [rsp+98h+var_48]                                          ; +0x183, 0x1401b25e3\nlea     rcx, [rsp+98h+var_28]                                          ; +0x188, 0x1401b25e8\ncall    sub_14003F4F0                                                  ; +0x18d, 0x1401b25ed\nmovss   xmm0, cs:flt_140835080                                         ; +0x192, 0x1401b25f2\nmovss   [rsp+98h+var_58], xmm0                                         ; +0x19a, 0x1401b25fa\nxorps   xmm1, xmm1                                                     ; +0x1a0, 0x1401b2600\nmovss   [rsp+98h+var_60], xmm1                                         ; +0x1a3, 0x1401b2603\nmov     [rsp+98h+var_68], 0                                            ; +0x1a9, 0x1401b2609\nmovss   xmm0, cs:dword_1408359A4                                       ; +0x1ae, 0x1401b260e\nmovss   [rsp+98h+var_70], xmm0                                         ; +0x1b6, 0x1401b2616\nmov     [rsp+98h+var_78], rsi                                          ; +0x1bc, 0x1401b261c\nlea     r9, aOk; \"OK\"                                                  ; +0x1c1, 0x1401b2621\nmov     r8, rax                                                        ; +0x1c8, 0x1401b2628\nlea     rdx, aMaxCoins_0; \"Max Coins\"                                  ; +0x1cb, 0x1401b262b\nmov     rcx, rdi                                                       ; +0x1d2, 0x1401b2632\ncall    FLAlertLayer__create                                           ; +0x1d5, 0x1401b2635\nmov     rbx, rax                                                       ; +0x1da, 0x1401b263a\nlea     rcx, [rsp+98h+var_48]                                          ; +0x1dd, 0x1401b263d\ncall    sub_14003D310                                                  ; +0x1e2, 0x1401b2642\nmov     rcx, [rbx]                                                     ; +0x1e7, 0x1401b2647\nmov     r8, [rcx+40h]                                                  ; +0x1ea, 0x1401b264a\nmov     edx, 7Ah ; 'z'                                                 ; +0x1ee, 0x1401b264e\nmov     rcx, rbx                                                       ; +0x1f3, 0x1401b2653\ncall    r8                                                             ; +0x1f6, 0x1401b2656\nmov     rcx, [rbx]                                                     ; +0x1f9, 0x1401b2659\nmov     rdx, [rcx+428h]                                                ; +0x1fc, 0x1401b265c\nmov     rcx, rbx                                                       ; +0x203, 0x1401b2663\ncall    rdx                                                            ; +0x206, 0x1401b2666\njmp     short loc_1401B26A9                                            ; +0x208, 0x1401b2668\ncmp     [rbx+620h], rsi                                                ; +0x20a, 0x1401b266a\njnz     short loc_1401B2684                                            ; +0x211, 0x1401b2671\nmov     rcx, [rbx+3B0h]                                                ; +0x213, 0x1401b2673\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x21a, 0x1401b267a\ntest    eax, eax                                                       ; +0x220, 0x1401b2680\njz      short loc_1401B268E                                            ; +0x222, 0x1401b2682\nmov     dl, 1                                                          ; +0x224, 0x1401b2684\nmov     rcx, rbx                                                       ; +0x226, 0x1401b2686\ncall    EditorUI__createUndoSelectObject                               ; +0x229, 0x1401b2689\nmov     edx, [rbx+570h]                                                ; +0x22e, 0x1401b268e\nmov     rcx, rbx                                                       ; +0x234, 0x1401b2694\ncall    EditorUI__onCreateObject                                       ; +0x237, 0x1401b2697\ntest    rax, rax                                                       ; +0x23c, 0x1401b269c\njz      short loc_1401B26A9                                            ; +0x23f, 0x1401b269f\nmov     rdx, rax                                                       ; +0x241, 0x1401b26a1\ncall    EditorUI__playSoundForCreatedObject                            ; +0x244, 0x1401b26a4\nmov     al, 1                                                          ; +0x249, 0x1401b26a9\nlea     r11, [rsp+98h+var_8]                                           ; +0x24b, 0x1401b26ab\nmov     rbx, [r11+20h]                                                 ; +0x253, 0x1401b26b3\nmov     rsi, [r11+28h]                                                 ; +0x257, 0x1401b26b7\nmov     rsp, r11                                                       ; +0x25b, 0x1401b26bb\npop     rdi                                                            ; +0x25e, 0x1401b26be\nretn                                                                   ; +0x25f, 0x1401b26bf", "xrefs": ["EditorUI::clickOnPosition @ 0x1401ada8e", "<???> @ 0x140919fac"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "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"}