// // cocos2d::CCTextureCache::addUIImage from 0x1005ee8e0 to 0x1005eeb0b (555 bytes) // // 3 xrefs: // > cocos2d::CCSprite::setTexture @ 0x10028b2e9 // > sub_1004851D0 @ 0x100485250 // > cocos2d::CCParticleSystem::initWithDictionary @ 0x1007c870a // // This function is hookable on this platform! // // Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings // cocos2d::CCTexture2D *__fastcall cocos2d::CCTextureCache::addUIImage( cocos2d::CCTextureCache *a1, cocos2d::CCImage *a2, const char *a3) { cocos2d::CCImage *v4; // r12 cocos2d::CCTextureCache *v5; // rbx double v6; // xmm0_8 cocos2d::CCFileUtils *v7; // rax cocos2d::CCDictionary *m_pTextures; // r14 char *v9; // r13 size_t v10; // rax size_t v11; // r12 char *v12; // rbx size_t v13; // r14 cocos2d::CCTexture2D *v14; // r14 char *v15; // r15 __int64 v16; // rbx size_t v17; // rax size_t v18; // r12 char *v19; // r13 size_t v20; // rbx cocos2d::CCDictionary *v22; // [rsp+10h] [rbp-70h] __int64 v23; // [rsp+18h] [rbp-68h] __int128 v24; // [rsp+20h] [rbp-60h] BYREF char *v25; // [rsp+30h] [rbp-50h] __int128 __dst; // [rsp+40h] [rbp-40h] BYREF char *__s; // [rsp+50h] [rbp-30h] v4 = a2; v5 = a1; v6 = 0.0; v24 = 0; v25 = nullptr; if ( !a3 ) goto LABEL_15; v7 = cocos2d::CCFileUtils::sharedFileUtils(); ((void (__fastcall *)(__int128 *, cocos2d::CCFileUtils *, const char *, _QWORD))v7->createCCArrayWithContentsOfFile)( &__dst, v7, a3, 0); m_pTextures = a1->m_pTextures; v6 = *(double *)&__dst; v24 = __dst; v25 = __s; v9 = (char *)&v24 + 1; if ( (__dst & 1) != 0 ) v9 = __s; v10 = strlen(v9); if ( v10 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(*(double *)&__dst); v11 = v10; if ( v10 >= 0x17 ) { v22 = m_pTextures; v13 = 26; if ( (v10 | 7) != 0x17 ) v13 = (v10 | 7) + 1; v12 = (char *)operator new(v13); __s = v12; *(_QWORD *)&__dst = v13 | 1; *((_QWORD *)&__dst + 1) = v11; m_pTextures = v22; goto LABEL_11; } LOBYTE(__dst) = 2 * v10; v12 = (char *)&__dst + 1; if ( v10 ) LABEL_11: memmove(v12, v9, v11); v12[v11] = 0; v14 = (cocos2d::CCTexture2D *)cocos2d::CCDictionary::objectForKey_1((__int64)m_pTextures, (char *)&__dst); v5 = a1; v4 = a2; if ( (__dst & 1) != 0 ) operator delete(__s); if ( !v14 ) { LABEL_15: v14 = (cocos2d::CCTexture2D *)operator new(0x68u); sub_100477FC0((__int64)v14); cocos2d::CCTexture2D::initWithImage(v14, v4); if ( !a3 ) goto LABEL_30; if ( (v24 & 1) != 0 ) v15 = v25; else v15 = (char *)&v24 + 1; v16 = (__int64)v5->m_pTextures; v17 = strlen(v15); if ( v17 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v6); v18 = v17; if ( v17 >= 0x17 ) { v23 = v16; v20 = 26; if ( (v17 | 7) != 0x17 ) v20 = (v17 | 7) + 1; v19 = (char *)operator new(v20); __s = v19; *(_QWORD *)&__dst = v20 | 1; *((_QWORD *)&__dst + 1) = v18; v16 = v23; } else { LOBYTE(__dst) = 2 * v17; v19 = (char *)&__dst + 1; if ( !v17 ) goto LABEL_27; } memmove(v19, v15, v18); LABEL_27: v19[v18] = 0; cocos2d::CCDictionary::setObject_1(v16, v14, (char *)&__dst); if ( (__dst & 1) != 0 ) operator delete(__s); cocos2d::CCObject::autorelease(v14); } LABEL_30: if ( (v24 & 1) != 0 ) operator delete(v25); return v14; }
GD Web Decomp Icon

GD Web Decomp

Raw Source