//
// _realloc_base from 0x180138640 to 0x1801386ba (122 bytes)
//
// 3 xrefs:
// > j__realloc_base @ 0x18012f84c
// > _recalloc_base @ 0x18013b62e
// > ??> @ 0x180203680
//
// 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
//
void *__cdecl realloc_base(void *Block, size_t Size)
{
void *result; // rax
if ( !Block )
return malloc_base(Size);
if ( !Size )
{
free_base(Block);
return nullptr;
}
if ( Size > 0xFFFFFFFFFFFFFFE0uLL )
{
LABEL_6:
*errno() = 12;
return nullptr;
}
while ( 1 )
{
result = HeapReAlloc(hHeap, 0, Block, Size);
if ( result )
return result;
if ( !(unsigned int)sub_18013BEC4() || !callnewh(Size) )
goto LABEL_6;
}
}