//
// DSO_load from 0x1009128 to 0x10093e8 (704 bytes)
//
// 5 xrefs:
// > CONF_modules_load @ 0x1000350
// > DSO_dsobyaddr @ 0x1009630
// > sub_10DB098 @ 0x10db38c
// > sub_10DB098 @ 0x10db470
// > ??> @ 0x105610
//
// 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:15:58 +0000
//
__int64 __fastcall DSO_load(__int64 a1, __int64 a2, __int64 a3, int a4)
{
__int64 v4; // x19
int v6; // w20
__int64 v7; // x1
__int64 (__fastcall *v9)(__int64); // x1
int v10; // w0
__int64 v11; // x0
__int64 v12; // x0
__int64 v13; // x0
int v14; // w3
__int64 (__fastcall *v15)(__int64); // x1
int v16; // w0
__int64 v17; // x0
int v18; // [xsp+48h] [xbp+48h]
int v19; // [xsp+48h] [xbp+48h]
v4 = a1;
v6 = 0;
if ( !a1 )
{
if ( !qword_15663D8 )
{
v19 = a4;
v17 = DSO_METHOD_openssl();
a4 = v19;
qword_15663D8 = v17;
}
v18 = a4;
v11 = CRYPTO_zalloc(72, "crypto/dso/dso_lib.c", 26);
v4 = v11;
if ( v11 )
{
v12 = OPENSSL_sk_new_null(v11);
*(_QWORD *)(v4 + 8) = v12;
if ( v12 )
{
*(_QWORD *)v4 = qword_15663D8;
*(_DWORD *)(v4 + 16) = 1;
v13 = CRYPTO_THREAD_lock_new(1);
*(_QWORD *)(v4 + 64) = v13;
v14 = v18;
if ( v13 )
{
v15 = *(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 56LL);
if ( !v15 || (v16 = v15(v4), v14 = v18, v16) )
{
if ( DSO_ctrl((_DWORD *)v4, 2, v14) < 0 )
{
ERR_put_error(37, 112, 100, "crypto/dso/dso_lib.c", 132);
goto LABEL_20;
}
v6 = 1;
goto LABEL_2;
}
DSO_free((__int64 *)v4);
}
else
{
ERR_put_error(37, 113, 65, "crypto/dso/dso_lib.c", 42);
OPENSSL_sk_free(*(_QWORD *)(v4 + 8));
CRYPTO_free(v4, "crypto/dso/dso_lib.c", 44);
}
}
else
{
ERR_put_error(37, 113, 65, "crypto/dso/dso_lib.c", 34);
CRYPTO_free(v4, "crypto/dso/dso_lib.c", 35);
}
}
else
{
ERR_put_error(37, 113, 65, "crypto/dso/dso_lib.c", 28);
}
ERR_put_error(37, 112, 65, "crypto/dso/dso_lib.c", 126);
return 0;
}
LABEL_2:
if ( *(_QWORD *)(v4 + 48) )
{
ERR_put_error(37, 112, 110, "crypto/dso/dso_lib.c", 139);
goto LABEL_4;
}
if ( !a2 )
goto LABEL_22;
if ( !(unsigned int)DSO_set_filename(v4, a2) )
{
ERR_put_error(37, 112, 112, "crypto/dso/dso_lib.c", 148);
goto LABEL_4;
}
if ( *(_QWORD *)(v4 + 48) )
{
v9 = *(__int64 (__fastcall **)(__int64))(*(_QWORD *)v4 + 8LL);
if ( v9 )
{
v10 = v9(v4);
v7 = v4;
if ( v10 )
return v7;
ERR_put_error(37, 112, 103, "crypto/dso/dso_lib.c", 161);
}
else
{
ERR_put_error(37, 112, 108, "crypto/dso/dso_lib.c", 157);
}
}
else
{
LABEL_22:
ERR_put_error(37, 112, 111, "crypto/dso/dso_lib.c", 153);
}
LABEL_4:
v7 = 0;
if ( !v6 )
return v7;
LABEL_20:
DSO_free((__int64 *)v4);
return 0;
}