//
// BIO_lookup from 0x9e0e54 to 0x9e10ac (600 bytes)
//
// 7 xrefs:
// > BIO_get_host_ip @ 0x9e3984
// > BIO_get_port @ 0x9e3aa8
// > BIO_get_accept_socket @ 0x9e3c1c
// > sub_9E60BC @ 0x9e61b8
// > sub_9E6944 @ 0x9e6aac
// > sub_9E6E44 @ 0x9e6fb4
// > ??> @ 0x78f0c
//
// 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:07:21 +0000
//
int __fastcall BIO_lookup(const char *a1, const char *a2, int a3, unsigned int a4, int a5, struct addrinfo **a6)
{
size_t v9; // r7
struct addrinfo *v10; // r0
_WORD *v11; // r0
struct addrinfo *v12; // r4
struct sockaddr *v13; // r0
int v14; // r0
int v15; // r4
_DWORD *v16; // r0
const char *v17; // r0
int v18; // r2
struct addrinfo v21; // [sp+10h] [bp-20h] BYREF
if ( a4 > 0xA || ((1 << a4) & 0x407) == 0 )
{
ERR_put_error(32, 135, 131, "crypto/bio/b_addr.c", 649);
return 0;
}
if ( a4 == 1 )
{
v9 = strlen(a1);
if ( !a6 )
OPENSSL_die("assertion failed: bai != NULL", "crypto/bio/b_addr.c", 568);
v10 = (struct addrinfo *)CRYPTO_zalloc(32, "crypto/bio/b_addr.c", 570);
*a6 = v10;
if ( v10 )
{
v10->ai_family = 1;
v10->ai_socktype = a5;
v10->ai_protocol = 0;
v11 = BIO_ADDR_new();
if ( v11 )
{
BIO_ADDR_rawmake(v11, 1, (int)a1, v9, 0);
v12 = *a6;
BIO_ADDR_sockaddr_noconst();
v12->ai_addr = v13;
}
(*a6)->ai_next = nullptr;
if ( (*a6)->ai_addr )
return 1;
BIO_ADDRINFO_free(*a6);
*a6 = nullptr;
}
ERR_put_error(32, 135, 65, "crypto/bio/b_addr.c", 658);
return 0;
}
if ( BIO_sock_init() != 1 )
return 0;
v21.ai_socktype = a5;
v21.ai_flags = a3 == 1;
memset(&v21.ai_protocol, 0, 20);
v21.ai_family = a4;
v14 = getaddrinfo(a1, a2, &v21, a6);
v15 = v14;
if ( !v14 )
return 1;
if ( v14 == 11 )
{
v16 = (_DWORD *)_errno();
ERR_put_error(2, 12, *v16, "crypto/bio/b_addr.c", 684);
ERR_put_error(32, 135, 2, "crypto/bio/b_addr.c", 685);
}
else
{
ERR_put_error(32, 135, 2, "crypto/bio/b_addr.c", 692);
v17 = gai_strerror(v15);
ERR_add_error_data(1, v17, v18);
}
return 0;
}