{"type": "func", "start": 3702548, "end": 3702860, "name": "EditorUI::menuItemFromObjectString", "pseudocode": "// \n// EditorUI::menuItemFromObjectString from 0x387f14 to 0x38804c (312 bytes)\n// \n// 1 xrefs:\n// > EditorUI::createCustomItems @ 0x3880d6\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, int a2, bool a3)\n{\n  ButtonSprite *v4; // r4\n  float width; // s16\n  int v6; // r0\n  const cocos2d::CCSize *(__fastcall *getContentSize)(const cocos2d::CCNode *__hidden); // r3\n  float height; // s15\n  ButtonSprite *v9; // r0\n  cocos2d::CCNode *v10; // r11\n  int v11; // r9\n  CreateMenuItem *v12; // r0\n  cocos2d::CCObject *v13; // r4\n  cocos2d::CCArray *m_customObjectButtonArray; // r0\n  bool v17[4]; // [sp+10h] [bp-24h]\n  void (__fastcall *setPosition)(cocos2d::CCSprite *__hidden, const cocos2d::CCPoint *); // [sp+14h] [bp-20h]\n  cocos2d::CCPoint v19; // [sp+1Ch] [bp-18h] BYREF\n  _DWORD v20[2]; // [sp+24h] [bp-10h] BYREF\n  cocos2d::SEL_MenuHandler v21; // 0:r3.4,4:^0.4\n\n  sub_775C20(v20, a2);\n  v4 = (ButtonSprite *)EditorUI::spriteFromObjectString(a1, v20, COERCE_FLOAT(1), 0, 100, 0, nullptr, 0);\n  sub_774008(v20);\n  width = v4->getContentSize(v4)->width;\n  v6 = (int)v4->getContentSize(v4);\n  getContentSize = v4->getContentSize;\n  if ( width <= *(float *)(v6 + 4) )\n    height = getContentSize(v4)->height;\n  else\n    height = getContentSize(v4)->width;\n  ((void (__fastcall *)(ButtonSprite *, _DWORD))v4->setScale)(v4, 40.0 / height);\n  v9 = ButtonSprite::create(v4, (cocos2d::CCSprite *)&dword_20, 0, 32.0, 1.0, 1, \"GJ_button_04.png\", nullptr, a3);\n  setPosition = v4->setPosition;\n  v10 = v9;\n  v11 = (int)v4->getPosition(v4);\n  cocos2d::CCPoint::CCPoint(&v19, 0.0, -1.0);\n  cocos2d::CCPoint::operator+(v20, v11, &v19);\n  setPosition(v4, (const cocos2d::CCPoint *)v20);\n  v21.ptr = (void (__cdecl *)(cocos2d::CCObject *))EditorUI::onCreateButton;\n  v21.adj = 0;\n  v20[0] = EditorUI::onCreateButton;\n  v20[1] = 0;\n  v12 = CreateMenuItem::create(v10, nullptr, a1, v21);\n  v12->m_objectID = *(_DWORD *)v17;\n  v13 = v12;\n  ((void (__fastcall *)(CreateMenuItem *, int))v12->setScale)(v12, 1063675494);\n  m_customObjectButtonArray = a1->m_customObjectButtonArray;\n  v13[6].m_uID = 1063675494;\n  cocos2d::CCArray::addObject(m_customObjectButtonArray, v13);\n  return v13;\n}", "assembly": "; \n; EditorUI::menuItemFromObjectString from 0x387f14 to 0x38804c (312 bytes)\n; \n; 1 xrefs:\n; > EditorUI::createCustomItems @ 0x3880d6\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.W          {R4-R11,LR}                                            ; +0x0, 0x387f14\nMOV             R8, R0                                                 ; +0x4, 0x387f18\nVPUSH           {D8}                                                   ; +0x6, 0x387f1a\nLDR             R6, =(__stack_chk_guard_ptr - 0x387F24)                ; +0xa, 0x387f1e\nADD             R6, PC; __stack_chk_guard_ptr                          ; +0xc, 0x387f20\nLDR             R6, [R6]; __stack_chk_guard                            ; +0xe, 0x387f22\nSUB             SP, SP, #0x34                                          ; +0x10, 0x387f24\nLDR             R3, [R6]                                               ; +0x12, 0x387f26\nADD             R5, SP, #0x34+var_10                                   ; +0x14, 0x387f28\nSTR             R2, [SP,#0x34+var_24]; bool                            ; +0x16, 0x387f2a\nMOV             R0, R5                                                 ; +0x18, 0x387f2c\nSTR             R3, [SP,#0x34+var_8]                                   ; +0x1a, 0x387f2e\nBL              sub_775C20                                             ; +0x1c, 0x387f30\nMOVS            R3, #0x64 ; 'd'                                        ; +0x20, 0x387f34\nMOV             R0, R8                                                 ; +0x22, 0x387f36\nSTR             R3, [SP,#0x34+var_34]                                  ; +0x24, 0x387f38\nMOV             R1, R5                                                 ; +0x26, 0x387f3a\nMOVS            R3, #0                                                 ; +0x28, 0x387f3c\nMOVS            R2, #1                                                 ; +0x2a, 0x387f3e\nSTR             R3, [SP,#0x34+var_30]                                  ; +0x2c, 0x387f40\nSTR             R3, [SP,#0x34+var_2C]                                  ; +0x2e, 0x387f42\nSTR             R3, [SP,#0x34+var_28]                                  ; +0x30, 0x387f44\nBL              _ZN8EditorUI22spriteFromObjectStringESsbbiPN7cocos2d7CCArrayES2_P10GameObject; EditorUI::spriteFromObjectString(std::string,bool,bool,int,cocos2d::CCArray *,cocos2d::CCArray *,GameObject *) ; +0x32, 0x387f46\nMOV             R4, R0                                                 ; +0x36, 0x387f4a\nMOV             R0, R5                                                 ; +0x38, 0x387f4c\nBL              sub_774008                                             ; +0x3a, 0x387f4e\nLDR             R3, [R4]                                               ; +0x3e, 0x387f52\nMOV             R0, R4                                                 ; +0x40, 0x387f54\nLDR.W           R3, [R3,#0x9C]                                         ; +0x42, 0x387f56\nBLX             R3                                                     ; +0x46, 0x387f5a\nLDR             R3, [R4]                                               ; +0x48, 0x387f5c\nLDR.W           R3, [R3,#0x9C]                                         ; +0x4a, 0x387f5e\nVLDR            S16, [R0]                                              ; +0x4e, 0x387f62\nMOV             R0, R4                                                 ; +0x52, 0x387f66\nBLX             R3                                                     ; +0x54, 0x387f68\nLDR             R3, [R4]                                               ; +0x56, 0x387f6a\nLDR.W           R3, [R3,#0x9C]                                         ; +0x58, 0x387f6c\nVLDR            S15, [R0,#4]                                           ; +0x5c, 0x387f70\nMOV             R0, R4                                                 ; +0x60, 0x387f74\nVCMPE.F32       S16, S15                                               ; +0x62, 0x387f76\nVMRS            APSR_nzcv, FPSCR                                       ; +0x66, 0x387f7a\nBLE             loc_387F88                                             ; +0x6a, 0x387f7e\nBLX             R3                                                     ; +0x6c, 0x387f80\nVLDR            S15, [R0]                                              ; +0x6e, 0x387f82\nB               loc_387F8E                                             ; +0x72, 0x387f86\nBLX             R3                                                     ; +0x74, 0x387f88\nVLDR            S15, [R0,#4]                                           ; +0x76, 0x387f8a\nLDR             R3, [R4]                                               ; +0x7a, 0x387f8e\nMOV             R0, R4                                                 ; +0x7c, 0x387f90\nMOVS            R7, #0                                                 ; +0x7e, 0x387f92\nADD.W           R10, SP, #0x34+var_18                                  ; +0x80, 0x387f94\nVLDR            S14, =40.0                                             ; +0x84, 0x387f98\nLDR             R3, [R3,#0x50]                                         ; +0x88, 0x387f9c\nVDIV.F32        S15, S14, S15                                          ; +0x8a, 0x387f9e\nVMOV            R1, S15                                                ; +0x8e, 0x387fa2\nBLX             R3                                                     ; +0x92, 0x387fa6\nMOV.W           R3, #0x3F800000                                        ; +0x94, 0x387fa8\nSTR             R3, [SP,#0x34+var_34]; float                           ; +0x98, 0x387fac\nMOVS            R3, #1                                                 ; +0x9a, 0x387fae\nSTR             R3, [SP,#0x34+var_30]; float                           ; +0x9c, 0x387fb0\nMOVS            R1, #dword_20; cocos2d::CCSprite *                     ; +0x9e, 0x387fb2\nLDR             R3, =(aGjButton04Png - 0x387FC0); \"GJ_button_04.png\"   ; +0xa0, 0x387fb4\nMOV             R0, R4; this                                           ; +0xa2, 0x387fb6\nMOV             R2, R7; int                                            ; +0xa4, 0x387fb8\nSTR             R7, [SP,#0x34+var_28]; char *                          ; +0xa6, 0x387fba\nADD             R3, PC; \"GJ_button_04.png\"                             ; +0xa8, 0x387fbc\nSTR             R3, [SP,#0x34+var_2C]; char *                          ; +0xaa, 0x387fbe\nMOV.W           R3, #0x42000000; int                                   ; +0xac, 0x387fc0\nBL              _ZN12ButtonSprite6createEPN7cocos2d8CCSpriteEiiffbPKcb; ButtonSprite::create(cocos2d::CCSprite *,int,int,float,float,bool,char const*,bool) ; +0xb0, 0x387fc4\nLDR             R2, [R4]                                               ; +0xb4, 0x387fc8\nLDR             R3, [R2,#0x5C]                                         ; +0xb6, 0x387fca\nLDR             R2, [R2,#0x60]                                         ; +0xb8, 0x387fcc\nSTR             R3, [SP,#0x34+var_20]                                  ; +0xba, 0x387fce\nMOV             R11, R0                                                ; +0xbc, 0x387fd0\nMOV             R0, R4                                                 ; +0xbe, 0x387fd2\nBLX             R2                                                     ; +0xc0, 0x387fd4\nMOVS            R1, #0; float                                          ; +0xc2, 0x387fd6\nLDR             R2, flt_388050; float                                  ; +0xc4, 0x387fd8\nMOV             R9, R0                                                 ; +0xc6, 0x387fda\nMOV             R0, R10; this                                          ; +0xc8, 0x387fdc\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0xca, 0x387fde\nMOV             R0, R5                                                 ; +0xce, 0x387fe2\nMOV             R2, R10                                                ; +0xd0, 0x387fe4\nMOV             R1, R9                                                 ; +0xd2, 0x387fe6\nBL              _ZNK7cocos2d7CCPointplERKS0_; cocos2d::CCPoint::operator+(cocos2d::CCPoint const&) ; +0xd4, 0x387fe8\nMOV             R0, R4                                                 ; +0xd8, 0x387fec\nMOV             R1, R5                                                 ; +0xda, 0x387fee\nLDR             R3, [SP,#0x34+var_20]                                  ; +0xdc, 0x387ff0\nBLX             R3                                                     ; +0xde, 0x387ff2\nLDR             R3, =(_ZN8EditorUI14onCreateButtonEPN7cocos2d8CCObjectE_ptr - 0x387FFE) ; +0xe0, 0x387ff4\nMOV             R2, R8                                                 ; +0xe2, 0x387ff6\nMOV             R1, R7                                                 ; +0xe4, 0x387ff8\nADD             R3, PC; _ZN8EditorUI14onCreateButtonEPN7cocos2d8CCObjectE_ptr ; +0xe6, 0x387ffa\nLDR             R3, [R3]; EditorUI::onCreateButton(cocos2d::CCObject *) ; +0xe8, 0x387ffc\nSTR             R7, [SP,#0x34+var_34]                                  ; +0xea, 0x387ffe\nMOV             R0, R11                                                ; +0xec, 0x388000\nSTR             R3, [SP,#0x34+var_10]                                  ; +0xee, 0x388002\nSTR             R7, [SP,#0x34+var_C]                                   ; +0xf0, 0x388004\nBL              _ZN14CreateMenuItem6createEPN7cocos2d6CCNodeES2_PNS0_8CCObjectEMS3_FvS4_E; CreateMenuItem::create(cocos2d::CCNode *,cocos2d::CCNode *,cocos2d::CCObject *,void (cocos2d::CCObject::*)(cocos2d::CCObject *)) ; +0xf2, 0x388006\nLDR             R3, [SP,#0x34+var_24]                                  ; +0xf6, 0x38800a\nLDR             R5, =0x3F666666                                        ; +0xf8, 0x38800c\nMOV             R1, R5                                                 ; +0xfa, 0x38800e\nSTR.W           R3, [R0,#0x178]                                        ; +0xfc, 0x388010\nMOV             R4, R0                                                 ; +0x100, 0x388014\nLDR             R3, [R0]                                               ; +0x102, 0x388016\nLDR             R3, [R3,#0x50]                                         ; +0x104, 0x388018\nBLX             R3                                                     ; +0x106, 0x38801a\nLDR.W           R0, [R8,#0x334]; this                                  ; +0x108, 0x38801c\nSTR.W           R5, [R4,#0x13C]                                        ; +0x10c, 0x388020\nMOV             R1, R4; cocos2d::CCObject *                            ; +0x110, 0x388024\nBL              _ZN7cocos2d7CCArray9addObjectEPNS_8CCObjectE; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x112, 0x388026\nLDR             R2, [SP,#0x34+var_8]                                   ; +0x116, 0x38802a\nLDR             R3, [R6]                                               ; +0x118, 0x38802c\nMOV             R0, R4                                                 ; +0x11a, 0x38802e\nCMP             R2, R3                                                 ; +0x11c, 0x388030\nBEQ             loc_388042                                             ; +0x11e, 0x388032\nBLX             __stack_chk_fail                                       ; +0x120, 0x388034\nMOV             R0, R5                                                 ; +0x124, 0x388038\nBL              sub_774008                                             ; +0x126, 0x38803a\nBL              __cxa_end_cleanup                                      ; +0x12a, 0x38803e\nADD             SP, SP, #0x34 ; '4'                                    ; +0x12e, 0x388042\nVPOP            {D8}                                                   ; +0x130, 0x388044\nPOP.W           {R4-R11,PC}                                            ; +0x134, 0x388048", "xrefs": ["EditorUI::createCustomItems @ 0x3880d6"], "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"}