// // GauntletLayer::setupGauntlet from 0x10037e0c0 to 0x10037f013 (3923 bytes) // // 2 xrefs: // > GauntletLayer::init @ 0x10037df53 // > GauntletLayer::loadLevelsFinished @ 0x10037f26e // // 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:29:08 +0000 // void __fastcall GauntletLayer::setupGauntlet(__int64 a1, __int64 a2) { __int64 v2; // r14 __int64 v3; // rax __int64 v4; // rsi __int64 v5; // rax const char *v6; // r14 size_t v7; // rax std::string::size_type v8; // r15 char *data; // r12 size_t v10; // rbx std::string::pointer v11; // rbx std::string::size_type size; // r13 unsigned __int8 v13; // r12 std::string::size_type v14; // rax std::string::size_type v15; // rdx char *v16; // r13 char *v17; // rax char *v18; // rax std::string::size_type v19; // rax const std::string::value_type *v20; // rcx std::string::size_type v21; // r8 std::string::size_type v22; // rbx __int64 v23; // rax std::string::size_type v24; // rcx unsigned int v25; // r13d unsigned int v26; // eax __int64 v27; // rbx __int64 v28; // rax unsigned int v29; // eax int v30; // xmm0_4 __int64 v31; // rbx __int64 v32; // rbx __int64 v33; // r14 _DWORD *v34; // r12 int v35; // eax void *v36; // r13 void *v37; // r15 double v38; // xmm0_8 void *v39; // rdi char *v40; // r14 char *v41; // rdi __int64 v42; // rax int v43; // edx __int64 v44; // rbx __int64 v45; // rax __int64 CString; // rax __int64 v47; // r14 double v48; // xmm0_8 char *v49; // r15 __int64 v50; // xmm0_8 __int64 v51; // rdi char *v52; // r14 char *v53; // r14 __int64 v54; // rax unsigned int j; // r14d __int64 v56; // rax int v57; // ebx int v58; // eax int v59; // ecx int v60; // r8d int v61; // r9d __int64 v62; // rax char v63; // bl unsigned __int8 *v64; // rsi unsigned __int64 v65; // xmm0_8 int v66; // r12d float *v67; // rsi char *v68; // r14 int v69; // eax double v70; // xmm0_8 __int64 v71; // rax __int64 v72; // rax int v73; // r13d unsigned __int8 v74; // bl unsigned __int8 v75; // r15 __int64 v76; // rax int v77; // ebx int v78; // r8d int v79; // r9d int v80; // r15d int v81; // eax int v82; // eax int v83; // ecx int v84; // r8d int v85; // r9d __int64 v86; // rax char v87; // [rsp+0h] [rbp-150h] unsigned __int64 v88; // [rsp+8h] [rbp-148h] BYREF float v89; // [rsp+10h] [rbp-140h] BYREF float v90; // [rsp+18h] [rbp-138h] BYREF float v91; // [rsp+20h] [rbp-130h] BYREF float v92; // [rsp+28h] [rbp-128h] BYREF float v93; // [rsp+30h] [rbp-120h] BYREF float v94; // [rsp+38h] [rbp-118h] BYREF float v95; // [rsp+40h] [rbp-110h] BYREF double v96; // [rsp+48h] [rbp-108h] BYREF float v97[2]; // [rsp+50h] [rbp-100h] BYREF __int64 v98; // [rsp+58h] [rbp-F8h] char v99; // [rsp+60h] [rbp-F0h] BYREF char __s[15]; // [rsp+61h] [rbp-EFh] BYREF void *v101; // [rsp+70h] [rbp-E0h] unsigned __int64 v102; // [rsp+78h] [rbp-D8h] BYREF __int64 v103; // [rsp+80h] [rbp-D0h] unsigned __int64 v104; // [rsp+88h] [rbp-C8h] BYREF unsigned __int8 v105; // [rsp+90h] [rbp-C0h] BYREF char v106[15]; // [rsp+91h] [rbp-BFh] BYREF void *__p; // [rsp+A0h] [rbp-B0h] float v108; // [rsp+ACh] [rbp-A4h] std::string __dst; // [rsp+B0h] [rbp-A0h] BYREF double v110; // [rsp+CCh] [rbp-84h] BYREF unsigned __int64 v111; // [rsp+D4h] [rbp-7Ch] BYREF __int16 v112; // [rsp+DCh] [rbp-74h] BYREF char v113; // [rsp+DEh] [rbp-72h] __int64 v114; // [rsp+E0h] [rbp-70h] int v115; // [rsp+ECh] [rbp-64h] __int128 v116; // [rsp+F0h] [rbp-60h] BYREF void *v117; // [rsp+100h] [rbp-50h] __int64 v118; // [rsp+108h] [rbp-48h] __int64 v119; // [rsp+110h] [rbp-40h] unsigned int i; // [rsp+11Ch] [rbp-34h] __int64 v121; // [rsp+120h] [rbp-30h] v121 = a1; if ( !a2 || (unsigned int)sub_1007FEF90(a2) != 5 || *(_QWORD *)(v121 + 416) ) return; v2 = v121; *(_QWORD *)(v121 + 416) = a2; cocos2d::CCObject::retain(a2); v3 = cocos2d::CCDirector::sharedDirector(a2, a2); cocos2d::CCDirector::getWinSize(v97, v3); v4 = cocos2d::CCMenu::create(); v5 = *(_QWORD *)v2; v98 = v4; (*(void (__fastcall **)(__int64, __int64, __int64))(v5 + 464))(v2, v4, 2); sub_100278250((float *)&v88, v97[0] * 0.5, (float)(v97[1] * 0.5) + -12.0); GauntletNode::frameForType(&v99, *(unsigned int *)(v2 + 432)); v6 = __s; if ( (v99 & 1) != 0 ) v6 = (const char *)v101; v7 = strlen(v6); if ( v7 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100003630(); v8 = v7; if ( v7 >= 0x17 ) { v10 = 26; if ( (v7 | 7) != 0x17 ) v10 = (v7 | 7) + 1; data = (char *)operator new(v10); __dst.__r_.__value_.__r.__words[2] = (std::string::size_type)data; __dst.__r_.__value_.__r.__words[0] = v10 | 1; __dst.__r_.__value_.__l.__size_ = v8; goto LABEL_13; } __dst.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v7); data = __dst.__r_.__value_.__s.__data_; if ( v7 ) LABEL_13: memcpy(data, v6, v8); v11 = __dst.__r_.__value_.__s.__data_; data[v8] = 0; *(_DWORD *)((char *)&v116 + 1) = 825241695; v105 = 22; strcpy(v106, "_locked_001"); if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 ) { v11 = __dst.__r_.__value_.__l.__data_; size = __dst.__r_.__value_.__l.__size_; } else { size = *(_BYTE *)&__dst.__r_.__value_.__l.0 >> 1; } v13 = 22; v14 = 0; while ( 2 ) { v15 = size - v14; if ( (__int64)(size - v14) >= 4 ) { v16 = &v11[size]; v17 = &v11[v14]; while ( 1 ) { v18 = (char *)memchr(v17, 95, v15 - 3); if ( !v18 ) goto LABEL_35; if ( *(_DWORD *)v18 == *(_DWORD *)((char *)&v116 + 1) ) break; v17 = v18 + 1; v15 = v16 - v17; if ( v16 - v17 < 4 ) goto LABEL_35; } if ( v18 == v16 ) break; v19 = v18 - v11; if ( v19 == -1 ) break; if ( (v13 & 1) != 0 ) { v20 = (const std::string::value_type *)__p; v21 = *(_QWORD *)&v106[7]; } else { v21 = v13 >> 1; v20 = v106; } v22 = v19; std::string::replace(&__dst, v19, 4u, v20, v21); v13 = v105; if ( (v105 & 1) != 0 ) { v23 = *(_QWORD *)&v106[7]; v24 = v22; v25 = (unsigned int)__dst.__r_.__value_.__l.0; if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) == 0 ) goto LABEL_31; } else { v23 = v105 >> 1; v24 = v22; v25 = (unsigned int)__dst.__r_.__value_.__l.0; if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) == 0 ) { LABEL_31: size = v25 >> 1; v11 = __dst.__r_.__value_.__s.__data_; v14 = v24 + v23; if ( size >= v14 ) continue; break; } } v11 = __dst.__r_.__value_.__l.__data_; size = __dst.__r_.__value_.__l.__size_; v14 = v24 + v23; if ( __dst.__r_.__value_.__l.__size_ >= v14 ) continue; } break; } LABEL_35: if ( (v13 & 1) != 0 ) operator delete(__p); for ( i = 0; ; ++i ) { v26 = sub_1007FEF90(*(_QWORD *)(v121 + 416)); if ( i >= v26 ) break; v27 = sub_1007FEFE0(*(_QWORD *)(v121 + 416), i); v28 = GameStatsManager::sharedState(); if ( !GameStatsManager::hasCompletedGauntletLevel( v28, (unsigned int)(*(_DWORD *)(v27 + 328) - *(_DWORD *)(v27 + 332))) ) break; } sub_1002782D0(&v105, &qword_100BE3100); v29 = *(_DWORD *)(v121 + 432) - 16; if ( v29 > 0x2E ) v30 = 1109393408; else v30 = dword_100A08960[v29]; v108 = *(float *)&v30; v31 = 0; do { v114 = sub_1007FEFE0(*(_QWORD *)(v121 + 416), (unsigned int)v31); v118 = v31; if ( i != (_DWORD)v31 || (_DWORD)v31 == 0 ) v115 = 0; else v115 = *(_BYTE *)(v114 + 650) ^ 1; sub_100278250((float *)&v116, (float)(v118 - 2) * 90.0, flt_100A08758[(v118 & 1) == 0]); sub_100278350((double *)&v102, &v88, (unsigned __int64 *)&v116); v32 = v121; v33 = GauntletSprite::create(*(unsigned int *)(v121 + 432), (unsigned __int8)v115 & 1u | ((unsigned int)v118 > i)); v34 = CCMenuItemSpriteExtra::create(v33, 0, v32, (__int64)GauntletLayer::onLevel, 0); v34[100] = 1067030938; CCMenuItemSpriteExtra::setSizeMult((__int64)v34, 1.2); (*(void (__fastcall **)(_DWORD *, __int64))(*(_QWORD *)v34 + 72LL))(v34, v118); (*(void (__fastcall **)(__int64, _DWORD *))(*(_QWORD *)v98 + 456LL))(v98, v34); v35 = 0; if ( (v118 & 1) == 0 ) v35 = -6; sub_100278250((float *)&v111, 0.0, (float)v35); sub_100278350(&v110, &v102, &v111); cocos2d::CCNode::convertToNodeSpace((double *)&v116, v98, (unsigned int *)&v110); (*(void (__fastcall **)(_DWORD *, __int128 *))(*(_QWORD *)v34 + 184LL))(v34, &v116); v36 = cocos2d::CCNode::create(); (*(void (__fastcall **)(void *, void *))(*(_QWORD *)v36 + 320LL))(v36, &unk_100BE3108); (*(void (__fastcall **)(__int64, void *, __int64))(*(_QWORD *)v33 + 464LL))(v33, v36, 1); (*(void (__fastcall **)(double *, __int64))(*(_QWORD *)v33 + 336LL))(&v110, v33); LODWORD(v119) = LODWORD(v110); (*(void (__fastcall **)(unsigned __int64 *, __int64))(*(_QWORD *)v33 + 336LL))(&v111, v33); sub_100278250((float *)&v116, *(float *)&v119 * 0.5, *((float *)&v111 + 1) * 0.5); (*(void (__fastcall **)(void *, __int128 *))(*(_QWORD *)v36 + 184LL))(v36, &v116); v37 = cocos2d::CCNode::create(); (*(void (__fastcall **)(void *, void *))(*(_QWORD *)v37 + 320LL))(v37, &unk_100BE3108); (*(void (__fastcall **)(__int64, void *, __int64))(*(_QWORD *)v33 + 464LL))(v33, v37, 0xFFFFFFFFLL); (*(void (__fastcall **)(double *, __int64))(*(_QWORD *)v33 + 336LL))(&v110, v33); LODWORD(v119) = LODWORD(v110); (*(void (__fastcall **)(unsigned __int64 *, __int64))(*(_QWORD *)v33 + 336LL))(&v111, v33); *(_QWORD *)&v38 = (unsigned int)v119; *(float *)&v38 = *(float *)&v119 * 0.5; sub_100278250((float *)&v116, *(float *)&v119 * 0.5, *((float *)&v111 + 1) * 0.5); (*(void (__fastcall **)(void *, __int128 *))(*(_QWORD *)v37 + 184LL))(v37, &v116); v39 = __s; if ( (v99 & 1) != 0 ) v39 = v101; v40 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)v39, v38); (*(void (__fastcall **)(void *, char *, __int64))(*(_QWORD *)v37 + 464LL))(v37, v40, 0xFFFFFFFFLL); sub_100278250((float *)&v116, 0.0, -10.0); (*(void (__fastcall **)(char *, __int128 *))(*(_QWORD *)v40 + 184LL))(v40, &v116); (*(void (__fastcall **)(char *, float))(*(_QWORD *)v40 + 144LL))(v40, 1.2); (*(void (__fastcall **)(char *, void *))(*(_QWORD *)v40 + 960LL))(v40, &unk_100A08780); (*(void (__fastcall **)(char *, __int64))(*(_QWORD *)v40 + 912LL))(v40, 75); if ( (unsigned int)v118 > i ) { (*(void (__fastcall **)(_DWORD *, _QWORD))(*(_QWORD *)v34 + 1056LL))(v34, 0); goto LABEL_96; } if ( (*(_BYTE *)(v114 + 344) & 1) != 0 ) { sub_10001AD30(&v116, *(const void **)(v114 + 360), *(_QWORD *)(v114 + 352)); } else { v117 = *(void **)(v114 + 360); v116 = *(_OWORD *)(v114 + 344); } v41 = (char *)&v116 + 1; if ( (v116 & 1) != 0 ) v41 = (char *)v117; v42 = cocos2d::CCLabelBMFont::create_3(v41, "bigFont.fnt"); v103 = v42; if ( (v116 & 1) != 0 ) { operator delete(v117); v42 = v103; } v43 = 120; if ( (v118 & 1) == 0 ) v43 = 80; v44 = v42; cocos2d::CCLabelBMFont::limitLabelWidth(v42, (float)v43, 0.5, 0.0); (*(void (__fastcall **)(void *, __int64, __int64))(*(_QWORD *)v36 + 464LL))(v36, v44, 3); sub_100278250((float *)&v116, 0.0, v108); (*(void (__fastcall **)(__int64, __int128 *))(*(_QWORD *)v103 + 184LL))(v103, &v116); v45 = sub_10088E820("%i", v87); CString = cocos2d::CCString::getCString(v45); v119 = cocos2d::CCLabelBMFont::create_3(CString, "bigFont.fnt"); sub_100278250((float *)&v116, 1.0, 0.5); v47 = v119; (*(void (__fastcall **)(__int64, __int128 *))(*(_QWORD *)v119 + 296LL))(v119, &v116); (*(void (__fastcall **)(__int64, float))(*(_QWORD *)v47 + 160LL))(v47, 0.40000001); (*(void (__fastcall **)(void *, __int64, __int64))(*(_QWORD *)v36 + 464LL))(v36, v119, 2); sub_100278250((float *)&v116, -4.0, -38.0); v48 = (*(double (__fastcall **)(__int64, __int128 *))(*(_QWORD *)v119 + 184LL))(v119, &v116); v49 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"GJ_bigStar_001.png", v48); sub_100278250((float *)&v116, 0.0, 0.5); (*(void (__fastcall **)(char *, __int128 *))(*(_QWORD *)v49 + 296LL))(v49, &v116); (*(void (__fastcall **)(char *, float))(*(_QWORD *)v49 + 160LL))(v49, 0.40000001); (*(void (__fastcall **)(void *, char *, __int64))(*(_QWORD *)v36 + 464LL))(v36, v49, 2); v50 = 3229614080LL; sub_100278250((float *)&v116, -4.0, -38.0); (*(void (__fastcall **)(char *, __int128 *))(*(_QWORD *)v49 + 184LL))(v49, &v116); v51 = GameStatsManager::sharedState(); if ( GameStatsManager::hasCompletedLevel(v51, v114) ) { v52 = cocos2d::CCSprite::createWithSpriteFrameName( (__int64)"GJ_completesIcon_001.png", COERCE_DOUBLE(3229614080LL)); sub_100278250((float *)&v116, 0.0, 0.5); (*(void (__fastcall **)(char *, __int128 *))(*(_QWORD *)v52 + 296LL))(v52, &v116); (*(void (__fastcall **)(void *, char *, __int64))(*(_QWORD *)v36 + 464LL))(v36, v52, 5); (*(void (__fastcall **)(char *, float))(*(_QWORD *)v52 + 160LL))(v52, 0.80000001); v50 = 1090519040; sub_100278250((float *)&v116, 8.0, -5.0); v51 = (__int64)v52; (*(void (__fastcall **)(char *, __int128 *))(*(_QWORD *)v52 + 184LL))(v52, &v116); } if ( (_DWORD)v118 == 4 ) { v53 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"miniSkull_001.png", *(double *)&v50); (*(void (__fastcall **)(void *, char *, __int64))(*(_QWORD *)v36 + 464LL))(v36, v53, 4); (*(void (__fastcall **)(char *, float))(*(_QWORD *)v53 + 160LL))(v53, 1.2); sub_100278250((float *)&v116, 0.0, 5.0); v51 = (__int64)v53; (*(void (__fastcall **)(char *, __int128 *))(*(_QWORD *)v53 + 184LL))(v53, &v116); if ( (_BYTE)v115 ) goto LABEL_69; } else { v53 = nullptr; if ( (_BYTE)v115 ) { LABEL_69: v54 = sub_1007FE900(v51); *(_QWORD *)(v121 + 464) = v54; cocos2d::CCObject::retain(v54); sub_1007FEBF0(*(_QWORD *)(v121 + 464), v103); sub_1007FEBF0(*(_QWORD *)(v121 + 464), v119); sub_1007FEBF0(*(_QWORD *)(v121 + 464), v49); if ( v53 ) sub_1007FEBF0(*(_QWORD *)(v121 + 464), v53); for ( j = 0; j < (unsigned int)sub_1007FEF90(*(_QWORD *)(v121 + 464)); ++j ) { v56 = sub_1007FEFE0(*(_QWORD *)(v121 + 464), j); (*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v56 + 344LL))(v56, 0); } *(_QWORD *)(v121 + 456) = v34; (*(void (__fastcall **)(_DWORD *, _QWORD))(*(_QWORD *)v34 + 1056LL))(v34, 0); v57 = cocos2d::CCDelayTime::create(2.0); v58 = cocos2d::CCCallFunc::create(v121, GauntletLayer::unlockActiveItem, 0); v62 = sub_10039EB60(v57, v58, 0, v59, v60, v61); cocos2d::CCNode::runAction(v121, v62); } } if ( (_DWORD)v118 ) { v63 = v118; v64 = &v105; if ( (v118 & 1) == 0 ) v64 = (unsigned __int8 *)&v102; sub_1002782D0(&v116, v64); _mm_storel_ps( (double *)&v116, _mm_add_ps( _mm_blend_ps((__m128)dword_100A08760[(v63 & 1) == 0], (__m128)xmmword_100A08770, 14), (__m128)(unsigned __int64)v116)); sub_100278250((float *)&v110, -2.0, -1.0); sub_100278250((float *)&v111, 10.0, 2.5); sub_100278250(&v89, 21.0, 11.5); sub_100278250(&v90, 25.0, 26.0); sub_100278250(&v91, 20.5, 41.0); sub_100278250(&v92, 15.0, 56.0); sub_100278250(&v93, 10.5, 71.0); sub_100278250(&v94, 14.5, 85.5); v65 = 1103626240; sub_100278250(&v95, 25.0, 96.0); v66 = 1; LODWORD(v114) = 8; do { sub_1002782A0(&v104); v67 = (float *)&v111; switch ( v66 ) { case 1: break; case 2: v67 = &v89; break; case 3: v67 = &v90; break; case 4: v67 = &v91; break; case 5: v67 = &v92; break; case 6: v67 = &v93; break; case 7: v67 = &v94; break; case 8: v67 = &v95; break; } sub_100278300(&v104, v67); if ( (v118 & 1) == 0 ) { v65 = (unsigned int)v104 ^ 0x8000000080000000LL; LODWORD(v104) = v104 ^ 0x80000000; } sub_100278350(&v96, (unsigned __int64 *)&v116, &v104); v68 = cocos2d::CCSprite::createWithSpriteFrameName((__int64)"uiDot_001.png", *(double *)&v65); (*(void (__fastcall **)(__int64, char *, __int64))(*(_QWORD *)v121 + 464LL))(v121, v68, 1); v69 = -6710887; if ( (v66 & 1) == 0 ) v69 = -5066062; v112 = v69; v113 = BYTE2(v69); (*(void (__fastcall **)(char *, __int16 *))(*(_QWORD *)v68 + 960LL))(v68, &v112); (*(void (__fastcall **)(char *, double *))(*(_QWORD *)v68 + 184LL))(v68, &v96); if ( (_BYTE)v115 ) { (*(void (__fastcall **)(char *, _QWORD))(*(_QWORD *)v68 + 912LL))(v68, 0); v70 = (*(double (__fastcall **)(char *))(*(_QWORD *)v68 + 168LL))(v68); v71 = *(_QWORD *)v68; LODWORD(v119) = LODWORD(v70); (*(void (__fastcall **)(char *, float))(v71 + 160))(v68, *(float *)&v70 * 2.5); v72 = cocos2d::CCScaleTo::create_1(0.30000001, *(float *)&v119); v119 = cocos2d::CCEaseBounceOut::create(v72); v73 = cocos2d::CCFadeIn::create(0.1); v74 = *(_BYTE *)(*(__int64 (__fastcall **)(char *))(*(_QWORD *)v68 + 944LL))(v68); v75 = *(_BYTE *)((*(__int64 (__fastcall **)(char *))(*(_QWORD *)v68 + 944LL))(v68) + 1); v76 = (*(__int64 (__fastcall **)(char *))(*(_QWORD *)v68 + 944LL))(v68); v77 = cocos2d::CCTintTo::create(v74, v75, *(unsigned __int8 *)(v76 + 2), 0.5); (*(void (__fastcall **)(char *, void *))(*(_QWORD *)v68 + 960LL))(v68, &unk_100A08783); v80 = sub_10039FF60(v119, v73, v77, 0, v78, v79); v81 = v66; if ( (v118 & 1) == 0 ) v81 = v114; HIDWORD(v65) = 0; *(float *)&v65 = (float)((float)v81 * 0.15000001) + 0.64999998; v82 = cocos2d::CCDelayTime::create(*(float *)&v65); v86 = sub_10039EB60(v82, v80, 0, v83, v84, v85); cocos2d::CCNode::runAction((__int64)v68, v86); } ++v66; LODWORD(v114) = v114 - 1; } while ( v66 != 9 ); } LABEL_96: sub_100278300(&v105, &v102); v31 = (unsigned int)(v118 + 1); } while ( (_DWORD)v118 != 4 ); if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 ) operator delete(__dst.__r_.__value_.__l.__data_); if ( (v99 & 1) != 0 ) operator delete(v101); }
GD Web Decomp Icon

GD Web Decomp

Raw Source