{"type": "func", "start": 3695152, "end": 3695354, "name": "EditorUI::getCreateMenuItemButton", "pseudocode": "// \n// EditorUI::getCreateMenuItemButton from 0x386230 to 0x3862fa (202 bytes)\n// \n// 4 xrefs:\n// > EditorUI::createCustomItems @ 0x388148\n// > EditorUI::createCustomItems @ 0x388186\n// > EditorUI::createCustomItems @ 0x3881c2\n// > EditorUI::createCustomItems @ 0x388200\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\nCreateMenuItem *EditorUI::getCreateMenuItemButton(\n        EditorUI *a1,\n        cocos2d::CCSprite *a2,\n        cocos2d::SEL_MenuHandler a3,\n        cocos2d::CCMenu *a4,\n        float a5,\n        int a6,\n        cocos2d::CCPoint a7)\n{\n  ButtonSprite *v8; // r10\n  CreateMenuItem *v9; // r4\n  cocos2d::CCPoint v10; // r1\n  cocos2d::CCPoint v12; // [sp+1Ch] [bp-Ch] BYREF\n  cocos2d::SEL_MenuHandler v13; // 0:^10.8\n\n  v13.adj = a3.adj;\n  switch ( a6 )\n  {\n    case 2:\n      a3.adj = (size_t)\"GJ_button_02.png\";\n      break;\n    case 3:\n      a3.adj = (size_t)\"GJ_button_03.png\";\n      break;\n    case 4:\n      a3.adj = (size_t)\"GJ_button_04.png\";\n      break;\n    case 5:\n      a3.adj = (size_t)\"GJ_button_05.png\";\n      break;\n    case 6:\n      a3.adj = (size_t)\"GJ_button_06.png\";\n      break;\n    default:\n      a3.adj = (size_t)\"GJ_button_01.png\";\n      break;\n  }\n  v8 = ButtonSprite::create(\n         (ButtonSprite *)a2,\n         (cocos2d::CCSprite *)&dword_20,\n         0,\n         32.0,\n         1.0,\n         (_BOOL4)&dword_0 + 1,\n         (char *)a3.adj,\n         (const char *)&dword_0 + 1,\n         (bool)a3.ptr);\n  v9 = CreateMenuItem::create(v8, nullptr, a1, v13);\n  ((void (__fastcall *)(CreateMenuItem *, _DWORD))v9->setScale)(v9, LODWORD(a5));\n  v9->m_baseScale = a5;\n  if ( a4 )\n    a4->addChild(a4, v9);\n  cocos2d::CCPoint::CCPoint(&v12, (const cocos2d::CCPoint *)LODWORD(a7.x));\n  LODWORD(v10.x) = &v12;\n  ButtonSprite::updateSpriteOffset(v8, v10);\n  return v9;\n}", "assembly": "; \n; EditorUI::getCreateMenuItemButton from 0x386230 to 0x3862fa (202 bytes)\n; \n; 4 xrefs:\n; > EditorUI::createCustomItems @ 0x388148\n; > EditorUI::createCustomItems @ 0x388186\n; > EditorUI::createCustomItems @ 0x3881c2\n; > EditorUI::createCustomItems @ 0x388200\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-R10,LR}                                            ; +0x0, 0x386230\nSUB             SP, SP, #0x28                                          ; +0x4, 0x386234\nADD             R4, SP, #0x28+var_18                                   ; +0x6, 0x386236\nMOV             R9, R0                                                 ; +0x8, 0x386238\nLDR.W           R8, [SP,#0x28+arg_0]                                   ; +0xa, 0x38623a\nSTM.W           R4, {R2,R3}                                            ; +0xe, 0x38623e\nLDR             R2, =(__stack_chk_guard_ptr - 0x38624A)                ; +0x12, 0x386242\nLDR             R4, [SP,#0x28+arg_8]                                   ; +0x14, 0x386244\nADD             R2, PC; __stack_chk_guard_ptr                          ; +0x16, 0x386246\nLDR             R2, [R2]; __stack_chk_guard                            ; +0x18, 0x386248\nLDR             R6, [SP,#0x28+arg_4]                                   ; +0x1a, 0x38624a\nLDR             R7, [SP,#0x28+arg_C]                                   ; +0x1c, 0x38624c\nLDR             R3, [R2]                                               ; +0x1e, 0x38624e\nMOV             R5, R2                                                 ; +0x20, 0x386250\nSTR             R3, [SP,#0x28+var_4]                                   ; +0x22, 0x386252\nSUBS            R3, R4, #2; switch 5 cases                             ; +0x24, 0x386254\nCMP             R3, #4                                                 ; +0x26, 0x386256\nBHI             def_38625A; jumptable 0038625A default case            ; +0x28, 0x386258\nTBB.W           [PC,R3]; switch jump                                   ; +0x2a, 0x38625a\nDCB 0x12; jump table for switch statement                              ; +0x2e, 0x38625e\nDCB 3                                                                  ; +0x2f, 0x38625f\nDCB 6                                                                  ; +0x30, 0x386260\nDCB 9                                                                  ; +0x31, 0x386261\nDCB 0xC                                                                ; +0x32, 0x386262\nALIGN 2                                                                ; +0x33, 0x386263\nLDR             R3, =(aGjButton03Png - 0x38626A); jumptable 0038625A case 3 ; +0x34, 0x386264\nADD             R3, PC; \"GJ_button_03.png\"                             ; +0x36, 0x386266\nB               loc_386286                                             ; +0x38, 0x386268\nLDR             R3, =(aGjButton04Png - 0x386270); jumptable 0038625A case 4 ; +0x3a, 0x38626a\nADD             R3, PC; \"GJ_button_04.png\"                             ; +0x3c, 0x38626c\nB               loc_386286                                             ; +0x3e, 0x38626e\nLDR             R3, =(aGjButton05Png - 0x386276); jumptable 0038625A case 5 ; +0x40, 0x386270\nADD             R3, PC; \"GJ_button_05.png\"                             ; +0x42, 0x386272\nB               loc_386286                                             ; +0x44, 0x386274\nLDR             R3, =(aGjButton06Png - 0x38627C); jumptable 0038625A case 6 ; +0x46, 0x386276\nADD             R3, PC; \"GJ_button_06.png\"                             ; +0x48, 0x386278\nB               loc_386286                                             ; +0x4a, 0x38627a\nLDR             R3, =(aGjButton01Png - 0x386282); jumptable 0038625A default case ; +0x4c, 0x38627c\nADD             R3, PC; \"GJ_button_01.png\"                             ; +0x4e, 0x38627e\nB               loc_386286                                             ; +0x50, 0x386280\nLDR             R3, =(aGjButton02Png - 0x386288); jumptable 0038625A case 2 ; +0x52, 0x386282\nADD             R3, PC; \"GJ_button_02.png\"                             ; +0x54, 0x386284\nMOV.W           R2, #0x3F800000                                        ; +0x56, 0x386286\nSTR             R3, [SP,#0x28+var_20]; char *                          ; +0x5a, 0x38628a\nSTR             R2, [SP,#0x28+var_28]; float                           ; +0x5c, 0x38628c\nMOV             R0, R1; this                                           ; +0x5e, 0x38628e\nMOVS            R2, #(dword_0+1)                                       ; +0x60, 0x386290\nMOVS            R1, #dword_20; cocos2d::CCSprite *                     ; +0x62, 0x386292\nSTR             R2, [SP,#0x28+var_24]; float                           ; +0x64, 0x386294\nMOV.W           R3, #0x42000000; int                                   ; +0x66, 0x386296\nSTR             R2, [SP,#0x28+var_1C]; char *                          ; +0x6a, 0x38629a\nMOVS            R2, #0; int                                            ; +0x6c, 0x38629c\nBL              _ZN12ButtonSprite6createEPN7cocos2d8CCSpriteEiiffbPKcb; ButtonSprite::create(cocos2d::CCSprite *,int,int,float,float,bool,char const*,bool) ; +0x6e, 0x38629e\nLDR             R3, [SP,#0x28+var_14]                                  ; +0x72, 0x3862a2\nMOVS            R1, #0                                                 ; +0x74, 0x3862a4\nMOV             R2, R9                                                 ; +0x76, 0x3862a6\nSTR             R3, [SP,#0x28+var_28]                                  ; +0x78, 0x3862a8\nLDR             R3, [SP,#0x28+var_18]                                  ; +0x7a, 0x3862aa\nMOV             R10, R0                                                ; +0x7c, 0x3862ac\nBL              _ZN14CreateMenuItem6createEPN7cocos2d6CCNodeES2_PNS0_8CCObjectEMS3_FvS4_E; CreateMenuItem::create(cocos2d::CCNode *,cocos2d::CCNode *,cocos2d::CCObject *,void (cocos2d::CCObject::*)(cocos2d::CCObject *)) ; +0x7e, 0x3862ae\nMOV             R1, R6                                                 ; +0x82, 0x3862b2\nLDR             R3, [R0]                                               ; +0x84, 0x3862b4\nMOV             R4, R0                                                 ; +0x86, 0x3862b6\nLDR             R3, [R3,#0x50]                                         ; +0x88, 0x3862b8\nBLX             R3                                                     ; +0x8a, 0x3862ba\nSTR.W           R6, [R4,#0x13C]                                        ; +0x8c, 0x3862bc\nCMP.W           R8, #0                                                 ; +0x90, 0x3862c0\nBEQ             loc_3862D4                                             ; +0x94, 0x3862c4\nLDR.W           R3, [R8]                                               ; +0x96, 0x3862c6\nMOV             R0, R8                                                 ; +0x9a, 0x3862ca\nMOV             R1, R4                                                 ; +0x9c, 0x3862cc\nLDR.W           R3, [R3,#0xDC]                                         ; +0x9e, 0x3862ce\nBLX             R3                                                     ; +0xa2, 0x3862d2\nADD             R6, SP, #0x28+var_C                                    ; +0xa4, 0x3862d4\nMOV             R1, R7; cocos2d::CCPoint *                             ; +0xa6, 0x3862d6\nMOV             R0, R6; this                                           ; +0xa8, 0x3862d8\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0xaa, 0x3862da\nMOV             R0, R10                                                ; +0xae, 0x3862de\nMOV             R1, R6                                                 ; +0xb0, 0x3862e0\nBL              _ZN12ButtonSprite18updateSpriteOffsetEN7cocos2d7CCPointE; ButtonSprite::updateSpriteOffset(cocos2d::CCPoint) ; +0xb2, 0x3862e2\nLDR             R2, [SP,#0x28+var_4]                                   ; +0xb6, 0x3862e6\nLDR             R3, [R5]                                               ; +0xb8, 0x3862e8\nMOV             R0, R4                                                 ; +0xba, 0x3862ea\nCMP             R2, R3                                                 ; +0xbc, 0x3862ec\nBEQ             loc_3862F4                                             ; +0xbe, 0x3862ee\nBLX             __stack_chk_fail                                       ; +0xc0, 0x3862f0\nADD             SP, SP, #0x28 ; '('                                    ; +0xc4, 0x3862f4\nPOP.W           {R4-R10,PC}                                            ; +0xc6, 0x3862f6", "xrefs": ["EditorUI::createCustomItems @ 0x388148", "EditorUI::createCustomItems @ 0x388186", "EditorUI::createCustomItems @ 0x3881c2", "EditorUI::createCustomItems @ 0x388200"], "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"}