//
// BIO_get_port from 0xd74cd0 to 0xd74de0 (272 bytes)
//
// 1 xrefs:
// > ??> @ 0x5f7a8
//
// 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
//
__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;
}
}