{"type": "func", "start": 6443076384, "end": 6443076721, "name": "cocos2d::cc_utf8_to_utf16", "pseudocode": "// \n// cocos2d::cc_utf8_to_utf16 from 0x180098b20 to 0x180098c71 (337 bytes)\n// \n// 3 xrefs:\n// > cocos2d::CCLabelBMFont::setString @ 0x18004e568\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801c0a68\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:22:10 +0000\n// \n\n// Hidden C++ exception states: #wind=1\nunsigned __int16 *__fastcall cocos2d::cc_utf8_to_utf16(cocos2d *this, char *a2, int *a3)\n{\n  _WORD *v5; // rbp\n  __int64 v6; // rdi\n  _WORD *v7; // rbx\n  void **v8; // rax\n  int i; // eax\n  void *v10; // rcx\n  _WORD *v11; // [rsp+30h] [rbp-58h] BYREF\n  void **v12; // [rsp+38h] [rbp-50h] BYREF\n  void *Block[2]; // [rsp+40h] [rbp-48h] BYREF\n  __int64 v14; // [rsp+50h] [rbp-38h]\n  unsigned __int64 v15; // [rsp+58h] [rbp-30h]\n\n  if ( !this )\n    return nullptr;\n  v5 = nullptr;\n  sub_180005A10(Block, (char *)this);\n  v6 = v14 + 1;\n  v7 = (_WORD *)sub_1800E4C6C(saturated_mul(v14 + 1, 2u));\n  memset(v7, 0, 2 * v6);\n  if ( !v14 )\n    goto LABEL_8;\n  v8 = Block;\n  if ( v15 > 0xF )\n    v8 = (void **)Block[0];\n  v12 = v8;\n  v11 = v7;\n  if ( (unsigned int)sub_180098140(\n                       (unsigned __int64 *)&v12,\n                       (unsigned __int64)v8 + v14,\n                       &v11,\n                       (unsigned __int64)&v7[2 * v14],\n                       0) )\n  {\n    j_j_free_0(v7);\n  }\n  else\n  {\nLABEL_8:\n    v5 = v7;\n    if ( a2 )\n    {\n      for ( i = 0; *v7; ++i )\n        ++v7;\n      *(_DWORD *)a2 = i;\n    }\n  }\n  if ( v15 > 0xF )\n  {\n    v10 = Block[0];\n    if ( v15 + 1 >= 0x1000 )\n    {\n      v10 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v10 - 8) > 0x1F )\n        invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n    }\n    j_j_free_0(v10);\n  }\n  return v5;\n}", "assembly": "; \n; cocos2d::cc_utf8_to_utf16 from 0x180098b20 to 0x180098c71 (337 bytes)\n; \n; 3 xrefs:\n; > cocos2d::CCLabelBMFont::setString @ 0x18004e568\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801c0a68\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:22:10 +0000\n; \nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x180098b20\npush    rbp                                                            ; +0x5, 0x180098b25\npush    rsi                                                            ; +0x6, 0x180098b26\npush    rdi                                                            ; +0x7, 0x180098b27\nsub     rsp, 70h                                                       ; +0x8, 0x180098b28\nmov     rax, cs:__security_cookie                                      ; +0xc, 0x180098b2c\nxor     rax, rsp                                                       ; +0x13, 0x180098b33\nmov     [rsp+88h+var_28], rax                                          ; +0x16, 0x180098b36\nmov     rsi, rdx                                                       ; +0x1b, 0x180098b3b\ntest    rcx, rcx                                                       ; +0x1e, 0x180098b3e\njnz     short loc_180098B4A                                            ; +0x21, 0x180098b41\nxor     eax, eax                                                       ; +0x23, 0x180098b43\njmp     loc_180098C54                                                  ; +0x25, 0x180098b45\nxor     ebp, ebp                                                       ; +0x2a, 0x180098b4a\nmov     rdx, rcx; Str                                                  ; +0x2c, 0x180098b4c\nlea     rcx, [rsp+88h+Block]; void *                                   ; +0x2f, 0x180098b4f\ncall    sub_180005A10                                                  ; +0x34, 0x180098b54\nnop                                                                    ; +0x39, 0x180098b59\nmov     rdi, [rsp+88h+var_38]                                          ; +0x3a, 0x180098b5a\ninc     rdi                                                            ; +0x3f, 0x180098b5f\nmov     eax, 2                                                         ; +0x42, 0x180098b62\nmul     rdi                                                            ; +0x47, 0x180098b67\nmov     rcx, 0FFFFFFFFFFFFFFFFh                                        ; +0x4a, 0x180098b6a\ncmovb   rax, rcx                                                       ; +0x51, 0x180098b71\nmov     rcx, rax; Size                                                 ; +0x55, 0x180098b75\ncall    sub_1800E4C6C                                                  ; +0x58, 0x180098b78\nmov     rbx, rax                                                       ; +0x5d, 0x180098b7d\nlea     r8, [rdi+rdi]; Size                                            ; +0x60, 0x180098b80\nxor     edx, edx; Val                                                  ; +0x64, 0x180098b84\nmov     rcx, rax; void *                                               ; +0x66, 0x180098b86\ncall    memset                                                         ; +0x69, 0x180098b89\nmov     rcx, [rsp+88h+var_38]                                          ; +0x6e, 0x180098b8e\ntest    rcx, rcx                                                       ; +0x73, 0x180098b93\njz      short loc_180098BDC                                            ; +0x76, 0x180098b96\nlea     rax, [rsp+88h+Block]                                           ; +0x78, 0x180098b98\ncmp     [rsp+88h+var_30], 0Fh                                          ; +0x7d, 0x180098b9d\ncmova   rax, [rsp+88h+Block]                                           ; +0x83, 0x180098ba3\nmov     [rsp+88h+var_50], rax                                          ; +0x89, 0x180098ba9\nmov     [rsp+88h+var_58], rbx                                          ; +0x8e, 0x180098bae\nlea     r9, [rbx+rcx*4]                                                ; +0x93, 0x180098bb3\nlea     rdx, [rcx+rax]                                                 ; +0x97, 0x180098bb7\nmov     dword ptr [rsp+88h+Reserved], ebp                              ; +0x9b, 0x180098bbb\nlea     r8, [rsp+88h+var_58]                                           ; +0x9f, 0x180098bbf\nlea     rcx, [rsp+88h+var_50]                                          ; +0xa4, 0x180098bc4\ncall    sub_180098140                                                  ; +0xa9, 0x180098bc9\ntest    eax, eax                                                       ; +0xae, 0x180098bce\njz      short loc_180098BDC                                            ; +0xb0, 0x180098bd0\nmov     rcx, rbx; Block                                                ; +0xb2, 0x180098bd2\ncall    j_j_free_0                                                     ; +0xb5, 0x180098bd5\njmp     short loc_180098BFE                                            ; +0xba, 0x180098bda\nmov     rbp, rbx                                                       ; +0xbc, 0x180098bdc\ntest    rsi, rsi                                                       ; +0xbf, 0x180098bdf\njz      short loc_180098BFE                                            ; +0xc2, 0x180098be2\nxor     eax, eax                                                       ; +0xc4, 0x180098be4\ncmp     [rbx], ax                                                      ; +0xc6, 0x180098be6\njz      short loc_180098BFC                                            ; +0xc9, 0x180098be9\nnop     dword ptr [rax+rax+00h]                                        ; +0xcb, 0x180098beb\nlea     rbx, [rbx+2]                                                   ; +0xd0, 0x180098bf0\ninc     eax                                                            ; +0xd4, 0x180098bf4\ncmp     word ptr [rbx], 0                                              ; +0xd6, 0x180098bf6\njnz     short loc_180098BF0                                            ; +0xda, 0x180098bfa\nmov     [rsi], eax                                                     ; +0xdc, 0x180098bfc\nmov     rdx, [rsp+88h+var_30]                                          ; +0xde, 0x180098bfe\ncmp     rdx, 0Fh                                                       ; +0xe3, 0x180098c03\njbe     short loc_180098C51                                            ; +0xe7, 0x180098c07\ninc     rdx                                                            ; +0xe9, 0x180098c09\nmov     rcx, [rsp+88h+Block]; Block                                    ; +0xec, 0x180098c0c\nmov     rax, rcx                                                       ; +0xf1, 0x180098c11\ncmp     rdx, 1000h                                                     ; +0xf4, 0x180098c14\njb      short loc_180098C4C                                            ; +0xfb, 0x180098c1b\nadd     rdx, 27h ; '''                                                 ; +0xfd, 0x180098c1d\nmov     rcx, [rcx-8]                                                   ; +0x101, 0x180098c21\nsub     rax, rcx                                                       ; +0x105, 0x180098c25\nsub     rax, 8                                                         ; +0x108, 0x180098c28\ncmp     rax, 1Fh                                                       ; +0x10c, 0x180098c2c\njbe     short loc_180098C4C                                            ; +0x110, 0x180098c30\nmov     [rsp+88h+Reserved], 0; Reserved                                ; +0x112, 0x180098c32\nxor     r9d, r9d; LineNo                                               ; +0x11b, 0x180098c3b\nxor     r8d, r8d; FileName                                             ; +0x11e, 0x180098c3e\nxor     edx, edx; FunctionName                                         ; +0x121, 0x180098c41\nxor     ecx, ecx; Expression                                           ; +0x123, 0x180098c43\ncall    cs:_invoke_watson                                              ; +0x125, 0x180098c45\nalign 4                                                                ; +0x12b, 0x180098c4b\ncall    j_j_free_0                                                     ; +0x12c, 0x180098c4c\nmov     rax, rbp                                                       ; +0x131, 0x180098c51\nmov     rcx, [rsp+88h+var_28]                                          ; +0x134, 0x180098c54\nxor     rcx, rsp; StackCookie                                          ; +0x139, 0x180098c59\ncall    __security_check_cookie                                        ; +0x13c, 0x180098c5c\nmov     rbx, [rsp+88h+arg_10]                                          ; +0x141, 0x180098c61\nadd     rsp, 70h                                                       ; +0x149, 0x180098c69\npop     rdi                                                            ; +0x14d, 0x180098c6d\npop     rsi                                                            ; +0x14e, 0x180098c6e\npop     rbp                                                            ; +0x14f, 0x180098c6f\nretn                                                                   ; +0x150, 0x180098c70", "xrefs": ["cocos2d::CCLabelBMFont::setString @ 0x18004e568", "<???> @ 0x18014cf68", "<???> @ 0x1801c0a68"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}