//
// EC_POINT_bn2point from 0xe34dd8 to 0xe34f28 (336 bytes)
//
// 2 xrefs:
// > EC_POINT_hex2point @ 0xe35050
// > ??> @ 0x39060
//
// 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
//
_QWORD *__fastcall EC_POINT_bn2point(__int64 *a1, _QWORD *a2, _QWORD *a3, __int64 a4)
{
int v8; // w0
int v9; // w5
__int64 v10; // x19
_BYTE *v11; // x21
v8 = BN_num_bits((__int64)a2);
v9 = v8 + 7;
if ( v8 + 7 < 0 )
v9 = v8 + 14;
v10 = v9 >> 3;
if ( !(v9 >> 3) )
return nullptr;
v11 = CRYPTO_malloc((void *)(v9 >> 3), (__int64)"crypto/ec/ec_print.c", 42);
if ( !v11 )
return nullptr;
if ( !(unsigned int)BN_bn2bin(a2, v11) )
{
CRYPTO_free(v11, (__int64)"crypto/ec/ec_print.c", 47);
return nullptr;
}
if ( a3 )
{
if ( (unsigned int)EC_POINT_oct2point((__int64)a1, a3, (__int64)v11, v10, a4) )
goto LABEL_8;
goto LABEL_13;
}
a3 = EC_POINT_new(a1);
if ( !a3 )
{
CRYPTO_free(v11, (__int64)"crypto/ec/ec_print.c", 53);
return nullptr;
}
if ( !(unsigned int)EC_POINT_oct2point((__int64)a1, a3, (__int64)v11, v10, a4) )
{
EC_POINT_clear_free((__int64)a3);
LABEL_13:
CRYPTO_free(v11, (__int64)"crypto/ec/ec_print.c", 62);
return nullptr;
}
LABEL_8:
CRYPTO_free(v11, (__int64)"crypto/ec/ec_print.c", 66);
return a3;
}