{"type": "func", "start": 6910640, "end": 6911240, "name": "EditorUI::menuItemFromObjectString", "pseudocode": "// \n// EditorUI::menuItemFromObjectString from 0x6972b0 to 0x697508 (600 bytes)\n// \n// 2 xrefs:\n// > EditorUI::createCustomItems @ 0x6975f8\n// > <???> @ 0x6d1d0\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\ncocos2d::CCObject *__fastcall EditorUI::menuItemFromObjectString(EditorUI *a1, __int64 a2, int a3)\n{\n  ButtonSprite *v5; // x19\n  char *v6; // x0\n  float width; // s8\n  float height; // s0\n  const cocos2d::CCSize *(__fastcall *getContentSize)(const cocos2d::CCNode *__hidden); // x1\n  float v10; // s0\n  cocos2d::CCNode *v11; // x25\n  void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // x26\n  __int64 v13; // x27\n  CreateMenuItem *v14; // x0\n  CreateMenuItem_vtbl *v15; // x1\n  cocos2d::CCObject *v16; // x19\n  cocos2d::CCArray *m_customObjectButtonArray; // x0\n  unsigned int *v19; // x2\n  int v20; // w1\n  cocos2d::CCPoint v21; // [xsp+68h] [xbp+68h] BYREF\n  _DWORD *v22; // [xsp+70h] [xbp+70h] BYREF\n  cocos2d::SEL_MenuHandler v23; // 0:x3.16\n\n  sub_D18D28(&v22, a2);\n  v5 = (ButtonSprite *)EditorUI::spriteFromObjectString(a1, (const void **)&v22, 1, 0, 100, nullptr, nullptr, 0);\n  v6 = (char *)(v22 - 6);\n  if ( v22 - 6 != (_DWORD *)&qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v19 = v22 - 2;\n      do\n        v20 = __ldaxr(v19);\n      while ( __stlxr(v20 - 1, v19) );\n    }\n    else\n    {\n      v20 = *(v22 - 2);\n      *(v22 - 2) = v20 - 1;\n    }\n    if ( v20 <= 0 )\n      operator delete(v6);\n  }\n  width = v5->getContentSize(v5)->width;\n  height = v5->getContentSize(v5)->height;\n  getContentSize = v5->getContentSize;\n  if ( width > height )\n    v10 = getContentSize(v5)->width;\n  else\n    v10 = getContentSize(v5)->height;\n  v5->setScale(v5, 40.0 / v10);\n  v11 = (cocos2d::CCNode *)ButtonSprite::create(\n                             v5,\n                             (cocos2d::CCSprite *)&qword_20,\n                             0,\n                             1,\n                             32.0,\n                             1.0,\n                             (cocos2d::CCSprite *)\"GJ_button_04.png\",\n                             nullptr);\n  setPosition = v5->setPosition;\n  v13 = (__int64)v5->getPosition(v5);\n  cocos2d::CCPoint::CCPoint(&v21, 0.0, -1.0);\n  cocos2d::CCPoint::operator+(&v22, v13, &v21);\n  setPosition(v5, (const cocos2d::CCPoint *)&v22);\n  v23.adj = 0;\n  v23.ptr = (void (__cdecl *)(cocos2d::CCObject *))EditorUI::onCreateButton;\n  v14 = CreateMenuItem::create(v11, nullptr, a1, v23);\n  v15 = v14->CCMenuItemSpriteExtra::cocos2d::CCMenuItemSprite::cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n  v14->m_objectID = a3;\n  v16 = v14;\n  ((void (__fastcall *)(float))v15->setScale)(0.9);\n  m_customObjectButtonArray = a1->m_customObjectButtonArray;\n  v16[7].m_nLuaID = 1063675494;\n  cocos2d::CCArray::addObject(m_customObjectButtonArray, v16);\n  return v16;\n}", "assembly": "; \n; EditorUI::menuItemFromObjectString from 0x6972b0 to 0x697508 (600 bytes)\n; \n; 2 xrefs:\n; > EditorUI::createCustomItems @ 0x6975f8\n; > <???> @ 0x6d1d0\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             X29, X30, [SP,#var_80]!                                ; +0x0, 0x6972b0\nMOV             X29, SP                                                ; +0x4, 0x6972b4\nSTP             X19, X20, [SP,#0x80+var_70]                            ; +0x8, 0x6972b8\nADRP            X20, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x6972bc\nSTR             X27, [SP,#0x80+var_30]                                 ; +0x10, 0x6972c0\nSTP             X23, X24, [SP,#0x80+var_50]                            ; +0x14, 0x6972c4\nMOV             W24, W2                                                ; +0x18, 0x6972c8\nLDR             X2, [X20,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1c, 0x6972cc\nSTP             X21, X22, [SP,#0x80+var_60]                            ; +0x20, 0x6972d0\nADD             X21, X29, #0x80+var_10                                 ; +0x24, 0x6972d4\nMOV             X22, X0                                                ; +0x28, 0x6972d8\nLDR             X2, [X2]                                               ; +0x2c, 0x6972dc\nMOV             X0, X21                                                ; +0x30, 0x6972e0\nSTR             X2, [X29,#0x80+var_8]                                  ; +0x34, 0x6972e4\nSTP             X25, X26, [SP,#0x80+var_40]                            ; +0x38, 0x6972e8\nSTR             D8, [SP,#0x80+var_28]                                  ; +0x3c, 0x6972ec\nBL              sub_D18D28                                             ; +0x40, 0x6972f0\nMOV             X0, X22                                                ; +0x44, 0x6972f4\nMOV             X1, X21                                                ; +0x48, 0x6972f8\nMOV             W2, #1                                                 ; +0x4c, 0x6972fc\nMOV             W3, #0                                                 ; +0x50, 0x697300\nMOV             W4, #0x64 ; 'd'                                        ; +0x54, 0x697304\nMOV             X5, #0                                                 ; +0x58, 0x697308\nMOV             X6, #0                                                 ; +0x5c, 0x69730c\nMOV             X7, #0                                                 ; +0x60, 0x697310\nBL              _ZN8EditorUI22spriteFromObjectStringESsbbiPN7cocos2d7CCArrayES2_P10GameObject; EditorUI::spriteFromObjectString(std::string,bool,bool,int,cocos2d::CCArray *,cocos2d::CCArray *,GameObject *) ; +0x64, 0x697314\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x68, 0x697318\nLDR             X2, [X29,#0x80+var_10]                                 ; +0x6c, 0x69731c\nMOV             X19, X0                                                ; +0x70, 0x697320\nSUB             X0, X2, #0x18; p                                       ; +0x74, 0x697324\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x78, 0x697328\nCMP             X0, X1                                                 ; +0x7c, 0x69732c\nB.NE            loc_697490                                             ; +0x80, 0x697330\nADD             X23, X29, #0x80+var_18                                 ; +0x84, 0x697334\nLDR             X1, [X19]                                              ; +0x88, 0x697338\nMOV             X0, X19                                                ; +0x8c, 0x69733c\nLDR             X1, [X1,#0x138]                                        ; +0x90, 0x697340\nBLR             X1                                                     ; +0x94, 0x697344\nLDR             X1, [X19]                                              ; +0x98, 0x697348\nLDR             S8, [X0]                                               ; +0x9c, 0x69734c\nMOV             X0, X19                                                ; +0xa0, 0x697350\nLDR             X1, [X1,#0x138]                                        ; +0xa4, 0x697354\nBLR             X1                                                     ; +0xa8, 0x697358\nLDR             S0, [X0,#4]                                            ; +0xac, 0x69735c\nLDR             X1, [X19]                                              ; +0xb0, 0x697360\nMOV             X0, X19                                                ; +0xb4, 0x697364\nFCMPE           S8, S0                                                 ; +0xb8, 0x697368\nLDR             X1, [X1,#0x138]                                        ; +0xbc, 0x69736c\nB.GT            loc_697484                                             ; +0xc0, 0x697370\nBLR             X1                                                     ; +0xc4, 0x697374\nLDR             S0, [X0,#4]                                            ; +0xc8, 0x697378\nLDR             S1, =0x42200000                                        ; +0xcc, 0x69737c\nLDR             X1, [X19]                                              ; +0xd0, 0x697380\nMOV             X0, X19                                                ; +0xd4, 0x697384\nFDIV            S0, S1, S0                                             ; +0xd8, 0x697388\nLDR             X1, [X1,#0xA0]                                         ; +0xdc, 0x69738c\nBLR             X1                                                     ; +0xe0, 0x697390\nLDR             S0, flt_69750C; float                                  ; +0xe4, 0x697394\nADRP            X4, #aGjButton04Png@PAGE; \"GJ_button_04.png\"           ; +0xe8, 0x697398\nMOV             W5, #0; char *                                         ; +0xec, 0x69739c\nMOV             W3, #1; int                                            ; +0xf0, 0x6973a0\nADD             X4, X4, #aGjButton04Png@PAGEOFF; \"GJ_button_04.png\"    ; +0xf4, 0x6973a4\nMOV             W2, #0; int                                            ; +0xf8, 0x6973a8\nFMOV            S1, #1.0; float                                        ; +0xfc, 0x6973ac\nMOV             W1, #qword_20; cocos2d::CCSprite *                     ; +0x100, 0x6973b0\nMOV             X0, X19; this                                          ; +0x104, 0x6973b4\nBL              _ZN12ButtonSprite6createEPN7cocos2d8CCSpriteEiiffbPKcb; ButtonSprite::create(cocos2d::CCSprite *,int,int,float,float,bool,char const*,bool) ; +0x108, 0x6973b8\nMOV             X25, X0                                                ; +0x10c, 0x6973bc\nLDR             X1, [X19]                                              ; +0x110, 0x6973c0\nMOV             X0, X19                                                ; +0x114, 0x6973c4\nLDR             X2, [X1,#0xC0]                                         ; +0x118, 0x6973c8\nLDR             X26, [X1,#0xB8]                                        ; +0x11c, 0x6973cc\nBLR             X2                                                     ; +0x120, 0x6973d0\nMOV             X27, X0                                                ; +0x124, 0x6973d4\nFMOV            S0, WZR; float                                         ; +0x128, 0x6973d8\nMOV             X0, X23; this                                          ; +0x12c, 0x6973dc\nFMOV            S1, #-1.0; float                                       ; +0x130, 0x6973e0\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x134, 0x6973e4\nMOV             X8, X21                                                ; +0x138, 0x6973e8\nMOV             X0, X27                                                ; +0x13c, 0x6973ec\nMOV             X1, X23                                                ; +0x140, 0x6973f0\nBL              _ZNK7cocos2d7CCPointplERKS0_; cocos2d::CCPoint::operator+(cocos2d::CCPoint const&) ; +0x144, 0x6973f4\nMOV             X0, X19                                                ; +0x148, 0x6973f8\nMOV             X1, X21                                                ; +0x14c, 0x6973fc\nBLR             X26                                                    ; +0x150, 0x697400\nADRP            X3, #_ZN8EditorUI14onCreateButtonEPN7cocos2d8CCObjectE_ptr@PAGE ; +0x154, 0x697404\nMOV             X2, X22                                                ; +0x158, 0x697408\nMOV             X4, #0                                                 ; +0x15c, 0x69740c\nMOV             X1, #0                                                 ; +0x160, 0x697410\nMOV             X0, X25                                                ; +0x164, 0x697414\nLDR             X3, [X3,#_ZN8EditorUI14onCreateButtonEPN7cocos2d8CCObjectE_ptr@PAGEOFF]; EditorUI::onCreateButton(cocos2d::CCObject *) ... ; +0x168, 0x697418\nBL              _ZN14CreateMenuItem6createEPN7cocos2d6CCNodeES2_PNS0_8CCObjectEMS3_FvS4_E; CreateMenuItem::create(cocos2d::CCNode *,cocos2d::CCNode *,cocos2d::CCObject *,void (cocos2d::CCObject::*)(cocos2d::CCObject *)) ; +0x16c, 0x69741c\nLDR             X1, [X0]                                               ; +0x170, 0x697420\nLDR             S8, =0x3F666666                                        ; +0x174, 0x697424\nSTR             W24, [X0,#0x1E0]                                       ; +0x178, 0x697428\nMOV             X19, X0                                                ; +0x17c, 0x69742c\nFMOV            S0, S8                                                 ; +0x180, 0x697430\nLDR             X1, [X1,#0xA0]                                         ; +0x184, 0x697434\nBLR             X1                                                     ; +0x188, 0x697438\nLDR             X0, [X22,#0x4E0]; this                                 ; +0x18c, 0x69743c\nMOV             X1, X19; cocos2d::CCObject *                           ; +0x190, 0x697440\nSTR             S8, [X19,#0x194]                                       ; +0x194, 0x697444\nBL              _ZN7cocos2d7CCArray9addObjectEPNS_8CCObjectE; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x198, 0x697448\nLDR             X20, [X20,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x19c, 0x69744c\nLDR             X2, [X29,#0x80+var_8]                                  ; +0x1a0, 0x697450\nMOV             X0, X19                                                ; +0x1a4, 0x697454\nLDR             X1, [X20]                                              ; +0x1a8, 0x697458\nCMP             X2, X1                                                 ; +0x1ac, 0x69745c\nB.NE            loc_6974D8                                             ; +0x1b0, 0x697460\nLDP             X19, X20, [SP,#0x80+var_70]                            ; +0x1b4, 0x697464\nLDP             X21, X22, [SP,#0x80+var_60]                            ; +0x1b8, 0x697468\nLDP             X23, X24, [SP,#0x80+var_50]                            ; +0x1bc, 0x69746c\nLDP             X25, X26, [SP,#0x80+var_40]                            ; +0x1c0, 0x697470\nLDR             X27, [SP,#0x80+var_30]                                 ; +0x1c4, 0x697474\nLDR             D8, [SP,#0x80+var_28]                                  ; +0x1c8, 0x697478\nLDP             X29, X30, [SP+0x80+var_80],#0x80                       ; +0x1cc, 0x69747c\nRET                                                                    ; +0x1d0, 0x697480\nBLR             X1                                                     ; +0x1d4, 0x697484\nLDR             S0, [X0]                                               ; +0x1d8, 0x697488\nB               loc_69737C                                             ; +0x1dc, 0x69748c\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x1e0, 0x697490\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x1e4, 0x697494\nCBZ             X1, loc_6974C8                                         ; +0x1e8, 0x697498\nSUB             X2, X2, #8                                             ; +0x1ec, 0x69749c\nLDAXR           W1, [X2]                                               ; +0x1f0, 0x6974a0\nSUB             W3, W1, #1                                             ; +0x1f4, 0x6974a4\nSTLXR           W4, W3, [X2]                                           ; +0x1f8, 0x6974a8\nCBNZ            W4, loc_6974A0                                         ; +0x1fc, 0x6974ac\nCMP             W1, WZR                                                ; +0x200, 0x6974b0\nADD             X23, X29, #0x80+var_18                                 ; +0x204, 0x6974b4\nB.GT            loc_697338                                             ; +0x208, 0x6974b8\nMOV             X1, X23                                                ; +0x20c, 0x6974bc\nBL              j__ZdlPv; operator delete(void *)                      ; +0x210, 0x6974c0\nB               loc_697338                                             ; +0x214, 0x6974c4\nLDUR            W1, [X2,#-8]                                           ; +0x218, 0x6974c8\nSUB             W3, W1, #1                                             ; +0x21c, 0x6974cc\nSTUR            W3, [X2,#-8]                                           ; +0x220, 0x6974d0\nB               loc_6974B0                                             ; +0x224, 0x6974d4\nBL              .__stack_chk_fail                                      ; +0x228, 0x6974d8\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x22c, 0x6974dc\nMOV             X19, X0                                                ; +0x230, 0x6974e0\nLDR             X0, [X29,#0x80+var_10]                                 ; +0x234, 0x6974e4\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x238, 0x6974e8\nSUB             X0, X0, #0x18                                          ; +0x23c, 0x6974ec\nCMP             X0, X1                                                 ; +0x240, 0x6974f0\nB.EQ            loc_697500                                             ; +0x244, 0x6974f4\nADD             X1, X29, #0x80+var_18                                  ; +0x248, 0x6974f8\nBL              sub_6865FC                                             ; +0x24c, 0x6974fc\nMOV             X0, X19                                                ; +0x250, 0x697500\nBL              _Unwind_Resume                                         ; +0x254, 0x697504", "xrefs": ["EditorUI::createCustomItems @ 0x6975f8", "<???> @ 0x6d1d0"], "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"}