// // i2d_ECPrivateKey from 0x7e76d0 to 0x7e7974 (676 bytes) // // 9 xrefs: // > sub_7E3C2C @ 0x7e3c30 // > sub_7E4C20 @ 0x7e4cb0 // > sub_7E4C20 @ 0x7e4ce4 // > @ 0x6107c // > PEM_write_bio_ECPrivateKey @ 0x820fc4 // > PEM_write_ECPrivateKey @ 0x821018 // > i2d_ECPrivateKey_fp @ 0x848778 // > i2d_ECPrivateKey_bio @ 0x848800 // > @ 0xab86d0 // // 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 i2d_ECPrivateKey(_DWORD *a1, int *a2) { size_t *v4; // r0 size_t *v5; // r5 int v6; // r0 int v7; // r6 int v9; // r3 int v10; // r0 int v11; // r2 _DWORD *v12; // r0 int v13; // r4 _DWORD *ecpkparameters; // r0 int v15; // [sp+8h] [bp-8h] BYREF int v16; // [sp+Ch] [bp-4h] BYREF v15 = 0; v16 = 0; if ( !a1 || !a1[3] || (a1[6] & 2) == 0 && !a1[4] ) { v5 = nullptr; ERR_put_error(16, 192, 67, "crypto/ec/ec_asn1.c", 1004); v7 = 0; goto LABEL_8; } v4 = (size_t *)EC_PRIVATEKEY_new(); v5 = v4; if ( !v4 ) { ERR_put_error(16, 192, 65, "crypto/ec/ec_asn1.c", 1009); v7 = 0; goto LABEL_8; } *v4 = a1[2]; v6 = EC_KEY_priv2buf(a1, &v15); v7 = v6; if ( !v6 ) { ERR_put_error(16, 192, 16, "crypto/ec/ec_asn1.c", 1018); LABEL_8: CRYPTO_clear_free(v15, v7, "crypto/ec/ec_asn1.c", 1060); CRYPTO_free(v16, "crypto/ec/ec_asn1.c", 1061); EC_PRIVATEKEY_free(v5); return 0; } ASN1_STRING_set0((_DWORD *)v5[1], v15, v6); v9 = a1[6]; v15 = 0; if ( (v9 & 1) == 0 ) { ecpkparameters = EC_GROUP_get_ecpkparameters((_DWORD *)a1[3], v5[2]); v5[2] = (size_t)ecpkparameters; if ( !ecpkparameters ) { ERR_put_error(16, 192, 16, "crypto/ec/ec_asn1.c", 1029); goto LABEL_8; } v9 = a1[6]; } if ( (v9 & 2) == 0 ) { v10 = ASN1_BIT_STRING_new(); v5[3] = v10; if ( !v10 ) { ERR_put_error(16, 192, 65, "crypto/ec/ec_asn1.c", 1037); goto LABEL_8; } v11 = EC_KEY_key2buf(a1, a1[7], &v16, 0); if ( !v11 ) { ERR_put_error(16, 192, 16, "crypto/ec/ec_asn1.c", 1044); goto LABEL_8; } v12 = (_DWORD *)v5[3]; v12[3] = v12[3] & 0xFFFFFFF0 | 8; ASN1_STRING_set0(v12, v16, v11); v16 = 0; } v13 = i2d_EC_PRIVATEKEY(v5, a2); if ( !v13 ) { ERR_put_error(16, 192, 16, "crypto/ec/ec_asn1.c", 1055); goto LABEL_8; } CRYPTO_clear_free(v15, v7, "crypto/ec/ec_asn1.c", 1060); CRYPTO_free(v16, "crypto/ec/ec_asn1.c", 1061); EC_PRIVATEKEY_free(v5); return v13; }
GD Web Decomp Icon

GD Web Decomp

Raw Source