//
// EVP_PKEY_set_type_str from 0x102a638 to 0x102a754 (284 bytes)
//
// 2 xrefs:
// > PEM_read_bio_Parameters @ 0x104740c
// > ??> @ 0xa68d0
//
// 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:16:16 +0000
//
__int64 __fastcall EVP_PKEY_set_type_str(__int64 a1, char *a2, unsigned int a3)
{
__int64 v4; // x3
void (*v5)(void); // x3
unsigned int *str; // x20
unsigned int v7; // w1
__int64 result; // x0
__int64 v9; // x2
unsigned int v10; // [xsp+20h] [xbp+20h]
unsigned int v11; // [xsp+20h] [xbp+20h]
unsigned int v12; // [xsp+20h] [xbp+20h]
char *v13; // [xsp+28h] [xbp+28h]
char *v14; // [xsp+28h] [xbp+28h]
char *v15; // [xsp+28h] [xbp+28h]
__int64 v16; // [xsp+38h] [xbp+38h] BYREF
v16 = 0;
if ( a1 )
{
if ( *(_QWORD *)(a1 + 32) )
{
v4 = *(_QWORD *)(a1 + 16);
if ( v4 )
{
v5 = *(void (**)(void))(v4 + 168);
if ( v5 )
{
v10 = a3;
v13 = a2;
v5();
a3 = v10;
a2 = v13;
*(_QWORD *)(a1 + 32) = 0;
}
}
v11 = a3;
v14 = a2;
ENGINE_finish(*(_QWORD *)(a1 + 24));
*(_QWORD *)(a1 + 24) = 0;
a3 = v11;
a2 = v14;
}
if ( !*(_DWORD *)(a1 + 4) && *(_QWORD *)(a1 + 16) )
return 1;
v12 = a3;
v15 = a2;
ENGINE_finish(*(_QWORD *)(a1 + 24));
*(_QWORD *)(a1 + 24) = 0;
a3 = v12;
a2 = v15;
}
if ( a2 )
str = (unsigned int *)EVP_PKEY_asn1_find_str(&v16, a2, a3);
else
str = (unsigned int *)EVP_PKEY_asn1_find(&v16, 0);
if ( !a1 )
{
ENGINE_finish(v16);
if ( str )
return 1;
goto LABEL_19;
}
if ( !str )
{
LABEL_19:
ERR_put_error(6, 158, 156, (__int64)"crypto/evp/p_lib.c", 204);
return 0;
}
v7 = *str;
result = 1;
v9 = v16;
*(_QWORD *)(a1 + 16) = str;
*(_QWORD *)(a1 + 24) = v9;
*(_QWORD *)a1 = v7;
return result;
}