//
// sub_100097C90 from 0x100097c90 to 0x100097e0f (383 bytes)
//
// 1 xrefs:
// > ??> @ 0x1008b4690
//
// 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
//
__int64 __fastcall sub_100097C90(__int64 a1, __int64 a2)
{
__int64 v2; // r12
const char *v3; // r15
_QWORD *v4; // rbx
size_t v5; // r12
char *v6; // r14
__int64 i; // r15
size_t v8; // r12
const char *v9; // rsi
char *v10; // rbx
const char *v11; // r14
const char *v12; // rbx
__int64 v13; // rax
__int64 v14; // r14
void *v15; // rdi
__int64 v17; // [rsp+10h] [rbp-30h]
v2 = a2;
if ( !a2 )
v2 = *(_QWORD *)(a1 + 8);
v3 = (const char *)sub_100093910((int *)(a1 + 24));
v4 = sub_100094970(v2 + 128);
v4[1] = v2;
v4[2] = 0;
*((_OWORD *)v4 + 3) = 0;
*((_OWORD *)v4 + 4) = 0;
*v4 = off_1008B4630;
*((_DWORD *)v4 + 22) = 0;
v4[12] = 0;
v4[10] = v2 + 128;
*((_DWORD *)v4 + 6) = 0;
*((_OWORD *)v4 + 2) = 0;
v5 = strlen(v3);
v6 = (char *)operator new[](v5 + 1);
v4[4] = v6;
memcpy(v6, v3, v5 + 1);
v4[5] = &v6[v5];
v17 = (__int64)v4;
*((_DWORD *)v4 + 6) = 512;
for ( i = *(_QWORD *)(a1 + 96); i; i = *(_QWORD *)(i + 56) )
{
v11 = (const char *)sub_100093910((int *)(i + 8));
v12 = (const char *)sub_100093910((int *)(i + 32));
v13 = sub_100097480(v17, v11);
v14 = v13;
if ( (*(_BYTE *)(v13 + 33) & 2) != 0 )
{
v15 = *(void **)(v13 + 40);
if ( v15 )
operator delete[](v15);
}
*(_DWORD *)(v14 + 32) = 0;
*(_OWORD *)(v14 + 40) = 0;
v8 = strlen(v12);
v9 = v12;
v10 = (char *)operator new[](v8 + 1);
*(_QWORD *)(v14 + 40) = v10;
memcpy(v10, v9, v8 + 1);
*(_QWORD *)(v14 + 48) = &v10[v8];
*(_DWORD *)(v14 + 32) = 512;
}
return v17;
}