// // cocos2d::CCSpriteFrameCache::addSpriteFramesWithDictionary from 0x180090660 to 0x1800912d6 (3190 bytes) // // 5 xrefs: // > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile @ 0x18009132f // > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile @ 0x18009179f // > cocos2d::CCSpriteFrameCache::addSpriteFramesWithFile @ 0x180091963 // > @ 0x1801438a8 // > @ 0x1801b6324 // // 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 // // Hidden C++ exception states: #wind=8 void __fastcall cocos2d::CCSpriteFrameCache::addSpriteFramesWithDictionary( cocos2d::CCSpriteFrameCache *this, struct cocos2d::CCDictionary *a2, struct cocos2d::CCTexture2D *a3) { struct cocos2d::CCTexture2D *v3; // r14 __int64 v5; // rbx void *v6; // rcx __int64 v7; // rsi void *v8; // rcx int v9; // r12d cocos2d::CCString *v10; // rax _QWORD *v11; // rsi _QWORD *v12; // r13 __int64 v13; // r15 size_t v14; // rbx unsigned __int64 v15; // rdi size_t v16; // rax void *v17; // rax void *v18; // r14 cocos2d::CCSpriteFrame *v19; // rsi cocos2d::CCString *v20; // rax float v21; // xmm11_4 void *v22; // rcx cocos2d::CCString *v23; // rax float v24; // xmm10_4 void *v25; // rcx cocos2d::CCString *v26; // rax float v27; // xmm9_4 void *v28; // rcx cocos2d::CCString *v29; // rax float v30; // xmm8_4 void *v31; // rcx cocos2d::CCString *v32; // rax float v33; // xmm7_4 void *v34; // rcx cocos2d::CCString *v35; // rax float v36; // xmm6_4 void *v37; // rcx cocos2d::CCString *v38; // rax int v39; // esi void *v40; // rcx cocos2d::CCString *v41; // rax int v42; // ebx void *v43; // rcx int v44; // edi int v45; // r14d cocos2d::CCSpriteFrame *v46; // rax cocos2d::CCSpriteFrame *v47; // rbx struct cocos2d::CCSize *v48; // rdi struct cocos2d::CCPoint *v49; // rbx cocos2d::CCRect *v50; // r8 cocos2d::CCString *v51; // rax std::string *v52; // rax cocos2d::CCString *v53; // rax std::string *v54; // rax cocos2d::CCString *v55; // rax std::string *v56; // rax cocos2d::CCString *v57; // rax struct cocos2d::CCRect *v58; // rax const char *v59; // r8 cocos2d::CCString *v60; // rax bool v61; // di cocos2d::CCObject *v62; // rax cocos2d::CCSpriteFrame *v63; // rax cocos2d::CCSpriteFrame *v64; // rbx cocos2d::CCRect *v65; // r8 struct cocos2d::CCPoint *v66; // rax cocos2d::CCString *v67; // rax struct cocos2d::CCRect *CString; // rax const char *v69; // r8 cocos2d::CCString *v70; // rax cocos2d::CCString *v71; // rax std::string *v72; // rax cocos2d::CCString *v73; // rax std::string *v74; // rax cocos2d::CCSpriteFrame *v75; // rax cocos2d::CCSpriteFrame *v76; // rbx void *v77; // rcx struct cocos2d::CCSize *v78; // [rsp+30h] [rbp-D8h] float v80[2]; // [rsp+40h] [rbp-C8h] BYREF cocos2d::CCSpriteFrameCache *v81; // [rsp+48h] [rbp-C0h] _BYTE v82[8]; // [rsp+50h] [rbp-B8h] BYREF _BYTE v83[8]; // [rsp+58h] [rbp-B0h] BYREF _BYTE v84[8]; // [rsp+60h] [rbp-A8h] BYREF int v85; // [rsp+68h] [rbp-A0h] BYREF cocos2d::CCRect v86; // [rsp+70h] [rbp-98h] BYREF cocos2d::CCSpriteFrame *v87; // [rsp+80h] [rbp-88h] float v88; // [rsp+88h] [rbp-80h] BYREF float v89; // [rsp+90h] [rbp-78h] BYREF cocos2d::CCObject *v90; // [rsp+98h] [rbp-70h] cocos2d::CCSpriteFrame *v91; // [rsp+A0h] [rbp-68h] cocos2d::CCSpriteFrame *v92; // [rsp+A8h] [rbp-60h] cocos2d::CCRect v93; // [rsp+B0h] [rbp-58h] BYREF cocos2d::CCRect v94; // [rsp+C0h] [rbp-48h] BYREF __int128 v95; // [rsp+D0h] [rbp-38h] BYREF __int64 v96; // [rsp+E0h] [rbp-28h] unsigned __int64 v97; // [rsp+E8h] [rbp-20h] void *v98[2]; // [rsp+F0h] [rbp-18h] BYREF __int64 v99; // [rsp+100h] [rbp-8h] unsigned __int64 v100; // [rsp+108h] [rbp+0h] void *Block[2]; // [rsp+110h] [rbp+8h] BYREF __int64 v102; // [rsp+120h] [rbp+18h] unsigned __int64 v103; // [rsp+128h] [rbp+20h] v3 = a3; v81 = this; Block[1] = nullptr; v102 = 8; v103 = 15; Block[0] = (void *)0x617461646174656DLL; v5 = cocos2d::CCDictionary::objectForKey((__int64)a2, (unsigned __int8 *)Block); if ( v103 > 0xF ) { v6 = Block[0]; if ( v103 + 1 >= 0x1000 ) { v6 = *((void **)Block[0] - 1); if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F ) invalid_parameter_noinfo_noreturn(); } j_j_free_0(v6); } v102 = 0; v103 = 15; LOBYTE(Block[0]) = 0; *(_OWORD *)v98 = 0; v99 = 6; v100 = 15; strcpy((char *)v98, "frames"); v7 = cocos2d::CCDictionary::objectForKey((__int64)a2, (unsigned __int8 *)v98); if ( v100 > 0xF ) { v8 = v98[0]; if ( v100 + 1 >= 0x1000 ) { v8 = *((void **)v98[0] - 1); if ( (unsigned __int64)((char *)v98[0] - (char *)v8 - 8) > 0x1F ) invalid_parameter_noinfo_noreturn(); } j_j_free_0(v8); } v99 = 0; v100 = 15; LOBYTE(v98[0]) = 0; v9 = 0; if ( v5 ) { sub_180005910(&v95, &dword_18010376C); v10 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v5, (unsigned __int8 *)&v95); v9 = cocos2d::CCString::uintValue(v10); if ( v97 > 0xF ) std::string::_Deallocate_for_capacity((__int64)&v95, (void *)v95, v97); } if ( v7 ) { v11 = *(_QWORD **)(v7 + 56); if ( !v11 ) goto LABEL_17; v12 = (_QWORD *)v11[36]; while ( 1 ) { if ( !v11 ) return; v13 = v11[33]; *(_OWORD *)v98 = 0; v99 = 0; v100 = 0; v14 = -1; do ++v14; while ( *((_BYTE *)v11 + v14) ); if ( v14 > 0x7FFFFFFFFFFFFFFFLL ) std::vector::_Xlen(); v100 = 15; if ( v14 <= 0xF ) { v99 = v14; memcpy(v98, v11, v14); *((_BYTE *)v98 + v14) = 0; goto LABEL_36; } v15 = v14 | 0xF; if ( (v14 | 0xF) > 0x7FFFFFFFFFFFFFFFLL ) break; if ( v15 < 0x16 ) v15 = 22; if ( v15 + 1 >= 0x1000 ) { v16 = v15 + 40; if ( v15 + 40 < v15 + 1 ) Concurrency::cancel_current_task(); goto LABEL_30; } if ( v15 == -1 ) v18 = nullptr; else v18 = operator new(v15 + 1); LABEL_35: v98[0] = v18; v99 = v14; v100 = v15; memcpy(v18, v11, v14); *((_BYTE *)v18 + v14) = 0; v3 = a3; LABEL_36: v19 = (cocos2d::CCSpriteFrame *)cocos2d::CCDictionary::objectForKey( (__int64)v81[1].__vftable, (unsigned __int8 *)v98); if ( v19 ) goto LABEL_113; if ( !v9 ) { v95 = 0; v96 = 1; v97 = 15; LOWORD(v95) = 120; v20 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (unsigned __int8 *)&v95); v21 = cocos2d::CCString::floatValue(v20); if ( v97 > 0xF ) { v22 = (void *)v95; if ( v97 + 1 >= 0x1000 ) { v22 = *(void **)(v95 - 8); if ( (unsigned __int64)(v95 - (_QWORD)v22 - 8) > 0x1F ) invalid_parameter_noinfo_noreturn(); } j_j_free_0(v22); } v95 = 0; v96 = 1; v97 = 15; LOWORD(v95) = 121; v23 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (unsigned __int8 *)&v95); v24 = cocos2d::CCString::floatValue(v23); if ( v97 > 0xF ) { v25 = (void *)v95; if ( v97 + 1 >= 0x1000 ) { v25 = *(void **)(v95 - 8); if ( (unsigned __int64)(v95 - (_QWORD)v25 - 8) > 0x1F ) invalid_parameter_noinfo_noreturn(); } j_j_free_0(v25); } v95 = 0; v96 = 5; v97 = 15; strcpy((char *)&v95, "width"); v26 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (unsigned __int8 *)&v95); v27 = cocos2d::CCString::floatValue(v26); if ( v97 > 0xF ) { v28 = (void *)v95; if ( v97 + 1 >= 0x1000 ) { v28 = *(void **)(v95 - 8); if ( (unsigned __int64)(v95 - (_QWORD)v28 - 8) > 0x1F ) invalid_parameter_noinfo_noreturn(); } j_j_free_0(v28); } v95 = 0; v96 = 6; v97 = 15; strcpy((char *)&v95, "height"); v29 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (unsigned __int8 *)&v95); v30 = cocos2d::CCString::floatValue(v29); if ( v97 > 0xF ) { v31 = (void *)v95; if ( v97 + 1 >= 0x1000 ) { v31 = *(void **)(v95 - 8); if ( (unsigned __int64)(v95 - (_QWORD)v31 - 8) > 0x1F ) invalid_parameter_noinfo_noreturn(); } j_j_free_0(v31); } v96 = 7; v97 = 15; v95 = 0x5874657366666FuLL; v32 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (unsigned __int8 *)&v95); v33 = cocos2d::CCString::floatValue(v32); if ( v97 > 0xF ) { v34 = (void *)v95; if ( v97 + 1 >= 0x1000 ) { v34 = *(void **)(v95 - 8); if ( (unsigned __int64)(v95 - (_QWORD)v34 - 8) > 0x1F ) invalid_parameter_noinfo_noreturn(); } j_j_free_0(v34); } v96 = 7; v97 = 15; v95 = 0x5974657366666FuLL; v35 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (unsigned __int8 *)&v95); v36 = cocos2d::CCString::floatValue(v35); if ( v97 > 0xF ) { v37 = (void *)v95; if ( v97 + 1 >= 0x1000 ) { v37 = *(void **)(v95 - 8); if ( (unsigned __int64)(v95 - (_QWORD)v37 - 8) > 0x1F ) invalid_parameter_noinfo_noreturn(); } j_j_free_0(v37); } v96 = 13; v97 = 15; strcpy((char *)&v95, "originalWidth"); HIWORD(v95) = 0; v38 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (unsigned __int8 *)&v95); v39 = cocos2d::CCString::uintValue(v38); if ( v97 > 0xF ) { v40 = (void *)v95; if ( v97 + 1 >= 0x1000 ) { v40 = *(void **)(v95 - 8); if ( (unsigned __int64)(v95 - (_QWORD)v40 - 8) > 0x1F ) invalid_parameter_noinfo_noreturn(); } j_j_free_0(v40); } sub_180005910(&v95, "originalHeight"); v41 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (unsigned __int8 *)&v95); v42 = cocos2d::CCString::uintValue(v41); if ( v97 > 0xF ) { v43 = (void *)v95; if ( v97 + 1 >= 0x1000 ) { v43 = *(void **)(v95 - 8); if ( (unsigned __int64)(v95 - (_QWORD)v43 - 8) > 0x1F ) invalid_parameter_noinfo_noreturn(); } j_j_free_0(v43); } v44 = -v39; if ( v39 > 0 ) v44 = v39; v45 = -v42; if ( v42 > 0 ) v45 = v42; v46 = (cocos2d::CCSpriteFrame *)operator new(0xC8u); v47 = v46; v87 = v46; if ( v46 ) { memset(v46, 0, sizeof(cocos2d::CCSpriteFrame)); v19 = cocos2d::CCSpriteFrame::CCSpriteFrame(v47); } else { v19 = nullptr; } v48 = (struct cocos2d::CCSize *)kmVec2Fill(&v88, (float)v44, (float)v45); v49 = (struct cocos2d::CCPoint *)kmVec2Fill(&v89, v33, v36); v50 = cocos2d::CCRect::CCRect(&v94, v21, v24, v27, v30); v3 = a3; cocos2d::CCSpriteFrame::initWithTexture(v19, a3, v50, 0, v49, v48); goto LABEL_112; } if ( (unsigned int)(v9 - 1) <= 1 ) { sub_180005910(&v95, "frame"); v67 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (unsigned __int8 *)&v95); CString = (struct cocos2d::CCRect *)cocos2d::CCString::getCString(v67); cocos2d::CCRectFromString(&v93, CString, v69); if ( v97 > 0xF ) std::string::_Deallocate_for_capacity((__int64)&v95, (void *)v95, v97); v61 = 0; if ( v9 == 2 ) { sub_180005910(&v95, "rotated"); v70 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (unsigned __int8 *)&v95); v61 = cocos2d::CCString::boolValue(v70); if ( v97 > 0xF ) std::string::_Deallocate_for_capacity((__int64)&v95, (void *)v95, v97); } sub_180005910(&v95, "offset"); v71 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (unsigned __int8 *)&v95); v72 = cocos2d::CCString::getCString(v71); cocos2d::CCPointFromString((cocos2d *)&v85, v72->m_data.m_smallStorage._Elems); if ( v97 > 0xF ) std::string::_Deallocate_for_capacity((__int64)&v95, (void *)v95, v97); sub_180005910(&v95, "sourceSize"); v73 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (unsigned __int8 *)&v95); v74 = cocos2d::CCString::getCString(v73); cocos2d::CCSizeFromString((cocos2d *)v84, v74->m_data.m_smallStorage._Elems); if ( v97 > 0xF ) std::string::_Deallocate_for_capacity((__int64)&v95, (void *)v95, v97); v75 = (cocos2d::CCSpriteFrame *)operator new(0xC8u); v76 = v75; v92 = v75; if ( v75 ) { memset(v75, 0, sizeof(cocos2d::CCSpriteFrame)); v19 = cocos2d::CCSpriteFrame::CCSpriteFrame(v76); } else { v19 = nullptr; } v78 = (struct cocos2d::CCSize *)v84; v66 = (struct cocos2d::CCPoint *)&v85; v65 = &v93; goto LABEL_111; } if ( v9 == 3 ) { sub_180005910(&v95, "spriteSize"); v51 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (unsigned __int8 *)&v95); v52 = cocos2d::CCString::getCString(v51); cocos2d::CCSizeFromString((cocos2d *)v80, v52->m_data.m_smallStorage._Elems); if ( v97 > 0xF ) std::string::_Deallocate_for_capacity((__int64)&v95, (void *)v95, v97); sub_180005910(&v95, "spriteOffset"); v53 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (unsigned __int8 *)&v95); v54 = cocos2d::CCString::getCString(v53); cocos2d::CCPointFromString((cocos2d *)v83, v54->m_data.m_smallStorage._Elems); if ( v97 > 0xF ) std::string::_Deallocate_for_capacity((__int64)&v95, (void *)v95, v97); sub_180005910(&v95, "spriteSourceSize"); v55 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (unsigned __int8 *)&v95); v56 = cocos2d::CCString::getCString(v55); cocos2d::CCSizeFromString((cocos2d *)v82, v56->m_data.m_smallStorage._Elems); if ( v97 > 0xF ) std::string::_Deallocate_for_capacity((__int64)&v95, (void *)v95, v97); sub_180005910(&v95, "textureRect"); v57 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (unsigned __int8 *)&v95); v58 = (struct cocos2d::CCRect *)cocos2d::CCString::getCString(v57); cocos2d::CCRectFromString(&v86, v58, v59); if ( v97 > 0xF ) std::string::_Deallocate_for_capacity((__int64)&v95, (void *)v95, v97); sub_180005910(&v95, "textureRotated"); v60 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v13, (unsigned __int8 *)&v95); v61 = cocos2d::CCString::boolValue(v60); if ( v97 > 0xF ) std::string::_Deallocate_for_capacity((__int64)&v95, (void *)v95, v97); sub_180005910(&v95, "aliases"); cocos2d::CCDictionary::objectForKey(v13, (unsigned __int8 *)&v95); if ( v97 > 0xF ) std::string::_Deallocate_for_capacity((__int64)&v95, (void *)v95, v97); v62 = (cocos2d::CCObject *)operator new(0x58u); v90 = v62; if ( v62 ) v62 = (cocos2d::CCObject *)cocos2d::CCString::CCString((__int64)v62, (__int64)v98); cocos2d::CCObject::release(v62); v63 = (cocos2d::CCSpriteFrame *)operator new(0xC8u); v64 = v63; v91 = v63; if ( v63 ) { memset(v63, 0, sizeof(cocos2d::CCSpriteFrame)); v19 = cocos2d::CCSpriteFrame::CCSpriteFrame(v64); } else { v19 = nullptr; } v65 = cocos2d::CCRect::CCRect((cocos2d::CCRect *)Block, v86.origin.x, v86.origin.y, v80[0], v80[1]); v78 = (struct cocos2d::CCSize *)v82; v66 = (struct cocos2d::CCPoint *)v83; LABEL_111: cocos2d::CCSpriteFrame::initWithTexture(v19, v3, v65, v61, v66, v78); } LABEL_112: cocos2d::CCDictionary::setObject((__int64)v81[1].__vftable, v19, (unsigned __int8 *)v98); cocos2d::CCObject::release(v19); LABEL_113: if ( v100 > 0xF ) { v77 = v98[0]; if ( v100 + 1 >= 0x1000 ) { v77 = *((void **)v98[0] - 1); if ( (unsigned __int64)((char *)v98[0] - (char *)v77 - 8) > 0x1F ) LABEL_127: invalid_parameter_noinfo_noreturn(); } j_j_free_0(v77); } v11 = v12; if ( v12 ) v12 = (_QWORD *)v12[36]; else LABEL_17: v12 = nullptr; } v15 = 0x7FFFFFFFFFFFFFFFLL; v16 = 0x8000000000000027uLL; LABEL_30: v17 = operator new(v16); if ( !v17 ) goto LABEL_127; v18 = (void *)(((unsigned __int64)v17 + 39) & 0xFFFFFFFFFFFFFFE0uLL); *((_QWORD *)v18 - 1) = v17; goto LABEL_35; } }
GD Web Decomp Icon

GD Web Decomp

Raw Source