{"type": "func", "start": 4749256, "end": 4749466, "name": "EditorUI::onCreate", "pseudocode": "// \n// EditorUI::onCreate from 0x4877c8 to 0x48789a (210 bytes)\n// \n// 1 xrefs:\n// > EditorUI::clickOnPosition @ 0x48c77a\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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:49:26 +0000\n// \n\nint __fastcall EditorUI::onCreate(EditorUI *this)\n{\n  int result; // r0\n  unsigned int locked; // r1\n  _DWORD *v4; // r3\n  int v5; // r2\n  int v6; // r1\n  GameObject *Object; // r1\n\n  result = *((_DWORD *)this + 223);\n  if ( result )\n  {\n    locked = LevelEditorLayer::lockedLayerForObject(\n               *((LevelEditorLayer **)this + 236),\n               *(__int16 *)(*((_DWORD *)this + 236) + 11826),\n               0);\n    if ( locked != -1 )\n    {\n      EditorUI::showLockedLayerAlert(this, locked);\n      return 1;\n    }\n    v4 = *((_DWORD **)this + 236);\n    v5 = v4[2967] - v4[2968];\n    v6 = *((_DWORD *)this + 223);\n    if ( v5 <= 79999 )\n    {\n      if ( v5 <= 39999 || v6 == 31 )\n        goto LABEL_12;\n    }\n    else\n    {\n      if ( v6 == 31 )\n        goto LABEL_12;\n      if ( !*(_BYTE *)(v4[352] + 985) )\n      {\n        EditorUI::showMaxError((int)this);\n        return 1;\n      }\n    }\n    if ( !*(_BYTE *)(v4[352] + 984) )\n    {\n      EditorUI::showMaxBasicError((int)this);\n      return 1;\n    }\nLABEL_12:\n    if ( v6 == 1329 && v4[2947] - v4[2948] > 2 )\n    {\n      EditorUI::showMaxCoinError((int)this, (const char *)&stru_2E0C.st_value);\n    }\n    else\n    {\n      if ( *((_DWORD *)this + 249) || cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 167)) )\n        EditorUI::createUndoSelectObject((cocos2d::CCArray ***)this, 1);\n      Object = EditorUI::onCreateObject(this, *((char **)this + 223));\n      if ( Object )\n        EditorUI::playSoundForCreatedObject(this, Object);\n    }\n    return 1;\n  }\n  return result;\n}", "assembly": "; \n; EditorUI::onCreate from 0x4877c8 to 0x48789a (210 bytes)\n; \n; 1 xrefs:\n; > EditorUI::clickOnPosition @ 0x48c77a\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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:49:26 +0000\n; \nPUSH            {R4,LR}                                                ; +0x0, 0x4877c8\nMOV             R4, R0                                                 ; +0x2, 0x4877ca\nLDR.W           R0, [R0,#0x37C]                                        ; +0x4, 0x4877cc\nCMP             R0, #0                                                 ; +0x8, 0x4877d0\nBEQ             locret_487898                                          ; +0xa, 0x4877d2\nLDR.W           R0, [R4,#0x3B0]; this                                  ; +0xc, 0x4877d4\nMOVW            R3, #0x2E32                                            ; +0x10, 0x4877d8\nMOVS            R2, #0; int                                            ; +0x14, 0x4877dc\nLDRSH           R1, [R0,R3]; int                                       ; +0x16, 0x4877de\nBL              _ZN16LevelEditorLayer20lockedLayerForObjectEii; LevelEditorLayer::lockedLayerForObject(int,int) ; +0x18, 0x4877e0\nADDS            R3, R0, #1                                             ; +0x1c, 0x4877e4\nMOV             R1, R0; int                                            ; +0x1e, 0x4877e6\nBEQ             loc_4877F2                                             ; +0x20, 0x4877e8\nMOV             R0, R4; this                                           ; +0x22, 0x4877ea\nBL              _ZN8EditorUI20showLockedLayerAlertEi; EditorUI::showLockedLayerAlert(int) ; +0x24, 0x4877ec\nB               loc_487864                                             ; +0x28, 0x4877f0\nLDR.W           R3, [R4,#0x3B0]                                        ; +0x2a, 0x4877f2\nMOVW            R2, #0x2E5C                                            ; +0x2e, 0x4877f6\nMOVW            R1, #0x2E60                                            ; +0x32, 0x4877fa\nLDR             R1, [R3,R1]                                            ; +0x36, 0x4877fe\nLDR             R2, [R3,R2]                                            ; +0x38, 0x487800\nSUBS            R2, R2, R1                                             ; +0x3a, 0x487802\nLDR             R1, =0x1387F                                           ; +0x3c, 0x487804\nCMP             R2, R1                                                 ; +0x3e, 0x487806\nLDR.W           R1, [R4,#0x37C]                                        ; +0x40, 0x487808\nBLE             loc_48781E                                             ; +0x44, 0x48780c\nCMP             R1, #0x1F                                              ; +0x46, 0x48780e\nBEQ             loc_487844                                             ; +0x48, 0x487810\nLDR.W           R2, [R3,#0x580]                                        ; +0x4a, 0x487812\nLDRB.W          R2, [R2,#0x3D9]                                        ; +0x4e, 0x487816\nCBNZ            R2, loc_48782A                                         ; +0x52, 0x48781a\nB               loc_48783C                                             ; +0x54, 0x48781c\nMOVW            R0, #0x9C3F                                            ; +0x56, 0x48781e\nCMP             R2, R0                                                 ; +0x5a, 0x487822\nBLE             loc_487844                                             ; +0x5c, 0x487824\nCMP             R1, #0x1F                                              ; +0x5e, 0x487826\nBEQ             loc_487844                                             ; +0x60, 0x487828\nLDR.W           R2, [R3,#0x580]                                        ; +0x62, 0x48782a\nLDRB.W          R2, [R2,#0x3D8]                                        ; +0x66, 0x48782e\nCBNZ            R2, loc_487844                                         ; +0x6a, 0x487832\nMOV             R0, R4; this                                           ; +0x6c, 0x487834\nBL              _ZN8EditorUI17showMaxBasicErrorEv; EditorUI::showMaxBasicError(void) ; +0x6e, 0x487836\nB               loc_487864                                             ; +0x72, 0x48783a\nMOV             R0, R4; this                                           ; +0x74, 0x48783c\nBL              _ZN8EditorUI12showMaxErrorEv; EditorUI::showMaxError(void) ; +0x76, 0x48783e\nB               loc_487864                                             ; +0x7a, 0x487842\nMOVW            R2, #0x531                                             ; +0x7c, 0x487844\nCMP             R1, R2                                                 ; +0x80, 0x487848\nBNE             loc_487868                                             ; +0x82, 0x48784a\nMOVW            R2, #0x2E0C                                            ; +0x84, 0x48784c\nMOVW            R1, #0x2E10                                            ; +0x88, 0x487850\nLDR             R2, [R3,R2]                                            ; +0x8c, 0x487854\nLDR             R3, [R3,R1]                                            ; +0x8e, 0x487856\nSUBS            R3, R2, R3                                             ; +0x90, 0x487858\nCMP             R3, #2                                                 ; +0x92, 0x48785a\nBLE             loc_487868                                             ; +0x94, 0x48785c\nMOV             R0, R4; this                                           ; +0x96, 0x48785e\nBL              _ZN8EditorUI16showMaxCoinErrorEv; EditorUI::showMaxCoinError(void) ; +0x98, 0x487860\nMOVS            R0, #1                                                 ; +0x9c, 0x487864\nPOP             {R4,PC}                                                ; +0x9e, 0x487866\nLDR.W           R3, [R4,#0x3E4]                                        ; +0xa0, 0x487868\nCBNZ            R3, loc_487878                                         ; +0xa4, 0x48786c\nLDR.W           R0, [R4,#0x29C]; this                                  ; +0xa6, 0x48786e\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0xaa, 0x487872\nCBZ             R0, loc_487880                                         ; +0xae, 0x487876\nMOV             R0, R4; this                                           ; +0xb0, 0x487878\nMOVS            R1, #1; bool                                           ; +0xb2, 0x48787a\nBL              _ZN8EditorUI22createUndoSelectObjectEb; EditorUI::createUndoSelectObject(bool) ; +0xb4, 0x48787c\nLDR.W           R1, [R4,#0x37C]; int                                   ; +0xb8, 0x487880\nMOV             R0, R4; this                                           ; +0xbc, 0x487884\nBL              _ZN8EditorUI14onCreateObjectEi; EditorUI::onCreateObject(int) ; +0xbe, 0x487886\nMOV             R1, R0; GameObject *                                   ; +0xc2, 0x48788a\nCMP             R0, #0                                                 ; +0xc4, 0x48788c\nBEQ             loc_487864                                             ; +0xc6, 0x48788e\nMOV             R0, R4; this                                           ; +0xc8, 0x487890\nBL              _ZN8EditorUI25playSoundForCreatedObjectEP10GameObject; EditorUI::playSoundForCreatedObject(GameObject *) ; +0xca, 0x487892\nB               loc_487864                                             ; +0xce, 0x487896\nPOP             {R4,PC}                                                ; +0xd0, 0x487898", "xrefs": ["EditorUI::clickOnPosition @ 0x48c77a"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "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"}