//
// BIO_accept from 0xd74f6c to 0xd75104 (408 bytes)
//
// 2 xrefs:
// > ??> @ 0xe479a4
// > ??> @ 0xb70c0
//
// 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_accept(__int64 a1, const char **a2)
{
unsigned int v3; // w21
const char *v4; // x23
const char *v5; // x22
__int64 v6; // x0
size_t v8; // x24
size_t v9; // x0
char *v10; // x0
unsigned int *v11; // x0
unsigned __int16 v12[56]; // [xsp+40h] [xbp+40h] BYREF
v3 = BIO_accept_ex(a1, v12, 0);
if ( v3 != -1 )
{
if ( !a2 )
return v3;
v4 = (const char *)BIO_ADDR_hostname_string(v12, 1);
v5 = (const char *)BIO_ADDR_service_string(v12, 1);
if ( v5 && v4 )
{
v8 = strlen(v4);
v9 = strlen(v5);
v10 = (char *)CRYPTO_zalloc(v8 + v9 + 2, "crypto/bio/b_sock.c", 267);
*a2 = v10;
if ( v10 )
{
strcpy(v10, v4);
strcpy((char *)&(*a2)[strlen(*a2)], ":");
strcat((char *)*a2, v5);
goto LABEL_7;
}
}
else
{
*a2 = nullptr;
}
ERR_put_error(32, 101, 65, "crypto/bio/b_sock.c", 272);
v6 = v3;
v3 = -1;
BIO_closesocket(v6);
LABEL_7:
CRYPTO_free(v4, "crypto/bio/b_sock.c", 280);
CRYPTO_free(v5, "crypto/bio/b_sock.c", 281);
return v3;
}
if ( (unsigned int)BIO_sock_should_retry() )
return (unsigned int)-2;
v11 = (unsigned int *)__errno();
ERR_put_error(2, 8, *v11, "crypto/bio/b_sock.c", 258);
ERR_put_error(32, 101, 100, "crypto/bio/b_sock.c", 259);
return 0xFFFFFFFFLL;
}