{"type": "func", "start": 6442887216, "end": 6442887692, "name": "cocos2d::CCParticleSystemQuad::initTexCoordsWithRect", "pseudocode": "// \n// cocos2d::CCParticleSystemQuad::initTexCoordsWithRect from 0x18006a830 to 0x18006aa0c (476 bytes)\n// \n// 5 xrefs:\n// > cocos2d::CCParticleSystemQuad::setTextureWithRect @ 0x18006ad48\n// > cocos2d::CCParticleSystemQuad::setTotalParticles @ 0x18006ae92\n// > cocos2d::CCParticleSystemQuad::updateTexCoords @ 0x18006b3f1\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b3ce4\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::CCParticleSystemQuad::initTexCoordsWithRect(\n        cocos2d::CCParticleSystemQuad *this,\n        const struct cocos2d::CCRect *a2)\n{\n  cocos2d::CCDirector *v4; // rax\n  float v5; // xmm8_4\n  cocos2d::CCDirector *v6; // rax\n  float v7; // xmm7_4\n  cocos2d::CCDirector *v8; // rax\n  float v9; // xmm6_4\n  cocos2d::CCDirector *v10; // rax\n  float ContentScaleFactor; // xmm0_4\n  cocos2d::CCTexture2D *m_pTexture; // rcx\n  float width; // xmm9_4\n  float height; // xmm1_4\n  cocos2d::CCParticleBatchNode *m_pBatchNode; // rcx\n  float v16; // xmm8_4\n  float v17; // xmm7_4\n  float v18; // xmm9_4\n  float v19; // xmm7_4\n  float v20; // xmm6_4\n  cocos2d::ccV3F_C4B_T2F_Quad *m_pQuads; // r9\n  unsigned int m_uAtlasIndex; // r8d\n  unsigned int m_uTotalParticles; // edx\n  float *p_v; // rax\n  __int64 v25; // rcx\n  cocos2d::CCRect v26; // [rsp+30h] [rbp-58h] BYREF\n\n  cocos2d::CCRect::operator=((float *)&this->m_tTextureRect.origin, (float *)&a2->origin);\n  v4 = cocos2d::CCDirector::sharedDirector();\n  v5 = cocos2d::CCDirector::getContentScaleFactor(v4) * a2->size.height;\n  v6 = cocos2d::CCDirector::sharedDirector();\n  v7 = cocos2d::CCDirector::getContentScaleFactor(v6) * a2->size.width;\n  v8 = cocos2d::CCDirector::sharedDirector();\n  v9 = cocos2d::CCDirector::getContentScaleFactor(v8) * a2->origin.y;\n  v10 = cocos2d::CCDirector::sharedDirector();\n  ContentScaleFactor = cocos2d::CCDirector::getContentScaleFactor(v10);\n  cocos2d::CCRect::CCRect(&v26, ContentScaleFactor * a2->origin.x, v9, v7, v5);\n  m_pTexture = this->m_pTexture;\n  width = a2->size.width;\n  height = a2->size.height;\n  if ( m_pTexture )\n  {\n    width = (float)((int (__fastcall *)(cocos2d::CCTexture2D *))m_pTexture->getPixelsWide)(m_pTexture);\n    height = (float)((int (__fastcall *)(cocos2d::CCTexture2D *))this->m_pTexture->getPixelsHigh)(this->m_pTexture);\n  }\n  m_pBatchNode = this->m_pBatchNode;\n  v16 = v26.origin.x / width;\n  v17 = v26.size.width / width;\n  v18 = v26.origin.y / height;\n  v19 = v17 + v16;\n  v20 = (float)(v26.origin.y / height) + (float)(v26.size.height / height);\n  if ( m_pBatchNode )\n  {\n    m_pQuads = (cocos2d::ccV3F_C4B_T2F_Quad *)((__int64 (__fastcall *)(cocos2d::CCTextureAtlas *))m_pBatchNode->m_pTextureAtlas->getQuads)(m_pBatchNode->m_pTextureAtlas);\n    m_uAtlasIndex = this->m_uAtlasIndex;\n    m_uTotalParticles = m_uAtlasIndex + this->m_uTotalParticles;\n  }\n  else\n  {\n    m_pQuads = this->m_pQuads;\n    m_uAtlasIndex = 0;\n    m_uTotalParticles = this->m_uTotalParticles;\n  }\n  if ( m_uAtlasIndex < m_uTotalParticles )\n  {\n    p_v = &m_pQuads[m_uAtlasIndex].bl.texCoords.v;\n    v25 = m_uTotalParticles - m_uAtlasIndex;\n    do\n    {\n      *(p_v - 1) = v16;\n      *p_v = v20;\n      p_v[11] = v19;\n      p_v[12] = v20;\n      *(p_v - 7) = v16;\n      *(p_v - 6) = v18;\n      p_v[5] = v19;\n      p_v[6] = v18;\n      p_v += 24;\n      --v25;\n    }\n    while ( v25 );\n  }\n}", "assembly": "; \n; cocos2d::CCParticleSystemQuad::initTexCoordsWithRect from 0x18006a830 to 0x18006aa0c (476 bytes)\n; \n; 5 xrefs:\n; > cocos2d::CCParticleSystemQuad::setTextureWithRect @ 0x18006ad48\n; > cocos2d::CCParticleSystemQuad::setTotalParticles @ 0x18006ae92\n; > cocos2d::CCParticleSystemQuad::updateTexCoords @ 0x18006b3f1\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b3ce4\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_0], rbx                                               ; +0x0, 0x18006a830\npush    rdi                                                            ; +0x5, 0x18006a835\nsub     rsp, 80h                                                       ; +0x6, 0x18006a836\nmovaps  [rsp+88h+var_18], xmm6                                         ; +0xd, 0x18006a83d\nmov     rdi, rcx                                                       ; +0x12, 0x18006a842\nmovaps  [rsp+88h+var_28], xmm7                                         ; +0x15, 0x18006a845\nadd     rcx, 330h                                                      ; +0x1a, 0x18006a84a\nmovaps  [rsp+88h+var_38], xmm8                                         ; +0x21, 0x18006a851\nmov     rbx, rdx                                                       ; +0x27, 0x18006a857\nmovaps  [rsp+88h+var_48], xmm9                                         ; +0x2a, 0x18006a85a\ncall    ??4CCRect@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCRect::operator=(cocos2d::CCRect const &) ; +0x30, 0x18006a860\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x35, 0x18006a865\nmov     rcx, rax; this                                                 ; +0x3a, 0x18006a86a\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x3d, 0x18006a86d\nmovaps  xmm8, xmm0                                                     ; +0x42, 0x18006a872\nmulss   xmm8, dword ptr [rbx+0Ch]                                      ; +0x46, 0x18006a876\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x4c, 0x18006a87c\nmov     rcx, rax; this                                                 ; +0x51, 0x18006a881\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x54, 0x18006a884\nmovaps  xmm7, xmm0                                                     ; +0x59, 0x18006a889\nmulss   xmm7, dword ptr [rbx+8]                                        ; +0x5c, 0x18006a88c\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x61, 0x18006a891\nmov     rcx, rax; this                                                 ; +0x66, 0x18006a896\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x69, 0x18006a899\nmovaps  xmm6, xmm0                                                     ; +0x6e, 0x18006a89e\nmulss   xmm6, dword ptr [rbx+4]                                        ; +0x71, 0x18006a8a1\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x76, 0x18006a8a6\nmov     rcx, rax; this                                                 ; +0x7b, 0x18006a8ab\ncall    ?getContentScaleFactor@CCDirector@cocos2d@@QEAAMXZ; cocos2d::CCDirector::getContentScaleFactor(void) ; +0x7e, 0x18006a8ae\nmulss   xmm0, dword ptr [rbx]                                          ; +0x83, 0x18006a8b3\nlea     rcx, [rsp+88h+var_58]; this                                    ; +0x87, 0x18006a8b7\nmovaps  xmm3, xmm7; float                                              ; +0x8c, 0x18006a8bc\nmovss   [rsp+88h+var_68], xmm8; float                                  ; +0x8f, 0x18006a8bf\nmovaps  xmm2, xmm6; float                                              ; +0x96, 0x18006a8c6\nmovaps  xmm1, xmm0; float                                              ; +0x99, 0x18006a8c9\ncall    ??0CCRect@cocos2d@@QEAA@MMMM@Z; cocos2d::CCRect::CCRect(float,float,float,float) ; +0x9c, 0x18006a8cc\nmov     rcx, [rdi+2A0h]                                                ; +0xa1, 0x18006a8d1\nmovss   xmm9, dword ptr [rbx+8]                                        ; +0xa8, 0x18006a8d8\nmovss   xmm1, dword ptr [rbx+0Ch]                                      ; +0xae, 0x18006a8de\ntest    rcx, rcx                                                       ; +0xb3, 0x18006a8e3\njz      short loc_18006A910                                            ; +0xb6, 0x18006a8e6\nmov     rax, [rcx]                                                     ; +0xb8, 0x18006a8e8\ncall    qword ptr [rax+50h]                                            ; +0xbb, 0x18006a8eb\nmov     rcx, [rdi+2A0h]                                                ; +0xbe, 0x18006a8ee\nxorps   xmm9, xmm9                                                     ; +0xc5, 0x18006a8f5\nmov     eax, eax                                                       ; +0xc9, 0x18006a8f9\ncvtsi2ss xmm9, rax                                                     ; +0xcb, 0x18006a8fb\nmov     rax, [rcx]                                                     ; +0xd0, 0x18006a900\ncall    qword ptr [rax+58h]                                            ; +0xd3, 0x18006a903\nmov     eax, eax                                                       ; +0xd6, 0x18006a906\nxorps   xmm1, xmm1                                                     ; +0xd8, 0x18006a908\ncvtsi2ss xmm1, rax                                                     ; +0xdb, 0x18006a90b\nmovss   xmm6, [rsp+88h+var_54]                                         ; +0xe0, 0x18006a910\nmovss   xmm8, [rsp+88h+var_58]                                         ; +0xe6, 0x18006a916\nmovss   xmm7, [rsp+88h+var_50]                                         ; +0xed, 0x18006a91d\nmovss   xmm0, [rsp+88h+var_4C]                                         ; +0xf3, 0x18006a923\nmov     rcx, [rdi+1B8h]                                                ; +0xf9, 0x18006a929\ndivss   xmm6, xmm1                                                     ; +0x100, 0x18006a930\ndivss   xmm8, xmm9                                                     ; +0x104, 0x18006a934\ndivss   xmm7, xmm9                                                     ; +0x109, 0x18006a939\nmovaps  xmm9, xmm6                                                     ; +0x10e, 0x18006a93e\naddss   xmm7, xmm8                                                     ; +0x112, 0x18006a942\ndivss   xmm0, xmm1                                                     ; +0x117, 0x18006a947\naddss   xmm6, xmm0                                                     ; +0x11b, 0x18006a94b\ntest    rcx, rcx                                                       ; +0x11f, 0x18006a94f\njz      short loc_18006A976                                            ; +0x122, 0x18006a952\nmov     rcx, [rcx+148h]                                                ; +0x124, 0x18006a954\nmov     rax, [rcx]                                                     ; +0x12b, 0x18006a95b\ncall    qword ptr [rax+68h]                                            ; +0x12e, 0x18006a95e\nmov     edx, [rdi+298h]                                                ; +0x131, 0x18006a961\nmov     r9, rax                                                        ; +0x137, 0x18006a967\nmov     r8d, [rdi+1C0h]                                                ; +0x13a, 0x18006a96a\nadd     edx, r8d                                                       ; +0x141, 0x18006a971\njmp     short loc_18006A986                                            ; +0x144, 0x18006a974\nmov     r9, [rdi+318h]                                                 ; +0x146, 0x18006a976\nxor     r8d, r8d                                                       ; +0x14d, 0x18006a97d\nmov     edx, [rdi+298h]                                                ; +0x150, 0x18006a980\ncmp     r8d, edx                                                       ; +0x156, 0x18006a986\njnb     short loc_18006A9E5                                            ; +0x159, 0x18006a989\nmov     eax, r8d                                                       ; +0x15b, 0x18006a98b\nlea     rax, [rax+rax*2]                                               ; +0x15e, 0x18006a98e\nshl     rax, 5                                                         ; +0x162, 0x18006a992\nadd     rax, 2Ch ; ','                                                 ; +0x166, 0x18006a996\nadd     rax, r9                                                        ; +0x16a, 0x18006a99a\nsub     edx, r8d                                                       ; +0x16d, 0x18006a99d\nmov     ecx, edx                                                       ; +0x170, 0x18006a9a0\nnop     dword ptr [rax+00h]                                            ; +0x172, 0x18006a9a2\nnop     word ptr [rax+rax+00000000h]                                   ; +0x176, 0x18006a9a6\nmovss   dword ptr [rax-4], xmm8                                        ; +0x180, 0x18006a9b0\nmovss   dword ptr [rax], xmm6                                          ; +0x186, 0x18006a9b6\nmovss   dword ptr [rax+2Ch], xmm7                                      ; +0x18a, 0x18006a9ba\nmovss   dword ptr [rax+30h], xmm6                                      ; +0x18f, 0x18006a9bf\nmovss   dword ptr [rax-1Ch], xmm8                                      ; +0x194, 0x18006a9c4\nmovss   dword ptr [rax-18h], xmm9                                      ; +0x19a, 0x18006a9ca\nmovss   dword ptr [rax+14h], xmm7                                      ; +0x1a0, 0x18006a9d0\nmovss   dword ptr [rax+18h], xmm9                                      ; +0x1a5, 0x18006a9d5\nlea     rax, [rax+60h]                                                 ; +0x1ab, 0x18006a9db\nsub     rcx, 1                                                         ; +0x1af, 0x18006a9df\njnz     short loc_18006A9B0                                            ; +0x1b3, 0x18006a9e3\nmov     rbx, [rsp+88h+arg_0]                                           ; +0x1b5, 0x18006a9e5\nmovaps  xmm6, [rsp+88h+var_18]                                         ; +0x1bd, 0x18006a9ed\nmovaps  xmm7, [rsp+88h+var_28]                                         ; +0x1c2, 0x18006a9f2\nmovaps  xmm8, [rsp+88h+var_38]                                         ; +0x1c7, 0x18006a9f7\nmovaps  xmm9, [rsp+88h+var_48]                                         ; +0x1cd, 0x18006a9fd\nadd     rsp, 80h                                                       ; +0x1d3, 0x18006aa03\npop     rdi                                                            ; +0x1da, 0x18006aa0a\nretn                                                                   ; +0x1db, 0x18006aa0b", "xrefs": ["cocos2d::CCParticleSystemQuad::setTextureWithRect @ 0x18006ad48", "cocos2d::CCParticleSystemQuad::setTotalParticles @ 0x18006ae92", "cocos2d::CCParticleSystemQuad::updateTexCoords @ 0x18006b3f1", "<???> @ 0x1801438a8", "<???> @ 0x1801b3ce4"], "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"}