//
// DSO_new from 0x7e3130 to 0x7e3288 (344 bytes)
//
// 2 xrefs:
// > sub_8B3090 @ 0x8b3244
// > ??> @ 0x60fbc
//
// 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 *DSO_new()
{
int v0; // r0
int *v1; // r4
int v2; // r0
int v3; // r5
int *result; // r0
int (__fastcall *v5)(int *); // r3
int v6; // r5
if ( !dword_AD2E6C )
dword_AD2E6C = DSO_METHOD_openssl();
v0 = CRYPTO_zalloc(40, "crypto/dso/dso_lib.c", 26);
v1 = (int *)v0;
if ( v0 )
{
v2 = OPENSSL_sk_new_null(v0);
v1[1] = v2;
if ( v2 )
{
*v1 = dword_AD2E6C;
v1[2] = 1;
v3 = CRYPTO_THREAD_lock_new(v2);
v1[9] = v3;
if ( v3 )
{
result = v1;
v5 = *(int (__fastcall **)(int *))(*v1 + 28);
if ( v5 )
{
v6 = v5(v1);
result = v1;
if ( !v6 )
{
DSO_free(v1);
return nullptr;
}
}
}
else
{
ERR_put_error(37, 113, 65, "crypto/dso/dso_lib.c", 42);
OPENSSL_sk_free(v1[1]);
CRYPTO_free(v1, "crypto/dso/dso_lib.c", 44);
return nullptr;
}
}
else
{
ERR_put_error(37, 113, 65, "crypto/dso/dso_lib.c", 34);
CRYPTO_free(v1, "crypto/dso/dso_lib.c", 35);
return nullptr;
}
}
else
{
ERR_put_error(37, 113, 65, "crypto/dso/dso_lib.c", 28);
return nullptr;
}
return result;
}