//
// ENGINE_set_default from 0x101b1b4 to 0x101b2a0 (236 bytes)
//
// 3 xrefs:
// > sub_E2F060 @ 0xe2f084
// > ENGINE_set_default_string @ 0x101b2e8
// > ??> @ 0xfed28
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:16:07 +0000
//
bool __fastcall ENGINE_set_default(__int64 a1, __int16 a2)
{
if ( (a2 & 0x40) != 0 && !(unsigned int)ENGINE_set_default_ciphers() )
return 0;
if ( (a2 & 0x80) != 0 )
{
if ( !(unsigned int)ENGINE_set_default_digests(a1) )
return 0;
if ( (a2 & 1) == 0 )
{
LABEL_4:
if ( (a2 & 2) == 0 )
goto LABEL_5;
goto LABEL_17;
}
}
else if ( (a2 & 1) == 0 )
{
goto LABEL_4;
}
if ( !(unsigned int)ENGINE_set_default_RSA(a1) )
return 0;
if ( (a2 & 2) == 0 )
{
LABEL_5:
if ( (a2 & 4) == 0 )
goto LABEL_6;
goto LABEL_19;
}
LABEL_17:
if ( !(unsigned int)ENGINE_set_default_DSA(a1) )
return 0;
if ( (a2 & 4) == 0 )
{
LABEL_6:
if ( (a2 & 0x800) == 0 )
goto LABEL_7;
LABEL_21:
if ( !(unsigned int)ENGINE_set_default_EC(a1) )
return 0;
if ( (a2 & 8) == 0 )
goto LABEL_8;
goto LABEL_23;
}
LABEL_19:
if ( !(unsigned int)ENGINE_set_default_DH(a1) )
return 0;
if ( (a2 & 0x800) != 0 )
goto LABEL_21;
LABEL_7:
if ( (a2 & 8) == 0 )
{
LABEL_8:
if ( (a2 & 0x200) == 0 )
goto LABEL_9;
LABEL_25:
if ( (unsigned int)ENGINE_set_default_pkey_meths(a1) )
{
if ( (a2 & 0x400) == 0 )
return 1;
return (unsigned int)ENGINE_set_default_pkey_asn1_meths(a1) != 0;
}
return 0;
}
LABEL_23:
if ( !(unsigned int)ENGINE_set_default_RAND(a1) )
return 0;
if ( (a2 & 0x200) != 0 )
goto LABEL_25;
LABEL_9:
if ( (a2 & 0x400) == 0 )
return 1;
return (unsigned int)ENGINE_set_default_pkey_asn1_meths(a1) != 0;
}