{"type": "func", "start": 6442475040, "end": 6442475298, "name": "cocos2d::extension::CCControlButton::initWithTitleAndFontNameAndFontSize", "pseudocode": "// \n// cocos2d::extension::CCControlButton::initWithTitleAndFontNameAndFontSize from 0x180005e20 to 0x180005f22 (258 bytes)\n// \n// 4 xrefs:\n// > <???> @ 0x180024188\n// > <???> @ 0x180027fd0\n// > <???> @ 0x18002fdf8\n// > <???> @ 0x180049564\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\n// Hidden C++ exception states: #wind=2\n__int64 __fastcall cocos2d::extension::CCControlButton::initWithTitleAndFontNameAndFontSize(\n        __int64 a1,\n        __int64 a2,\n        const char *a3,\n        float a4)\n{\n  const char *v6; // rcx\n  struct cocos2d::CCLabelTTF *v7; // rbp\n  __int64 v8; // rax\n  cocos2d::CCObject *v9; // rdi\n  unsigned __int8 v10; // di\n  unsigned __int64 v11; // rdx\n  _QWORD *v12; // rcx\n  cocos2d::extension::CCScale9Sprite *v14; // [rsp+20h] [rbp-48h]\n\n  v6 = (const char *)a2;\n  if ( *(_QWORD *)(a2 + 24) > 0xFu )\n    v6 = *(const char **)a2;\n  v7 = cocos2d::CCLabelTTF::create(v6, a3, a4);\n  v14 = (cocos2d::extension::CCScale9Sprite *)operator new(0x210u);\n  v8 = cocos2d::extension::CCScale9Sprite::CCScale9Sprite(v14);\n  v9 = (cocos2d::CCObject *)v8;\n  if ( v8 )\n  {\n    if ( (*(unsigned __int8 (__fastcall **)(__int64))(*(_QWORD *)v8 + 72LL))(v8) )\n    {\n      cocos2d::CCObject::autorelease(v9);\n      goto LABEL_8;\n    }\n    (*(void (__fastcall **)(cocos2d::CCObject *, __int64))(*(_QWORD *)v9 + 8LL))(v9, 1);\n  }\n  v9 = nullptr;\nLABEL_8:\n  v10 = (*(__int64 (__fastcall **)(__int64, struct cocos2d::CCLabelTTF *, cocos2d::CCObject *))(*(_QWORD *)a1 + 1168LL))(\n          a1,\n          v7,\n          v9);\n  v11 = *(_QWORD *)(a2 + 24);\n  if ( v11 > 0xF )\n  {\n    v12 = *(_QWORD **)a2;\n    if ( v11 + 1 >= 0x1000 )\n    {\n      if ( (unsigned __int64)v12 - *(v12 - 1) - 8 > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n      v12 = (_QWORD *)*(v12 - 1);\n    }\n    j_j_free(v12);\n  }\n  *(_QWORD *)(a2 + 16) = 0;\n  *(_QWORD *)(a2 + 24) = 15;\n  *(_BYTE *)a2 = 0;\n  return v10;\n}", "assembly": "; \n; cocos2d::extension::CCControlButton::initWithTitleAndFontNameAndFontSize from 0x180005e20 to 0x180005f22 (258 bytes)\n; \n; 4 xrefs:\n; > <???> @ 0x180024188\n; > <???> @ 0x180027fd0\n; > <???> @ 0x18002fdf8\n; > <???> @ 0x180049564\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    rbx                                                            ; +0x0, 0x180005e20\npush    rbp                                                            ; +0x2, 0x180005e22\npush    rsi                                                            ; +0x3, 0x180005e23\npush    rdi                                                            ; +0x4, 0x180005e24\nsub     rsp, 48h                                                       ; +0x5, 0x180005e25\nmov     rax, cs:__security_cookie                                      ; +0x9, 0x180005e29\nxor     rax, rsp                                                       ; +0x10, 0x180005e30\nmov     [rsp+68h+var_38], rax                                          ; +0x13, 0x180005e33\nmov     rbx, rdx                                                       ; +0x18, 0x180005e38\nmov     rsi, rcx                                                       ; +0x1b, 0x180005e3b\nmov     [rsp+68h+var_40], rdx                                          ; +0x1e, 0x180005e3e\nmov     rcx, rdx                                                       ; +0x23, 0x180005e43\ncmp     qword ptr [rdx+18h], 0Fh                                       ; +0x26, 0x180005e46\njbe     short loc_180005E50                                            ; +0x2b, 0x180005e4b\nmov     rcx, [rdx]                                                     ; +0x2d, 0x180005e4d\nmovaps  xmm2, xmm3                                                     ; +0x30, 0x180005e50\nmov     rdx, r8                                                        ; +0x33, 0x180005e53\ncall    cs:?create@CCLabelTTF@cocos2d@@SAPEAV12@PEBD0M@Z; cocos2d::CCLabelTTF::create(char const *,char const *,float) ; +0x36, 0x180005e56\nmov     rbp, rax                                                       ; +0x3c, 0x180005e5c\nmov     ecx, 210h; Size                                                ; +0x3f, 0x180005e5f\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x44, 0x180005e64\nmov     [rsp+68h+var_48], rax                                          ; +0x49, 0x180005e69\nmov     rcx, rax; this                                                 ; +0x4e, 0x180005e6e\ncall    ??0CCScale9Sprite@extension@cocos2d@@QEAA@XZ; cocos2d::extension::CCScale9Sprite::CCScale9Sprite(void) ; +0x51, 0x180005e71\nmov     rdi, rax                                                       ; +0x56, 0x180005e76\ntest    rax, rax                                                       ; +0x59, 0x180005e79\njz      short loc_180005EA1                                            ; +0x5c, 0x180005e7c\nmov     rax, [rax]                                                     ; +0x5e, 0x180005e7e\nmov     rcx, rdi                                                       ; +0x61, 0x180005e81\ncall    qword ptr [rax+48h]                                            ; +0x64, 0x180005e84\nmov     rcx, rdi                                                       ; +0x67, 0x180005e87\ntest    al, al                                                         ; +0x6a, 0x180005e8a\njz      short loc_180005E96                                            ; +0x6c, 0x180005e8c\ncall    cs:?autorelease@CCObject@cocos2d@@QEAAPEAV12@XZ; cocos2d::CCObject::autorelease(void) ; +0x6e, 0x180005e8e\njmp     short loc_180005EA3                                            ; +0x74, 0x180005e94\nmov     rax, [rdi]                                                     ; +0x76, 0x180005e96\nmov     edx, 1                                                         ; +0x79, 0x180005e99\ncall    qword ptr [rax+8]                                              ; +0x7e, 0x180005e9e\nxor     edi, edi                                                       ; +0x81, 0x180005ea1\nmov     rax, [rsi]                                                     ; +0x83, 0x180005ea3\nmov     r8, rdi                                                        ; +0x86, 0x180005ea6\nmov     rdx, rbp                                                       ; +0x89, 0x180005ea9\nmov     rcx, rsi                                                       ; +0x8c, 0x180005eac\ncall    qword ptr [rax+490h]                                           ; +0x8f, 0x180005eaf\nmovzx   edi, al                                                        ; +0x95, 0x180005eb5\nmov     rdx, [rbx+18h]                                                 ; +0x98, 0x180005eb8\ncmp     rdx, 0Fh                                                       ; +0x9c, 0x180005ebc\njbe     short loc_180005EEE                                            ; +0xa0, 0x180005ec0\ninc     rdx                                                            ; +0xa2, 0x180005ec2\nmov     rcx, [rbx]                                                     ; +0xa5, 0x180005ec5\ncmp     rdx, 1000h                                                     ; +0xa8, 0x180005ec8\njb      short loc_180005EE9                                            ; +0xaf, 0x180005ecf\nadd     rdx, 27h ; '''                                                 ; +0xb1, 0x180005ed1\nmov     r8, [rcx-8]                                                    ; +0xb5, 0x180005ed5\nsub     rcx, r8                                                        ; +0xb9, 0x180005ed9\nlea     rax, [rcx-8]                                                   ; +0xbc, 0x180005edc\ncmp     rax, 1Fh                                                       ; +0xc0, 0x180005ee0\nja      short loc_180005F1B                                            ; +0xc4, 0x180005ee4\nmov     rcx, r8; Block                                                 ; +0xc6, 0x180005ee6\ncall    j_j_free                                                       ; +0xc9, 0x180005ee9\nmov     qword ptr [rbx+10h], 0                                         ; +0xce, 0x180005eee\nmov     qword ptr [rbx+18h], 0Fh                                       ; +0xd6, 0x180005ef6\nmov     byte ptr [rbx], 0                                              ; +0xde, 0x180005efe\nmovzx   eax, dil                                                       ; +0xe1, 0x180005f01\nmov     rcx, [rsp+68h+var_38]                                          ; +0xe5, 0x180005f05\nxor     rcx, rsp; StackCookie                                          ; +0xea, 0x180005f0a\ncall    __security_check_cookie                                        ; +0xed, 0x180005f0d\nadd     rsp, 48h                                                       ; +0xf2, 0x180005f12\npop     rdi                                                            ; +0xf6, 0x180005f16\npop     rsi                                                            ; +0xf7, 0x180005f17\npop     rbp                                                            ; +0xf8, 0x180005f18\npop     rbx                                                            ; +0xf9, 0x180005f19\nretn                                                                   ; +0xfa, 0x180005f1a\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xfb, 0x180005f1b\ndb 0CCh                                                                ; +0x101, 0x180005f21", "xrefs": ["<???> @ 0x180024188", "<???> @ 0x180027fd0", "<???> @ 0x18002fdf8", "<???> @ 0x180049564"], "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"}