//
// PEM_read_bio_Parameters from 0x823748 to 0x823870 (296 bytes)
//
// 1 xrefs:
// > ??> @ 0x6548c
//
// 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 __fastcall PEM_read_bio_Parameters(_DWORD *a1, int *a2)
{
int result; // r0
signed int v4; // r6
_DWORD *v5; // r0
int v6; // r4
int (__fastcall *v7)(int, void **, int); // r3
char *v8; // [sp+10h] [bp-10h] BYREF
void *v9; // [sp+14h] [bp-Ch] BYREF
void *v10; // [sp+18h] [bp-8h] BYREF
int v11; // [sp+1Ch] [bp-4h] BYREF
v10 = nullptr;
v8 = nullptr;
v9 = nullptr;
result = PEM_bytes_read_bio(&v10, &v11, &v8, "PARAMETERS", a1, nullptr, nullptr);
if ( result )
{
v9 = v10;
v4 = pem_check_suffix(v8, "PARAMETERS");
if ( v4 > 0 )
{
v5 = EVP_PKEY_new();
v6 = (int)v5;
if ( v5 )
{
if ( EVP_PKEY_set_type_str(v5, v8, v4) )
{
v7 = *(int (__fastcall **)(int, void **, int))(*(_DWORD *)(v6 + 12) + 60);
if ( v7 )
{
if ( v7(v6, &v9, v11) )
{
if ( a2 )
{
EVP_PKEY_free(*a2);
*a2 = v6;
}
goto LABEL_11;
}
}
}
EVP_PKEY_free(v6);
}
}
ERR_put_error(9, 140, 13, (int)"crypto/pem/pem_pkey.c", 146);
v6 = 0;
LABEL_11:
CRYPTO_free(v8, (int)"crypto/pem/pem_pkey.c", 147);
CRYPTO_free(v10, (int)"crypto/pem/pem_pkey.c", 148);
return v6;
}
return result;
}