// // AchievementManager::achievementForUnlock from 0x1007852d0 to 0x100785806 (1334 bytes) // // 6 xrefs: // > GameStatsManager::generateItemUnlockableData @ 0x10006594b // > GameStatsManager::getItemUnlockStateLite @ 0x1000775ec // > GJGarageLayer::titleForUnlock @ 0x10036f5ec // > GJGarageLayer::descriptionForUnlock @ 0x10036f75c // > GJGarageLayer::achievementForUnlock @ 0x10036f8d8 // > ItemInfoPopup::init @ 0x100371d17 // // 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 // size_t *__fastcall AchievementManager::achievementForUnlock(size_t *a1, __int64 a2, int a3, int a4, double a5) { __int64 v5; // rax __int64 v6; // rax __int64 v7; // r14 size_t v8; // r15 size_t v9; // rdi void *v10; // rax void *v11; // r12 _QWORD *v12; // r13 void *v13; // r12 size_t v14; // rax size_t v15; // r15 char *v16; // r13 size_t v17; // rbx cocos2d::CCString *v18; // rax const char *CString; // r14 size_t v20; // rax size_t v21; // r15 size_t *v22; // rcx _BYTE *v23; // r12 size_t v25; // rbx size_t *v26; // rax _QWORD __dst[2]; // [rsp+0h] [rbp-260h] BYREF void *__p; // [rsp+10h] [rbp-250h] size_t *v29; // [rsp+18h] [rbp-248h] size_t __len; // [rsp+20h] [rbp-240h] BYREF size_t v31; // [rsp+28h] [rbp-238h] void *__src; // [rsp+30h] [rbp-230h] _QWORD v33[63]; // [rsp+38h] [rbp-228h] BYREF v29 = a1; v31 = 500; __src = v33; switch ( a4 ) { case 1: __len = 5; qmemcpy(v33, "icon_", 5); v5 = 5; if ( a3 <= 9 ) goto LABEL_31; goto LABEL_32; case 2: __len = 6; qmemcpy(v33, "color_", 6); v5 = 6; if ( a3 <= 9 ) goto LABEL_31; goto LABEL_32; case 3: __len = 7; qmemcpy(v33, "color2_", 7); v5 = 7; if ( a3 <= 9 ) goto LABEL_31; goto LABEL_32; case 4: __len = 5; qmemcpy(v33, "ship_", 5); v5 = 5; if ( a3 <= 9 ) goto LABEL_31; goto LABEL_32; case 5: __len = 5; qmemcpy(v33, "ball_", 5); v5 = 5; if ( a3 <= 9 ) goto LABEL_31; goto LABEL_32; case 6: __len = 5; qmemcpy(v33, "bird_", 5); v5 = 5; if ( a3 <= 9 ) goto LABEL_31; goto LABEL_32; case 7: __len = 5; qmemcpy(v33, "dart_", 5); v5 = 5; if ( a3 <= 9 ) goto LABEL_31; goto LABEL_32; case 8: __len = 6; qmemcpy(v33, "robot_", 6); v5 = 6; if ( a3 <= 9 ) goto LABEL_31; goto LABEL_32; case 9: __len = 7; qmemcpy(v33, "spider_", 7); v5 = 7; if ( a3 <= 9 ) goto LABEL_31; goto LABEL_32; case 10: __len = 8; v6 = 0x5F6C616963657073LL; goto LABEL_26; case 11: __len = 6; qmemcpy(v33, "death_", 6); v5 = 6; if ( a3 <= 9 ) goto LABEL_31; goto LABEL_32; case 12: __len = 5; qmemcpy(v33, "item_", 5); v5 = 5; if ( a3 > 9 ) goto LABEL_32; goto LABEL_31; case 13: __len = 6; qmemcpy(v33, "swing_", 6); v5 = 6; if ( a3 > 9 ) goto LABEL_32; goto LABEL_31; case 14: __len = 8; v6 = 0x5F6B63617074656ALL; LABEL_26: v33[0] = v6; v5 = 8; if ( a3 > 9 ) goto LABEL_32; goto LABEL_31; case 15: __len = 11; qmemcpy(v33, "shipstreak_", 11); v5 = 11; if ( a3 > 9 ) goto LABEL_32; goto LABEL_31; default: __len = 2; LOWORD(v33[0]) = 24352; v5 = 2; if ( a3 > 9 ) goto LABEL_32; LABEL_31: __len = v5 + 1; *((_BYTE *)v33 + v5) = 48; LABEL_32: sub_10003DD80((__int64)&__len, a3); v7 = *(_QWORD *)(a2 + 336); v8 = __len; if ( v31 >= __len + 1 ) { v11 = __src; } else { v9 = v31 + (v31 >> 1); if ( v9 <= __len + 1 ) v9 = __len + 1; v31 = v9; v10 = operator new[](v9); v11 = v10; v12 = __src; if ( v8 ) memmove(v10, __src, v8); if ( v12 != v33 && v12 != nullptr ) operator delete[](v12); __src = v11; } *((_BYTE *)v11 + v8) = 0; v13 = __src; v14 = strlen((const char *)__src); if ( v14 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(a5); v15 = v14; if ( v14 >= 0x17 ) { v17 = 26; if ( (v14 | 7) != 0x17 ) v17 = (v14 | 7) + 1; v16 = (char *)operator new(v17); __p = v16; __dst[0] = v17 | 1; __dst[1] = v15; } else { LOBYTE(__dst[0]) = 2 * v14; v16 = (char *)__dst + 1; if ( !v14 ) goto LABEL_49; } memmove(v16, v13, v15); LABEL_49: v16[v15] = 0; v18 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v7, (__int64)__dst); CString = cocos2d::CCString::getCString(v18); v20 = strlen(CString); if ( v20 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(a5); v21 = v20; if ( v20 >= 0x17 ) { v25 = 26; if ( (v20 | 7) != 0x17 ) v25 = (v20 | 7) + 1; v23 = operator new(v25); v26 = v29; v29[2] = (size_t)v23; *v26 = v25 | 1; v26[1] = v21; } else { v22 = v29; *(_BYTE *)v29 = 2 * v20; v23 = (char *)v22 + 1; if ( !v20 ) { *v23 = 0; if ( (__dst[0] & 1) == 0 ) goto LABEL_54; goto LABEL_53; } } memmove(v23, CString, v21); v23[v21] = 0; if ( (__dst[0] & 1) != 0 ) LABEL_53: operator delete(__p); LABEL_54: if ( __src != v33 && __src != nullptr ) operator delete[](__src); return v29; } }