//
// CRYPTO_clear_realloc from 0x1033e70 to 0x1033f3c (204 bytes)
//
// 4 xrefs:
// > BUF_MEM_grow_clean @ 0xffdf0c
// > ASN1_BIT_STRING_set_bit @ 0x10861f8
// > a2i_ASN1_INTEGER @ 0x108d338
// > ??> @ 0x7abc0
//
// This function is hookable on this platform (idp: arm, 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 13:16:23 +0000
//
void *__fastcall CRYPTO_clear_realloc(_BYTE *a1, unsigned __int64 a2, void *a3, __int64 a4, unsigned int a5)
{
size_t v5; // x21
void *v8; // x19
const void *v9; // x20
void *result; // x0
v5 = a2;
if ( !a1 )
return CRYPTO_malloc(a3, a4, a5);
v8 = a3;
v9 = a1;
if ( !a3 )
goto LABEL_6;
if ( (unsigned __int64)a3 < a2 )
{
OPENSSL_cleanse((_BYTE *)a3 + (_QWORD)a1, a2 - (_QWORD)a3);
return (void *)v9;
}
result = CRYPTO_malloc(a3, a4, a5);
v8 = result;
if ( result )
{
memcpy(result, v9, v5);
a1 = v9;
a2 = v5;
LABEL_6:
CRYPTO_clear_free(a1, a2, a4, a5);
return v8;
}
return result;
}