//
// BIO_new_file from 0x7d2e2c to 0x7d2f6c (320 bytes)
//
// 6 xrefs:
// > CONF_load @ 0x7d9c7c
// > X509_load_cert_crl_file @ 0x83ce90
// > sub_858480 @ 0x8588bc
// > sub_879C94 @ 0x879cb0
// > sub_8B3A24 @ 0x8b3a54
// > ??> @ 0x5f98c
//
// 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
//
_DWORD *__fastcall BIO_new_file(const char *a1, const char *a2)
{
FILE *v4; // r5
int v5; // r6
void *v6; // r0
_DWORD *v7; // r0
_DWORD *v8; // r4
_DWORD *v10; // r0
v4 = openssl_fopen(a1, a2);
if ( strchr(a2, 98) )
v5 = 1;
else
v5 = 17;
if ( v4 )
{
v6 = BIO_s_file();
v7 = BIO_new((int)v6);
v8 = v7;
if ( v7 )
{
BIO_clear_flags((int)v7, 0);
BIO_ctrl(v8, 106, v5, (int)v4);
return v8;
}
else
{
fclose(v4);
return nullptr;
}
}
else
{
v10 = (_DWORD *)_errno();
ERR_put_error(2, 1, *v10, "crypto/bio/bss_file.c", 74);
ERR_add_error_data(5, "fopen('", a1);
if ( *(_DWORD *)_errno() == 2 || *(_DWORD *)_errno() == 6 )
{
ERR_put_error(32, 109, 128, "crypto/bio/bss_file.c", 81);
return nullptr;
}
else
{
ERR_put_error(32, 109, 2, "crypto/bio/bss_file.c", 83);
return nullptr;
}
}
}