{"type": "func", "start": 6442835440, "end": 6442835843, "name": "cocos2d::CCProgressTimer::initWithSprite", "pseudocode": "// \n// cocos2d::CCProgressTimer::initWithSprite from 0x18005ddf0 to 0x18005df83 (403 bytes)\n// \n// 3 xrefs:\n// > cocos2d::CCProgressTimer::create @ 0x18005dae6\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b321c\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::CCProgressTimer::initWithSprite(\n        cocos2d::CCProgressTimer *this,\n        struct cocos2d::CCSprite *a2,\n        __int64 a3,\n        float a4)\n{\n  float v6; // xmm0_4\n  cocos2d::CCProgressTimerType m_eType; // ecx\n  cocos2d::CCSize *v8; // rax\n  cocos2d::CCProgressTimer_vtbl *v9; // rbx\n  float *v10; // rax\n  float *v11; // rax\n  cocos2d::CCSprite *m_pSprite; // rcx\n  cocos2d::CCProgressTimer_vtbl *v13; // rbx\n  __int64 v14; // rax\n  cocos2d::ccV2F_C4B_T2F *m_pVertexData; // rcx\n  cocos2d::CCProgressTimer_vtbl *v16; // rbx\n  cocos2d::CCShaderCache *v17; // rax\n  struct cocos2d::CCGLProgram *v18; // rax\n  float v20; // [rsp+40h] [rbp+8h] BYREF\n\n  if ( this->m_fPercentage != 0.0 )\n  {\n    v6 = cocos2d::clampf((cocos2d *)this, 0.0, 100.0, a4);\n    m_eType = this->m_eType;\n    this->m_fPercentage = v6;\n    if ( m_eType )\n    {\n      if ( m_eType == kCCProgressTimerTypeBar )\n        cocos2d::CCProgressTimer::updateBar(this);\n    }\n    else\n    {\n      cocos2d::CCProgressTimer::updateRadial(this);\n    }\n  }\n  this->m_pVertexData = nullptr;\n  this->m_nVertexDataCount = 0;\n  v8 = (cocos2d::CCSize *)kmVec2Fill(&v20, 0.5, 0.5);\n  cocos2d::CCNode::setAnchorPoint(this, v8);\n  v9 = this->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n  this->m_eType = kCCProgressTimerTypeRadial;\n  this->m_bReverseDirection = 0;\n  v10 = kmVec2Fill(&v20, 0.5, 0.5);\n  ((void (__fastcall *)(cocos2d::CCProgressTimer *, float *))v9->setMidpoint)(this, v10);\n  v11 = kmVec2Fill(&v20, 1.0, 1.0);\n  cocos2d::CCSize::operator=(&this->m_tBarChangeRate, v11);\n  if ( this->m_pSprite != a2 )\n  {\n    if ( a2 )\n      cocos2d::CCObject::retain(a2);\n    m_pSprite = this->m_pSprite;\n    if ( m_pSprite )\n      cocos2d::CCObject::release(m_pSprite);\n    v13 = this->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n    this->m_pSprite = a2;\n    v14 = ((__int64 (__fastcall *)(struct cocos2d::CCSprite *))a2->getContentSize)(a2);\n    ((void (__fastcall *)(cocos2d::CCProgressTimer *, __int64))v13->setContentSize)(this, v14);\n    m_pVertexData = this->m_pVertexData;\n    if ( m_pVertexData )\n    {\n      free(m_pVertexData);\n      this->m_pVertexData = nullptr;\n      this->m_nVertexDataCount = 0;\n    }\n  }\n  v16 = this->cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n  v17 = cocos2d::CCShaderCache::sharedShaderCache();\n  v18 = cocos2d::CCShaderCache::programForKey(v17, \"ShaderPositionTextureColor\");\n  ((void (__fastcall *)(cocos2d::CCProgressTimer *, struct cocos2d::CCGLProgram *))v16->setShaderProgram)(this, v18);\n  return 1;\n}", "assembly": "; \n; cocos2d::CCProgressTimer::initWithSprite from 0x18005ddf0 to 0x18005df83 (403 bytes)\n; \n; 3 xrefs:\n; > cocos2d::CCProgressTimer::create @ 0x18005dae6\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b321c\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, 0x18005ddf0\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x18005ddf5\nmov     [rsp+arg_18], rsi                                              ; +0xa, 0x18005ddfa\npush    rdi                                                            ; +0xf, 0x18005ddff\nsub     rsp, 30h                                                       ; +0x10, 0x18005de00\nmovss   xmm1, dword ptr [rcx+15Ch]                                     ; +0x14, 0x18005de04\nxorps   xmm0, xmm0                                                     ; +0x1c, 0x18005de0c\nucomiss xmm1, xmm0                                                     ; +0x1f, 0x18005de0f\nmov     rsi, rdx                                                       ; +0x22, 0x18005de12\nmov     rdi, rcx                                                       ; +0x25, 0x18005de15\nmovaps  [rsp+38h+var_18], xmm6                                         ; +0x28, 0x18005de18\njp      short loc_18005DE21                                            ; +0x2d, 0x18005de1d\njz      short loc_18005DE5A                                            ; +0x2f, 0x18005de1f\nmovss   xmm2, cs:flt_1800EA220; float                                  ; +0x31, 0x18005de21\nxorps   xmm1, xmm1; float                                              ; +0x39, 0x18005de29\ncall    ?clampf@cocos2d@@YAMMMM@Z; cocos2d::clampf(float,float,float)  ; +0x3c, 0x18005de2c\nmov     ecx, [rdi+158h]                                                ; +0x41, 0x18005de31\nmovss   dword ptr [rdi+15Ch], xmm0                                     ; +0x47, 0x18005de37\ntest    ecx, ecx                                                       ; +0x4f, 0x18005de3f\njz      short loc_18005DE52                                            ; +0x51, 0x18005de41\ncmp     ecx, 1                                                         ; +0x53, 0x18005de43\njnz     short loc_18005DE5A                                            ; +0x56, 0x18005de46\nmov     rcx, rdi; this                                                 ; +0x58, 0x18005de48\ncall    ?updateBar@CCProgressTimer@cocos2d@@IEAAXXZ; cocos2d::CCProgressTimer::updateBar(void) ; +0x5b, 0x18005de4b\njmp     short loc_18005DE5A                                            ; +0x60, 0x18005de50\nmov     rcx, rdi; this                                                 ; +0x62, 0x18005de52\ncall    ?updateRadial@CCProgressTimer@cocos2d@@IEAAXXZ; cocos2d::CCProgressTimer::updateRadial(void) ; +0x65, 0x18005de55\nmovss   xmm6, cs:dword_1800E6308                                       ; +0x6a, 0x18005de5a\nlea     rcx, [rsp+38h+arg_0]                                           ; +0x72, 0x18005de62\nxor     ebp, ebp                                                       ; +0x77, 0x18005de67\nmovaps  xmm2, xmm6                                                     ; +0x79, 0x18005de69\nmovaps  xmm1, xmm6                                                     ; +0x7c, 0x18005de6c\nmov     [rdi+170h], rbp                                                ; +0x7f, 0x18005de6f\nmov     [rdi+168h], ebp                                                ; +0x86, 0x18005de76\ncall    kmVec2Fill                                                     ; +0x8c, 0x18005de7c\nmov     rdx, rax; struct cocos2d::CCPoint *                            ; +0x91, 0x18005de81\nmov     rcx, rdi; this                                                 ; +0x94, 0x18005de84\ncall    ?setAnchorPoint@CCNode@cocos2d@@UEAAXAEBVCCPoint@2@@Z; cocos2d::CCNode::setAnchorPoint(cocos2d::CCPoint const &) ; +0x97, 0x18005de87\nmov     rbx, [rdi]                                                     ; +0x9c, 0x18005de8c\nlea     rcx, [rsp+38h+arg_0]                                           ; +0x9f, 0x18005de8f\nmovaps  xmm2, xmm6                                                     ; +0xa4, 0x18005de94\nmov     [rdi+158h], ebp                                                ; +0xa7, 0x18005de97\nmovaps  xmm1, xmm6                                                     ; +0xad, 0x18005de9d\nmov     [rdi+188h], bpl                                                ; +0xb0, 0x18005dea0\ncall    kmVec2Fill                                                     ; +0xb7, 0x18005dea7\nmov     rdx, rax                                                       ; +0xbc, 0x18005deac\nmov     rcx, rdi                                                       ; +0xbf, 0x18005deaf\ncall    qword ptr [rbx+380h]                                           ; +0xc2, 0x18005deb2\nmovss   xmm1, cs:flt_1800E61A8                                         ; +0xc8, 0x18005deb8\nlea     rcx, [rsp+38h+arg_0]                                           ; +0xd0, 0x18005dec0\nmovaps  xmm2, xmm1                                                     ; +0xd5, 0x18005dec5\ncall    kmVec2Fill                                                     ; +0xd8, 0x18005dec8\nlea     rcx, [rdi+180h]                                                ; +0xdd, 0x18005decd\nmov     rdx, rax                                                       ; +0xe4, 0x18005ded4\ncall    ??4CCSize@cocos2d@@QEAAAEAV01@AEBVCCPoint@1@@Z; cocos2d::CCSize::operator=(cocos2d::CCPoint const &) ; +0xe7, 0x18005ded7\ncmp     [rdi+160h], rsi                                                ; +0xec, 0x18005dedc\njz      short loc_18005DF44                                            ; +0xf3, 0x18005dee3\ntest    rsi, rsi                                                       ; +0xf5, 0x18005dee5\njz      short loc_18005DEF2                                            ; +0xf8, 0x18005dee8\nmov     rcx, rsi; this                                                 ; +0xfa, 0x18005deea\ncall    ?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0xfd, 0x18005deed\nmov     rcx, [rdi+160h]; this                                          ; +0x102, 0x18005def2\ntest    rcx, rcx                                                       ; +0x109, 0x18005def9\njz      short loc_18005DF03                                            ; +0x10c, 0x18005defc\ncall    ?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0x10e, 0x18005defe\nmov     rbx, [rdi]                                                     ; +0x113, 0x18005df03\nmov     rcx, rsi                                                       ; +0x116, 0x18005df06\nmov     [rdi+160h], rsi                                                ; +0x119, 0x18005df09\nmov     rax, [rsi]                                                     ; +0x120, 0x18005df10\ncall    qword ptr [rax+130h]                                           ; +0x123, 0x18005df13\nmov     rdx, rax                                                       ; +0x129, 0x18005df19\nmov     rcx, rdi                                                       ; +0x12c, 0x18005df1c\ncall    qword ptr [rbx+128h]                                           ; +0x12f, 0x18005df1f\nmov     rcx, [rdi+170h]; Block                                         ; +0x135, 0x18005df25\ntest    rcx, rcx                                                       ; +0x13c, 0x18005df2c\njz      short loc_18005DF44                                            ; +0x13f, 0x18005df2f\ncall    cs:__imp_free                                                  ; +0x141, 0x18005df31\nmov     [rdi+170h], rbp                                                ; +0x147, 0x18005df37\nmov     [rdi+168h], ebp                                                ; +0x14e, 0x18005df3e\nmov     rbx, [rdi]                                                     ; +0x154, 0x18005df44\ncall    ?sharedShaderCache@CCShaderCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCShaderCache::sharedShaderCache(void) ; +0x157, 0x18005df47\nmov     rcx, rax; this                                                 ; +0x15c, 0x18005df4c\nlea     rdx, aShaderposition_3; \"ShaderPositionTextureColor\"           ; +0x15f, 0x18005df4f\ncall    ?programForKey@CCShaderCache@cocos2d@@QEAAPEAVCCGLProgram@2@PEBD@Z; cocos2d::CCShaderCache::programForKey(char const *) ; +0x166, 0x18005df56\nmov     rdx, rax                                                       ; +0x16b, 0x18005df5b\nmov     rcx, rdi                                                       ; +0x16e, 0x18005df5e\ncall    qword ptr [rbx+280h]                                           ; +0x171, 0x18005df61\nmov     rbx, [rsp+38h+arg_8]                                           ; +0x177, 0x18005df67\nmov     al, 1                                                          ; +0x17c, 0x18005df6c\nmov     rbp, [rsp+38h+arg_10]                                          ; +0x17e, 0x18005df6e\nmov     rsi, [rsp+38h+arg_18]                                          ; +0x183, 0x18005df73\nmovaps  xmm6, [rsp+38h+var_18]                                         ; +0x188, 0x18005df78\nadd     rsp, 30h                                                       ; +0x18d, 0x18005df7d\npop     rdi                                                            ; +0x191, 0x18005df81\nretn                                                                   ; +0x192, 0x18005df82", "xrefs": ["cocos2d::CCProgressTimer::create @ 0x18005dae6", "<???> @ 0x1801438a8", "<???> @ 0x1801b321c"], "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"}