//
// AchievementManager::notifyAchievementWithID from 0x100864af0 to 0x100864c8e (414 bytes)
//
// 1 xrefs:
// > AchievementManager::reportAchievementWithID @ 0x100864e90
//
// 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:36:43 +0000
//
void __fastcall AchievementManager::notifyAchievementWithID(__int64 a1, const char *a2)
{
__int64 v2; // rbx
size_t v3; // rax
size_t v4; // r14
_BYTE *v5; // r15
size_t v6; // r12
__int64 v7; // rbx
void *v8; // rax
__int64 CString; // r14
void *v10; // rax
__int64 v11; // r15
void *v12; // rdi
__int64 v13; // rbx
__int64 v14; // rax
_BYTE __dst[48]; // [rsp+0h] [rbp-40h] BYREF
if ( *(_BYTE *)(a1 + 360) )
return;
v2 = *(_QWORD *)(a1 + 328);
v3 = strlen(a2);
if ( v3 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v4 = v3;
if ( v3 >= 0x17 )
{
v6 = 26;
if ( (v3 | 7) != 0x17 )
v6 = (v3 | 7) + 1;
v5 = operator new(v6);
*(_QWORD *)&__dst[16] = v5;
*(_QWORD *)__dst = v6 + 1;
*(_QWORD *)&__dst[8] = v4;
}
else
{
__dst[0] = 2 * v3;
v5 = &__dst[1];
if ( !v3 )
goto LABEL_10;
}
memcpy(v5, a2, v4);
LABEL_10:
v5[v4] = 0;
v7 = cocos2d::CCDictionary::objectForKey(v2, __dst);
if ( (__dst[0] & 1) != 0 )
operator delete(*(void **)&__dst[16]);
if ( v7 )
{
strcpy(__dst, "\ntitle");
v8 = cocos2d::CCDictionary::valueForKey(v7, (__int64)__dst);
CString = cocos2d::CCString::getCString(v8);
if ( (__dst[0] & 1) != 0 )
operator delete(*(void **)&__dst[16]);
strcpy(__dst, "&achievedDescription");
v10 = cocos2d::CCDictionary::valueForKey(v7, (__int64)__dst);
v11 = cocos2d::CCString::getCString(v10);
if ( (__dst[0] & 1) != 0 )
operator delete(*(void **)&__dst[16]);
__dst[0] = 8;
strcpy(&__dst[1], "icon");
v12 = cocos2d::CCDictionary::valueForKey(v7, (__int64)__dst);
v13 = cocos2d::CCString::getCString(v12);
if ( (__dst[0] & 1) != 0 )
{
v12 = *(void **)&__dst[16];
operator delete(*(void **)&__dst[16]);
}
v14 = AchievementNotifier::sharedState(v12);
AchievementNotifier::notifyAchievement(v14, CString, v11, v13, 0);
}
}