//
// BIO_get_port from 0xff3030 to 0xff3140 (272 bytes)
//
// 1 xrefs:
// > ??> @ 0x82588
//
// 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:15:46 +0000
//
__int64 __fastcall BIO_get_port(const char *a1, _WORD *a2)
{
unsigned int v4; // w19
_WORD *v6; // x0
struct addrinfo *v7; // [xsp+38h] [xbp+38h] BYREF
v7 = nullptr;
if ( a1 )
{
v4 = 0;
if ( (unsigned int)BIO_sock_init() == 1 )
{
v4 = BIO_lookup(nullptr, a1, 0, 2, 1, &v7);
if ( v4 )
{
if ( (unsigned int)BIO_ADDRINFO_family((__int64)v7) == 2 )
{
v6 = (_WORD *)BIO_ADDRINFO_address((__int64)v7);
*a2 = __rev16(BIO_ADDR_rawport(v6));
v4 = 1;
}
else
{
v4 = 0;
ERR_put_error(32, 107, 141, "crypto/bio/b_sock.c", 79);
}
BIO_ADDRINFO_free(v7);
}
else
{
ERR_add_error_data(2, "host=", a1);
}
}
return v4;
}
else
{
ERR_put_error(32, 107, 113, "crypto/bio/b_sock.c", 69);
return 0;
}
}