//
// DSO_new from 0x9f7d30 to 0x9f7e88 (344 bytes)
//
// 2 xrefs:
// > sub_AC8090 @ 0xac8244
// > ??> @ 0x7aa3c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:07:33 +0000
//
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_D340F8 )
dword_D340F8 = 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_D340F8;
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;
}