//
// cocos2d::extension::AssetsManager::update from 0xd0a3ac to 0xd0a568 (444 bytes)
//
// 2 xrefs:
// > ??> @ 0x98638
// > ??> @ 0x1509c58
//
// This function is hookable on this platform (idp: arm, 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 13:06:59 +0000
//
__int64 __fastcall cocos2d::extension::AssetsManager::update(cocos2d::extension::AssetsManager *this)
{
unsigned __int8 v3; // w0
__int64 v4; // x1
int v5; // w0
__int64 v6; // x0
char *v7; // x4
char *v8; // x0
char *i; // x8
char *v10; // x1
char *v11; // x9
char *v12; // x3
const char *v13; // x2
int v14; // t1
cocos2d::CCUserDefault *v15; // x0
cocos2d::CCUserDefault *v16; // x0
__int64 v17; // x3
__int64 v18; // x0
pthread_t *v19; // x0
__int64 v20[3]; // [xsp+30h] [xbp+30h] BYREF
if ( !*((_QWORD *)this + 18) )
{
v3 = *((_BYTE *)this + 80);
v4 = v3 >> 1;
if ( (v3 & 1) != 0 )
v4 = *((_QWORD *)this + 11);
if ( v4 )
{
v5 = *((unsigned __int8 *)this + 56);
if ( (v5 & 1) != 0 )
{
v6 = *((_QWORD *)this + 8);
if ( !v6 )
return _stack_chk_guard;
v7 = *((char **)this + 9);
}
else
{
LODWORD(v6) = v5 >> 1;
if ( !(_DWORD)v6 )
return _stack_chk_guard;
v7 = (char *)this + 57;
v6 = (int)v6;
}
if ( (unsigned __int64)(v6 - 4) <= 0x7FFFFFFFFFFFFFFBLL )
{
v8 = &v7[v6];
if ( v7 != v8 - 3 )
{
for ( i = v7 + 1; ; ++i )
{
v10 = i - 1;
v11 = i;
if ( *(i - 1) == 46 )
break;
LABEL_25:
if ( v8 - 3 == v11 )
return _stack_chk_guard;
}
v12 = i - 1;
v13 = ".zip";
while ( 1 )
{
++v13;
if ( v12 == i + 2 )
break;
v14 = (unsigned __int8)*++v12;
if ( v14 != *(unsigned __int8 *)v13 )
goto LABEL_25;
}
if ( v10 != v8 && v10 - v7 != -1 )
{
v15 = (cocos2d::CCUserDefault *)(*(unsigned __int8 (__fastcall **)(cocos2d::extension::AssetsManager *))(*(_QWORD *)this + 16LL))(this);
if ( (_BYTE)v15 )
{
v16 = (cocos2d::CCUserDefault *)cocos2d::CCUserDefault::sharedUserDefault(v15);
cocos2d::CCUserDefault::getStringForKey(v20, v16, "downloaded-version-code");
if ( (*((_BYTE *)this + 104) & 1) != 0 )
{
**((_BYTE **)this + 15) = 0;
*((_QWORD *)this + 14) = 0;
}
else
{
*((_BYTE *)this + 105) = 0;
*((_BYTE *)this + 104) = 0;
}
std::string::reserve((__int64 *)this + 13, 0);
v17 = v20[1];
v18 = v20[2];
*((_QWORD *)this + 13) = v20[0];
*((_QWORD *)this + 14) = v17;
*((_QWORD *)this + 15) = v18;
v19 = (pthread_t *)operator new(8u);
*v19 = 0;
*((_QWORD *)this + 18) = v19;
pthread_create(
v19,
nullptr,
(void *(*)(void *))cocos2d::extension::assetsManagerDownloadAndUncompress,
this);
}
}
}
}
}
}
return _stack_chk_guard;
}