//
// PEM_read_bio_DHparams from 0x823a30 to 0x823b14 (228 bytes)
//
// 3 xrefs:
// > sub_7BB2DC @ 0x7bb32c
// > PEM_read_DHparams @ 0x823b6c
// > ??> @ 0x5e08c
//
// 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_DHparams(
_DWORD *a1,
int *a2,
int (__fastcall *a3)(char *, int, _DWORD, const char *),
const char *a4)
{
int result; // r0
_DWORD *v6; // r4
char *v7; // [sp+10h] [bp-14h] BYREF
unsigned __int8 *v8; // [sp+14h] [bp-10h] BYREF
unsigned __int8 *v9; // [sp+18h] [bp-Ch] BYREF
int v10; // [sp+1Ch] [bp-8h] BYREF
v9 = nullptr;
v7 = nullptr;
v8 = nullptr;
result = PEM_bytes_read_bio(&v9, &v10, &v7, "DH PARAMETERS", a1, a3, a4);
if ( result )
{
v8 = v9;
if ( !strcmp(v7, "X9.42 DH PARAMETERS") )
v6 = d2i_DHxparams(a2, &v8, v10);
else
v6 = (_DWORD *)d2i_DHparams(a2, &v8, v10);
if ( !v6 )
ERR_put_error(9, 141, 13, (int)"crypto/pem/pem_pkey.c", 220);
CRYPTO_free(v7, (int)"crypto/pem/pem_pkey.c", 221);
CRYPTO_free(v9, (int)"crypto/pem/pem_pkey.c", 222);
return (int)v6;
}
return result;
}