//
// EC_KEY_oct2key from 0x7e9738 to 0x7e97e8 (176 bytes)
//
// 4 xrefs:
// > sub_7E3D80 @ 0x7e3f40
// > d2i_ECPrivateKey @ 0x7e7534
// > o2i_ECPublicKey @ 0x7e7bac
// > ??> @ 0x610fc
//
// 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
//
int __fastcall EC_KEY_oct2key(_DWORD *a1, _BYTE *a2, int a3, int a4)
{
int v5; // r0
int v7; // r1
int v9; // r3
_DWORD *v10; // r5
int result; // r0
int v12; // r0
if ( !a1 )
return 0;
v5 = a1[3];
if ( !v5 )
return 0;
v7 = a1[4];
v9 = a3;
v10 = a1;
if ( !v7 )
{
v12 = EC_POINT_new(v5);
v9 = a3;
v7 = v12;
v10[4] = v12;
if ( !v12 )
return 0;
v5 = v10[3];
}
if ( !EC_POINT_oct2point(v5, v7, a2, v9, a4) )
return 0;
result = 1;
if ( (**(_DWORD **)v10[3] & 2) == 0 )
v10[7] = *a2 & 0xFE;
return result;
}