//
// BIO_new_file from 0xd78c4c to 0xd78d88 (316 bytes)
//
// 6 xrefs:
// > CONF_load @ 0xd81820
// > X509_load_cert_crl_file @ 0xde4d2c
// > sub_DFF0C8 @ 0xdff430
// > sub_E24408 @ 0xe24428
// > sub_E5D8E4 @ 0xe5d91c
// > ??> @ 0x39b70
//
// 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_new_file(const char *a1, const char *a2)
{
FILE *v4; // x21
__int64 v5; // x20
void *v6; // x0
__int64 v7; // x0
__int64 v8; // x19
_DWORD *v10; // x20
v4 = openssl_fopen(a1, a2);
if ( strchr(a2, 98) )
v5 = 1;
else
v5 = 17;
if ( v4 )
{
v6 = BIO_s_file();
v7 = BIO_new((__int64)v6);
v8 = v7;
if ( v7 )
{
BIO_clear_flags(v7, 0);
BIO_ctrl(v8, 0x6Au, v5, (__int64)v4);
return v8;
}
else
{
fclose(v4);
return 0;
}
}
else
{
v10 = (_DWORD *)__errno();
ERR_put_error(2, 1, (unsigned int)*v10, "crypto/bio/bss_file.c", 74);
ERR_add_error_data(5, "fopen('", a1);
if ( *v10 == 2 || *v10 == 6 )
{
ERR_put_error(32, 109, 128, "crypto/bio/bss_file.c", 81);
return 0;
}
else
{
ERR_put_error(32, 109, 2, "crypto/bio/bss_file.c", 83);
return 0;
}
}
}