// // DemonInfoPopup::init from 0x1007c1420 to 0x1007c1d0b (2283 bytes) // // 1 xrefs: // > DemonInfoPopup::create @ 0x1007c13dc // // 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 // // local variable allocation has failed, the output may be wrong! bool __fastcall DemonInfoPopup::init( DemonInfoPopup *a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, int a13) { __int64 v14; // rbx __int64 v15; // r12 __int64 v16; // r13 bool result; // al cocos2d::extension::CCScale9Sprite *v18; // rbx cocos2d::CCMenu *v19; // rax const char *v20; // rsi char *v21; // rax int v22; // r12d const char *CString; // rax cocos2d::CCLabelBMFont *v24; // rbx double v25; // xmm0_8 const char *v26; // rsi char *v27; // rax const char *v28; // rax cocos2d::CCLabelBMFont *v29; // r14 unsigned int **v30; // rbx cocos2d::CCPoint v31; // xmm1_8 unsigned __int64 *v32; // r14 int v33; // r15d double v34; // xmm0_8 int v35; // esi int v36; // ebx char *v37; // rax const char *v38; // r15 size_t v39; // rax size_t v40; // r13 char *v41; // r12 const char *v42; // rdi cocos2d::CCSprite *v43; // rax DemonInfoPopup *v44; // r13 cocos2d::CCSprite *v45; // r15 double v46; // xmm0_8 const char *v47; // rdi cocos2d::CCLabelBMFont *v48; // rbx double v49; // xmm0_8 const char *v50; // rdi cocos2d::CCLabelBMFont *v51; // r12 unsigned __int64 *v52; // rbx int v53; // r15d unsigned __int64 *v54; // rbx __int64 v55; // rax size_t v56; // r14 double v57; // xmm0_8 const char *v58; // rsi char *v59; // rax const char *v60; // rax cocos2d::CCLabelBMFont *v61; // rbx const char *v62; // rsi char *v63; // rax const char *v64; // rax cocos2d::CCLabelBMFont *v65; // rbx ButtonSprite *v66; // rax CCMenuItemSpriteExtra *v67; // rbx const cocos2d::CCPoint *m_buttonMenu; // r14 float v69; // [rsp+8h] [rbp-B8h] BYREF DemonInfoPopup *v70; // [rsp+10h] [rbp-B0h] __int64 v71; // [rsp+18h] [rbp-A8h] __int64 v72; // [rsp+20h] [rbp-A0h] __int64 v73; // [rsp+28h] [rbp-98h] __int64 v74; // [rsp+30h] [rbp-90h] unsigned __int64 v75; // [rsp+3Ch] [rbp-84h] BYREF unsigned __int64 v76; // [rsp+44h] [rbp-7Ch] BYREF int v77; // [rsp+4Ch] [rbp-74h] int v78; // [rsp+50h] [rbp-70h] int v79; // [rsp+54h] [rbp-6Ch] size_t v80[2]; // [rsp+58h] [rbp-68h] BYREF void *v81; // [rsp+68h] [rbp-58h] float v82; // [rsp+70h] [rbp-50h] BYREF float v83; // [rsp+74h] [rbp-4Ch] int v84; // [rsp+78h] [rbp-48h] bool v85; // [rsp+7Fh] [rbp-41h] unsigned __int64 __dst[2]; // [rsp+80h] [rbp-40h] BYREF void *__p; // [rsp+90h] [rbp-30h] double v88; // 0:xmm0_8.8 cocos2d::CCRect v89; // 0:xmm0_8.8,8:xmm1_8.8 v14 = (unsigned int)a5; v15 = (unsigned int)a4; v16 = (unsigned int)a3; v73 = *(_QWORD *)&a2; result = FLAlertLayer::init_1(a1, 75); if ( !result ) return result; v85 = result; cocos2d::CCDirector::sharedDirector(); cocos2d::CCDirector::getWinSize((cocos2d::CCDirector *)&v82); v74 = v14; v89.origin = 0; v89.size = 0; sub_10028CC00((__int64)__dst, 0.0, 0.0, (__m128)0x42A00000u, (__m128)0x42A00000u); v18 = cocos2d::extension::CCScale9Sprite::create_2("GJ_square02.png", v89); v79 = a6; sub_10028CBF0((float *)__dst, 380.0, 210.0); ((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, unsigned __int64 *))v18->setContentSize)(v18, __dst); ((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::extension::CCScale9Sprite *, __int64))a1->m_mainLayer->addChild_0)( a1->m_mainLayer, v18, 0xFFFFFFFFLL); sub_10028CBE0((float *)__dst, v82 * 0.5, v83 * 0.5); ((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, unsigned __int64 *))v18->setPosition)(v18, __dst); v19 = cocos2d::CCMenu::create(); a1->m_buttonMenu = v19; *(double *)&v89.origin = ((double (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCMenu *, __int64))a1->m_mainLayer->addChild_0)( a1->m_mainLayer, v19, 10); v72 = v16; v71 = v15; GameToolbox::pointsToString(__dst, a6 + v16 + v73 + v15 + v74, *(double *)&v89.origin); if ( (__dst[0] & 1) != 0 ) v20 = (const char *)__p; else v20 = (char *)__dst + 1; v21 = sub_1007AB580("Classic: %s", v20); v22 = v72; CString = cocos2d::CCString::getCString((cocos2d::CCString *)v21); v24 = cocos2d::CCLabelBMFont::create_3(CString, "goldFont.fnt"); if ( (__dst[0] & 1) != 0 ) operator delete(__p); ((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v24); v25 = ((double (__fastcall *)(cocos2d::CCLabelBMFont *, float))v24->setScale)(v24, 0.69999999); GameToolbox::pointsToString(__dst, a11 + a7 + a8 + a9 + a10, v25); if ( (__dst[0] & 1) != 0 ) v26 = (const char *)__p; else v26 = (char *)__dst + 1; v27 = sub_1007AB580("Platformer: %s", v26); v28 = cocos2d::CCString::getCString((cocos2d::CCString *)v27); v29 = cocos2d::CCLabelBMFont::create_3(v28, "goldFont.fnt"); if ( (__dst[0] & 1) != 0 ) operator delete(__p); ((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))a1->m_mainLayer->addChild)(a1->m_mainLayer, v29); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v29->setScale)(v29, 0.69999999); BYTE2(__dst[0]) = -1; LOWORD(__dst[0]) = -14081; ((void (__fastcall *)(cocos2d::CCLabelBMFont *, unsigned __int64 *))v29->setColor)(v29, __dst); v30 = sub_10071FB90(v24, v29, 0); v31 = (cocos2d::CCPoint)LODWORD(v83); v31.x = (float)((float)(v83 * 0.5) + 105.0) + -20.0; sub_10028CBE0((float *)__dst, v82 * 0.5, v31.x); GameToolbox::alignItemsHorisontally((cocos2d::CCArray *)v30, 30.0, v31, (bool)__dst); v32 = (unsigned __int64 *)&v69; sub_10028CBE0(&v69, (float)(v82 * 0.5) + -140.0, (float)(v83 * 0.5) + 35.0); v33 = 0; v70 = a1; do { HIDWORD(v34) = 0; *(float *)&v34 = (float)v33 * 70.0; sub_10028CBE0((float *)__dst, *(float *)&v34, 0.0); sub_10028CCE0((double *)&v75, v32, __dst); v77 = v33; switch ( v33 ) { case 0: v35 = 7; v84 = a7; v36 = v73; break; case 1: v35 = 8; v84 = a8; v36 = v22; break; case 2: v35 = 6; v84 = a9; v36 = v71; break; case 3: v35 = 9; v84 = a10; v36 = v74; break; case 4: v35 = 10; v84 = a11; v36 = v79; break; } v37 = sub_1007AB580("difficulty_%02d_btn2_001.png", v35); v38 = cocos2d::CCString::getCString((cocos2d::CCString *)v37); v39 = strlen(v38); if ( v39 >= 0xFFFFFFFFFFFFFFF8LL ) sub_100006BF0(v34); v40 = v39; if ( v39 >= 0x17 ) { v78 = v36; v54 = v32; v55 = v39 | 7; v56 = 26; if ( (v40 | 7) != 0x17 ) v56 = v55 + 1; v41 = (char *)operator new(v56); __p = v41; __dst[0] = v56 + 1; __dst[1] = v40; v32 = v54; v36 = v78; } else { LOBYTE(__dst[0]) = 2 * v39; v41 = (char *)__dst + 1; if ( !v39 ) { BYTE1(__dst[0]) = 0; v42 = (char *)__dst + 1; if ( (__dst[0] & 1) == 0 ) goto LABEL_25; LABEL_24: v42 = (const char *)__p; goto LABEL_25; } } memmove(v41, v38, v40); v41[v40] = 0; v42 = (char *)__dst + 1; if ( (__dst[0] & 1) != 0 ) goto LABEL_24; LABEL_25: v43 = cocos2d::CCSprite::createWithSpriteFrameName(v42); v44 = v70; v45 = v43; ((void (__fastcall *)(cocos2d::CCSprite *, float))v43->setScale)(v43, 1.0); ((void (__fastcall *)(cocos2d::CCSprite *, unsigned __int64 *))v45->setPosition)(v45, &v75); v46 = ((double (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCSprite *))v44->m_mainLayer->addChild)( v44->m_mainLayer, v45); GameToolbox::pointsToString(v80, v36, v46); v47 = (char *)v80 + 1; if ( (v80[0] & 1) != 0 ) v47 = (const char *)v81; v48 = cocos2d::CCLabelBMFont::create_3(v47, "goldFont.fnt"); if ( (v80[0] & 1) != 0 ) operator delete(v81); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v48->setScale)(v48, 0.60000002); ((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))v44->m_mainLayer->addChild)( v44->m_mainLayer, v48); sub_10028CBE0((float *)&v76, 0.0, -50.0); sub_10028CCE0((double *)v80, &v75, &v76); v49 = ((double (__fastcall *)(cocos2d::CCLabelBMFont *, size_t *))v48->setPosition)(v48, v80); GameToolbox::pointsToString(v80, v84, v49); v50 = (char *)v80 + 1; if ( (v80[0] & 1) != 0 ) v50 = (const char *)v81; v51 = cocos2d::CCLabelBMFont::create_3(v50, "goldFont.fnt"); if ( (v80[0] & 1) != 0 ) operator delete(v81); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v51->setScale)(v51, 0.60000002); ((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))v44->m_mainLayer->addChild)( v44->m_mainLayer, v51); v52 = (unsigned __int64 *)((__int64 (__fastcall *)(cocos2d::CCLabelBMFont *))v48->getPosition)(v48); sub_10028CBE0((float *)&v76, 0.0, -26.0); sub_10028CCE0((double *)v80, v52, &v76); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, size_t *))v51->setPosition)(v51, v80); BYTE2(v80[0]) = -1; LOWORD(v80[0]) = -14081; ((void (__fastcall *)(cocos2d::CCLabelBMFont *, size_t *))v51->setColor)(v51, v80); v22 = v72; v53 = v77; if ( (__dst[0] & 1) != 0 ) operator delete(__p); v33 = v53 + 1; } while ( v33 != 5 ); *(_QWORD *)&v57 = LODWORD(v82); *(float *)&v57 = (float)((float)(v82 * 0.5) + 190.0) + -12.0; sub_10028CBE0((float *)v80, *(float *)&v57, (float)((float)(v83 * 0.5) + -105.0) + 14.0); if ( a13 > 0 ) { GameToolbox::pointsToString(__dst, a13, v57); if ( (__dst[0] & 1) != 0 ) v58 = (const char *)__p; else v58 = (char *)__dst + 1; v59 = sub_1007AB580("Gauntlet: %s", v58); v60 = cocos2d::CCString::getCString((cocos2d::CCString *)v59); v61 = cocos2d::CCLabelBMFont::create_3(v60, "goldFont.fnt"); if ( (__dst[0] & 1) != 0 ) operator delete(__p); ((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))v44->m_mainLayer->addChild)( v44->m_mainLayer, v61); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v61->setScale)(v61, 0.40000001); sub_10028CBE0((float *)__dst, 1.0, 0.0); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, unsigned __int64 *))v61->setAnchorPoint)(v61, __dst); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, size_t *))v61->setPosition)(v61, v80); *(_QWORD *)&v57 = HIDWORD(v80[0]); *(float *)&v57 = *((float *)v80 + 1) + 16.0; *((float *)v80 + 1) = *((float *)v80 + 1) + 16.0; } if ( a12 > 0 ) { GameToolbox::pointsToString(__dst, a12, v57); if ( (__dst[0] & 1) != 0 ) v62 = (const char *)__p; else v62 = (char *)__dst + 1; v63 = sub_1007AB580("Weekly: %s", v62); v64 = cocos2d::CCString::getCString((cocos2d::CCString *)v63); v65 = cocos2d::CCLabelBMFont::create_3(v64, "goldFont.fnt"); if ( (__dst[0] & 1) != 0 ) operator delete(__p); ((void (__fastcall *)(cocos2d::CCLayer *, cocos2d::CCLabelBMFont *))v44->m_mainLayer->addChild)( v44->m_mainLayer, v65); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, float))v65->setScale)(v65, 0.40000001); sub_10028CBE0((float *)__dst, 1.0, 0.0); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, unsigned __int64 *))v65->setAnchorPoint)(v65, __dst); ((void (__fastcall *)(cocos2d::CCLabelBMFont *, size_t *))v65->setPosition)(v65, v80); } v66 = sub_100092A30("OK"); v67 = CCMenuItemSpriteExtra::create( v66, nullptr, v44, (cocos2d::SEL_MenuHandler)(unsigned __int64)DemonInfoPopup::onClose); ((void (__fastcall *)(cocos2d::CCMenu *, CCMenuItemSpriteExtra *))v44->m_buttonMenu->addChild)(v44->m_buttonMenu, v67); m_buttonMenu = (const cocos2d::CCPoint *)v44->m_buttonMenu; sub_10028CBE0((float *)&v75, v82 * 0.5, (float)((float)(0.5 * v83) + -105.0) + 25.0); *(cocos2d::CCPoint *)&v88 = cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)__dst, m_buttonMenu); ((void (__fastcall *)(CCMenuItemSpriteExtra *, unsigned __int64 *, double))v67->setPosition)(v67, __dst, v88); return v85; }