// // BN_to_ASN1_INTEGER from 0xa771b0 to 0xa772e8 (312 bytes) // // 13 xrefs: // > sub_9F2C54 @ 0x9f2cb8 // > sub_9F300C @ 0x9f3068 // > sub_9F3D50 @ 0x9f40f8 // > sub_9F5C2C @ 0x9f5c94 // > sub_9F5FE0 @ 0x9f60a4 // > EC_GROUP_get_ecparameters @ 0x9fac1c // > EC_GROUP_get_ecparameters @ 0x9fac40 // > EC_GROUP_get_ecparameters @ 0x9faf38 // > sub_A66C30 @ 0xa66cf0 // > sub_A66EB4 @ 0xa66ffc // > s2i_ASN1_INTEGER @ 0xa71c90 // > s2i_ASN1_INTEGER @ 0xa71cec // > @ 0x7a33c // // This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False! // // Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings // Generated at Fri, 27 Nov 2026 12:08:44 +0000 // int __fastcall BN_to_ASN1_INTEGER(_DWORD *a1, int a2, int a3, int a4) { int v6; // r5 int v7; // r0 int v8; // r4 int v9; // r4 int v11; // r0 if ( a2 ) a4 = 2; if ( a2 ) { *(_DWORD *)(a2 + 4) = a4; v6 = a2; } else { v11 = ASN1_STRING_type_new(2); v6 = v11; if ( !v11 ) { ERR_put_error(13, 229, 58, (int)"crypto/asn1/a_int.c", 484); return 0; } } if ( BN_is_negative((int)a1) && !BN_is_zero((int)a1) ) *(_DWORD *)(v6 + 4) |= 0x102u; v7 = BN_num_bits(a1); v8 = v7 + 7; if ( v7 + 7 < 0 ) v8 = v7 + 14; v9 = v8 >> 3; if ( !v9 ) v9 = 1; if ( ASN1_STRING_set((signed int *)v6, nullptr, v9) ) { if ( BN_is_zero((int)a1) ) **(_BYTE **)(v6 + 8) = 0; else v9 = BN_bn2bin(a1, *(_BYTE **)(v6 + 8)); *(_DWORD *)v6 = v9; return v6; } else { ERR_put_error(13, 229, 65, (int)"crypto/asn1/a_int.c", 497); if ( a2 != v6 ) ASN1_INTEGER_free(v6); return 0; } }