// // SetupSmartBlockLayer::onPasteTemplate from 0x1004e17f0 to 0x1004e1a23 (563 bytes) // // 1 xrefs: // > SetupSmartBlockLayer::init @ 0x1004e09f1 // // 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:31:18 +0000 // __int64 __fastcall SetupSmartBlockLayer::onPasteTemplate(_QWORD *a1, double a2, double a3, __m128 a4) { _QWORD *v4; // rbx __int64 v5; // r14 __int64 v6; // r14 __int64 v7; // rax __int64 v8; // rax __int64 v9; // r12 float v10; // xmm1_4 double v11; // xmm0_8 __int64 v12; // r12 __int64 v13; // rbx __int64 v14; // rax __int64 ActiveSmartTemplate; // rax __int64 v16; // r15 __int64 v17; // rax __int64 v19; // [rsp+10h] [rbp-70h] BYREF __int64 v20; // [rsp+18h] [rbp-68h] BYREF _QWORD *v21; // [rsp+20h] [rbp-60h] _QWORD v22[2]; // [rsp+28h] [rbp-58h] BYREF void *__p; // [rsp+38h] [rbp-48h] __int64 v24; // [rsp+40h] [rbp-40h] BYREF __int64 v25; // [rsp+48h] [rbp-38h] BYREF float v26; // [rsp+50h] [rbp-30h] float v27; // [rsp+54h] [rbp-2Ch] v4 = a1; if ( *(_QWORD *)(GameManager::sharedState() + 552) ) { v5 = *(_QWORD *)(*(_QWORD *)(GameManager::sharedState() + 552) + 14248LL); __p = operator new(0x1760u); v22[0] = 5985; v22[1] = 5983; memcpy(__p, a12895236453195, 0x175Fu); *((_BYTE *)__p + 5983) = 0; v6 = EditorUI::pasteObjects(v5, v22, 0, 0); if ( (v22[0] & 1) != 0 ) operator delete(__p); v7 = GameManager::sharedState(); EditorBuildStats::noteAction(*(_QWORD *)(v7 + 552) + 14704LL); if ( v6 && (unsigned int)sub_1007FEF90(v6) ) { v21 = a1; v8 = cocos2d::CCDirector::sharedDirector(); cocos2d::CCDirector::getWinSize(&v24, v8); v9 = *(_QWORD *)(*(_QWORD *)(GameManager::sharedState() + 552) + 3920LL); v26 = *(float *)&v24 * 0.5; v27 = *((float *)&v24 + 1) * 0.5; v10 = (float)(0.5 * *(float *)(*(_QWORD *)(*(_QWORD *)(GameManager::sharedState() + 552) + 14248LL) + 856LL)) + v27; *(_QWORD *)&v11 = LODWORD(v26); sub_100278250((float *)&v25, v26, v10); cocos2d::CCNode::convertToNodeSpace((double *)&v19, v9, (unsigned int *)&v25); v12 = *(_QWORD *)(*(_QWORD *)(GameManager::sharedState() + 552) + 14248LL); sub_1002782D0(&v20, &v19); EditorUI::getGridSnappedPos( (__int64)&v25, v12, (unsigned int *)&v20, v11, COERCE_DOUBLE((unsigned __int64)LODWORD(v10)), a4); sub_100278300(&v19, &v25); v13 = *(_QWORD *)(*(_QWORD *)(GameManager::sharedState() + 552) + 14248LL); sub_1002782D0(&v25, &v19); EditorUI::repositionObjectsToCenter(v13, v6, &v25, 0); v14 = GameLevelManager::sharedState(v11); ActiveSmartTemplate = GameLevelManager::getActiveSmartTemplate(v14); if ( ActiveSmartTemplate ) { v16 = ActiveSmartTemplate; v17 = GameManager::sharedState(); EditorUI::createSmartObjectsFromTemplate(*(_QWORD *)(*(_QWORD *)(v17 + 552) + 14248LL), v16, v6, 0, 1, 1, 0); } v4 = v21; } } return SetupSmartBlockLayer::onClose(v4); }
GD Web Decomp Icon

GD Web Decomp

Raw Source