//
// CRYPTO_clear_realloc from 0x80e718 to 0x80e7ac (148 bytes)
//
// 4 xrefs:
// > BUF_MEM_grow_clean @ 0x7d8e64
// > ASN1_BIT_STRING_set_bit @ 0x85fedc
// > a2i_ASN1_INTEGER @ 0x866f4c
// > ??> @ 0x5fffc
//
// 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_clear_realloc(_BYTE *a1, unsigned int a2, void *a3, int a4, int a5)
{
const void *v5; // r6
void *v7; // r4
size_t v8; // r5
void *v9; // r0
v5 = a1;
if ( !a1 )
return CRYPTO_malloc(a3, a4, a5);
v7 = a3;
if ( !a3 )
goto LABEL_6;
v8 = a2;
if ( (unsigned int)a3 >= a2 )
{
v9 = CRYPTO_malloc(a3, a4, a5);
v7 = v9;
if ( !v9 )
return v7;
memcpy(v9, v5, v8);
a1 = v5;
a2 = v8;
LABEL_6:
CRYPTO_clear_free(a1, a2, a4, a5);
return v7;
}
OPENSSL_cleanse((_BYTE *)a3 + (_DWORD)a1, a2 - (_DWORD)a3);
return (void *)v5;
}