//
// OPENSSL_buf2hexstr from 0x81b01c to 0x81b100 (228 bytes)
//
// 4 xrefs:
// > i2s_ASN1_OCTET_STRING @ 0x85b4c4
// > sub_8C3F00 @ 0x8c3f24
// > sub_8C3F00 @ 0x8c3f84
// > ??> @ 0x6424c
//
// 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
//
char *__fastcall OPENSSL_buf2hexstr(unsigned __int8 *a1, int a2)
{
int v2; // r5
char *v5; // r0
char *v6; // r4
char *v7; // r5
unsigned __int8 *v8; // r12
char *v9; // r2
unsigned __int8 *v10; // r0
unsigned int v11; // t1
if ( !a2 )
return (char *)CRYPTO_zalloc((char *)&dword_0 + 1, (int)"crypto/o_str.c", 203);
v2 = 3 * a2;
v5 = (char *)CRYPTO_malloc((void *)(3 * a2), (int)"crypto/o_str.c", 206);
v6 = v5;
if ( v5 )
{
if ( a2 > 0 )
{
v8 = a1;
v9 = v5 + 3;
do
{
v10 = v8;
v11 = *v8++;
v9 += 3;
*(v9 - 6) = byte_A128A8[(v11 >> 4) + 56];
*(v9 - 5) = byte_A128A8[(*v10 & 0xF) + 56];
*(v9 - 4) = 58;
}
while ( v8 != &a1[a2] );
v7 = &v6[v2];
}
else
{
v7 = v5;
}
*(v7 - 1) = 0;
}
else
{
ERR_put_error(15, 117, 65, (int)"crypto/o_str.c", 207);
}
return v6;
}