//
// BIO_get_accept_socket from 0xd74e40 to 0xd74f6c (300 bytes)
//
// 1 xrefs:
// > ??> @ 0xc90a8
//
// 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_accept_socket(const char *a1, int a2)
{
unsigned int v3; // w19
unsigned int v5; // w19
unsigned int v6; // w0
__int64 v7; // x1
__int64 v8; // x0
__int64 v9; // [xsp+28h] [xbp+28h]
char *v10; // [xsp+38h] [xbp+38h] BYREF
const char *v11; // [xsp+40h] [xbp+40h] BYREF
struct addrinfo *v12; // [xsp+48h] [xbp+48h] BYREF
v10 = nullptr;
v11 = nullptr;
v12 = nullptr;
if ( !(unsigned int)BIO_parse_hostserv(a1, (__int64 *)&v10, (__int64 *)&v11, 1) || (unsigned int)BIO_sock_init() != 1 )
return 0xFFFFFFFFLL;
if ( (unsigned int)BIO_lookup(v10, v11, 1, 0, 1, &v12)
|| (v5 = BIO_ADDRINFO_family((__int64)v12),
v9 = (unsigned int)BIO_ADDRINFO_socktype((__int64)v12),
v6 = BIO_ADDRINFO_protocol(v12),
v3 = BIO_socket(v5, v9, v6, 0),
v3 == -1) )
{
v3 = -1;
}
else
{
v7 = BIO_ADDRINFO_address((__int64)v12);
if ( !(unsigned int)BIO_listen(v3, v7, a2 != 0) )
{
v8 = v3;
v3 = -1;
BIO_closesocket(v8);
}
}
BIO_ADDRINFO_free(v12);
CRYPTO_free(v10, "crypto/bio/b_sock.c", 241);
CRYPTO_free(v11, "crypto/bio/b_sock.c", 242);
return v3;
}