// // GJSmartBlockPreview::addTemplateGuide from 0xb0fa74 to 0xb0ffd4 (1376 bytes) // // 3 xrefs: // > GJSmartBlockPreview::addTemplateGuide @ 0xb106b8 // > BrowseSmartTemplateLayer::addPrefabMenuItem @ 0xb1775c // > @ 0x69460 // // This function is hookable on this platform (idp: arm, 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 13:01:28 +0000 // cocos2d::CCArray *__fastcall GJSmartBlockPreview::addTemplateGuide(__int64 a1, __int64 a2, float a3) { __int64 v6; // x0 int v7; // w1 __int64 v8; // x0 cocos2d::CCNode *v9; // x27 _BYTE *v10; // x23 ObjectToolbox *v11; // x0 unsigned __int8 *v12; // x1 int v13; // w19 ObjectToolbox *v14; // x20 int v15; // w0 char *v16; // x0 size_t v17; // x0 cocos2d::CCSprite *v18; // x0 cocos2d::CCSprite *v19; // x22 int v20; // w0 void (__fastcall *v21)(cocos2d::CCSprite *, __int64 *); // x19 unsigned __int64 v22; // x20 int i; // w19 __int64 v24; // x0 int v25; // w22 int v26; // w0 const char *v27; // x1 cocos2d::CCSprite *v28; // x0 cocos2d::CCSprite *v29; // x21 void (__fastcall *v30)(cocos2d::CCSprite *, __int64 *); // x22 __int64 v31; // x2 cocos2d::CCSprite *v32; // x0 cocos2d::CCArray *v34; // [xsp+A8h] [xbp+A8h] float v35; // [xsp+B0h] [xbp+B0h] char *v36; // [xsp+B0h] [xbp+B0h] char v37; // [xsp+C0h] [xbp+C0h] BYREF char v38; // [xsp+C1h] [xbp+C1h] char v39; // [xsp+C2h] [xbp+C2h] _BYTE v40[8]; // [xsp+C8h] [xbp+C8h] BYREF float v41; // [xsp+D0h] [xbp+D0h] BYREF float v42; // [xsp+D4h] [xbp+D4h] __int64 v43; // [xsp+D8h] [xbp+D8h] BYREF char *v44[2]; // [xsp+E0h] [xbp+E0h] BYREF cocos2d::CCSprite *v45; // [xsp+F0h] [xbp+F0h] v34 = (cocos2d::CCArray *)cocos2d::CCArray::create(_stack_chk_guard); v35 = *(float *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 328LL))(a1) * 0.5; v6 = (*(__int64 (__fastcall **)(__int64))(*(_QWORD *)a1 + 328LL))(a1); cocos2d::CCPoint::CCPoint((cocos2d::CCPoint *)v40, v35, *(float *)(v6 + 4) * 0.5); v7 = *(_DWORD *)(a2 + 56); v8 = 0xFFFFFFFFLL; v37 = -1; v38 = -1; v39 = -1; if ( !v7 ) { v8 = *(_QWORD *)a2; if ( *(_QWORD *)a2 ) v37 = 0; else v38 = 0; v39 = 0; } v9 = GJSmartBlockPreviewSprite::create((GJSmartBlockPreviewSprite *)v8); v10 = (_BYTE *)(a2 + 8); (*(void (__fastcall **)(__int64, cocos2d::CCNode *))(*(_QWORD *)a1 + 456LL))(a1, v9); if ( (*(_BYTE *)(a2 + 8) & 1) == 0 ) { v11 = (ObjectToolbox *)((int)*(unsigned __int8 *)(a2 + 8) >> 1); v12 = (unsigned __int8 *)(a2 + 9); if ( (_DWORD)v11 ) goto LABEL_8; LABEL_50: sub_B0BD50(); } v11 = *(ObjectToolbox **)(a2 + 16); if ( !v11 ) goto LABEL_50; v12 = *(unsigned __int8 **)(a2 + 24); LABEL_8: v13 = *v12; v14 = (ObjectToolbox *)ObjectToolbox::sharedState(v11); v15 = GJSmartTemplate::smartTypeToObjectKey(v13); v16 = ObjectToolbox::intKeyToFrame(v14, v15); v44[0] = nullptr; v36 = v16; v44[1] = nullptr; v45 = nullptr; v17 = strlen(v16); std::string::__init((__int64 *)v44, v36, v17); v18 = (cocos2d::CCSprite *)((char *)v44 + 1); if ( ((__int64)v44[0] & 1) != 0 ) v18 = v45; v19 = (cocos2d::CCSprite *)cocos2d::CCSprite::createWithSpriteFrameName(v18, (const char *)LOBYTE(v44[0])); GJSmartTemplate::applyTransformationsForType(v13, v19); (*(void (__fastcall **)(cocos2d::CCSprite *, char *))(*(_QWORD *)v19 + 960LL))(v19, &v37); v20 = v13; v21 = *(void (__fastcall **)(cocos2d::CCSprite *, __int64 *))(*(_QWORD *)v19 + 184LL); GJSmartTemplate::offsetForType(v20, (cocos2d::CCPoint *)&v41); cocos2d::CCPoint::operator+(&v43, v40); v21(v19, &v43); (*(void (__fastcall **)(cocos2d::CCNode *, cocos2d::CCSprite *, _QWORD))(*(_QWORD *)v9 + 464LL))(v9, v19, 0); (*(void (__fastcall **)(cocos2d::CCSprite *))(*(_QWORD *)v19 + 912LL))(v19); cocos2d::CCArray::addObject(v34, v19); (*(void (__fastcall **)(cocos2d::CCSprite *, _QWORD))(*(_QWORD *)v19 + 72LL))(v19, 0); v22 = 1; for ( i = 1; i != 9; ++i ) { while ( 1 ) { if ( (*v10 & 1) != 0 ) { if ( v22 >= *(_QWORD *)(a2 + 16) ) goto LABEL_52; v24 = *(_QWORD *)(a2 + 24); } else { if ( v22 >= *v10 >> 1 ) LABEL_52: sub_B0BD50(); v24 = a2 + 9; } v25 = *(unsigned __int8 *)(v24 + v22); if ( !GJSmartTemplate::shouldDiscardObject(v25, i) ) break; ++i; ++v22; if ( i == 9 ) goto LABEL_36; } v26 = GJSmartTemplate::smartTypeToObjectKey(v25); if ( v26 == 2896 ) { std::string::assign((__int64 *)v44, "smartBlock02b_001.png"); } else if ( v26 == 2897 ) { std::string::assign((__int64 *)v44, "smartBlock03b_001.png"); } else { std::string::assign((__int64 *)v44, "smartBlock01b_001.png"); } if ( ((__int64)v44[0] & 1) != 0 ) v28 = v45; else v28 = (cocos2d::CCSprite *)((char *)v44 + 1); v29 = (cocos2d::CCSprite *)cocos2d::CCSprite::createWithSpriteFrameName(v28, v27); GJSmartTemplate::applyTransformationsForType(v25, v29); (*(void (__fastcall **)(cocos2d::CCNode *, cocos2d::CCSprite *, _QWORD))(*(_QWORD *)v9 + 464LL))(v9, v29, 0); GJSmartTemplate::offsetForType(v25, (cocos2d::CCPoint *)&v41); if ( (unsigned int)(i - 5) <= 1 || i == 1 ) v42 = v42 + 30.0; if ( (unsigned int)(i - 7) <= 1 || i == 2 ) v42 = v42 - 30.0; if ( (i & 0xFFFFFFFB) == 3 || i == 5 ) v41 = v41 - 30.0; if ( (i & 0xFFFFFFFD) == 4 || i == 8 ) v41 = v41 + 30.0; v30 = *(void (__fastcall **)(cocos2d::CCSprite *, __int64 *))(*(_QWORD *)v29 + 184LL); cocos2d::CCPoint::operator+(&v43, v40); v30(v29, &v43); if ( (*(_BYTE *)(a1 + 320) & 1) != 0 ) { if ( v22 >= *(_QWORD *)(a1 + 328) ) goto LABEL_53; v31 = *(_QWORD *)v29; v32 = v29; if ( *(_BYTE *)(*(_QWORD *)(a1 + 336) + v22) != 48 ) goto LABEL_34; } else { if ( v22 >= *(_BYTE *)(a1 + 320) >> 1 ) LABEL_53: sub_B0BD50(); v31 = *(_QWORD *)v29; v32 = v29; if ( *(_BYTE *)(a1 + 321 + v22) != 48 ) { LABEL_34: (*(void (**)(void))(v31 + 960))(); (*(void (__fastcall **)(cocos2d::CCSprite *, _QWORD))(*(_QWORD *)v29 + 912LL))( v29, (unsigned __int8)(unsigned int)(float)(a3 * 255.0)); (*(void (__fastcall **)(cocos2d::CCSprite *, __int64))(*(_QWORD *)v29 + 72LL))(v29, 1); goto LABEL_35; } } (*(void (__fastcall **)(cocos2d::CCSprite *, void *))(v31 + 960))(v32, &unk_11845B0); (*(void (__fastcall **)(cocos2d::CCSprite *, _QWORD))(*(_QWORD *)v29 + 912LL))( v29, (unsigned int)(float)(a3 * 150.0)); (*(void (__fastcall **)(cocos2d::CCSprite *, __int64))(*(_QWORD *)v29 + 72LL))(v29, 2); LABEL_35: cocos2d::CCArray::addObject(v34, v29); ++v22; } LABEL_36: if ( ((__int64)v44[0] & 1) != 0 ) operator delete(v45); return v34; }
GD Web Decomp Icon

GD Web Decomp

Raw Source