//
// sub_1001EAA10 from 0x1001eaa10 to 0x1001eaad3 (195 bytes)
//
// 1 xrefs:
// > sub_1001EAA00 @ 0x1001eaa09
//
// 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:26:31 +0000
//
void *__fastcall sub_1001EAA10(__int64 a1, unsigned __int8 *a2, size_t *a3, _QWORD *a4)
{
unsigned int v5; // eax
__int64 v7; // rax
unsigned int v9; // r14d
void *v10; // r12
__int128 v11; // [rsp+0h] [rbp-40h] BYREF
size_t __sz; // [rsp+10h] [rbp-30h]
if ( a3 )
*a3 = 0;
if ( !*a4 )
return nullptr;
v5 = *a2;
if ( (v5 & 1) != 0 )
{
if ( !*((_QWORD *)a2 + 1) )
return nullptr;
}
else if ( !(v5 >> 1) )
{
return nullptr;
}
v7 = sub_1001EB070(a4 + 1);
if ( (_QWORD *)v7 == a4 + 2 )
return nullptr;
__sz = *(_QWORD *)(v7 + 72);
v11 = *(_OWORD *)(v7 + 56);
if ( (unsigned int)sub_1008ACAD0(*a4, &v11) || (unsigned int)sub_1008AD270(*a4) )
return nullptr;
v9 = __sz;
v10 = operator new[](__sz);
sub_1008AD2F0(*a4, v10, v9);
if ( a3 )
*a3 = __sz;
sub_1008AB660(*a4);
return v10;
}