//
// AchievementManager::storeAchievementUnlocks from 0x2da458 to 0x2da582 (298 bytes)
//
// 1 xrefs:
// > AchievementManager::init @ 0x2da5d6
//
// 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
//
void AchievementManager::storeAchievementUnlocks(AchievementManager *a1)
{
cocos2d::CCDictionary *m_achievementUnlocks; // r5
cocos2d::CCDictionary *v3; // r0
cocos2d::CCArray *v4; // r10
cocos2d::CCString *v5; // r0
char *CString; // r0
cocos2d::CCDictionary *m_platformAchievements; // r8
char *v8; // r11
cocos2d::CCDictionary *v9; // r8
cocos2d::CCString *v10; // r9
char *v11; // r0
const std::string *v12; // r1
cocos2d::CCObject *v13; // r11
char *v14; // r0
cocos2d::CCDictionary *v15; // [sp+4h] [bp-28h]
int v16; // [sp+18h] [bp-14h] BYREF
char v17; // [sp+1Ch] [bp-10h] BYREF
std::string v18; // [sp+20h] [bp-Ch] BYREF
m_achievementUnlocks = a1->m_achievementUnlocks;
if ( !m_achievementUnlocks )
{
v3 = cocos2d::CCDictionary::create();
a1->m_achievementUnlocks = v3;
cocos2d::CCObject::retain(v3);
v4 = cocos2d::CCDictionary::allKeys(a1->m_platformAchievements);
while ( (unsigned int)m_achievementUnlocks < cocos2d::CCArray::count(v4) )
{
v5 = cocos2d::CCArray::stringAtIndex(v4, (unsigned int)m_achievementUnlocks);
CString = (char *)cocos2d::CCString::getCString(v5);
m_platformAchievements = a1->m_platformAchievements;
v8 = CString;
sub_776584((int)&v18, CString);
v9 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::objectForKey(m_platformAchievements, &v18);
sub_774008(&v18);
sub_776584((int)&v18, "icon");
v10 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey(v9, &v18);
sub_774008(&v18);
if ( v10 )
{
v11 = (char *)cocos2d::CCString::getCString(v10);
sub_776584((int)&v16, v11);
if ( *(_DWORD *)(v16 - 12) )
{
v15 = a1->m_achievementUnlocks;
sub_776584((int)&v17, v8);
v13 = (cocos2d::CCObject *)cocos2d::CCString::create((cocos2d::CCString *)&v17, v12);
v14 = (char *)cocos2d::CCString::getCString(v10);
sub_776584((int)&v18, v14);
cocos2d::CCDictionary::setObject((int)v15, v13);
sub_774008(&v18);
sub_774008(&v17);
}
sub_774008(&v16);
}
m_achievementUnlocks = (cocos2d::CCDictionary *)((char *)m_achievementUnlocks + 1);
}
}
}