// // GJSmartTemplate::scanForPrefab from 0x671c24 to 0x6720b8 (1172 bytes) // // 2 xrefs: // > EditorUI::createSmartObjectsFromTemplate @ 0x487f68 // > GJSmartTemplate::getTemplateState @ 0x6721b6 // // This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False! // // 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 11:55:53 +0000 // SmartPrefabResult *__fastcall GJSmartTemplate::scanForPrefab(SmartPrefabResult *a1, int a2, int *a3) { int *v3; // r6 _DWORD *v6; // r0 int *v7; // r2 int v8; // r10 int v9; // r3 int *v10; // r2 _DWORD *v11; // r8 int *v12; // r2 _DWORD *v13; // r0 const SmartPrefabResult *v14; // r0 int *v15; // r2 int v16; // r3 bool v17; // zf int v18; // r3 int v19; // r3 int v20; // r7 int v21; // r3 int v22; // r3 int v23; // r8 int i; // r3 int v25; // r3 int j; // r3 int v27; // r3 int v28; // r9 _BYTE *v29; // r2 int v30; // r3 _BYTE *v31; // r2 int v32; // r3 _BYTE *v33; // r2 int v34; // r3 unsigned __int8 *v35; // r4 int v37; // [sp+4h] [bp-F8h] int v38; // [sp+8h] [bp-F4h] int v39; // [sp+Ch] [bp-F0h] int v40; // [sp+14h] [bp-E8h] int v42[3]; // [sp+20h] [bp-DCh] BYREF int v43[3]; // [sp+2Ch] [bp-D0h] BYREF int v44[3]; // [sp+38h] [bp-C4h] BYREF int v45[3]; // [sp+44h] [bp-B8h] BYREF int v46[3]; // [sp+50h] [bp-ACh] BYREF int v47; // [sp+5Ch] [bp-A0h] BYREF int v48; // [sp+60h] [bp-9Ch] _BYTE *v49; // [sp+64h] [bp-98h] int v50[3]; // [sp+68h] [bp-94h] BYREF int v51[3]; // [sp+74h] [bp-88h] BYREF int v52; // [sp+80h] [bp-7Ch] BYREF int v53; // [sp+84h] [bp-78h] _BYTE *v54; // [sp+88h] [bp-74h] int v55[3]; // [sp+8Ch] [bp-70h] BYREF int v56[3]; // [sp+98h] [bp-64h] BYREF int v57[3]; // [sp+A4h] [bp-58h] BYREF int v58; // [sp+B0h] [bp-4Ch] BYREF int v59; // [sp+B4h] [bp-48h] _BYTE *v60; // [sp+B8h] [bp-44h] int v61[3]; // [sp+BCh] [bp-40h] BYREF int Prefab; // [sp+C8h] [bp-34h] BYREF unsigned __int8 v63[12]; // [sp+CCh] [bp-30h] BYREF int v64; // [sp+D8h] [bp-24h] BYREF int v65; // [sp+DCh] [bp-20h] _BYTE *v66; // [sp+E0h] [bp-1Ch] int v67; // [sp+E4h] [bp-18h] unsigned __int8 v68; // [sp+E8h] [bp-14h] int v69; // [sp+ECh] [bp-10h] char v70; // [sp+F0h] [bp-Ch] char v71; // [sp+F1h] [bp-Bh] char v72; // [sp+F2h] [bp-Ah] v3 = (int *)(a2 + 80); v6 = std::map::operator[]((int *)(a2 + 80), a3, a3); v8 = *((unsigned __int8 *)v6 + 4); if ( (v8 & 1) != 0 ) v9 = v6[2]; else v9 = v8 >> 1; if ( v9 ) { if ( *std::map::operator[](v3, a3, v7) ) { v11 = std::map::operator[](v3, a3, v10); v13 = std::map::operator[](v3, a3, v12); std::string::basic_string(&Prefab, (int)(v13 + 4)); *v11 = GJSmartTemplate::getRandomPrefab(a2, (int)&Prefab); std::string::~string((int)&Prefab); } v14 = (const SmartPrefabResult *)std::map::operator[](v3, a3, v10); SmartPrefabResult::SmartPrefabResult(a1, v14); } else { SmartPrefabResult::SmartPrefabResult((SmartPrefabResult *)&Prefab); std::string::operator=(v63, (unsigned __int8 *)a3); v15 = (int *)*(unsigned __int8 *)(a2 + 94); v37 = *(unsigned __int8 *)(a2 + 93); v16 = *(unsigned __int8 *)(a2 + 92); if ( *(_BYTE *)(a2 + 94) ) { v17 = v16 == 0; v18 = *(unsigned __int8 *)(a2 + 93); if ( !v17 ) v18 = 0; v37 = v18; v19 = 1; } else { v17 = v16 == 0; v19 = *(unsigned __int8 *)(a2 + 93); if ( !v17 ) v19 = 1; } v20 = 0; v40 = v19; while ( 1 ) { v21 = *(_BYTE *)(a2 + 95) ? 2 : 1; if ( v20 >= v21 ) break; std::string::basic_string(v42, (int)a3); if ( v20 == 1 ) { v72 = 1; std::string::basic_string(v43, (int)v42); GJSmartTemplate::getNoCornerKey(v61, a2, (unsigned __int8 *)v43); std::string::~string((int)v43); if ( (v61[0] & 1) != 0 ) v22 = v61[1]; else v22 = (int)LOBYTE(v61[0]) >> 1; if ( v22 ) std::string::operator=((unsigned __int8 *)v42, (unsigned __int8 *)v61); v23 = 1; std::string::~string((int)v61); } else { v23 = 0; } for ( i = 0; ; i = v38 + 1 ) { v38 = i; v25 = v40 ? 2 : 1; if ( v38 >= v25 ) break; for ( j = 0; ; j = v39 + 1 ) { v39 = j; v27 = *(_BYTE *)(a2 + 94) ? 4 : 1; if ( v39 >= v27 ) break; if ( v38 ) v28 = 0; else v28 = v40; v69 = 90 * v39; std::string::basic_string(v44, (int)v42); GJSmartTemplate::rotateKey(v43, (int)v44, v69); std::string::~string((int)v44); std::string::operator=((unsigned __int8 *)&v64, (unsigned __int8 *)v43); std::string::basic_string(v45, (int)&v64); Prefab = GJSmartTemplate::getPrefab((_DWORD *)a2, (unsigned __int8 *)v45, v28, v23); std::string::~string((int)v45); if ( Prefab ) goto LABEL_68; if ( *(_BYTE *)(a2 + 92) ) { std::string::basic_string(v46, (int)v43); GJSmartTemplate::flipKey(&v47, (int)v46, 1, 0); v30 = v64 & 1; if ( (v64 & 1) != 0 ) { v29 = v66; v30 = 0; } else { BYTE1(v64) = v64 & 1; } if ( (v64 & 1) != 0 ) { *v29 = v30; v65 = v30; } else { LOBYTE(v64) = v30; } std::string::reserve(&v64, 0); v64 = v47; v65 = v48; v66 = v49; v47 = 0; v48 = 0; v49 = nullptr; std::string::~string((int)&v47); std::string::~string((int)v46); std::string::basic_string(v50, (int)&v64); Prefab = GJSmartTemplate::getPrefab((_DWORD *)a2, (unsigned __int8 *)v50, v28, v23); std::string::~string((int)v50); if ( Prefab ) { v70 = 1; goto LABEL_68; } } if ( v37 ) { std::string::basic_string(v51, (int)v43); GJSmartTemplate::flipKey(&v52, (int)v51, 0, 1); v32 = v64 & 1; if ( (v64 & 1) != 0 ) { v31 = v66; v32 = 0; } else { BYTE1(v64) = v64 & 1; } if ( (v64 & 1) != 0 ) { *v31 = v32; v65 = v32; } else { LOBYTE(v64) = v32; } std::string::reserve(&v64, 0); v64 = v52; v65 = v53; v66 = v54; v52 = 0; v53 = 0; v54 = nullptr; std::string::~string((int)&v52); std::string::~string((int)v51); std::string::basic_string(v55, (int)&v64); Prefab = GJSmartTemplate::getPrefab((_DWORD *)a2, (unsigned __int8 *)v55, v28, v23); std::string::~string((int)v55); if ( Prefab ) goto LABEL_66; } if ( *(_BYTE *)(a2 + 92) && v37 ) { std::string::basic_string(v56, (int)v43); GJSmartTemplate::flipKey(v57, (int)v56, 1, 0); GJSmartTemplate::flipKey(&v58, (int)v57, 0, 1); v34 = v64 & 1; if ( (v64 & 1) != 0 ) { v33 = v66; v34 = 0; } else { BYTE1(v64) = v64 & 1; } if ( (v64 & 1) != 0 ) { *v33 = v34; v65 = v34; } else { LOBYTE(v64) = v34; } std::string::reserve(&v64, 0); v64 = v58; v65 = v59; v66 = v60; v58 = 0; v59 = 0; v60 = nullptr; std::string::~string((int)&v58); std::string::~string((int)v57); std::string::~string((int)v56); std::string::basic_string(v61, (int)&v64); Prefab = GJSmartTemplate::getPrefab((_DWORD *)a2, (unsigned __int8 *)v61, v28, v23); std::string::~string((int)v61); if ( Prefab ) { v70 = 1; LABEL_66: v71 = 1; LABEL_68: std::string::~string((int)v43); break; } } std::string::~string((int)v43); } if ( Prefab ) break; } if ( Prefab ) { std::string::~string((int)v42); break; } std::string::~string((int)v42); ++v20; } if ( Prefab ) std::string::operator=((unsigned __int8 *)&v64, (unsigned __int8 *)(Prefab + 52)); v35 = (unsigned __int8 *)std::map::operator[](v3, a3, v15); *(_DWORD *)v35 = Prefab; std::string::operator=(v35 + 4, v63); std::string::operator=(v35 + 16, (unsigned __int8 *)&v64); *((_DWORD *)v35 + 7) = v67; v35[32] = v68; *((_DWORD *)v35 + 9) = v69; v35[40] = v70; v35[41] = v71; v35[42] = v72; SmartPrefabResult::SmartPrefabResult((int)a1, (int)&Prefab); SmartPrefabResult::~SmartPrefabResult((SmartPrefabResult *)&Prefab); } return a1; }
GD Web Decomp Icon

GD Web Decomp

Raw Source