//
// sub_DD66B8 from 0xdd66b8 to 0xdd67bc (260 bytes)
//
// 1 xrefs:
// > ??> @ 0x11309e0
//
// 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
//
__int64 __fastcall sub_DD66B8(__int64 a1, __int64 a2)
{
unsigned int *v2; // x20
void *v5; // x22
__int64 v6; // x19
__int64 v7; // x0
int key; // w20
__int64 v10; // x0
v2 = *(unsigned int **)(a1 + 40);
if ( !*((_QWORD *)v2 + 1) )
{
v10 = BN_new();
*((_QWORD *)v2 + 1) = v10;
if ( !v10 || !(unsigned int)BN_set_word(v10, 65537) )
return 0;
}
v5 = RSA_new();
if ( !v5 )
return 0;
v6 = *(_QWORD *)(a1 + 56);
if ( v6 )
{
v7 = BN_GENCB_new();
v6 = v7;
if ( !v7 )
{
RSA_free((__int64)v5);
return 0;
}
evp_pkey_set_cb_translate(v7, a1);
}
key = RSA_generate_key_ex(v5, *v2, *((_QWORD *)v2 + 1), v6);
BN_GENCB_free(v6);
if ( key <= 0 )
{
RSA_free((__int64)v5);
return (unsigned int)key;
}
else
{
EVP_PKEY_assign(a2, 6u, (__int64)v5);
return (unsigned int)key;
}
}