{"type": "func", "start": 6442478048, "end": 6442478291, "name": "cocos2d::extension::CCControlButton::setTitleBMFontForState", "pseudocode": "// \n// cocos2d::extension::CCControlButton::setTitleBMFontForState from 0x1800069e0 to 0x180006ad3 (243 bytes)\n// \n// 4 xrefs:\n// > <???> @ 0x1800241e8\n// > <???> @ 0x180028030\n// > <???> @ 0x18002fdf8\n// > <???> @ 0x1800496a8\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\nvoid __fastcall cocos2d::extension::CCControlButton::setTitleBMFontForState(\n        cocos2d::extension::CCControlButton *this,\n        const char *a2,\n        unsigned int a3)\n{\n  cocos2d::CCString *v6; // rdi\n  void *v7; // rcx\n  __int64 v8; // rbx\n  const char *CString; // rax\n  struct cocos2d::CCLabelBMFont *v10; // rax\n  void *Block[2]; // [rsp+20h] [rbp-58h] BYREF\n  __int64 v12; // [rsp+30h] [rbp-48h]\n  unsigned __int64 v13; // [rsp+38h] [rbp-40h]\n\n  v6 = (cocos2d::CCString *)(*(__int64 (__fastcall **)(cocos2d::extension::CCControlButton *, _QWORD))(*(_QWORD *)this + 1192LL))(\n                              this,\n                              a3);\n  if ( !v6 )\n  {\n    *(_OWORD *)Block = 0;\n    v12 = 0;\n    v13 = 15;\n    LOBYTE(Block[0]) = 0;\n    v6 = (cocos2d::CCString *)cocos2d::CCString::create(Block);\n    if ( v13 > 0xF )\n    {\n      v7 = Block[0];\n      if ( v13 + 1 >= 0x1000 )\n      {\n        v7 = *((void **)Block[0] - 1);\n        if ( (unsigned __int64)((char *)Block[0] - (char *)v7 - 8) > 0x1F )\n          invalid_parameter_noinfo_noreturn();\n      }\n      j_j_free(v7);\n    }\n    v12 = 0;\n    v13 = 15;\n    LOBYTE(Block[0]) = 0;\n  }\n  v8 = *(_QWORD *)this;\n  CString = cocos2d::CCString::getCString(v6);\n  v10 = cocos2d::CCLabelBMFont::create(CString, a2);\n  (*(void (__fastcall **)(cocos2d::extension::CCControlButton *, struct cocos2d::CCLabelBMFont *, _QWORD))(v8 + 1232))(\n    this,\n    v10,\n    a3);\n}", "assembly": "; \n; cocos2d::extension::CCControlButton::setTitleBMFontForState from 0x1800069e0 to 0x180006ad3 (243 bytes)\n; \n; 4 xrefs:\n; > <???> @ 0x1800241e8\n; > <???> @ 0x180028030\n; > <???> @ 0x18002fdf8\n; > <???> @ 0x1800496a8\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, 0x1800069e0\npush    rbp                                                            ; +0x2, 0x1800069e2\npush    rsi                                                            ; +0x3, 0x1800069e3\npush    rdi                                                            ; +0x4, 0x1800069e4\npush    r14                                                            ; +0x5, 0x1800069e5\nsub     rsp, 50h                                                       ; +0x7, 0x1800069e7\nmov     rax, cs:__security_cookie                                      ; +0xb, 0x1800069eb\nxor     rax, rsp                                                       ; +0x12, 0x1800069f2\nmov     [rsp+78h+var_38], rax                                          ; +0x15, 0x1800069f5\nmov     ebp, r8d                                                       ; +0x1a, 0x1800069fa\nmov     r14, rdx                                                       ; +0x1d, 0x1800069fd\nmov     rsi, rcx                                                       ; +0x20, 0x180006a00\nmov     rax, [rcx]                                                     ; +0x23, 0x180006a03\nmov     edx, r8d                                                       ; +0x26, 0x180006a06\ncall    qword ptr [rax+4A8h]                                           ; +0x29, 0x180006a09\nmov     rdi, rax                                                       ; +0x2f, 0x180006a0f\ntest    rax, rax                                                       ; +0x32, 0x180006a12\njnz     short loc_180006A94                                            ; +0x35, 0x180006a15\nxorps   xmm0, xmm0                                                     ; +0x37, 0x180006a17\nmovups  xmmword ptr [rsp+78h+Block], xmm0                              ; +0x3a, 0x180006a1a\nxor     ebx, ebx                                                       ; +0x3f, 0x180006a1f\nmov     [rsp+78h+var_48], rbx                                          ; +0x41, 0x180006a21\nmov     [rsp+78h+var_40], 0Fh                                          ; +0x46, 0x180006a26\nmov     byte ptr [rsp+78h+Block], bl                                   ; +0x4f, 0x180006a2f\nlea     rcx, [rsp+78h+Block]                                           ; +0x53, 0x180006a33\ncall    cs:?create@CCString@cocos2d@@SAPEAV12@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCString::create(std::string const &) ; +0x58, 0x180006a38\nmov     rdi, rax                                                       ; +0x5e, 0x180006a3e\nmov     rdx, [rsp+78h+var_40]                                          ; +0x61, 0x180006a41\ncmp     rdx, 0Fh                                                       ; +0x66, 0x180006a46\njbe     short loc_180006A81                                            ; +0x6a, 0x180006a4a\ninc     rdx                                                            ; +0x6c, 0x180006a4c\nmov     rcx, [rsp+78h+Block]; Block                                    ; +0x6f, 0x180006a4f\nmov     rax, rcx                                                       ; +0x74, 0x180006a54\ncmp     rdx, 1000h                                                     ; +0x77, 0x180006a57\njb      short loc_180006A7C                                            ; +0x7e, 0x180006a5e\nadd     rdx, 27h ; '''                                                 ; +0x80, 0x180006a60\nmov     rcx, [rcx-8]                                                   ; +0x84, 0x180006a64\nsub     rax, rcx                                                       ; +0x88, 0x180006a68\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x8b, 0x180006a6b\ncmp     rax, 1Fh                                                       ; +0x8f, 0x180006a6f\njbe     short loc_180006A7C                                            ; +0x93, 0x180006a73\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x95, 0x180006a75\nalign 4                                                                ; +0x9b, 0x180006a7b\ncall    j_j_free                                                       ; +0x9c, 0x180006a7c\nmov     [rsp+78h+var_48], rbx                                          ; +0xa1, 0x180006a81\nmov     [rsp+78h+var_40], 0Fh                                          ; +0xa6, 0x180006a86\nmov     byte ptr [rsp+78h+Block], 0                                    ; +0xaf, 0x180006a8f\nmov     rbx, [rsi]                                                     ; +0xb4, 0x180006a94\nmov     rcx, rdi                                                       ; +0xb7, 0x180006a97\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0xba, 0x180006a9a\nmov     rcx, rax                                                       ; +0xc0, 0x180006aa0\nmov     rdx, r14                                                       ; +0xc3, 0x180006aa3\ncall    cs:?create@CCLabelBMFont@cocos2d@@SAPEAV12@PEBD0@Z; cocos2d::CCLabelBMFont::create(char const *,char const *) ; +0xc6, 0x180006aa6\nmov     rdx, rax                                                       ; +0xcc, 0x180006aac\nmov     r8d, ebp                                                       ; +0xcf, 0x180006aaf\nmov     rcx, rsi                                                       ; +0xd2, 0x180006ab2\ncall    qword ptr [rbx+4D0h]                                           ; +0xd5, 0x180006ab5\nmov     rcx, [rsp+78h+var_38]                                          ; +0xdb, 0x180006abb\nxor     rcx, rsp; StackCookie                                          ; +0xe0, 0x180006ac0\ncall    __security_check_cookie                                        ; +0xe3, 0x180006ac3\nadd     rsp, 50h                                                       ; +0xe8, 0x180006ac8\npop     r14                                                            ; +0xec, 0x180006acc\npop     rdi                                                            ; +0xee, 0x180006ace\npop     rsi                                                            ; +0xef, 0x180006acf\npop     rbp                                                            ; +0xf0, 0x180006ad0\npop     rbx                                                            ; +0xf1, 0x180006ad1\nretn                                                                   ; +0xf2, 0x180006ad2", "xrefs": ["<???> @ 0x1800241e8", "<???> @ 0x180028030", "<???> @ 0x18002fdf8", "<???> @ 0x1800496a8"], "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"}