// // EVP_CipherInit_ex from 0x1028084 to 0x102848c (1032 bytes) // // 32 xrefs: // > ssl3_change_cipher_state @ 0xfdd158 // > tls1_change_cipher_state @ 0xfdf0ec // > tls1_change_cipher_state @ 0xfdf154 // > tls1_change_cipher_state @ 0xfdf364 // > tls1_change_cipher_state @ 0xfdf3e4 // > sub_1025FE8 @ 0x1026080 // > EVP_CipherInit @ 0x10284dc // > EVP_EncryptInit_ex @ 0x10284f4 // > EVP_DecryptInit_ex @ 0x10284fc // > PKCS12_PBE_keyivgen @ 0x1047c10 // > PKCS7_dataInit @ 0x104aa50 // > PKCS7_dataInit @ 0x104aa8c // > PKCS7_dataDecode @ 0x104b29c // > PKCS7_dataDecode @ 0x104b340 // > CMS_RecipientInfo_kari_decrypt @ 0x109d504 // > cms_RecipientInfo_kari_encrypt @ 0x109d9ac // > cms_RecipientInfo_pwri_crypt @ 0x109f0a4 // > sub_10DCF10 @ 0x10dd0c8 // > BIO_set_cipher @ 0x10dd22c // > BIO_set_cipher @ 0x10dd28c // > PKCS5_PBE_keyivgen @ 0x10e02c4 // > PKCS5_v2_PBE_keyivgen @ 0x10e0bdc // > PKCS5_v2_PBKDF2_keyivgen @ 0x10e0f70 // > PKCS5_pbe2_set_iv @ 0x10f0c18 // > PKCS5_pbe2_set_scrypt @ 0x10f0ef4 // > PKCS5_v2_scrypt_keyivgen @ 0x10f137c // > cms_EncryptedContent_init_bio @ 0x10f9138 // > cms_EncryptedContent_init_bio @ 0x10f91d0 // > cms_EncryptedContent_init_bio @ 0x10f9260 // > cms_EncryptedContent_init_bio @ 0x10f92f0 // > cms_EncryptedContent_init_bio @ 0x10f94e0 // > @ 0xc82c0 // // This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True! // // 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 13:16:14 +0000 // __int64 __fastcall EVP_CipherInit_ex( __int64 a1, unsigned int *a2, __int64 cipher_engine, __int64 a4, const void *a5, int a6) { unsigned int *cipher; // x20 unsigned int v11; // w23 __int64 v12; // x5 __int64 v13; // x21 signed int v14; // w0 __int64 v15; // x1 __int64 v16; // x0 int v17; // w0 unsigned int v18; // w21 __int64 v19; // x0 __int64 v20; // x0 int v21; // w0 __int64 v23; // x0 __int64 v24; // x0 unsigned __int64 v25; // x0 __int64 v26; // x0 const void *v27; // x20 int v28; // w0 int v29; // w0 int v30; // w0 cipher = a2; if ( a6 == -1 ) { v11 = *(_DWORD *)(a1 + 16); if ( *(_QWORD *)(a1 + 8) ) { LABEL_3: v12 = *(_QWORD *)a1; if ( *(_QWORD *)a1 ) { if ( !a2 || *a2 == *(_DWORD *)v12 ) goto LABEL_13; goto LABEL_6; } if ( !a2 ) { LABEL_36: v18 = 0; ERR_put_error(6, 123, 131, (__int64)"crypto/evp/evp_enc.c", 144); return v18; } goto LABEL_7; } } else { v11 = a6 != 0; *(_DWORD *)(a1 + 16) = v11; if ( *(_QWORD *)(a1 + 8) ) goto LABEL_3; } if ( !a2 ) { v12 = *(_QWORD *)a1; if ( *(_QWORD *)a1 ) goto LABEL_13; goto LABEL_36; } if ( *(_QWORD *)a1 ) { LABEL_6: v13 = *(_QWORD *)(a1 + 112); EVP_CIPHER_CTX_reset((__int64 *)a1); *(_DWORD *)(a1 + 16) = v11; *(_QWORD *)(a1 + 112) = v13; } LABEL_7: if ( !cipher_engine ) { cipher_engine = ENGINE_get_cipher_engine(*cipher); if ( !cipher_engine ) goto LABEL_10; goto LABEL_9; } if ( (unsigned int)ENGINE_init(cipher_engine) ) { LABEL_9: cipher = (unsigned int *)ENGINE_get_cipher(cipher_engine, *cipher); if ( !cipher ) { v18 = 0; ERR_put_error(6, 123, 134, (__int64)"crypto/evp/evp_enc.c", 110); return v18; } LABEL_10: v14 = cipher[12]; *(_QWORD *)(a1 + 8) = cipher_engine; *(_QWORD *)a1 = cipher; if ( v14 ) { v26 = CRYPTO_zalloc(v14, "crypto/evp/evp_enc.c", 126); *(_QWORD *)(a1 + 120) = v26; v18 = v26; if ( !v26 ) { ERR_put_error(6, 123, 65, (__int64)"crypto/evp/evp_enc.c", 128); return v18; } v12 = *(_QWORD *)a1; } else { *(_QWORD *)(a1 + 120) = 0; v12 = (__int64)cipher; } v15 = *(_QWORD *)(v12 + 16); v16 = *(_QWORD *)(a1 + 112) & 1LL; *(_DWORD *)(a1 + 104) = cipher[2]; *(_QWORD *)(a1 + 112) = v16; if ( (v15 & 0x40) != 0 ) { v18 = EVP_CIPHER_CTX_ctrl(a1); if ( !v18 ) { ERR_put_error(6, 123, 134, (__int64)"crypto/evp/evp_enc.c", 139); return v18; } v17 = *(_DWORD *)(*(_QWORD *)a1 + 4LL); if ( ((v17 - 8) & 0xFFFFFFF7) == 0 ) { LABEL_15: v18 = *(_QWORD *)(a1 + 112) & 1; if ( !v18 ) { v23 = EVP_CIPHER_CTX_cipher(a1); if ( (EVP_CIPHER_flags(v23) & 0xF0007) == 0x10002 ) { ERR_put_error(6, 123, 170, (__int64)"crypto/evp/evp_enc.c", 157); return v18; } } v19 = EVP_CIPHER_CTX_cipher(a1); if ( (EVP_CIPHER_flags(v19) & 0x10) == 0 ) { v24 = EVP_CIPHER_CTX_cipher(a1); v25 = EVP_CIPHER_flags(v24) & 0xF0007; if ( v25 > 5 ) return 0; switch ( (int)v25 ) { case 0: case 1: break; case 2: goto LABEL_44; case 3: case 4: *(_DWORD *)(a1 + 88) = 0; LABEL_44: if ( (int)EVP_CIPHER_CTX_iv_length(a1) > 16 ) OPENSSL_die( "assertion failed: EVP_CIPHER_CTX_iv_length(ctx) <= (int)sizeof(ctx->iv)", "crypto/evp/evp_enc.c", 177); v27 = (const void *)(a1 + 24); if ( a5 ) { v27 = (const void *)(a1 + 24); v28 = EVP_CIPHER_CTX_iv_length(a1); memcpy((void *)(a1 + 24), a5, v28); } v29 = EVP_CIPHER_CTX_iv_length(a1); memcpy((void *)(a1 + 40), v27, v29); break; case 5: *(_DWORD *)(a1 + 88) = 0; if ( a5 ) { v30 = EVP_CIPHER_CTX_iv_length(a1); memcpy((void *)(a1 + 40), a5, v30); } break; } } v20 = *(_QWORD *)a1; if ( a4 || (*(_QWORD *)(v20 + 16) & 0x20) != 0 ) { v18 = (*(__int64 (__fastcall **)(__int64, __int64, const void *, _QWORD))(v20 + 24))(a1, a4, a5, v11); if ( !v18 ) return v18; v20 = *(_QWORD *)a1; } v21 = *(_DWORD *)(v20 + 4); v18 = 1; *(_DWORD *)(a1 + 20) = 0; *(_DWORD *)(a1 + 128) = 0; *(_DWORD *)(a1 + 132) = v21 - 1; return v18; } LABEL_14: if ( v17 != 1 ) OPENSSL_die( "assertion failed: ctx->cipher->block_size == 1 || ctx->cipher->block_size == 8 || ctx->cipher->block_size == 16", "crypto/evp/evp_enc.c", 153); goto LABEL_15; } LABEL_13: v17 = *(_DWORD *)(v12 + 4); if ( ((v17 - 8) & 0xFFFFFFF7) == 0 ) goto LABEL_15; goto LABEL_14; } ERR_put_error(6, 123, 134, (__int64)"crypto/evp/evp_enc.c", 95); return 0; }
GD Web Decomp Icon

GD Web Decomp

Raw Source