{"type": "func", "start": 6442768704, "end": 6442769207, "name": "cocos2d::CCLabelTTF::_prepareTextDefinition", "pseudocode": "// \n// cocos2d::CCLabelTTF::_prepareTextDefinition from 0x18004d940 to 0x18004db37 (503 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b1bf0\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=1\nstruct cocos2d::_ccFontDefinition *__fastcall cocos2d::CCLabelTTF::_prepareTextDefinition(\n        struct cocos2d::_ccFontDefinition *__return_ptr retstr,\n        __int64 a2,\n        char a3)\n{\n  cocos2d::CCDirector *v6; // rax\n  float v7; // xmm0_4\n  __int64 v8; // r8\n  void *v9; // rdx\n  cocos2d::CCDirector *v10; // rax\n  float v11; // xmm6_4\n  cocos2d::CCDirector *v12; // rax\n  float ContentScaleFactor; // xmm0_4\n  float *p_m_strokeSize; // rdx\n  cocos2d::CCDirector *v15; // rax\n  cocos2d::CCDirector *v16; // rax\n  float v17; // xmm6_4\n  cocos2d::CCDirector *v18; // rax\n  float v19; // xmm0_4\n  float *v20; // rax\n  float v22; // [rsp+60h] [rbp+8h] BYREF\n  __int64 v23; // [rsp+68h] [rbp+10h]\n\n  v23 = a2;\n  sub_18004D6F0(a2);\n  if ( a3 )\n  {\n    v6 = cocos2d::CCDirector::sharedDirector();\n    v7 = cocos2d::CCDirector::getContentScaleFactor(v6) * *(float *)&retstr[7].m_fontName.m_data.m_size;\n  }\n  else\n  {\n    v7 = *(float *)&retstr[7].m_fontName.m_data.m_size;\n  }\n  *(_DWORD *)(a2 + 32) = (int)v7;\n  v8 = *((_QWORD *)&retstr[7].m_fontName.m_data.m_bigStorage + 1);\n  if ( a2 != v8 )\n  {\n    v9 = *((void **)&retstr[7].m_fontName.m_data.m_bigStorage + 1);\n    if ( *(_QWORD *)(v8 + 24) > 0xFu )\n      v9 = *(void **)v8;\n    sub_180010050((void **)a2, v9, *(_QWORD *)(v8 + 16));\n  }\n  *(_DWORD *)(a2 + 36) = *(_DWORD *)retstr[7].m_fontName.m_data.m_smallStorage._Elems;\n  *(_DWORD *)(a2 + 40) = HIDWORD(retstr[7].m_fontName.m_data.m_bigStorage);\n  if ( a3 )\n  {\n    v10 = cocos2d::CCDirector::sharedDirector();\n    v11 = cocos2d::CCDirector::getContentScaleFactor(v10) * *((float *)&retstr[6].m_stroke + 2);\n    v12 = cocos2d::CCDirector::sharedDirector();\n    ContentScaleFactor = cocos2d::CCDirector::getContentScaleFactor(v12);\n    p_m_strokeSize = kmVec2Fill(&v22, ContentScaleFactor * retstr[6].m_stroke.m_strokeSize, v11);\n  }\n  else\n  {\n    p_m_strokeSize = &retstr[6].m_stroke.m_strokeSize;\n  }\n  cocos2d::CCSize::operator=((_DWORD *)(a2 + 44), p_m_strokeSize);\n  if ( retstr[7].m_stroke.m_strokeEnabled )\n  {\n    *(_BYTE *)(a2 + 76) = 1;\n    *(_WORD *)(a2 + 77) = *(_WORD *)&retstr[7].m_stroke.m_strokeColor.r;\n    *(_BYTE *)(a2 + 79) = retstr[7].m_stroke.m_strokeColor.b;\n    if ( a3 )\n    {\n      v15 = cocos2d::CCDirector::sharedDirector();\n      *(float *)(a2 + 80) = cocos2d::CCDirector::getContentScaleFactor(v15) * retstr[7].m_stroke.m_strokeSize;\n    }\n    else\n    {\n      *(float *)(a2 + 80) = retstr[7].m_stroke.m_strokeSize;\n    }\n  }\n  else\n  {\n    *(_BYTE *)(a2 + 76) = 0;\n  }\n  if ( retstr[7].m_shadow.m_shadowEnabled )\n  {\n    *(_BYTE *)(a2 + 56) = 1;\n    *(float *)(a2 + 68) = retstr[7].m_shadow.m_shadowOpacity;\n    *(float *)(a2 + 72) = retstr[7].m_shadow.m_shadowBlur;\n    if ( a3 )\n    {\n      v16 = cocos2d::CCDirector::sharedDirector();\n      v17 = cocos2d::CCDirector::getContentScaleFactor(v16) * retstr[7].m_shadow.m_shadowOffset.height;\n      v18 = cocos2d::CCDirector::sharedDirector();\n      v19 = cocos2d::CCDirector::getContentScaleFactor(v18);\n      v20 = kmVec2Fill(&v22, v19 * retstr[7].m_shadow.m_shadowOffset.width, v17);\n      cocos2d::CCSize::operator=((_DWORD *)(a2 + 60), v20);\n    }\n    else\n    {\n      cocos2d::CCSize::operator=((_DWORD *)(a2 + 60), &retstr[7].m_shadow.m_shadowOffset);\n    }\n  }\n  else\n  {\n    *(_BYTE *)(a2 + 56) = 0;\n  }\n  *(_WORD *)(a2 + 52) = *((_WORD *)&retstr[7].m_stroke + 4);\n  *(_BYTE *)(a2 + 54) = *((_BYTE *)&retstr[7].m_stroke + 10);\n  return (struct cocos2d::_ccFontDefinition *)a2;\n}", "assembly": "; \n; cocos2d::CCLabelTTF::_prepareTextDefinition from 0x18004d940 to 0x18004db37 (503 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b1bf0\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\nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x18004d940\nmov     [rsp+arg_8], rdx                                               ; +0x5, 0x18004d945\npush    rbp                                                            ; +0xa, 0x18004d94a\npush    rsi                                                            ; +0xb, 0x18004d94b\npush    rdi                                                            ; +0xc, 0x18004d94c\nsub     rsp, 40h                                                       ; +0xd, 0x18004d94d\nmovaps  [rsp+58h+var_28], xmm6                                         ; +0x11, 0x18004d951\nmovzx   esi, r8b                                                       ; +0x16, 0x18004d956\nmov     rbx, rdx                                                       ; +0x1a, 0x18004d95a\nmov     rdi, rcx                                                       ; +0x1d, 0x18004d95d\nmov     [rsp+58h+var_38], 0                                            ; +0x20, 0x18004d960\nmov     rcx, rdx                                                       ; +0x28, 0x18004d968\ncall    sub_18004D6F0                                                  ; +0x2b, 0x18004d96b\nmov     [rsp+58h+var_38], 1                                            ; +0x30, 0x18004d970\ntest    sil, sil                                                       ; +0x38, 0x18004d978\njz      short loc_18004D994                                            ; +0x3b, 0x18004d97b\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x3d, 0x18004d97d\nmov     rcx, rax; this                                                 ; +0x42, 0x18004d982\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x45, 0x18004d985\nmulss   xmm0, dword ptr [rdi+278h]                                     ; +0x4a, 0x18004d98a\njmp     short loc_18004D99C                                            ; +0x52, 0x18004d992\nmovss   xmm0, dword ptr [rdi+278h]                                     ; +0x54, 0x18004d994\ncvttss2si eax, xmm0                                                    ; +0x5c, 0x18004d99c\nmov     [rbx+20h], eax                                                 ; +0x60, 0x18004d9a0\nmov     r8, [rdi+270h]                                                 ; +0x63, 0x18004d9a3\ncmp     rbx, r8                                                        ; +0x6a, 0x18004d9aa\njz      short loc_18004D9C8                                            ; +0x6d, 0x18004d9ad\nmov     rdx, r8                                                        ; +0x6f, 0x18004d9af\ncmp     qword ptr [r8+18h], 0Fh                                        ; +0x72, 0x18004d9b2\njbe     short loc_18004D9BC                                            ; +0x77, 0x18004d9b7\nmov     rdx, [r8]; Src                                                 ; +0x79, 0x18004d9b9\nmov     r8, [r8+10h]; Size                                             ; +0x7c, 0x18004d9bc\nmov     rcx, rbx; void *                                               ; +0x80, 0x18004d9c0\ncall    sub_180010050                                                  ; +0x83, 0x18004d9c3\nmov     eax, [rdi+268h]                                                ; +0x88, 0x18004d9c8\nmov     [rbx+24h], eax                                                 ; +0x8e, 0x18004d9ce\nmov     eax, [rdi+26Ch]                                                ; +0x91, 0x18004d9d1\nmov     [rbx+28h], eax                                                 ; +0x97, 0x18004d9d7\ntest    sil, sil                                                       ; +0x9a, 0x18004d9da\njz      short loc_18004DA21                                            ; +0x9d, 0x18004d9dd\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x9f, 0x18004d9df\nmov     rcx, rax; this                                                 ; +0xa4, 0x18004d9e4\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0xa7, 0x18004d9e7\nmovaps  xmm6, xmm0                                                     ; +0xac, 0x18004d9ec\nmulss   xmm6, dword ptr [rdi+264h]                                     ; +0xaf, 0x18004d9ef\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0xb7, 0x18004d9f7\nmov     rcx, rax; this                                                 ; +0xbc, 0x18004d9fc\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0xbf, 0x18004d9ff\nmulss   xmm0, dword ptr [rdi+260h]                                     ; +0xc4, 0x18004da04\nmovaps  xmm2, xmm6                                                     ; +0xcc, 0x18004da0c\nmovaps  xmm1, xmm0                                                     ; +0xcf, 0x18004da0f\nlea     rcx, [rsp+58h+arg_0]                                           ; +0xd2, 0x18004da12\ncall    kmVec2Fill                                                     ; +0xd7, 0x18004da17\nmov     rdx, rax                                                       ; +0xdc, 0x18004da1c\njmp     short loc_18004DA28                                            ; +0xdf, 0x18004da1f\nlea     rdx, [rdi+260h]                                                ; +0xe1, 0x18004da21\nlea     rcx, [rbx+2Ch]                                                 ; +0xe8, 0x18004da28\ncall    ??4CCSize@cocos2d@@QEAAAEAV01@AEBVCCPoint@1@@Z; cocos2d::CCSize::operator=(cocos2d::CCPoint const &) ; +0xec, 0x18004da2c\ncmp     byte ptr [rdi+2B4h], 0                                         ; +0xf1, 0x18004da31\njz      short loc_18004DA83                                            ; +0xf8, 0x18004da38\nmov     byte ptr [rbx+4Ch], 1                                          ; +0xfa, 0x18004da3a\nmovzx   eax, word ptr [rdi+2B5h]                                       ; +0xfe, 0x18004da3e\nmov     [rbx+4Dh], ax                                                  ; +0x105, 0x18004da45\nmovzx   eax, byte ptr [rdi+2B7h]                                       ; +0x109, 0x18004da49\nmov     [rbx+4Fh], al                                                  ; +0x110, 0x18004da50\ntest    sil, sil                                                       ; +0x113, 0x18004da53\njz      short loc_18004DA74                                            ; +0x116, 0x18004da56\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x118, 0x18004da58\nmov     rcx, rax; this                                                 ; +0x11d, 0x18004da5d\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x120, 0x18004da60\nmulss   xmm0, dword ptr [rdi+2B8h]                                     ; +0x125, 0x18004da65\nmovss   dword ptr [rbx+50h], xmm0                                      ; +0x12d, 0x18004da6d\njmp     short loc_18004DA87                                            ; +0x132, 0x18004da72\nmovss   xmm0, dword ptr [rdi+2B8h]                                     ; +0x134, 0x18004da74\nmovss   dword ptr [rbx+50h], xmm0                                      ; +0x13c, 0x18004da7c\njmp     short loc_18004DA87                                            ; +0x141, 0x18004da81\nmov     byte ptr [rbx+4Ch], 0                                          ; +0x143, 0x18004da83\ncmp     byte ptr [rdi+2A0h], 0                                         ; +0x147, 0x18004da87\njz      short loc_18004DB08                                            ; +0x14e, 0x18004da8e\nmov     byte ptr [rbx+38h], 1                                          ; +0x150, 0x18004da90\nmov     eax, [rdi+2B0h]                                                ; +0x154, 0x18004da94\nmov     [rbx+44h], eax                                                 ; +0x15a, 0x18004da9a\nmov     eax, [rdi+2ACh]                                                ; +0x15d, 0x18004da9d\nmov     [rbx+48h], eax                                                 ; +0x163, 0x18004daa3\ntest    sil, sil                                                       ; +0x166, 0x18004daa6\njz      short loc_18004DAF6                                            ; +0x169, 0x18004daa9\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x16b, 0x18004daab\nmov     rcx, rax; this                                                 ; +0x170, 0x18004dab0\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x173, 0x18004dab3\nmovaps  xmm6, xmm0                                                     ; +0x178, 0x18004dab8\nmulss   xmm6, dword ptr [rdi+2A8h]                                     ; +0x17b, 0x18004dabb\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x183, 0x18004dac3\nmov     rcx, rax; this                                                 ; +0x188, 0x18004dac8\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x18b, 0x18004dacb\nmulss   xmm0, dword ptr [rdi+2A4h]                                     ; +0x190, 0x18004dad0\nmovaps  xmm2, xmm6                                                     ; +0x198, 0x18004dad8\nmovaps  xmm1, xmm0                                                     ; +0x19b, 0x18004dadb\nlea     rcx, [rsp+58h+arg_0]                                           ; +0x19e, 0x18004dade\ncall    kmVec2Fill                                                     ; +0x1a3, 0x18004dae3\nmov     rdx, rax                                                       ; +0x1a8, 0x18004dae8\nlea     rcx, [rbx+3Ch]                                                 ; +0x1ab, 0x18004daeb\ncall    ??4CCSize@cocos2d@@QEAAAEAV01@AEBVCCPoint@1@@Z; cocos2d::CCSize::operator=(cocos2d::CCPoint const &) ; +0x1af, 0x18004daef\njmp     short loc_18004DB0C                                            ; +0x1b4, 0x18004daf4\nlea     rcx, [rbx+3Ch]                                                 ; +0x1b6, 0x18004daf6\nlea     rdx, [rdi+2A4h]                                                ; +0x1ba, 0x18004dafa\ncall    ??4CCSize@cocos2d@@QEAAAEAV01@AEBVCCPoint@1@@Z; cocos2d::CCSize::operator=(cocos2d::CCPoint const &) ; +0x1c1, 0x18004db01\njmp     short loc_18004DB0C                                            ; +0x1c6, 0x18004db06\nmov     byte ptr [rbx+38h], 0                                          ; +0x1c8, 0x18004db08\nmovzx   eax, word ptr [rdi+2BCh]                                       ; +0x1cc, 0x18004db0c\nmov     [rbx+34h], ax                                                  ; +0x1d3, 0x18004db13\nmovzx   eax, byte ptr [rdi+2BEh]                                       ; +0x1d7, 0x18004db17\nmov     [rbx+36h], al                                                  ; +0x1de, 0x18004db1e\nmov     rax, rbx                                                       ; +0x1e1, 0x18004db21\nmov     rbx, [rsp+58h+arg_10]                                          ; +0x1e4, 0x18004db24\nmovaps  xmm6, [rsp+58h+var_28]                                         ; +0x1e9, 0x18004db29\nadd     rsp, 40h                                                       ; +0x1ee, 0x18004db2e\npop     rdi                                                            ; +0x1f2, 0x18004db32\npop     rsi                                                            ; +0x1f3, 0x18004db33\npop     rbp                                                            ; +0x1f4, 0x18004db34\nretn                                                                   ; +0x1f5, 0x18004db35\ndb 0CCh                                                                ; +0x1f6, 0x18004db36", "xrefs": ["<???> @ 0x1801438a8", "<???> @ 0x1801b1bf0"], "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"}