//
// CONF_modules_unload from 0x7da974 to 0x7daa9c (296 bytes)
//
// 2 xrefs:
// > conf_modules_free_int @ 0x7dabac
// > ??> @ 0x6032c
//
// 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 CONF_modules_unload(int a1)
{
int v2; // r4
bool v3; // cf
_DWORD *v4; // r0
_DWORD *v5; // r6
int result; // r0
int v7; // r0
int v8; // r1
_DWORD *v9; // r6
CONF_modules_finish();
v2 = OPENSSL_sk_num(dword_AD2E34) - 1;
if ( v2 >= 0 )
{
if ( a1 )
{
do
{
v7 = OPENSSL_sk_value(dword_AD2E34, v2);
v8 = v2--;
v9 = (_DWORD *)v7;
OPENSSL_sk_delete(dword_AD2E34, v8);
DSO_free(*v9);
CRYPTO_free(v9[1], "crypto/conf/conf_mod.c", 379);
CRYPTO_free(v9, "crypto/conf/conf_mod.c", 380);
}
while ( v2 != -1 );
}
else
{
do
{
while ( 1 )
{
v4 = (_DWORD *)OPENSSL_sk_value(dword_AD2E34, v2);
v5 = v4;
if ( (int)v4[4] <= 0 )
{
if ( *v4 )
break;
}
v3 = v2-- != 0;
if ( !v3 )
goto LABEL_9;
}
OPENSSL_sk_delete(dword_AD2E34, v2);
DSO_free(*v5);
CRYPTO_free(v5[1], "crypto/conf/conf_mod.c", 379);
CRYPTO_free(v5, "crypto/conf/conf_mod.c", 380);
v3 = v2-- != 0;
}
while ( v3 );
}
}
LABEL_9:
result = OPENSSL_sk_num(dword_AD2E34);
if ( !result )
{
result = OPENSSL_sk_free(dword_AD2E34);
dword_AD2E34 = 0;
}
return result;
}