// // ECPKParameters_print from 0xd95c40 to 0xd9625c (1564 bytes) // // 7 xrefs: // > sub_D8C794 @ 0xd8c86c // > sub_D8C8B0 @ 0xd8ca00 // > sub_D8CA44 @ 0xd8cbc8 // > EC_KEY_print @ 0xd8ce2c // > ECParameters_print @ 0xd8cf88 // > ECPKParameters_print_fp @ 0xd962a4 // > @ 0x84258 // // 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 ECPKParameters_print(__int64 a1, unsigned int *a2, __int64 a3) { unsigned int v5; // w28 __int64 v6; // x22 __int64 v7; // x19 unsigned int v8; // w20 __int64 v9; // x26 __int64 v10; // x25 __int64 v11; // x24 __int64 v12; // x2 unsigned int v13; // w20 __int64 v15; // x0 unsigned int field_type; // w21 __int64 curve_name; // x0 int v18; // w19 const char *v19; // x0 char *v20; // x19 __int64 v21; // d9 __int64 v22; // d10 unsigned int point_conversion_form; // s11 __int64 v24; // d12 __int64 seed_len; // d13 const char *v26; // x0 __int64 v27; // x0 const char *v28; // x1 __int64 v29; // x0 char *v30; // x1 void *v31; // x0 unsigned __int64 v32; // x20 int v33; // w4 unsigned int basis_type; // w21 const char *v35; // x0 char v36; // [xsp+90h] [xbp+90h] BYREF _BYTE v37[7]; // [xsp+91h] [xbp+91h] BYREF v5 = a3; if ( !a2 ) { v7 = 0; v8 = 67; v9 = 0; v10 = 0; v11 = 0; v6 = 0; goto LABEL_7; } v6 = BN_CTX_new(a1, a2, a3); if ( !v6 ) { v7 = 0; v9 = 0; v10 = 0; v11 = 0; v8 = 65; goto LABEL_7; } if ( (unsigned int)EC_GROUP_get_asn1_flag((__int64)a2) ) { if ( (unsigned int)BIO_indent(a1, v5, 128) ) { curve_name = EC_GROUP_get_curve_name((__int64)a2); v18 = curve_name; if ( (_DWORD)curve_name ) { v19 = (const char *)OBJ_nid2sn(curve_name); if ( (int)BIO_printf(a1, "ASN1 OID: %s", v19) > 0 && (int)BIO_printf(a1, &byte_F1AB78) > 0 ) { v20 = EC_curve_nid2nist(v18); if ( !v20 || (unsigned int)BIO_indent(a1, v5, 128) && (int)BIO_printf(a1, "NIST CURVE: %s\n", v20) > 0 ) { v7 = 0; v13 = 1; v9 = 0; v10 = 0; v11 = 0; goto LABEL_8; } } } } v7 = 0; v8 = 32; v9 = 0; v10 = 0; v11 = 0; goto LABEL_7; } v15 = EC_GROUP_method_of((__int64)a2); field_type = EC_METHOD_get_field_type(v15); v11 = BN_new(); if ( !v11 ) { v7 = 0; v9 = 0; v10 = 0; v8 = 65; goto LABEL_7; } v10 = BN_new(); if ( !v10 ) { v7 = 0; v9 = 0; v8 = 65; goto LABEL_7; } v9 = BN_new(); if ( !v9 ) { v7 = 0; v8 = 65; goto LABEL_7; } if ( field_type == 407 ) { if ( !(unsigned int)EC_GROUP_get_curve_GF2m((__int64)a2) ) { LABEL_15: v7 = 0; v8 = 16; goto LABEL_7; } } else if ( !(unsigned int)EC_GROUP_get_curve_GFp((__int64)a2) ) { goto LABEL_15; } v7 = EC_GROUP_get0_generator((__int64)a2); if ( !v7 ) goto LABEL_58; v21 = EC_GROUP_get0_order((__int64)a2); v22 = EC_GROUP_get0_cofactor((__int64)a2); if ( !v21 ) { v7 = 0; v8 = 16; goto LABEL_7; } point_conversion_form = EC_GROUP_get_point_conversion_form((__int64)a2); v7 = EC_POINT_point2bn(a2, v7, point_conversion_form, 0, v6); if ( !v7 ) { LABEL_58: v8 = 16; goto LABEL_7; } v24 = EC_GROUP_get0_seed((__int64)a2); if ( v24 ) seed_len = EC_GROUP_get_seed_len((__int64)a2); else seed_len = 0; v8 = 32; if ( !(unsigned int)BIO_indent(a1, v5, 128) ) goto LABEL_7; v26 = (const char *)OBJ_nid2sn(field_type); if ( (int)BIO_printf(a1, "Field Type: %s\n", v26) <= 0 ) goto LABEL_7; if ( field_type == 407 ) { basis_type = EC_GROUP_get_basis_type(a2); if ( !basis_type ) goto LABEL_7; if ( !(unsigned int)BIO_indent(a1, v5, 128) ) goto LABEL_7; v35 = (const char *)OBJ_nid2sn(basis_type); if ( (int)BIO_printf(a1, "Basis Type: %s\n", v35) <= 0 ) goto LABEL_7; v27 = a1; v28 = "Polynomial:"; } else { v27 = a1; v28 = "Prime:"; } if ( (unsigned int)ASN1_bn_print(v27, v28, v11, 0, v5) ) { if ( (unsigned int)ASN1_bn_print(a1, "A: ", v10, 0, v5) && (unsigned int)ASN1_bn_print(a1, "B: ", v9, 0, v5) ) { if ( point_conversion_form == 2 ) { v29 = a1; v30 = "Generator (compressed):"; } else { v29 = a1; v30 = point_conversion_form == 4 ? "Generator (uncompressed):" : "Generator (hybrid):"; } if ( (unsigned int)ASN1_bn_print(v29, v30, v7, 0, v5) && (unsigned int)ASN1_bn_print(a1, "Order: ", v21, 0, v5) && (!v22 || (unsigned int)ASN1_bn_print(a1, "Cofactor: ", v22, 0, v5)) ) { if ( !v24 ) goto LABEL_70; if ( (int)v5 <= 0 ) { v5 = 0; } else { if ( (int)v5 > 128 ) v5 = 128; v31 = memset(&v36, 32, (int)v5); if ( (int)BIO_write(a1, (__int64)v31, v5) <= 0 ) goto LABEL_56; } if ( (int)BIO_printf(a1, "%s", "Seed:") > 0 ) { v32 = 0; if ( seed_len ) { while ( 1 ) { if ( v32 == 15 * (v32 / 0xF) ) { v36 = 10; memset(v37, 32, (int)(v5 + 4)); if ( (int)BIO_write(a1, (__int64)&v36, v5 + 5) <= 0 ) goto LABEL_56; } v33 = *(unsigned __int8 *)(v24 + v32++); if ( v32 == seed_len ) { if ( (int)BIO_printf(a1, "%02x%s", v33, &byte_F288A0) <= 0 ) goto LABEL_56; break; } if ( (int)BIO_printf(a1, "%02x%s", v33, ":") <= 0 ) goto LABEL_56; } } if ( (int)BIO_write(a1, (__int64)&byte_F1AB78, 1u) > 0 ) { LABEL_70: v13 = 1; goto LABEL_8; } } } } LABEL_56: v8 = 32; } LABEL_7: v12 = v8; v13 = 0; ERR_put_error(16, 149, v12, "crypto/ec/eck_prn.c", 228); LABEL_8: BN_free(v11); BN_free(v10); BN_free(v9); BN_free(v7); BN_CTX_free(v6); return v13; }