{"type": "func", "start": 6443027072, "end": 6443027380, "name": "cocos2d::CCSprite::setTexture", "pseudocode": "// \n// cocos2d::CCSprite::setTexture from 0x18008ca80 to 0x18008cbb4 (308 bytes)\n// \n// 7 xrefs:\n// > <???> @ 0x1800ebd48\n// > <???> @ 0x1800ec220\n// > <???> @ 0x1800ecda0\n// > <???> @ 0x180103c58\n// > <???> @ 0x180106c80\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b5e2c\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\nvoid __fastcall cocos2d::CCSprite::setTexture(cocos2d::CCSprite *this, struct cocos2d::CCTexture2D *a2)\n{\n  __int64 v4; // rcx\n  __int64 v5; // rax\n  cocos2d::CCTextureCache *v6; // rax\n  cocos2d::CCImage *v7; // rax\n  cocos2d::CCImage *v8; // rsi\n  cocos2d::CCTextureCache *v9; // rax\n  cocos2d::CCObject *v10; // rcx\n\n  v4 = *(_QWORD *)&this->m_uAutoReleaseCount;\n  if ( v4 )\n  {\n    v5 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)(v4 + 320) + 16LL))(v4 + 320);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)v5 + 96LL))(v5);\n    ((void (__fastcall *)(struct cocos2d::CCTexture2D *))a2->getName)(a2);\n  }\n  if ( !a2 )\n  {\n    v6 = cocos2d::CCTextureCache::sharedTextureCache();\n    a2 = cocos2d::CCTextureCache::textureForKey(v6, \"cc_2x2_white_image\");\n    if ( !a2 )\n    {\n      v7 = (cocos2d::CCImage *)operator new(0x50u);\n      v8 = v7 ? cocos2d::CCImage::CCImage(v7) : nullptr;\n      cocos2d::CCImage::initWithImageData(v8, byte_1801A30B0, 16, kFmtRawData, 2, 2, 8);\n      v9 = cocos2d::CCTextureCache::sharedTextureCache();\n      a2 = cocos2d::CCTextureCache::addUIImage(v9, v8, \"cc_2x2_white_image\");\n      if ( v8 )\n        cocos2d::CCObject::release(v8);\n    }\n  }\n  if ( !*(_QWORD *)&this->m_uAutoReleaseCount && *(struct cocos2d::CCTexture2D **)&this->m_fVertexZ != a2 )\n  {\n    if ( a2 )\n      cocos2d::CCObject::retain(a2);\n    v10 = *(cocos2d::CCObject **)&this->m_fVertexZ;\n    if ( v10 )\n      cocos2d::CCObject::release(v10);\n    *(_QWORD *)&this->m_fVertexZ = a2;\n    (*(void (__fastcall **)(char *))(*((_QWORD *)this - 43) + 1048LL))((char *)this - 344);\n  }\n}", "assembly": "; \n; cocos2d::CCSprite::setTexture from 0x18008ca80 to 0x18008cbb4 (308 bytes)\n; \n; 7 xrefs:\n; > <???> @ 0x1800ebd48\n; > <???> @ 0x1800ec220\n; > <???> @ 0x1800ecda0\n; > <???> @ 0x180103c58\n; > <???> @ 0x180106c80\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b5e2c\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, 0x18008ca80\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x18008ca85\npush    rdi                                                            ; +0xa, 0x18008ca8a\nsub     rsp, 40h                                                       ; +0xb, 0x18008ca8b\nmov     rbx, rdx                                                       ; +0xf, 0x18008ca8f\nmov     rdi, rcx                                                       ; +0x12, 0x18008ca92\nmov     rcx, [rcx+18h]                                                 ; +0x15, 0x18008ca95\ntest    rcx, rcx                                                       ; +0x19, 0x18008ca99\njz      short loc_18008CABE                                            ; +0x1c, 0x18008ca9c\nadd     rcx, 140h                                                      ; +0x1e, 0x18008ca9e\nmov     rax, [rcx]                                                     ; +0x25, 0x18008caa5\ncall    qword ptr [rax+10h]                                            ; +0x28, 0x18008caa8\nmov     r8, [rax]                                                      ; +0x2b, 0x18008caab\nmov     rcx, rax                                                       ; +0x2e, 0x18008caae\ncall    qword ptr [r8+60h]                                             ; +0x31, 0x18008cab1\nmov     rax, [rbx]                                                     ; +0x35, 0x18008cab5\nmov     rcx, rbx                                                       ; +0x38, 0x18008cab8\ncall    qword ptr [rax+60h]                                            ; +0x3b, 0x18008cabb\ntest    rbx, rbx                                                       ; +0x3e, 0x18008cabe\njnz     loc_18008CB68                                                  ; +0x41, 0x18008cac1\ncall    ?sharedTextureCache@CCTextureCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCTextureCache::sharedTextureCache(void) ; +0x47, 0x18008cac7\nmov     rcx, rax; this                                                 ; +0x4c, 0x18008cacc\nlea     rdx, aCc2x2WhiteImag; \"cc_2x2_white_image\"                     ; +0x4f, 0x18008cacf\ncall    ?textureForKey@CCTextureCache@cocos2d@@QEAAPEAVCCTexture2D@2@PEBD@Z; cocos2d::CCTextureCache::textureForKey(char const *) ; +0x56, 0x18008cad6\nmov     rbx, rax                                                       ; +0x5b, 0x18008cadb\ntest    rax, rax                                                       ; +0x5e, 0x18008cade\njnz     loc_18008CB68                                                  ; +0x61, 0x18008cae1\nlea     ecx, [rax+50h]; Size                                           ; +0x67, 0x18008cae7\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x6a, 0x18008caea\nmov     [rsp+48h+arg_0], rax                                           ; +0x6f, 0x18008caef\ntest    rax, rax                                                       ; +0x74, 0x18008caf4\njz      short loc_18008CB06                                            ; +0x77, 0x18008caf7\nmov     rcx, rax; this                                                 ; +0x79, 0x18008caf9\ncall    ??0CCImage@cocos2d@@QEAA@XZ; cocos2d::CCImage::CCImage(void)   ; +0x7c, 0x18008cafc\nmov     rsi, rax                                                       ; +0x81, 0x18008cb01\njmp     short loc_18008CB08                                            ; +0x84, 0x18008cb04\nxor     esi, esi                                                       ; +0x86, 0x18008cb06\nmov     [rsp+48h+var_10], 0                                            ; +0x88, 0x18008cb08\nmov     [rsp+48h+var_18], 8                                            ; +0x90, 0x18008cb10\nmov     [rsp+48h+var_20], 2                                            ; +0x98, 0x18008cb18\nmov     [rsp+48h+var_28], 2                                            ; +0xa0, 0x18008cb20\nmov     r9d, 4                                                         ; +0xa8, 0x18008cb28\nlea     r8d, [r9+0Ch]                                                  ; +0xae, 0x18008cb2e\nlea     rdx, byte_1801A30B0                                            ; +0xb2, 0x18008cb32\nmov     rcx, rsi                                                       ; +0xb9, 0x18008cb39\ncall    ?initWithImageData@CCImage@cocos2d@@QEAA_NPEAXHW4EImageFormat@12@HHHH@Z; cocos2d::CCImage::initWithImageData(void *,int,cocos2d::CCImage::EImageFormat,int,int,int,int) ; +0xbc, 0x18008cb3c\ncall    ?sharedTextureCache@CCTextureCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCTextureCache::sharedTextureCache(void) ; +0xc1, 0x18008cb41\nmov     rcx, rax; this                                                 ; +0xc6, 0x18008cb46\nlea     r8, aCc2x2WhiteImag; \"cc_2x2_white_image\"                      ; +0xc9, 0x18008cb49\nmov     rdx, rsi; struct cocos2d::CCImage *                            ; +0xd0, 0x18008cb50\ncall    ?addUIImage@CCTextureCache@cocos2d@@QEAAPEAVCCTexture2D@2@PEAVCCImage@2@PEBD@Z; cocos2d::CCTextureCache::addUIImage(cocos2d::CCImage *,char const *) ; +0xd3, 0x18008cb53\nmov     rbx, rax                                                       ; +0xd8, 0x18008cb58\ntest    rsi, rsi                                                       ; +0xdb, 0x18008cb5b\njz      short loc_18008CB68                                            ; +0xde, 0x18008cb5e\nmov     rcx, rsi; this                                                 ; +0xe0, 0x18008cb60\ncall    ?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0xe3, 0x18008cb63\ncmp     qword ptr [rdi+18h], 0                                         ; +0xe8, 0x18008cb68\njnz     short loc_18008CBA4                                            ; +0xed, 0x18008cb6d\ncmp     [rdi+48h], rbx                                                 ; +0xef, 0x18008cb6f\njz      short loc_18008CBA4                                            ; +0xf3, 0x18008cb73\ntest    rbx, rbx                                                       ; +0xf5, 0x18008cb75\njz      short loc_18008CB82                                            ; +0xf8, 0x18008cb78\nmov     rcx, rbx; this                                                 ; +0xfa, 0x18008cb7a\ncall    ?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0xfd, 0x18008cb7d\nmov     rcx, [rdi+48h]; this                                           ; +0x102, 0x18008cb82\ntest    rcx, rcx                                                       ; +0x106, 0x18008cb86\njz      short loc_18008CB90                                            ; +0x109, 0x18008cb89\ncall    ?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0x10b, 0x18008cb8b\nmov     [rdi+48h], rbx                                                 ; +0x110, 0x18008cb90\nlea     rcx, [rdi-158h]                                                ; +0x114, 0x18008cb94\nmov     rax, [rcx]                                                     ; +0x11b, 0x18008cb9b\ncall    qword ptr [rax+418h]                                           ; +0x11e, 0x18008cb9e\nmov     rbx, [rsp+48h+arg_8]                                           ; +0x124, 0x18008cba4\nmov     rsi, [rsp+48h+arg_10]                                          ; +0x129, 0x18008cba9\nadd     rsp, 40h                                                       ; +0x12e, 0x18008cbae\npop     rdi                                                            ; +0x132, 0x18008cbb2\nretn                                                                   ; +0x133, 0x18008cbb3", "xrefs": ["<???> @ 0x1800ebd48", "<???> @ 0x1800ec220", "<???> @ 0x1800ecda0", "<???> @ 0x180103c58", "<???> @ 0x180106c80", "<???> @ 0x1801438a8", "<???> @ 0x1801b5e2c"], "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"}