//
// ENGINE_load_private_key from 0xa0ce44 to 0xa0cf5c (280 bytes)
//
// 2 xrefs:
// > sub_8539B8 @ 0x85482a
// > ??> @ 0x6838c
//
// 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:44 +0000
//
int __fastcall ENGINE_load_private_key(int a1, int a2, int a3, int a4)
{
int (__fastcall *v8)(int, int, int, int); // r4
int result; // r0
if ( a1 )
{
CRYPTO_THREAD_write_lock(global_engine_lock);
if ( *(_DWORD *)(a1 + 84) )
{
CRYPTO_THREAD_unlock(global_engine_lock);
v8 = *(int (__fastcall **)(int, int, int, int))(a1 + 60);
if ( v8 )
{
result = v8(a1, a2, a3, a4);
if ( !result )
{
ERR_put_error(38, 150, 128, "crypto/engine/eng_pkey.c", 78);
return 0;
}
}
else
{
ERR_put_error(38, 150, 125, "crypto/engine/eng_pkey.c", 72);
return 0;
}
}
else
{
CRYPTO_THREAD_unlock(global_engine_lock);
ERR_put_error(38, 150, 117, "crypto/engine/eng_pkey.c", 66);
return 0;
}
}
else
{
ERR_put_error(38, 150, 67, "crypto/engine/eng_pkey.c", 60);
return 0;
}
return result;
}