{"type": "func", "start": 3029528, "end": 3029868, "name": "ButtonSprite::init", "pseudocode": "// \n// ButtonSprite::init from 0x2e3a18 to 0x2e3b6c (340 bytes)\n// \n// 1 xrefs:\n// > ButtonSprite::create @ 0x2e3bba\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\nbool ButtonSprite::init(\n        ButtonSprite *a1,\n        const char *a2,\n        int a3,\n        int a4,\n        float a5,\n        bool a6,\n        const char *a7,\n        const char *a8,\n        float a9)\n{\n  _BOOL4 v13; // r7\n  cocos2d::CCLabelBMFont *v14; // r0\n  ButtonSprite_vtbl *v15; // r3\n  cocos2d::extension::CCScale9Sprite *v16; // r0\n  cocos2d::extension::CCScale9Sprite_vtbl *v17; // r3\n  cocos2d::extension::CCScale9Sprite *v18; // r6\n  void (__fastcall *setContentSize)(cocos2d::extension::CCScale9Sprite *__hidden, const cocos2d::CCSize *); // r8\n  float v21; // r2\n  float v22; // r3\n  int v23; // [sp+Ch] [bp-30h]\n  cocos2d::CCPoint v24; // [sp+1Ch] [bp-20h] BYREF\n  cocos2d::CCRect v25; // [sp+24h] [bp-18h] BYREF\n  cocos2d::CCSize v26; // 0:^0.8\n  cocos2d::CCRect v27; // 0:kr00_16.16\n\n  v13 = cocos2d::CCSprite::init(a1);\n  if ( v13 )\n  {\n    a1->m_mode = 1;\n    a1->m_scale = a5;\n    a1->m_absolute = a6;\n    a1->m_width = (float)a3;\n    a1->m_height = a9;\n    a1->m_minWidth = (float)a4;\n    cocos2d::CCPoint::CCPoint(&v25.origin, 0.0, 2.0);\n    cocos2d::CCPoint::operator=(&a1->m_textOffset, &v25);\n    sub_776584((int)&v24, (char *)a7);\n    sub_776584((int)&v25, \"bigFont.fnt\");\n    v23 = sub_774DBC(&v24, &v25);\n    sub_774008(&v25);\n    sub_774008(&v24);\n    if ( !v23 )\n    {\n      cocos2d::CCPoint::CCPoint(&v24, 0.0, 2.0);\n      cocos2d::CCPoint::CCPoint(&v25.origin, -1.0, v24.y);\n      cocos2d::CCPoint::operator=(&a1->m_textOffset, &v25);\n    }\n    v14 = cocos2d::CCLabelBMFont::create();\n    v15 = a1->cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n    a1->m_label = v14;\n    v15->addChild_0(a1, v14, 1);\n    cocos2d::CCRect::CCRect(&v25, 0.0, 0.0, 40.0, 40.0);\n    v27.origin.x = v21;\n    v27.origin.y = v22;\n    v27.size = v26;\n    v16 = (cocos2d::extension::CCScale9Sprite *)cocos2d::extension::CCScale9Sprite::create(\n                                                  (cocos2d::extension::CCScale9Sprite *)a8,\n                                                  (const char *)&v25,\n                                                  v27);\n    v17 = v16->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n    v18 = v16;\n    a1->m_BGSprite = v16;\n    setContentSize = v17->setContentSize;\n    cocos2d::CCSize::CCSize((cocos2d::CCSize *)&v25, 16.0, 16.0);\n    setContentSize(v18, (const cocos2d::CCSize *)&v25);\n    a1->addChild_0(a1, a1->m_BGSprite, 0);\n    ButtonSprite::setString(a1, a2);\n  }\n  return v13;\n}", "assembly": "; \n; ButtonSprite::init from 0x2e3a18 to 0x2e3b6c (340 bytes)\n; \n; 1 xrefs:\n; > ButtonSprite::create @ 0x2e3bba\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, 0x2e3a18\nMOV             R4, R0                                                 ; +0x4, 0x2e3a1c\nVPUSH           {D8}                                                   ; +0x6, 0x2e3a1e\nMOV             R10, R1                                                ; +0xa, 0x2e3a22\nLDR             R5, =(__stack_chk_guard_ptr - 0x2E3A2E)                ; +0xc, 0x2e3a24\nVMOV            S16, R3                                                ; +0xe, 0x2e3a26\nADD             R5, PC; __stack_chk_guard_ptr                          ; +0x12, 0x2e3a2a\nLDR             R5, [R5]; __stack_chk_guard                            ; +0x14, 0x2e3a2c\nSUB             SP, SP, #0x3C                                          ; +0x16, 0x2e3a2e\nVMOV            S17, R2                                                ; +0x18, 0x2e3a30\nMOV             R11, R5                                                ; +0x1c, 0x2e3a34\nLDR             R3, [SP,#0x3C+arg_C]                                   ; +0x1e, 0x2e3a36\nLDR.W           R8, [SP,#0x3C+arg_8]                                   ; +0x20, 0x2e3a38\nSTR             R3, [SP,#0x3C+var_34]                                  ; +0x24, 0x2e3a3c\nLDR             R3, [R5]                                               ; +0x26, 0x2e3a3e\nSTR             R3, [SP,#0x3C+var_8]                                   ; +0x28, 0x2e3a40\nBL              _ZN7cocos2d8CCSprite4initEv; cocos2d::CCSprite::init(void) ; +0x2a, 0x2e3a42\nMOV             R7, R0                                                 ; +0x2e, 0x2e3a46\nCMP             R0, #0                                                 ; +0x30, 0x2e3a48\nBEQ             loc_2E3B48                                             ; +0x32, 0x2e3a4a\nMOVS            R3, #1                                                 ; +0x34, 0x2e3a4c\nSTR.W           R3, [R4,#0x1FC]                                        ; +0x36, 0x2e3a4e\nLDR             R3, [SP,#0x3C+arg_0]                                   ; +0x3a, 0x2e3a52\nVCVT.F32.S32    S17, S17                                               ; +0x3c, 0x2e3a54\nADD             R5, SP, #0x3C+var_18                                   ; +0x40, 0x2e3a58\nADD.W           R9, R4, #0x224                                         ; +0x42, 0x2e3a5a\nMOV.W           R2, #0x40000000; float                                 ; +0x46, 0x2e3a5e\nMOVS            R1, #0; float                                          ; +0x4a, 0x2e3a62\nSTR.W           R3, [R4,#0x208]                                        ; +0x4c, 0x2e3a64\nMOV             R0, R5; this                                           ; +0x50, 0x2e3a68\nLDRB.W          R3, [SP,#0x3C+arg_4]                                   ; +0x52, 0x2e3a6a\nADD             R6, SP, #0x3C+var_20                                   ; +0x56, 0x2e3a6e\nVCVT.F32.S32    S16, S16                                               ; +0x58, 0x2e3a70\nSTRB.W          R3, [R4,#0x210]                                        ; +0x5c, 0x2e3a74\nLDR             R3, [SP,#0x3C+arg_10]                                  ; +0x60, 0x2e3a78\nVSTR            S17, [R4,#0x200]                                       ; +0x62, 0x2e3a7a\nSTR.W           R3, [R4,#0x20C]                                        ; +0x66, 0x2e3a7e\nVSTR            S16, [R4,#0x204]                                       ; +0x6a, 0x2e3a82\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x6e, 0x2e3a86\nMOV             R1, R5                                                 ; +0x72, 0x2e3a8a\nMOV             R0, R9                                                 ; +0x74, 0x2e3a8c\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0x76, 0x2e3a8e\nMOV             R1, R8; char *                                         ; +0x7a, 0x2e3a92\nADD             R2, SP, #0x3C+var_28                                   ; +0x7c, 0x2e3a94\nMOV             R0, R6; int                                            ; +0x7e, 0x2e3a96\nBL              sub_776584                                             ; +0x80, 0x2e3a98\nLDR             R1, =(aBigfontFnt - 0x2E3AA6); \"bigFont.fnt\"           ; +0x84, 0x2e3a9c\nMOV             R0, R5; int                                            ; +0x86, 0x2e3a9e\nADD             R2, SP, #0x3C+var_24                                   ; +0x88, 0x2e3aa0\nADD             R1, PC; \"bigFont.fnt\"                                  ; +0x8a, 0x2e3aa2\nBL              sub_776584                                             ; +0x8c, 0x2e3aa4\nMOV             R1, R5                                                 ; +0x90, 0x2e3aa8\nMOV             R0, R6                                                 ; +0x92, 0x2e3aaa\nBL              sub_774DBC                                             ; +0x94, 0x2e3aac\nSTR             R0, [SP,#0x3C+var_30]                                  ; +0x98, 0x2e3ab0\nMOV             R0, R5                                                 ; +0x9a, 0x2e3ab2\nBL              sub_774008                                             ; +0x9c, 0x2e3ab4\nMOV             R0, R6                                                 ; +0xa0, 0x2e3ab8\nBL              sub_774008                                             ; +0xa2, 0x2e3aba\nLDR             R3, [SP,#0x3C+var_30]                                  ; +0xa6, 0x2e3abe\nCBNZ            R3, loc_2E3AE0                                         ; +0xa8, 0x2e3ac0\nMOVS            R1, #0; float                                          ; +0xaa, 0x2e3ac2\nMOV.W           R2, #0x40000000; float                                 ; +0xac, 0x2e3ac4\nMOV             R0, R6; this                                           ; +0xb0, 0x2e3ac8\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0xb2, 0x2e3aca\nLDR             R1, flt_2E3B6C; float                                  ; +0xb6, 0x2e3ace\nMOV             R0, R5; this                                           ; +0xb8, 0x2e3ad0\nLDR             R2, [SP,#0x3C+var_1C]; float                           ; +0xba, 0x2e3ad2\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0xbc, 0x2e3ad4\nMOV             R0, R9                                                 ; +0xc0, 0x2e3ad8\nMOV             R1, R5                                                 ; +0xc2, 0x2e3ada\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0xc4, 0x2e3adc\nLDR             R0, =(unk_939830 - 0x2E3AE8)                           ; +0xc8, 0x2e3ae0\nMOV             R1, R8; char *                                         ; +0xca, 0x2e3ae2\nADD             R0, PC; unk_939830 ; this                              ; +0xcc, 0x2e3ae4\nBL              _ZN7cocos2d13CCLabelBMFont6createEPKcS2_; cocos2d::CCLabelBMFont::create(char const*,char const*) ; +0xce, 0x2e3ae6\nLDR             R3, [R4]                                               ; +0xd2, 0x2e3aea\nMOVS            R2, #1                                                 ; +0xd4, 0x2e3aec\nMOV             R1, R0                                                 ; +0xd6, 0x2e3aee\nSTR.W           R0, [R4,#0x214]                                        ; +0xd8, 0x2e3af0\nMOV             R0, R4                                                 ; +0xdc, 0x2e3af4\nLDR.W           R3, [R3,#0xE0]                                         ; +0xde, 0x2e3af6\nBLX             R3                                                     ; +0xe2, 0x2e3afa\nLDR             R3, flt_2E3B70; float                                  ; +0xe4, 0x2e3afc\nMOVS            R1, #0; float                                          ; +0xe6, 0x2e3afe\nMOV             R0, R5; this                                           ; +0xe8, 0x2e3b00\nMOV             R2, R1; float                                          ; +0xea, 0x2e3b02\nSTR             R3, [SP,#0x3C+var_3C]; float                           ; +0xec, 0x2e3b04\nBL              _ZN7cocos2d6CCRectC1Effff; cocos2d::CCRect::CCRect(float,float,float,float) ; +0xee, 0x2e3b06\nMOV             R1, R5                                                 ; +0xf2, 0x2e3b0a\nLDR             R0, [SP,#0x3C+var_34]                                  ; +0xf4, 0x2e3b0c\nBL              _ZN7cocos2d9extension14CCScale9Sprite6createEPKcNS_6CCRectE; cocos2d::extension::CCScale9Sprite::create(char const*,cocos2d::CCRect) ; +0xf6, 0x2e3b0e\nMOV.W           R1, #0x41800000; float                                 ; +0xfa, 0x2e3b12\nMOV             R2, R1; float                                          ; +0xfe, 0x2e3b16\nLDR             R3, [R0]                                               ; +0x100, 0x2e3b18\nMOV             R6, R0                                                 ; +0x102, 0x2e3b1a\nSTR.W           R0, [R4,#0x220]                                        ; +0x104, 0x2e3b1c\nMOV             R0, R5; this                                           ; +0x108, 0x2e3b20\nLDR.W           R8, [R3,#0x98]                                         ; +0x10a, 0x2e3b22\nBL              _ZN7cocos2d6CCSizeC1Eff; cocos2d::CCSize::CCSize(float,float) ; +0x10e, 0x2e3b26\nMOV             R0, R6                                                 ; +0x112, 0x2e3b2a\nMOV             R1, R5                                                 ; +0x114, 0x2e3b2c\nBLX             R8                                                     ; +0x116, 0x2e3b2e\nLDR             R3, [R4]                                               ; +0x118, 0x2e3b30\nMOV             R0, R4                                                 ; +0x11a, 0x2e3b32\nLDR.W           R1, [R4,#0x220]                                        ; +0x11c, 0x2e3b34\nMOVS            R2, #0                                                 ; +0x120, 0x2e3b38\nLDR.W           R3, [R3,#0xE0]                                         ; +0x122, 0x2e3b3a\nBLX             R3                                                     ; +0x126, 0x2e3b3e\nMOV             R0, R4; this                                           ; +0x128, 0x2e3b40\nMOV             R1, R10; char *                                        ; +0x12a, 0x2e3b42\nBL              _ZN12ButtonSprite9setStringEPKc; ButtonSprite::setString(char const*) ; +0x12c, 0x2e3b44\nLDR             R2, [SP,#0x3C+var_8]                                   ; +0x130, 0x2e3b48\nMOV             R0, R7                                                 ; +0x132, 0x2e3b4a\nLDR.W           R3, [R11]                                              ; +0x134, 0x2e3b4c\nCMP             R2, R3                                                 ; +0x138, 0x2e3b50\nBEQ             loc_2E3B62                                             ; +0x13a, 0x2e3b52\nBLX             __stack_chk_fail                                       ; +0x13c, 0x2e3b54\nMOV             R0, R6                                                 ; +0x140, 0x2e3b58\nBL              sub_774008                                             ; +0x142, 0x2e3b5a\nBL              __cxa_end_cleanup                                      ; +0x146, 0x2e3b5e\nADD             SP, SP, #0x3C ; '<'                                    ; +0x14a, 0x2e3b62\nVPOP            {D8}                                                   ; +0x14c, 0x2e3b64\nPOP.W           {R4-R11,PC}                                            ; +0x150, 0x2e3b68", "xrefs": ["ButtonSprite::create @ 0x2e3bba"], "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"}