//
// CRYPTO_realloc from 0xdb5940 to 0xdb59d8 (152 bytes)
//
// 29 xrefs:
// > SSL_CTX_dane_mtype_set @ 0xd3f338
// > SSL_CTX_dane_mtype_set @ 0xd3f358
// > SSL_CTX_use_serverinfo @ 0xd45944
// > SSL_CTX_use_serverinfo_file @ 0xd45c38
// > SSL_CTX_add_server_custom_ext @ 0xd54b68
// > SSL_CTX_add_client_custom_ext @ 0xd54cec
// > ASN1_STRING_set @ 0xd693c4
// > sub_D72A68 @ 0xd72b18
// > sub_D72C0C @ 0xd7328c
// > sub_D735D8 @ 0xd737d8
// > sub_D735D8 @ 0xd739d0
// > BUF_MEM_grow @ 0xd7fa50
// > ERR_add_error_vdata @ 0xda1478
// > OPENSSL_LH_insert @ 0xdb3768
// > OPENSSL_LH_delete @ 0xdb3a18
// > CRYPTO_realloc @ 0xdb5978
// > sub_DBDAF0 @ 0xdbdcc0
// > OPENSSL_sk_insert @ 0xde061c
// > sub_DFF0C8 @ 0xdff2d8
// > sub_DFF0C8 @ 0xdff3cc
// > sub_DFF0C8 @ 0xdff488
// > a2i_ASN1_STRING @ 0xe0f4e0
// > ??> @ 0x4a718
// > CRYPTO_realloc @ 0xdb5958
// > CRYPTO_realloc @ 0xdb596c
// > CRYPTO_set_mem_functions @ 0xdb59fc
// > CRYPTO_get_mem_functions @ 0xdb5a4c
// > ??> @ 0x122a600
// > ??> @ 0x1239048
//
// 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 *__fastcall CRYPTO_realloc(void *a1, void *a2, __int64 a3, __int64 a4)
{
if ( off_1239048 && off_1239048 != CRYPTO_realloc )
return (void *)off_1239048(a1, a2, a3, a4);
if ( !a1 )
return CRYPTO_malloc(a2, a3, (unsigned int)a4);
if ( a2 )
{
dword_1239030 = 0;
return realloc(a1, (size_t)a2);
}
else
{
CRYPTO_free(a1, a3, (unsigned int)a4);
return nullptr;
}
}