//
// sub_D88C38 from 0xd88c38 to 0xd88dd8 (416 bytes)
//
// 1 xrefs:
// > ??> @ 0x1122c50
//
// 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_D88C38(__int64 a1, __int64 a2)
{
int v2; // w2
_QWORD *v4; // x20
_DWORD *v5; // x19
unsigned int v6; // w23
int v7; // w0
__int64 v8; // x0
__int64 v9; // x20
int v10; // w21
__int64 v11; // x0
int v12; // w0
unsigned int v13; // w1
__int64 v15; // [xsp+48h] [xbp+48h] BYREF
v2 = *(_DWORD *)(a2 + 40);
v15 = 0;
v4 = *(_QWORD **)(a2 + 32);
if ( !v2 )
{
v5 = nullptr;
v6 = -1;
goto LABEL_7;
}
v5 = (_DWORD *)v4[2];
if ( v5 )
{
v5 = (_DWORD *)v4[3];
if ( v5 )
{
v5 = (_DWORD *)v4[4];
if ( v5 )
{
v5 = (_DWORD *)ASN1_STRING_new();
if ( !v5 )
{
ERR_put_error(10, 118, 65, "crypto/dsa/dsa_ameth.c", 90);
goto LABEL_10;
}
v6 = 16;
v7 = i2d_DSAparams(v4);
*v5 = v7;
if ( v7 <= 0 )
{
ERR_put_error(10, 118, 65, "crypto/dsa/dsa_ameth.c", 95);
goto LABEL_10;
}
LABEL_7:
v8 = BN_to_ASN1_INTEGER(v4[5], 0);
v9 = v8;
if ( v8 )
goto LABEL_8;
LABEL_13:
ERR_put_error(10, 118, 65, "crypto/dsa/dsa_ameth.c", 105);
goto LABEL_10;
}
}
}
v6 = -1;
v8 = BN_to_ASN1_INTEGER(v4[5], 0);
v9 = v8;
if ( !v8 )
goto LABEL_13;
LABEL_8:
v10 = i2d_ASN1_INTEGER(v8, &v15);
ASN1_INTEGER_free(v9);
if ( v10 <= 0 )
{
ERR_put_error(10, 118, 65, "crypto/dsa/dsa_ameth.c", 113);
goto LABEL_10;
}
v11 = OBJ_nid2obj(116);
v12 = X509_PUBKEY_set0_param(a1, v11, v6, v5, v15, (unsigned int)v10);
v13 = 1;
if ( !v12 )
{
LABEL_10:
CRYPTO_free(v15, "crypto/dsa/dsa_ameth.c", 122);
ASN1_STRING_free((__int64)v5);
return 0;
}
return v13;
}