// // sub_1006C0210 from 0x1006c0210 to 0x1006c0832 (1570 bytes) // // 1 xrefs: // > cocos2d::CCTextureCache::addImageAsync @ 0x1006c0021 // // This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True! // // Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings // Generated at Fri, 27 Nov 2026 12:35:31 +0000 // void *__fastcall sub_1006C0210(void *a1) { _QWORD *v1; // rbx __int64 v2; // rcx void **v3; // rax unsigned __int64 v4; // rdx unsigned __int8 *v5; // r13 unsigned int v6; // ecx void *v7; // rax unsigned __int8 *v8; // r15 __int64 v9; // r12 char *v10; // rbx __int64 v11; // rdx unsigned __int8 *v12; // rax char *v13; // rax __int64 v14; // rdx unsigned __int8 *v15; // rax char *v16; // rax __int64 v17; // rdx unsigned __int8 *v18; // rax char *v19; // rax int v20; // r14d __int64 v21; // rdx unsigned __int8 *v22; // rax char *v23; // rax __int64 v24; // rdx unsigned __int8 *v25; // rax char *v26; // rax __int64 v27; // rdx unsigned __int8 *v28; // rax char *v29; // rax __int64 v30; // rdx unsigned __int8 *v31; // rax char *v32; // rax unsigned __int8 *v33; // rax char *v34; // rax _DWORD *v35; // r15 _QWORD *v36; // rbx _QWORD *v37; // r14 __int64 v38; // rax __int64 v39; // rsi __int64 v40; // rcx unsigned __int64 v41; // rdx void *v42; // rbx void *v43; // rbx char v45; // [rsp+8h] [rbp-48h] void *__p; // [rsp+10h] [rbp-40h] __int64 v47; // [rsp+18h] [rbp-38h] NSAutoreleasePool *v48[6]; // [rsp+20h] [rbp-30h] BYREF while ( 1 ) { v48[0] = nullptr; cocos2d::CCThread::createAutoreleasePool(v48); v1 = qword_100BE5FE8; pthread_mutex_lock(&stru_100BE5FF8); v2 = v1[5]; if ( !v2 ) break; v3 = (void **)v1[1]; v4 = v1[4]; v5 = *((unsigned __int8 **)v3[v4 >> 9] + (v4 & 0x1FF)); v1[5] = v2 - 1; v1[4] = ++v4; if ( v4 >= 0x400 ) { operator delete(*v3); v1[1] += 8LL; v1[4] -= 512LL; } pthread_mutex_unlock(&stru_100BE5FF8); v6 = *v5; if ( (v6 & 1) != 0 ) { v7 = *((void **)v5 + 2); v47 = (__int64)v7; } else { v47 = (__int64)(v5 + 1); v7 = *((void **)v5 + 2); } v8 = v5 + 1; v9 = v6 >> 1; v45 = *v5; __p = v7; if ( (v6 & 1) != 0 ) { v8 = (unsigned __int8 *)v7; v9 = *((_QWORD *)v5 + 1); } if ( v9 >= 4 ) { v10 = (char *)&v8[v9]; v11 = v9; v12 = v8; do { v13 = (char *)memchr(v12, 46, v11 - 3); if ( !v13 ) break; if ( *(_DWORD *)v13 == 1735420462 ) { if ( v13 != v10 && v13 - (char *)v8 != -1 ) { LABEL_39: v20 = 0; LABEL_68: v35 = operator new(0x50u); cocos2d::CCImage::CCImage((__int64)v35); if ( (unsigned __int8)cocos2d::CCImage::initWithImageFileThreadSafe((__int64)v35, v47, v20) ) { v36 = operator new(0x18u); v36[2] = 0; *v36 = v5; v36[1] = v35; *((_DWORD *)v36 + 4) = v20; pthread_mutex_lock(&stru_100BE6038); v37 = qword_100BE5FF0; v38 = *((_QWORD *)qword_100BE5FF0 + 1); v39 = ((*((_QWORD *)qword_100BE5FF0 + 2) - v38) << 6) - 1; if ( *((_QWORD *)qword_100BE5FF0 + 2) == v38 ) v39 = 0; v40 = *((_QWORD *)qword_100BE5FF0 + 5); v41 = v40 + *((_QWORD *)qword_100BE5FF0 + 4); if ( v39 == v41 ) { sub_1006C2110(qword_100BE5FF0); v38 = v37[1]; v40 = v37[5]; v41 = v40 + v37[4]; } *(_QWORD *)(*(_QWORD *)(v38 + 8 * (v41 >> 9)) + 8 * (v41 & 0x1FF)) = v36; v37[5] = v40 + 1; pthread_mutex_unlock(&stru_100BE6038); } else { cocos2d::CCObject::release(v35); } goto LABEL_3; } break; } v12 = (unsigned __int8 *)(v13 + 1); v11 = v10 - (char *)v12; } while ( v10 - (char *)v12 >= 4 ); if ( v9 != 4 ) { v14 = v9; v15 = v8; do { v16 = (char *)memchr(v15, 46, v14 - 4); if ( !v16 ) break; if ( !(*(_DWORD *)v16 ^ 0x65706A2E | (unsigned __int8)v16[4] ^ 0x67) ) { if ( v16 != v10 && v16 - (char *)v8 != -1 ) goto LABEL_39; break; } v15 = (unsigned __int8 *)(v16 + 1); v14 = v10 - (char *)v15; } while ( v10 - (char *)v15 >= 5 ); } v17 = v9; v18 = v8; do { v19 = (char *)memchr(v18, 46, v17 - 3); if ( !v19 ) break; if ( *(_DWORD *)v19 == 1735290926 ) { v20 = 1; if ( v19 != v10 && v19 - (char *)v8 != -1 ) goto LABEL_68; break; } v18 = (unsigned __int8 *)(v19 + 1); v17 = v10 - (char *)v18; } while ( v10 - (char *)v18 >= 4 ); v21 = v9; v22 = v8; do { v23 = (char *)memchr(v22, 46, v21 - 3); if ( !v23 ) break; if ( *(_DWORD *)v23 == 1196314670 ) { v20 = 1; if ( v23 != v10 && v23 - (char *)v8 != -1 ) goto LABEL_68; break; } v22 = (unsigned __int8 *)(v23 + 1); v21 = v10 - (char *)v22; } while ( v10 - (char *)v22 >= 4 ); if ( v9 != 4 ) { v24 = v9; v25 = v8; do { v26 = (char *)memchr(v25, 46, v24 - 4); if ( !v26 ) break; if ( !(*(_DWORD *)v26 ^ 0x6669742E | (unsigned __int8)v26[4] ^ 0x66) ) { v20 = 2; if ( v26 != v10 && v26 - (char *)v8 != -1 ) goto LABEL_68; break; } v25 = (unsigned __int8 *)(v26 + 1); v24 = v10 - (char *)v25; } while ( v10 - (char *)v25 >= 5 ); v27 = v9; v28 = v8; do { v29 = (char *)memchr(v28, 46, v27 - 4); if ( !v29 ) break; if ( !(*(_DWORD *)v29 ^ 0x4649542E | (unsigned __int8)v29[4] ^ 0x46) ) { v20 = 2; if ( v29 != v10 && v29 - (char *)v8 != -1 ) goto LABEL_68; break; } v28 = (unsigned __int8 *)(v29 + 1); v27 = v10 - (char *)v28; } while ( v10 - (char *)v28 >= 5 ); v30 = v9; v31 = v8; do { v32 = (char *)memchr(v31, 46, v30 - 4); if ( !v32 ) break; if ( !(*(_DWORD *)v32 ^ 0x6265772E | (unsigned __int8)v32[4] ^ 0x70) ) { v20 = 3; if ( v32 != v10 && v32 - (char *)v8 != -1 ) goto LABEL_68; break; } v31 = (unsigned __int8 *)(v32 + 1); v30 = v10 - (char *)v31; } while ( v10 - (char *)v31 >= 5 ); v33 = v8; do { v34 = (char *)memchr(v33, 46, v9 - 4); if ( !v34 ) break; if ( !(*(_DWORD *)v34 ^ 0x4245572E | (unsigned __int8)v34[4] ^ 0x50) ) { v20 = 3; if ( v34 == v10 || v34 - (char *)v8 == -1 ) break; goto LABEL_68; } v33 = (unsigned __int8 *)(v34 + 1); v9 = v10 - (char *)v33; } while ( v10 - (char *)v33 >= 5 ); } } if ( (v45 & 1) != 0 ) operator delete(__p); operator delete(v5); LABEL_3: cocos2d::CCThread::dCCThread((id *)v48); } pthread_mutex_unlock(&stru_100BE5FF8); if ( !byte_100BE5FB0 ) { pthread_cond_wait(&stru_100BE5FB8, &stru_100BE6078); goto LABEL_3; } cocos2d::CCThread::dCCThread((id *)v48); v42 = qword_100BE5FE8; if ( qword_100BE5FE8 ) { sub_1006C2500(qword_100BE5FE8); operator delete(v42); qword_100BE5FE8 = nullptr; v43 = qword_100BE5FF0; if ( qword_100BE5FF0 ) { sub_1006C2500(qword_100BE5FF0); operator delete(v43); } qword_100BE5FF0 = nullptr; pthread_mutex_destroy(&stru_100BE5FF8); pthread_mutex_destroy(&stru_100BE6038); pthread_mutex_destroy(&stru_100BE6078); pthread_cond_destroy(&stru_100BE5FB8); } return nullptr; }
GD Web Decomp Icon

GD Web Decomp

Raw Source