//
// OPENSSL_hexstr2buf from 0xa2fac8 to 0xa2fc10 (328 bytes)
//
// 7 xrefs:
// > EVP_PKEY_CTX_hex2ctrl @ 0xa1c324
// > sub_A44544 @ 0xa4460c
// > sub_A68410 @ 0xa684c8
// > sub_A6D080 @ 0xa6d2ac
// > s2i_ASN1_OCTET_STRING @ 0xa700e8
// > sub_A79B7C @ 0xa7a3a4
// > ??> @ 0x7d71c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:08:04 +0000
//
unsigned int __fastcall OPENSSL_hexstr2buf(const char *a1, _DWORD *a2)
{
const char *v3; // r4
size_t v4; // r0
_BYTE *v5; // r0
unsigned int v6; // r7
_BYTE *v7; // r9
int v8; // r6
int v9; // r6
int v10; // r0
const char *v11; // r3
const char *v12; // r4
int v13; // r5
int v14; // t1
unsigned int result; // r0
v3 = a1;
v4 = strlen(a1);
v5 = CRYPTO_malloc((void *)(v4 >> 1), (int)"crypto/o_str.c", 159);
v6 = (unsigned int)v5;
if ( v5 )
{
v7 = v5;
while ( 2 )
{
v11 = v3;
do
{
v12 = v11;
v14 = *(unsigned __int8 *)v11++;
v13 = v14;
if ( !v14 )
{
if ( a2 )
v7 -= v6;
result = v6;
if ( a2 )
*a2 = v7;
return result;
}
}
while ( v13 == 58 );
v8 = *((unsigned __int8 *)v12 + 1);
v3 = v12 + 2;
if ( v8 )
{
v9 = OPENSSL_hexchar2int(v8);
v10 = OPENSSL_hexchar2int(v13);
if ( (v10 | v9) >= 0 )
{
*v7++ = v9 | (16 * v10);
continue;
}
CRYPTO_free((void *)v6, (int)"crypto/o_str.c", 177);
ERR_put_error(15, 118, 102, (int)"crypto/o_str.c", 178);
return 0;
}
else
{
ERR_put_error(15, 118, 103, (int)"crypto/o_str.c", 170);
CRYPTO_free((void *)v6, (int)"crypto/o_str.c", 171);
return 0;
}
}
}
else
{
ERR_put_error(15, 118, 65, (int)"crypto/o_str.c", 160);
return 0;
}
}