{"type": "func", "start": 6442668720, "end": 6442669072, "name": "cocos2d::CCAnimate::initWithAnimation", "pseudocode": "// \n// cocos2d::CCAnimate::initWithAnimation from 0x1800352b0 to 0x180035410 (352 bytes)\n// \n// 5 xrefs:\n// > cocos2d::CCAnimate::copyWithZone @ 0x180031b11\n// > cocos2d::CCAnimate::create @ 0x180033586\n// > cocos2d::CCAnimate::reverse @ 0x180035ad5\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b0750\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\nchar __fastcall cocos2d::CCAnimate::initWithAnimation(cocos2d::CCAnimate *this, struct cocos2d::CCAnimation *a2)\n{\n  double v4; // xmm0_8\n  float v5; // xmm8_4\n  float v6; // xmm6_4\n  float v7; // xmm1_4\n  cocos2d::CCObject *m_pSplitTimes; // rcx\n  unsigned int v9; // eax\n  _QWORD *v10; // rcx\n  float v11; // xmm7_4\n  cocos2d::CCArray *m_pFrames; // rbx\n  cocos2d::ccArray *data; // rbx\n  __int64 num; // rax\n  cocos2d::CCObject **arr; // rbx\n  cocos2d::CCObject **i; // rsi\n  __int64 v17; // rcx\n  float v18; // xmm0_4\n  float *v19; // rdx\n  float v20; // xmm0_4\n  __int64 v22; // [rsp+60h] [rbp+8h] BYREF\n\n  v4 = ((double (__fastcall *)(struct cocos2d::CCAnimation *))a2->getTotalDelayUnits)(a2);\n  v5 = *(float *)&v4;\n  v6 = 0.0;\n  v7 = (float)(int)a2->m_uLoops * *(float *)&v4;\n  this->m_fDuration = v7;\n  if ( v7 == 0.0 )\n    this->m_fDuration = 0.00000011920929;\n  this->m_bFirstTick = 1;\n  this->m_elapsed = 0.0;\n  LODWORD(this->m_pOrigFrame) = 0;\n  if ( (struct cocos2d::CCAnimation *)this->m_pSplitTimes != a2 )\n  {\n    cocos2d::CCObject::retain(a2);\n    m_pSplitTimes = (cocos2d::CCObject *)this->m_pSplitTimes;\n    if ( m_pSplitTimes )\n      cocos2d::CCObject::release(m_pSplitTimes);\n    this->m_pSplitTimes = (std::vector<float> *)a2;\n  }\n  *(_QWORD *)&this->m_uExecutedLoops = 0;\n  *((_DWORD *)this + 32) = 0;\n  v9 = cocos2d::CCArray::count(a2->m_pFrames);\n  v10 = *(_QWORD **)&this->m_nNextFrame;\n  v22 = v9;\n  if ( v9 > (unsigned __int64)((__int64)(v10[2] - *v10) >> 2) )\n    sub_1800308E0((__int64)v10, &v22);\n  v11 = *(float *)&v4 / a2->m_fTotalDelayUnits;\n  m_pFrames = a2->m_pFrames;\n  if ( m_pFrames )\n  {\n    data = m_pFrames->data;\n    num = data->num;\n    if ( (_DWORD)num )\n    {\n      arr = data->arr;\n      for ( i = &arr[num - 1]; arr <= i; ++arr )\n      {\n        if ( !*arr )\n          break;\n        v17 = *(_QWORD *)&this->m_nNextFrame;\n        v18 = v11 * v6;\n        v6 = v6 + *(float *)&(*arr)[1].m_uID;\n        v19 = *(float **)(v17 + 8);\n        v20 = v18 / v5;\n        *(float *)&v22 = v20;\n        if ( v19 == *(float **)(v17 + 16) )\n        {\n          sub_180030780((const void **)v17, v19, &v22);\n        }\n        else\n        {\n          *v19 = v20;\n          *(_QWORD *)(v17 + 8) = v19 + 1;\n        }\n      }\n    }\n  }\n  return 1;\n}", "assembly": "; \n; cocos2d::CCAnimate::initWithAnimation from 0x1800352b0 to 0x180035410 (352 bytes)\n; \n; 5 xrefs:\n; > cocos2d::CCAnimate::copyWithZone @ 0x180031b11\n; > cocos2d::CCAnimate::create @ 0x180033586\n; > cocos2d::CCAnimate::reverse @ 0x180035ad5\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b0750\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_8], rbx                                               ; +0x0, 0x1800352b0\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x1800352b5\npush    rdi                                                            ; +0xa, 0x1800352ba\nsub     rsp, 50h                                                       ; +0xb, 0x1800352bb\nmov     rax, [rdx]                                                     ; +0xf, 0x1800352bf\nmov     rdi, rcx                                                       ; +0x12, 0x1800352c2\nmovaps  [rsp+58h+var_18], xmm6                                         ; +0x15, 0x1800352c5\nmov     rcx, rdx                                                       ; +0x1a, 0x1800352ca\nmovaps  [rsp+58h+var_28], xmm7                                         ; +0x1d, 0x1800352cd\nmov     rbx, rdx                                                       ; +0x22, 0x1800352d2\nmovaps  [rsp+58h+var_38], xmm8                                         ; +0x25, 0x1800352d5\ncall    qword ptr [rax+48h]                                            ; +0x2b, 0x1800352db\nmov     eax, [rbx+54h]                                                 ; +0x2e, 0x1800352de\nxorps   xmm1, xmm1                                                     ; +0x31, 0x1800352e1\nmovaps  xmm8, xmm0                                                     ; +0x34, 0x1800352e4\nxorps   xmm6, xmm6                                                     ; +0x38, 0x1800352e8\ncvtsi2ss xmm1, rax                                                     ; +0x3b, 0x1800352eb\nmulss   xmm1, xmm8                                                     ; +0x40, 0x1800352f0\nucomiss xmm1, xmm6                                                     ; +0x45, 0x1800352f5\nmovss   dword ptr [rdi+50h], xmm1                                      ; +0x48, 0x1800352f8\njp      short loc_180035308                                            ; +0x4d, 0x1800352fd\njnz     short loc_180035308                                            ; +0x4f, 0x1800352ff\nmov     dword ptr [rdi+50h], 34000000h                                 ; +0x51, 0x180035301\nxor     esi, esi                                                       ; +0x58, 0x180035308\nmov     byte ptr [rdi+5Ch], 1                                          ; +0x5a, 0x18003530a\nmov     [rdi+58h], esi                                                 ; +0x5e, 0x18003530e\nmov     [rdi+70h], esi                                                 ; +0x61, 0x180035311\ncmp     [rdi+60h], rbx                                                 ; +0x64, 0x180035314\njz      short loc_180035334                                            ; +0x68, 0x180035318\nmov     rcx, rbx; this                                                 ; +0x6a, 0x18003531a\ncall    ?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0x6d, 0x18003531d\nmov     rcx, [rdi+60h]; this                                           ; +0x72, 0x180035322\ntest    rcx, rcx                                                       ; +0x76, 0x180035326\njz      short loc_180035330                                            ; +0x79, 0x180035329\ncall    ?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0x7b, 0x18003532b\nmov     [rdi+60h], rbx                                                 ; +0x80, 0x180035330\nmov     [rdi+78h], rsi                                                 ; +0x84, 0x180035334\nmov     [rdi+80h], esi                                                 ; +0x88, 0x180035338\nmov     rcx, [rbx+48h]; this                                           ; +0x8e, 0x18003533e\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x92, 0x180035342\nmov     rcx, [rdi+68h]                                                 ; +0x97, 0x180035347\nmov     edx, eax                                                       ; +0x9b, 0x18003534b\nmov     [rsp+58h+arg_0], rdx                                           ; +0x9d, 0x18003534d\nmov     rax, [rcx+10h]                                                 ; +0xa2, 0x180035352\nsub     rax, [rcx]                                                     ; +0xa6, 0x180035356\nsar     rax, 2                                                         ; +0xa9, 0x180035359\ncmp     rdx, rax                                                       ; +0xad, 0x18003535d\njbe     short loc_18003536C                                            ; +0xb0, 0x180035360\nlea     rdx, [rsp+58h+arg_0]                                           ; +0xb2, 0x180035362\ncall    sub_1800308E0                                                  ; +0xb7, 0x180035367\nmovaps  xmm7, xmm8                                                     ; +0xbc, 0x18003536c\ndivss   xmm7, dword ptr [rbx+38h]                                      ; +0xc0, 0x180035370\nmov     rbx, [rbx+48h]                                                 ; +0xc5, 0x180035375\ntest    rbx, rbx                                                       ; +0xc9, 0x180035379\njz      short loc_1800353EE                                            ; +0xcc, 0x18003537c\nmov     rbx, [rbx+38h]                                                 ; +0xce, 0x18003537e\nmov     eax, [rbx]                                                     ; +0xd2, 0x180035382\ntest    eax, eax                                                       ; +0xd4, 0x180035384\njz      short loc_1800353EE                                            ; +0xd6, 0x180035386\nmov     rbx, [rbx+10h]                                                 ; +0xd8, 0x180035388\nlea     rsi, [rax-1]                                                   ; +0xdc, 0x18003538c\nlea     rsi, [rbx+rsi*8]                                               ; +0xe0, 0x180035390\ncmp     rbx, rsi                                                       ; +0xe4, 0x180035394\nja      short loc_1800353EE                                            ; +0xe7, 0x180035397\nnop     dword ptr [rax+00000000h]                                      ; +0xe9, 0x180035399\nmov     rax, [rbx]                                                     ; +0xf0, 0x1800353a0\ntest    rax, rax                                                       ; +0xf3, 0x1800353a3\njz      short loc_1800353EE                                            ; +0xf6, 0x1800353a6\nmov     rcx, [rdi+68h]                                                 ; +0xf8, 0x1800353a8\nmovaps  xmm0, xmm7                                                     ; +0xfc, 0x1800353ac\nmulss   xmm0, xmm6                                                     ; +0xff, 0x1800353af\naddss   xmm6, dword ptr [rax+40h]                                      ; +0x103, 0x1800353b3\nmov     rdx, [rcx+8]                                                   ; +0x108, 0x1800353b8\ndivss   xmm0, xmm8                                                     ; +0x10c, 0x1800353bc\nmovss   dword ptr [rsp+58h+arg_0], xmm0                                ; +0x111, 0x1800353c1\ncmp     rdx, [rcx+10h]                                                 ; +0x117, 0x1800353c7\njz      short loc_1800353DB                                            ; +0x11b, 0x1800353cb\nlea     rax, [rdx+4]                                                   ; +0x11d, 0x1800353cd\nmovss   dword ptr [rdx], xmm0                                          ; +0x121, 0x1800353d1\nmov     [rcx+8], rax                                                   ; +0x125, 0x1800353d5\njmp     short loc_1800353E5                                            ; +0x129, 0x1800353d9\nlea     r8, [rsp+58h+arg_0]                                            ; +0x12b, 0x1800353db\ncall    sub_180030780                                                  ; +0x130, 0x1800353e0\nadd     rbx, 8                                                         ; +0x135, 0x1800353e5\ncmp     rbx, rsi                                                       ; +0x139, 0x1800353e9\njbe     short loc_1800353A0                                            ; +0x13c, 0x1800353ec\nmov     rbx, [rsp+58h+arg_8]                                           ; +0x13e, 0x1800353ee\nmov     al, 1                                                          ; +0x143, 0x1800353f3\nmov     rsi, [rsp+58h+arg_10]                                          ; +0x145, 0x1800353f5\nmovaps  xmm6, [rsp+58h+var_18]                                         ; +0x14a, 0x1800353fa\nmovaps  xmm7, [rsp+58h+var_28]                                         ; +0x14f, 0x1800353ff\nmovaps  xmm8, [rsp+58h+var_38]                                         ; +0x154, 0x180035404\nadd     rsp, 50h                                                       ; +0x15a, 0x18003540a\npop     rdi                                                            ; +0x15e, 0x18003540e\nretn                                                                   ; +0x15f, 0x18003540f", "xrefs": ["cocos2d::CCAnimate::copyWithZone @ 0x180031b11", "cocos2d::CCAnimate::create @ 0x180033586", "cocos2d::CCAnimate::reverse @ 0x180035ad5", "<???> @ 0x1801438a8", "<???> @ 0x1801b0750"], "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"}