// // sub_10066A4F0 from 0x10066a4f0 to 0x10066a811 (801 bytes) // // 1 xrefs: // > sub_100654A90 @ 0x100655742 // // 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:35:00 +0000 // void **__fastcall sub_10066A4F0(void **a1, __int64 a2, __int64 a3, unsigned __int64 a4) { __int64 v5; // r15 void **v7; // r12 __int64 v8; // rax void **v9; // r13 void *v10; // rdi void **v11; // rbx __int64 v12; // r13 __int64 v13; // rbx __int64 v14; // rax char *v15; // r13 void **result; // rax unsigned __int64 v17; // rax __int64 v18; // r13 char *v19; // r12 _QWORD *v20; // rdi void **v21; // rax _QWORD *v22; // rdi void **v23; // rbx void **v24; // [rsp+28h] [rbp-38h] void **v25; // [rsp+28h] [rbp-38h] unsigned __int64 v26; // [rsp+30h] [rbp-30h] v5 = a2; v7 = (void **)*a1; v8 = (__int64)a1[2]; if ( 0xCCCCCCCCCCCCCCCDLL * ((v8 - (__int64)*a1) >> 3) >= a4 ) { v11 = (void **)a1[1]; if ( 0xCCCCCCCCCCCCCCCDLL * (v11 - v7) >= a4 ) { v15 = (char *)*a1; if ( a2 != a3 ) { do { *((_DWORD *)v7 + 2) = *(_DWORD *)(v5 + 8); *v7 = *(void **)v5; std::string::operator=((std::string *)(v7 + 2), (const std::string *)(v5 + 16)); v7 += 5; v15 += 40; v5 += 40; } while ( v5 != a3 ); v11 = (void **)a1[1]; } while ( v11 != v7 ) { if ( (*(_BYTE *)(v11 - 3) & 1) != 0 ) operator delete(*(v11 - 1)); v11 -= 5; } a1[1] = v15; return a1; } else { v12 = a2 + (char *)v11 - (char *)v7; if ( v11 != v7 ) { v13 = 0; do { LODWORD(v7[v13 + 1]) = *(_DWORD *)(a2 + v13 * 8 + 8); v7[v13] = *(void **)(a2 + v13 * 8); std::string::operator=((std::string *)&v7[v13 + 2], (const std::string *)(a2 + v13 * 8 + 16)); v14 = a2 + v13 * 8 + 40; v13 += 5; } while ( v14 != v12 ); v11 = (void **)a1[1]; } v25 = v11; v21 = v11; if ( v12 != a3 ) { v21 = v11; do { *((_DWORD *)v21 + 2) = *(_DWORD *)(v12 + 8); *v21 = *(void **)v12; v22 = v21 + 2; if ( (*(_BYTE *)(v12 + 16) & 1) != 0 ) { sub_10001AD30(v22, *(const void **)(v12 + 32), *(_QWORD *)(v12 + 24)); v21 = v25; } else { v21[4] = *(void **)(v12 + 32); *(_OWORD *)v22 = *(_OWORD *)(v12 + 16); } v12 += 40; v21 += 5; v25 = v21; } while ( v12 != a3 ); } v23 = v21; a1[1] = v23; return a1; } } else { if ( v7 ) { v26 = a4; v9 = (void **)a1[1]; v10 = *a1; if ( v9 != v7 ) { do { if ( (*(_BYTE *)(v9 - 3) & 1) != 0 ) operator delete(*(v9 - 1)); v9 -= 5; } while ( v9 != v7 ); v10 = *a1; } a1[1] = v7; operator delete(v10); *(_OWORD *)a1 = 0; a1[2] = nullptr; v8 = 0; a4 = v26; } if ( a4 > 0x666666666666666LL ) goto LABEL_44; v17 = 0xCCCCCCCCCCCCCCCDLL * (v8 >> 3); if ( 2 * v17 > a4 ) a4 = 2 * v17; if ( v17 >= 0x333333333333333LL ) a4 = 0x666666666666666LL; if ( a4 > 0x666666666666666LL ) LABEL_44: sub_10066A4A0(); v18 = 40 * a4; v19 = (char *)operator new(40 * a4); *a1 = v19; a1[1] = v19; a1[2] = &v19[v18]; v24 = (void **)v19; if ( a2 == a3 ) { result = (void **)v19; } else { result = (void **)v19; do { *((_DWORD *)result + 2) = *(_DWORD *)(v5 + 8); *result = *(void **)v5; v20 = result + 2; if ( (*(_BYTE *)(v5 + 16) & 1) != 0 ) { sub_10001AD30(v20, *(const void **)(v5 + 32), *(_QWORD *)(v5 + 24)); result = v24; } else { result[4] = *(void **)(v5 + 32); *(_OWORD *)v20 = *(_OWORD *)(v5 + 16); } v5 += 40; result += 5; v24 = result; } while ( v5 != a3 ); } a1[1] = result; } return result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source