//
// BIO_get_accept_socket from 0x7cefc0 to 0x7cf0e4 (292 bytes)
//
// 1 xrefs:
// > ??> @ 0x5f63c
//
// 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 BIO_get_accept_socket(const char *a1, int a2)
{
int v3; // r4
int v5; // r7
int v6; // r6
int v7; // r0
int v8; // r0
int v9; // r2
int v10; // [sp+Ch] [bp-10h] BYREF
int v11; // [sp+10h] [bp-Ch] BYREF
struct addrinfo *v12; // [sp+14h] [bp-8h] BYREF
v10 = 0;
v11 = 0;
v12 = nullptr;
if ( BIO_parse_hostserv(a1, &v10, &v11, 1) && BIO_sock_init() == 1 )
{
if ( !BIO_lookup((const char *)v10, (const char *)v11, 1, 0, 1, &v12) )
{
v5 = BIO_ADDRINFO_family((int)v12);
v6 = BIO_ADDRINFO_socktype((int)v12);
v7 = BIO_ADDRINFO_protocol(v12);
v3 = BIO_socket(v5, v6, v7, 0);
if ( v3 != -1 )
{
v8 = BIO_ADDRINFO_address((int)v12);
v9 = a2;
if ( a2 )
v9 = 1;
if ( BIO_listen(v3, v8, v9) )
goto LABEL_5;
BIO_closesocket(v3);
}
}
v3 = -1;
LABEL_5:
BIO_ADDRINFO_free(v12);
CRYPTO_free(v10, "crypto/bio/b_sock.c", 241);
CRYPTO_free(v11, "crypto/bio/b_sock.c", 242);
return v3;
}
return -1;
}