{"type": "func", "start": 6442739552, "end": 6442740304, "name": "cocos2d::CCLabelAtlas::updateAtlasValues", "pseudocode": "// \n// cocos2d::CCLabelAtlas::updateAtlasValues from 0x180046760 to 0x180046a50 (752 bytes)\n// \n// 3 xrefs:\n// > <???> @ 0x1800eb768\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b177c\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::CCLabelAtlas::updateAtlasValues(cocos2d::CCLabelAtlas *this)\n{\n  unsigned int m_size; // esi\n  std::string *p_m_sString; // r14\n  __int64 v4; // rbx\n  float v5; // xmm9_4\n  float v6; // xmm10_4\n  cocos2d::CCDirector *v7; // rax\n  float ContentScaleFactor; // xmm0_4\n  float m_uItemHeight; // xmm8_4\n  float m_uItemWidth; // xmm6_4\n  cocos2d::CCDirector *v11; // rax\n  float v12; // xmm7_4\n  __int64 v13; // rax\n  __int64 v14; // r9\n  __int64 v15; // r8\n  float v16; // xmm4_4\n  float v17; // xmm5_4\n  unsigned int v18; // eax\n  signed int v19; // ecx\n  __int64 v20; // rdx\n  float v21; // xmm3_4\n  unsigned int v22; // ecx\n  float v23; // xmm3_4\n  float v24; // xmm1_4\n  int v25; // eax\n  int v26; // eax\n  int v27; // eax\n  signed int v28; // eax\n  signed int v29; // eax\n  unsigned int v30; // eax\n  int v31; // [rsp+80h] [rbp+8h]\n\n  m_size = this->m_sString.m_data.m_size;\n  p_m_sString = &this->m_sString;\n  if ( this->m_sString.m_data.m_capacity > 0xF )\n    p_m_sString = (std::string *)p_m_sString->m_data.m_bigStorage;\n  v4 = ((__int64 (__fastcall *)(cocos2d::CCTextureAtlas *))this->m_pTextureAtlas->getTexture)(this->m_pTextureAtlas);\n  v5 = (float)(*(int (__fastcall **)(__int64))(*(_QWORD *)v4 + 80LL))(v4);\n  v6 = (float)(*(int (__fastcall **)(__int64))(*(_QWORD *)v4 + 88LL))(v4);\n  v7 = cocos2d::CCDirector::sharedDirector();\n  ContentScaleFactor = cocos2d::CCDirector::getContentScaleFactor(v7);\n  m_uItemHeight = (float)(int)this->m_uItemHeight;\n  m_uItemWidth = ContentScaleFactor * (float)(int)this->m_uItemWidth;\n  v11 = cocos2d::CCDirector::sharedDirector();\n  v12 = cocos2d::CCDirector::getContentScaleFactor(v11) * m_uItemHeight;\n  if ( this->m_bIgnoreContentScaleFactor )\n  {\n    v12 = m_uItemHeight;\n    m_uItemWidth = (float)(int)this->m_uItemWidth;\n  }\n  ((void (__fastcall *)(cocos2d::CCTextureAtlas *))this->m_pTextureAtlas->getCapacity)(this->m_pTextureAtlas);\n  v13 = ((__int64 (__fastcall *)(cocos2d::CCTextureAtlas *))this->m_pTextureAtlas->getQuads)(this->m_pTextureAtlas);\n  LODWORD(v14) = 0;\n  if ( m_size )\n  {\n    v15 = v13 + 20;\n    v16 = m_uItemWidth / v5;\n    v17 = v12 / v6;\n    do\n    {\n      v18 = (unsigned __int8)(p_m_sString->m_data.m_smallStorage._Elems[0] - LOBYTE(this->m_uMapStartChar))\n          / this->m_uItemsPerRow;\n      v19 = (unsigned __int8)(p_m_sString->m_data.m_smallStorage._Elems[0] - LOBYTE(this->m_uMapStartChar))\n          % this->m_uItemsPerRow;\n      p_m_sString = (std::string *)((char *)p_m_sString + 1);\n      v20 = v18;\n      v21 = (float)v19;\n      v22 = v14 + 1;\n      v23 = (float)(v21 * m_uItemWidth) / v5;\n      v24 = (float)((float)(int)v18 * v12) / v6;\n      *(float *)(v15 - 4) = v23;\n      *(float *)v15 = v24;\n      *(float *)(v15 + 48) = v24;\n      *(float *)(v15 + 20) = v23;\n      *(float *)(v15 + 44) = v16 + v23;\n      *(float *)(v15 + 24) = v17 + v24;\n      *(float *)(v15 + 72) = v17 + v24;\n      *(float *)(v15 + 68) = v16 + v23;\n      v25 = this->m_uItemWidth * v14;\n      *(_QWORD *)(v15 + 8) = 0;\n      *(float *)(v15 + 4) = (float)v25;\n      v26 = this->m_uItemWidth * (v14 + 1);\n      *(_QWORD *)(v15 + 56) = 0;\n      *(float *)(v15 + 52) = (float)v26;\n      v27 = this->m_uItemWidth * v14;\n      v14 = (unsigned int)(v14 + 1);\n      *(float *)(v15 - 20) = (float)v27;\n      v28 = this->m_uItemHeight;\n      *(_DWORD *)(v15 - 12) = 0;\n      *(float *)(v15 - 16) = (float)v28;\n      *(float *)(v15 + 28) = (float)(int)(this->m_uItemWidth * v22);\n      v29 = this->m_uItemHeight;\n      *(_DWORD *)(v15 + 36) = 0;\n      *(float *)(v15 + 32) = (float)v29;\n      LOWORD(v31) = *(_WORD *)&this->_displayedColor.r;\n      BYTE2(v31) = this->_displayedColor.b;\n      HIBYTE(v31) = this->_displayedOpacity;\n      *(_DWORD *)(v15 - 8) = v31;\n      *(_DWORD *)(v15 + 40) = v31;\n      *(_DWORD *)(v15 + 16) = v31;\n      *(_DWORD *)(v15 + 64) = v31;\n      v15 += 96;\n    }\n    while ( v22 < m_size );\n    this->m_pTextureAtlas->m_bDirty = 1;\n    v30 = ((__int64 (__fastcall *)(cocos2d::CCTextureAtlas *, __int64, __int64, __int64))this->m_pTextureAtlas->getTotalQuads)(\n            this->m_pTextureAtlas,\n            v20,\n            v15,\n            v14);\n    if ( m_size > v30 )\n      cocos2d::CCTextureAtlas::increaseTotalQuadsWith(this->m_pTextureAtlas, m_size - v30);\n  }\n}", "assembly": "; \n; cocos2d::CCLabelAtlas::updateAtlasValues from 0x180046760 to 0x180046a50 (752 bytes)\n; \n; 3 xrefs:\n; > <???> @ 0x1800eb768\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b177c\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     rax, rsp                                                       ; +0x0, 0x180046760\nmov     [rax+10h], rbx                                                 ; +0x3, 0x180046763\nmov     [rax+18h], rsi                                                 ; +0x7, 0x180046767\nmov     [rax+20h], rdi                                                 ; +0xb, 0x18004676b\npush    r14                                                            ; +0xf, 0x18004676f\nsub     rsp, 70h                                                       ; +0x11, 0x180046771\nmov     esi, [rcx+1B0h]                                                ; +0x15, 0x180046775\nlea     r14, [rcx+1A0h]                                                ; +0x1b, 0x18004677b\ncmp     qword ptr [r14+18h], 0Fh                                       ; +0x22, 0x180046782\nmov     rdi, rcx                                                       ; +0x27, 0x180046787\nmovaps  xmmword ptr [rax-18h], xmm6                                    ; +0x2a, 0x18004678a\nmovaps  xmmword ptr [rax-28h], xmm7                                    ; +0x2e, 0x18004678e\nmovaps  xmmword ptr [rax-38h], xmm8                                    ; +0x32, 0x180046792\nmovaps  xmmword ptr [rax-48h], xmm9                                    ; +0x37, 0x180046797\nmovaps  xmmword ptr [rax-58h], xmm10                                   ; +0x3c, 0x18004679c\njbe     short loc_1800467A6                                            ; +0x41, 0x1800467a1\nmov     r14, [r14]                                                     ; +0x43, 0x1800467a3\nmov     rcx, [rcx+178h]                                                ; +0x46, 0x1800467a6\nmov     rax, [rcx]                                                     ; +0x4d, 0x1800467ad\ncall    qword ptr [rax+58h]                                            ; +0x50, 0x1800467b0\nmov     rcx, rax                                                       ; +0x53, 0x1800467b3\nmov     rbx, rax                                                       ; +0x56, 0x1800467b6\nmov     rdx, [rax]                                                     ; +0x59, 0x1800467b9\ncall    qword ptr [rdx+50h]                                            ; +0x5c, 0x1800467bc\nmov     rdx, [rbx]                                                     ; +0x5f, 0x1800467bf\nxorps   xmm9, xmm9                                                     ; +0x62, 0x1800467c2\nmov     ecx, eax                                                       ; +0x66, 0x1800467c6\ncvtsi2ss xmm9, rcx                                                     ; +0x68, 0x1800467c8\nmov     rcx, rbx                                                       ; +0x6d, 0x1800467cd\ncall    qword ptr [rdx+58h]                                            ; +0x70, 0x1800467d0\nmov     eax, eax                                                       ; +0x73, 0x1800467d3\nxorps   xmm10, xmm10                                                   ; +0x75, 0x1800467d5\ncvtsi2ss xmm10, rax                                                    ; +0x79, 0x1800467d9\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x7e, 0x1800467de\nmov     rcx, rax; this                                                 ; +0x83, 0x1800467e3\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x86, 0x1800467e6\nmov     eax, [rdi+168h]                                                ; +0x8b, 0x1800467eb\nxorps   xmm1, xmm1                                                     ; +0x91, 0x1800467f1\nmovaps  xmm6, xmm0                                                     ; +0x94, 0x1800467f4\nxorps   xmm8, xmm8                                                     ; +0x97, 0x1800467f7\ncvtsi2ss xmm1, rax                                                     ; +0x9b, 0x1800467fb\nmov     eax, [rdi+16Ch]                                                ; +0xa0, 0x180046800\ncvtsi2ss xmm8, rax                                                     ; +0xa6, 0x180046806\nmulss   xmm6, xmm1                                                     ; +0xab, 0x18004680b\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0xaf, 0x18004680f\nmov     rcx, rax; this                                                 ; +0xb4, 0x180046814\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0xb7, 0x180046817\ncmp     byte ptr [rdi+194h], 0                                         ; +0xbc, 0x18004681c\nmovaps  xmm7, xmm0                                                     ; +0xc3, 0x180046823\nmulss   xmm7, xmm8                                                     ; +0xc6, 0x180046826\njz      short loc_18004683F                                            ; +0xcb, 0x18004682b\nmov     eax, [rdi+168h]                                                ; +0xcd, 0x18004682d\nxorps   xmm6, xmm6                                                     ; +0xd3, 0x180046833\nmovaps  xmm7, xmm8                                                     ; +0xd6, 0x180046836\ncvtsi2ss xmm6, rax                                                     ; +0xda, 0x18004683a\nmov     rcx, [rdi+178h]                                                ; +0xdf, 0x18004683f\nmov     rax, [rcx]                                                     ; +0xe6, 0x180046846\ncall    qword ptr [rax+50h]                                            ; +0xe9, 0x180046849\nmov     rcx, [rdi+178h]                                                ; +0xec, 0x18004684c\nmov     rax, [rcx]                                                     ; +0xf3, 0x180046853\ncall    qword ptr [rax+68h]                                            ; +0xf6, 0x180046856\nxor     r10d, r10d                                                     ; +0xf9, 0x180046859\nmov     r9d, r10d                                                      ; +0xfc, 0x18004685c\ntest    esi, esi                                                       ; +0xff, 0x18004685f\njz      loc_180046A20                                                  ; +0x101, 0x180046861\nmovaps  xmm4, xmm6                                                     ; +0x107, 0x180046867\nlea     r8, [rax+14h]                                                  ; +0x10a, 0x18004686a\nmovaps  xmm5, xmm7                                                     ; +0x10e, 0x18004686e\ndivss   xmm4, xmm9                                                     ; +0x111, 0x180046871\ndivss   xmm5, xmm10                                                    ; +0x116, 0x180046876\nnop     dword ptr [rax+rax+00h]                                        ; +0x11b, 0x18004687b\nmovzx   eax, byte ptr [r14]                                            ; +0x120, 0x180046880\nxorps   xmm1, xmm1                                                     ; +0x124, 0x180046884\nsub     al, [rdi+1C0h]                                                 ; +0x127, 0x180046887\nxor     edx, edx                                                       ; +0x12d, 0x18004688d\nmovzx   eax, al                                                        ; +0x12f, 0x18004688f\nxorps   xmm3, xmm3                                                     ; +0x132, 0x180046892\ndiv     dword ptr [rdi+160h]                                           ; +0x135, 0x180046895\nmovaps  xmm0, xmm5                                                     ; +0x13b, 0x18004689b\nmovaps  xmm2, xmm4                                                     ; +0x13e, 0x18004689e\nmov     ecx, edx                                                       ; +0x141, 0x1800468a1\ninc     r14                                                            ; +0x143, 0x1800468a3\nmov     edx, eax                                                       ; +0x146, 0x1800468a6\nmov     eax, r9d                                                       ; +0x148, 0x1800468a8\ncvtsi2ss xmm3, rcx                                                     ; +0x14b, 0x1800468ab\nlea     ecx, [r9+1]                                                    ; +0x150, 0x1800468b0\ncvtsi2ss xmm1, rdx                                                     ; +0x154, 0x1800468b4\nmulss   xmm3, xmm6                                                     ; +0x159, 0x1800468b9\nmulss   xmm1, xmm7                                                     ; +0x15d, 0x1800468bd\ndivss   xmm3, xmm9                                                     ; +0x161, 0x1800468c1\ndivss   xmm1, xmm10                                                    ; +0x166, 0x1800468c6\nmovss   dword ptr [r8-4], xmm3                                         ; +0x16b, 0x1800468cb\naddss   xmm2, xmm3                                                     ; +0x171, 0x1800468d1\nmovss   dword ptr [r8], xmm1                                           ; +0x175, 0x1800468d5\naddss   xmm0, xmm1                                                     ; +0x17a, 0x1800468da\nmovss   dword ptr [r8+30h], xmm1                                       ; +0x17e, 0x1800468de\nxorps   xmm1, xmm1                                                     ; +0x184, 0x1800468e4\nmovss   dword ptr [r8+14h], xmm3                                       ; +0x187, 0x1800468e7\nmovss   dword ptr [r8+2Ch], xmm2                                       ; +0x18d, 0x1800468ed\nmovss   dword ptr [r8+18h], xmm0                                       ; +0x193, 0x1800468f3\nmovss   dword ptr [r8+48h], xmm0                                       ; +0x199, 0x1800468f9\nxorps   xmm0, xmm0                                                     ; +0x19f, 0x1800468ff\nmovss   dword ptr [r8+44h], xmm2                                       ; +0x1a2, 0x180046902\nimul    eax, [rdi+168h]                                                ; +0x1a8, 0x180046908\nmov     [r8+8], r10                                                    ; +0x1af, 0x18004690f\ncvtsi2ss xmm0, rax                                                     ; +0x1b3, 0x180046913\nmov     eax, ecx                                                       ; +0x1b8, 0x180046918\nmovss   dword ptr [r8+4], xmm0                                         ; +0x1ba, 0x18004691a\nxorps   xmm0, xmm0                                                     ; +0x1c0, 0x180046920\nimul    eax, [rdi+168h]                                                ; +0x1c3, 0x180046923\nmov     [r8+38h], r10                                                  ; +0x1ca, 0x18004692a\ncvtsi2ss xmm0, rax                                                     ; +0x1ce, 0x18004692e\nmovss   dword ptr [r8+34h], xmm0                                       ; +0x1d3, 0x180046933\nxorps   xmm0, xmm0                                                     ; +0x1d9, 0x180046939\nimul    r9d, [rdi+168h]                                                ; +0x1dc, 0x18004693c\nmov     eax, r9d                                                       ; +0x1e4, 0x180046944\nmov     r9d, ecx                                                       ; +0x1e7, 0x180046947\ncvtsi2ss xmm0, rax                                                     ; +0x1ea, 0x18004694a\nmovss   dword ptr [r8-14h], xmm0                                       ; +0x1ef, 0x18004694f\nxorps   xmm0, xmm0                                                     ; +0x1f5, 0x180046955\nmov     eax, [rdi+16Ch]                                                ; +0x1f8, 0x180046958\nmov     [r8-0Ch], r10d                                                 ; +0x1fe, 0x18004695e\ncvtsi2ss xmm1, rax                                                     ; +0x202, 0x180046962\nmov     eax, ecx                                                       ; +0x207, 0x180046967\nmovss   dword ptr [r8-10h], xmm1                                       ; +0x209, 0x180046969\nxorps   xmm1, xmm1                                                     ; +0x20f, 0x18004696f\nimul    eax, [rdi+168h]                                                ; +0x212, 0x180046972\ncvtsi2ss xmm0, rax                                                     ; +0x219, 0x180046979\nmovss   dword ptr [r8+1Ch], xmm0                                       ; +0x21e, 0x18004697e\nmov     eax, [rdi+16Ch]                                                ; +0x224, 0x180046984\nmov     [r8+24h], r10d                                                 ; +0x22a, 0x18004698a\ncvtsi2ss xmm1, rax                                                     ; +0x22e, 0x18004698e\nmovss   dword ptr [r8+20h], xmm1                                       ; +0x233, 0x180046993\nmovzx   eax, byte ptr [rdi+14Ah]                                       ; +0x239, 0x180046999\nmov     byte ptr [rsp+78h+arg_0], al                                   ; +0x240, 0x1800469a0\nmovzx   eax, byte ptr [rdi+14Bh]                                       ; +0x247, 0x1800469a7\nmov     byte ptr [rsp+78h+arg_0+1], al                                 ; +0x24e, 0x1800469ae\nmovzx   eax, byte ptr [rdi+14Ch]                                       ; +0x255, 0x1800469b5\nmov     byte ptr [rsp+78h+arg_0+2], al                                 ; +0x25c, 0x1800469bc\nmovzx   eax, byte ptr [rdi+148h]                                       ; +0x263, 0x1800469c3\nmov     byte ptr [rsp+78h+arg_0+3], al                                 ; +0x26a, 0x1800469ca\nmov     eax, [rsp+78h+arg_0]                                           ; +0x271, 0x1800469d1\nmov     [r8-8], eax                                                    ; +0x278, 0x1800469d8\nmov     [r8+28h], eax                                                  ; +0x27c, 0x1800469dc\nmov     [r8+10h], eax                                                  ; +0x280, 0x1800469e0\nmov     [r8+40h], eax                                                  ; +0x284, 0x1800469e4\nadd     r8, 60h ; '`'                                                  ; +0x288, 0x1800469e8\ncmp     ecx, esi                                                       ; +0x28c, 0x1800469ec\njb      loc_180046880                                                  ; +0x28e, 0x1800469ee\nmov     rax, [rdi+178h]                                                ; +0x294, 0x1800469f4\nmov     byte ptr [rax+48h], 1                                          ; +0x29b, 0x1800469fb\nmov     rcx, [rdi+178h]                                                ; +0x29f, 0x1800469ff\nmov     rax, [rcx]                                                     ; +0x2a6, 0x180046a06\ncall    qword ptr [rax+48h]                                            ; +0x2a9, 0x180046a09\ncmp     esi, eax                                                       ; +0x2ac, 0x180046a0c\njbe     short loc_180046A20                                            ; +0x2ae, 0x180046a0e\nmov     rcx, [rdi+178h]; this                                          ; +0x2b0, 0x180046a10\nsub     esi, eax                                                       ; +0x2b7, 0x180046a17\nmov     edx, esi; unsigned int                                         ; +0x2b9, 0x180046a19\ncall    ?increaseTotalQuadsWith@CCTextureAtlas@cocos2d@@QEAAXI@Z; cocos2d::CCTextureAtlas::increaseTotalQuadsWith(uint) ; +0x2bb, 0x180046a1b\nmovaps  xmm6, [rsp+78h+var_18]                                         ; +0x2c0, 0x180046a20\nlea     r11, [rsp+78h+var_8]                                           ; +0x2c5, 0x180046a25\nmov     rbx, [r11+18h]                                                 ; +0x2ca, 0x180046a2a\nmov     rsi, [r11+20h]                                                 ; +0x2ce, 0x180046a2e\nmov     rdi, [r11+28h]                                                 ; +0x2d2, 0x180046a32\nmovaps  xmm8, xmmword ptr [r11-30h]                                    ; +0x2d6, 0x180046a36\nmovaps  xmm9, xmmword ptr [r11-40h]                                    ; +0x2db, 0x180046a3b\nmovaps  xmm10, xmmword ptr [r11-50h]                                   ; +0x2e0, 0x180046a40\nmovaps  xmm7, [rsp+78h+var_28]                                         ; +0x2e5, 0x180046a45\nmov     rsp, r11                                                       ; +0x2ea, 0x180046a4a\npop     r14                                                            ; +0x2ed, 0x180046a4d\nretn                                                                   ; +0x2ef, 0x180046a4f", "xrefs": ["<???> @ 0x1800eb768", "<???> @ 0x1801438a8", "<???> @ 0x1801b177c"], "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"}