// // AchievementCell::loadFromDict from 0x1001012cc to 0x10010207c (3504 bytes) // // 1 xrefs: // > CustomListView::loadCell @ 0x1001011bc // // 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 __fastcall AchievementCell::loadFromDict(AchievementCell *a1, cocos2d::CCDictionary *a2) { cocos2d::CCString *v4; // x0 const char *CString; // x20 AchievementManager *v6; // x0 _BOOL4 isAchievementEarned; // w21 __int64 v8; // x23 float v9; // s8 cocos2d::CCString *v10; // x0 char *v11; // x23 _QWORD *v12; // x0 __int64 v13; // x23 std::string *p_str; // x8 std::string::size_type size; // x25 std::string *v16; // x9 std::string::size_type v17; // x11 std::string *v18; // x10 __int64 v19; // x8 __int64 v20; // x26 GJItemIcon *v21; // x23 cocos2d::CCSprite *v22; // x24 __n128 v23; // q0 __n128 v24; // q1 __n128 v25; // q0 __n128 v26; // q1 std::string::size_type v27; // x24 std::string *p_p; // x1 __int64 v29; // x0 __int64 v30; // x28 bool v31; // zf std::string::size_type v32; // x11 std::string *v33; // x8 _BYTE *v34; // x9 _BYTE *v35; // x10 std::string::size_type v36; // x11 __int64 v37; // x8 cocos2d::CCString *v38; // x0 char *v39; // x24 cocos2d::CCString *v40; // x0 int v41; // w23 bool v42; // w25 UnlockType v43; // w0 bool v44; // w25 bool v45; // w25 bool v46; // w25 bool v47; // w25 bool v48; // w25 bool v49; // w25 bool v50; // w25 bool v51; // w25 bool v52; // w25 bool v53; // w25 bool v54; // w25 _BOOL4 v55; // w24 cocos2d::CCNode *v56; // x25 float *v57; // x0 __n128 v58; // q1 __n128 v59; // q0 cocos2d::CCString *v60; // x24 const char *v61; // x0 cocos2d::CCLabelBMFont *v62; // x24 __n128 v63; // q0 __n128 v64; // q1 float v65; // s8 __n128 v66; // q0 float *v67; // x0 cocos2d::CCString *v68; // x0 const char *v69; // x0 __n128 v70; // q0 __n128 v71; // q1 cocos2d::CCObject *v72; // x22 __n128 v73; // q0 __n128 v74; // q1 __n128 v75; // q0 __n128 v76; // q1 std::string *v77; // x1 float v78; // s11 float v79; // s8 float v80; // s9 __n128 v81; // q1 __n128 v82; // q0 __n128 v83; // q0 __n128 v84; // q1 AchievementManager *v85; // x0 int v86; // w0 cocos2d::CCSprite *v87; // x20 __n128 v88; // q0 __n128 v89; // q1 __n128 v90; // q0 __n128 v91; // q1 cocos2d::CCString *v92; // x0 const char *v93; // x0 cocos2d::CCLabelBMFont *v94; // x20 float32x2_t *v95; // x19 __n128 v96; // q0 __n128 v97; // q1 double v98; // d0 void *v99[2]; // [xsp+10h] [xbp-F0h] BYREF char v100; // [xsp+27h] [xbp-D9h] void *v101[2]; // [xsp+28h] [xbp-D8h] BYREF char v102; // [xsp+3Fh] [xbp-C1h] std::string __str; // [xsp+40h] [xbp-C0h] BYREF std::allocator __a[8]; // [xsp+58h] [xbp-A8h] BYREF char v105; // [xsp+6Fh] [xbp-91h] std::string __p; // [xsp+70h] [xbp-90h] BYREF ((void (__fastcall *)(cocos2d::CCLayerColor *, __int64))a1->m_backgroundLayer->setOpacity)(a1->m_backgroundLayer, 255); ((void (__fastcall *)(cocos2d::CCLayer *, __int64))a1->m_mainLayer->removeAllChildrenWithCleanup)(a1->m_mainLayer, 1); sub_100009900(&__p, "identifier"); v4 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1(a2, &__p); CString = cocos2d::CCString::getCString(v4); if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); v6 = AchievementManager::sharedState(); isAchievementEarned = AchievementManager::isAchievementEarned(v6, CString); if ( !isAchievementEarned ) { v21 = (GJItemIcon *)cocos2d::CCSprite::createWithSpriteFrameName("playerSquare_001.png"); v22 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_lock_001.png"); v23 = ((__n128 (__fastcall *)(GJItemIcon *, cocos2d::CCSprite *))v21->addChild)(v21, v22); v23.n128_f32[0] = v21->m_obRect.size.width * 0.5; v24.n128_f32[0] = v21->m_obRect.size.height * 0.5; sub_100022980(v23, v24, &__p); ((void (__fastcall *)(cocos2d::CCSprite *, std::string *))v22->setPosition)(v22, &__p); __p.__r_.__value_.__s.__data_[2] = -81; LOWORD(__p.__r_.__value_.__l.__data_) = -20561; ((void (__fastcall *)(GJItemIcon *, std::string *))v21->setColor)(v21, &__p); v9 = 0.0; goto LABEL_139; } sub_100009900(&__p, "icon"); v8 = cocos2d::CCDictionary::objectForKey_1(a2, &__p); if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); v9 = 0.0; if ( !v8 ) { LABEL_138: v21 = (GJItemIcon *)cocos2d::CCSprite::createWithSpriteFrameName("GJ_achImage_001.png"); goto LABEL_139; } sub_100009900(&__p, "icon"); v10 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1(a2, &__p); v11 = (char *)cocos2d::CCString::getCString(v10); if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); v12 = sub_100009900(&__str, v11); v13 = sub_10024A15C(v12); if ( (__str.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL ) p_str = &__str; else p_str = (std::string *)__str.__r_.__value_.__r.__words[0]; if ( (__str.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL ) size = HIBYTE(__str.__r_.__value_.__r.__words[2]); else size = __str.__r_.__value_.__l.__size_; if ( size ) { v16 = (std::string *)((char *)p_str + size); v17 = size; v18 = p_str; while ( v18->__r_.__value_.__s.__data_[0] != 95 ) { v18 = (std::string *)((char *)v18 + 1); if ( !--v17 ) { v18 = (std::string *)((char *)p_str + size); break; } } v19 = (char *)v18 - (char *)p_str; if ( v18 == v16 ) v20 = -1; else v20 = v19; } else { v20 = -1; } v27 = 0; do { std::string::basic_string(&__p, &__str, v27, v20 - v27, __a); if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) { if ( v27 == size && !__p.__r_.__value_.__l.__size_ ) goto LABEL_35; p_p = (std::string *)__p.__r_.__value_.__r.__words[0]; } else { if ( v27 == size && !*((_BYTE *)&__p.__r_.__value_.__s + 23) ) goto LABEL_35; p_p = &__p; } sub_100009900(__a, (char *)p_p); v29 = sub_100268E48(__a); sub_10024A2D0(v13, v29); if ( v105 < 0 ) operator delete(*(void **)&__a[0].std::__non_trivial_if); LABEL_35: if ( v20 == -1 ) goto LABEL_36; v27 = v20 + 1; v32 = __str.__r_.__value_.__l.__size_; if ( (__str.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL ) v33 = &__str; else v33 = (std::string *)__str.__r_.__value_.__r.__words[0]; if ( (__str.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL ) v32 = HIBYTE(__str.__r_.__value_.__r.__words[2]); if ( v32 <= v27 ) { LABEL_36: v30 = -1; } else { v34 = (char *)v33 + v32; v35 = (char *)v33 + v27; v36 = ~v20 + v32; while ( *v35 != 95 ) { ++v35; if ( !--v36 ) { v35 = v34; break; } } v37 = v35 - (_BYTE *)v33; if ( v35 == v34 ) v30 = -1; else v30 = v37; } if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); v31 = v20 == -1; v20 = v30; } while ( !v31 ); if ( SHIBYTE(__str.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__str.__r_.__value_.__l.__data_); if ( (unsigned int)sub_10024A36C(v13) < 2 ) goto LABEL_138; v38 = (cocos2d::CCString *)sub_10024A388(v13, 0); v39 = (char *)cocos2d::CCString::getCString(v38); v40 = (cocos2d::CCString *)sub_10024A388(v13, 1); v41 = cocos2d::CCString::intValue(v40); sub_100009900(&__p, v39); sub_100009900(__a, "ship"); v42 = sub_1000045BC(&__p, __a); if ( v105 < 0 ) operator delete(*(void **)&__a[0].std::__non_trivial_if); if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); v9 = 0.0; if ( v42 ) { v43 = 4; } else { sub_100009900(&__p, v39); sub_100009900(__a, "ball"); v44 = sub_1000045BC(&__p, __a); if ( v105 < 0 ) operator delete(*(void **)&__a[0].std::__non_trivial_if); if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); if ( v44 ) { v43 = 5; } else { sub_100009900(&__p, v39); sub_100009900(__a, "bird"); v45 = sub_1000045BC(&__p, __a); if ( v105 < 0 ) operator delete(*(void **)&__a[0].std::__non_trivial_if); if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); if ( v45 ) { v9 = -5.0; v43 = Bird; } else { sub_100009900(&__p, v39); sub_100009900(__a, "dart"); v46 = sub_1000045BC(&__p, __a); if ( v105 < 0 ) operator delete(*(void **)&__a[0].std::__non_trivial_if); if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); if ( v46 ) { v43 = Dart; } else { sub_100009900(&__p, v39); sub_100009900(__a, "robot"); v47 = sub_1000045BC(&__p, __a); if ( v105 < 0 ) operator delete(*(void **)&__a[0].std::__non_trivial_if); if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); if ( v47 ) { v43 = 8; } else { sub_100009900(&__p, v39); sub_100009900(__a, "spider"); v48 = sub_1000045BC(&__p, __a); if ( v105 < 0 ) operator delete(*(void **)&__a[0].std::__non_trivial_if); if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); if ( v48 ) { v43 = 9; } else { sub_100009900(&__p, v39); sub_100009900(__a, "death"); v49 = sub_1000045BC(&__p, __a); if ( v105 < 0 ) operator delete(*(void **)&__a[0].std::__non_trivial_if); if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); if ( v49 ) { v43 = Death; } else { sub_100009900(&__p, v39); sub_100009900(__a, "special"); v50 = sub_1000045BC(&__p, __a); if ( v105 < 0 ) operator delete(*(void **)&__a[0].std::__non_trivial_if); if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); if ( v50 ) { v43 = Streak; } else { sub_100009900(&__p, v39); sub_100009900(__a, "swing"); v51 = sub_1000045BC(&__p, __a); if ( v105 < 0 ) operator delete(*(void **)&__a[0].std::__non_trivial_if); if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); if ( v51 ) { v43 = GJItem|0x1; } else { sub_100009900(&__p, v39); sub_100009900(__a, "jetpack"); v52 = sub_1000045BC(&__p, __a); if ( v105 < 0 ) operator delete(*(void **)&__a[0].std::__non_trivial_if); if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); if ( v52 ) { v43 = GJItem|Col1; } else { sub_100009900(&__p, v39); sub_100009900(__a, "shipstreak"); v53 = sub_1000045BC(&__p, __a); if ( v105 < 0 ) operator delete(*(void **)&__a[0].std::__non_trivial_if); if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); if ( v53 ) { v43 = GJItem|Col2; } else { sub_100009900(&__p, v39); sub_100009900(__a, "color"); v54 = sub_1000045BC(&__p, __a); if ( v105 < 0 ) operator delete(*(void **)&__a[0].std::__non_trivial_if); if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); if ( v54 ) { v43 = Col1; } else { sub_100009900(&__p, v39); sub_100009900(__a, "color2"); v55 = sub_1000045BC(&__p, __a); if ( v105 < 0 ) operator delete(*(void **)&__a[0].std::__non_trivial_if); if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); v43 = v55 ? Col2 : 1; } } } } } } } } } } } } v21 = GJItemIcon::create( v43, v41, (cocos2d::ccColor3B)-5263441, (cocos2d::ccColor3B)-1, 0, 0, 0, (cocos2d::ccColor3B)-1); if ( !v21 ) goto LABEL_138; LABEL_139: v26.n128_f32[0] = v9 + (float)(a1->m_height * 0.5); v25.n128_u32[0] = 1108082688; sub_100022980(v25, v26, &__p); ((void (__fastcall *)(GJItemIcon *, std::string *))v21->setPosition)(v21, &__p); ((void (__fastcall *)(cocos2d::CCLayer *, GJItemIcon *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v21); ((void (__fastcall *)(GJItemIcon *, float))v21->setScale)(v21, 1.0); v56 = cocos2d::CCNode::create(); ((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCNode *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v56); v57 = (float *)((__int64 (__fastcall *)(GJItemIcon *))v21->getPosition)(v21); v58.n128_u32[1] = 1107296256; v59.n128_f32[0] = *v57 + 32.0; v58.n128_f32[0] = a1->m_height * 0.5; sub_100022980(v59, v58, &__p); ((void (__fastcall *)(cocos2d::CCNode *, std::string *))v56->setPosition)(v56, &__p); sub_100009900(&__p, "title"); v60 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1(a2, &__p); if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); v61 = cocos2d::CCString::getCString(v60); v62 = cocos2d::CCLabelBMFont::create_1(v61, "goldFont.fnt"); v63 = ((__n128 (__fastcall *)(cocos2d::CCNode *, cocos2d::CCLabelBMFont *))v56->addChild)(v56, v62); v63.n128_u32[0] = 0; v64.n128_u32[0] = 0.5; sub_100022980(v63, v64, &__p); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::string *))v62->setAnchorPoint)(v62, &__p); v65 = 0.7; ((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v62->setScale)(v62, 0.7); v66.n128_u32[0] = *(_DWORD *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v62->getContentSize)(v62); if ( v66.n128_f32[0] > 200.0 ) { v67 = (float *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *, float))v62->getContentSize)(v62, v66.n128_f32[0]); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v62->setScale)(v62, 200.0 / *v67); } if ( ((float (__fastcall *)(cocos2d::CCLabelBMFont *, __n128))v62->getScale)(v62, v66) < 0.7 ) v65 = ((float (__fastcall *)(cocos2d::CCLabelBMFont *))v62->getScale)(v62); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v62->setScale)(v62, v65); memset(&__p, 0, sizeof(__p)); if ( isAchievementEarned ) sub_100009900(__a, "achievedDescription"); else sub_100009900(__a, "unachievedDescription"); v68 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(a2, __a); v69 = cocos2d::CCString::getCString(v68); std::string::assign(&__p, v69); if ( v105 < 0 ) operator delete(*(void **)&__a[0].std::__non_trivial_if); sub_100009900(v101, " "); v70.n128_u32[0] = 0; v71.n128_u32[0] = 1.0; sub_100022980(v70, v71, __a); v72 = TextArea::create((__int64)v101, (__int64)"chatFont.fnt", (__int64 *)__a, 0, 1.0, 190.0, 20.0); if ( v102 < 0 ) operator delete(v101[0]); v73 = ((__n128 (__fastcall *)(cocos2d::CCNode *, cocos2d::CCObject *))v56->addChild)(v56, v72); v73.n128_u32[0] = 0; v74.n128_u32[0] = 0.5; sub_100022980(v73, v74, __a); v75 = ((__n128 (__fastcall *)(cocos2d::CCObject *, std::allocator *))v72->__vftable[3].update)(v72, __a); v75.n128_u32[0] = 0; v76.n128_u32[0] = 5.0; sub_100022980(v75, v76, __a); ((void (__fastcall *)(cocos2d::CCObject *, std::allocator *))v72->__vftable[2].isEqual)(v72, __a); v72[11].m_uAutoReleaseCount = 1098907648; if ( (__p.__r_.__value_.__r.__words[2] & 0x8000000000000000LL) == 0LL ) v77 = &__p; else v77 = (std::string *)__p.__r_.__value_.__r.__words[0]; sub_100009900(v99, (char *)v77); TextArea::setString((__int64)v72, (const void **)v99); if ( v100 < 0 ) operator delete(v99[0]); v78 = *(float *)(((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v62->getContentSize)(v62) + 4); v79 = *(float *)(((__int64 (__fastcall *)(cocos2d::CCObject *))v72->__vftable[3].setTag)(v72) + 4) + 17.0; v80 = (float)(v78 + v79) * 0.5; v81.n128_f32[0] = (float)((float)(v80 - (float)(v78 * 0.5)) + 3.0) + 2.0; v82.n128_u32[0] = 0; sub_100022980(v82, v81, __a); v83 = ((__n128 (__fastcall *)(cocos2d::CCLabelBMFont *, std::allocator *))v62->setPosition)(v62, __a); v84.n128_f32[0] = (float)((float)((float)(v79 * 0.5) - v80) + 16.0) + -2.0; v83.n128_u32[0] = 0; sub_100022980(v83, v84, __a); ((void (__fastcall *)(cocos2d::CCObject *, std::allocator *))v72->__vftable[2].isEqual)(v72, __a); v85 = AchievementManager::sharedState(); v86 = AchievementManager::percentForAchievement(v85, CString); if ( v86 && v86 != 100 ) { if ( !isAchievementEarned ) { v92 = (cocos2d::CCString *)sub_100268F4C("%i%%", v86); v93 = cocos2d::CCString::getCString(v92); v94 = cocos2d::CCLabelBMFont::create_1(v93, "goldFont.fnt"); ((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *, __int64))a1->m_mainLayer->addChild_0)( a1->m_mainLayer, v94, 10); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v94->setScale)(v94, 0.6); v95 = (float32x2_t *)((__int64 (__fastcall *)(GJItemIcon *))v21->getPosition)(v21); v96.n128_u32[0] = 0; v97.n128_u32[0] = -25.0; sub_100022980(v96, v97, &__str); *(float32x2_t *)&v98 = sub_1000229DC(v95, (float32x2_t *)&__str, (float32x2_t *)__a); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, std::allocator *, double))v94->setPosition)(v94, __a, v98); goto LABEL_164; } LABEL_162: v87 = cocos2d::CCSprite::createWithSpriteFrameName("GJ_completesIcon_001.png"); v88.n128_u32[0] = 0; v89.n128_u32[0] = 0.5; sub_100022980(v88, v89, __a); ((void (__fastcall *)(cocos2d::CCSprite *, std::allocator *))v87->setAnchorPoint)(v87, __a); ((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v87); v90 = ((__n128 (__fastcall *)(cocos2d::CCSprite *, float))v87->setScale)(v87, 0.8); v90.n128_f32[0] = a1->m_width + -40.0; v91.n128_f32[0] = a1->m_height * 0.5; sub_100022980(v90, v91, __a); ((void (__fastcall *)(cocos2d::CCSprite *, std::allocator *))v87->setPosition)(v87, __a); goto LABEL_164; } if ( isAchievementEarned ) goto LABEL_162; LABEL_164: if ( SHIBYTE(__p.__r_.__value_.__r.__words[2]) < 0 ) operator delete(__p.__r_.__value_.__l.__data_); }