// // EVP_CipherInit_ex from 0xa17b0c to 0xa17f28 (1052 bytes) // // 32 xrefs: // > ssl3_change_cipher_state @ 0x9ccec0 // > tls1_change_cipher_state @ 0x9cf018 // > tls1_change_cipher_state @ 0x9cf094 // > tls1_change_cipher_state @ 0x9cf2bc // > tls1_change_cipher_state @ 0x9cf350 // > sub_A15DCC @ 0xa15e9c // > EVP_CipherInit @ 0xa17f90 // > EVP_EncryptInit_ex @ 0xa17fec // > EVP_DecryptInit_ex @ 0xa18010 // > PKCS12_PBE_keyivgen @ 0xa38c00 // > PKCS7_dataInit @ 0xa3b9d0 // > PKCS7_dataInit @ 0xa3ba1c // > PKCS7_dataDecode @ 0xa3c2d8 // > PKCS7_dataDecode @ 0xa3c38c // > CMS_RecipientInfo_kari_decrypt @ 0xa8950c // > cms_RecipientInfo_kari_encrypt @ 0xa89978 // > cms_RecipientInfo_pwri_crypt @ 0xa8afe8 // > sub_ACA09C @ 0xaca210 // > BIO_set_cipher @ 0xaca360 // > BIO_set_cipher @ 0xaca3b8 // > PKCS5_PBE_keyivgen @ 0xacd118 // > PKCS5_v2_PBE_keyivgen @ 0xacd7d0 // > PKCS5_v2_PBKDF2_keyivgen @ 0xacdacc // > PKCS5_pbe2_set_iv @ 0xadc27c // > PKCS5_pbe2_set_scrypt @ 0xadc588 // > PKCS5_v2_scrypt_keyivgen @ 0xadca80 // > cms_EncryptedContent_init_bio @ 0xae4490 // > cms_EncryptedContent_init_bio @ 0xae4528 // > cms_EncryptedContent_init_bio @ 0xae45a8 // > cms_EncryptedContent_init_bio @ 0xae464c // > cms_EncryptedContent_init_bio @ 0xae4830 // > @ 0x7779c // // 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:07:50 +0000 // int __fastcall EVP_CipherInit_ex(int *a1, int *a2, _DWORD *cipher_engine, int a4, void *a5, int a6) { int *cipher; // r7 int v10; // r6 int *v11; // r3 int v12; // r5 int v13; // r0 int v14; // r0 int v15; // r2 int v16; // r2 int v18; // r5 int v19; // r0 int v20; // r3 int v22; // r0 int v23; // r0 size_t v24; // r0 size_t v25; // r0 int v26; // r0 size_t v27; // r0 cipher = a2; if ( a6 == -1 ) { v10 = a1[2]; } else { v10 = a6 != 0; a1[2] = v10; } v11 = (int *)*a1; if ( a1[1] ) { if ( v11 ) { if ( !a2 || *a2 == *v11 ) goto LABEL_16; goto LABEL_8; } if ( !a2 ) { LABEL_38: ERR_put_error(6, 123, 131, (int)"crypto/evp/evp_enc.c", 144); return 0; } } else { if ( !a2 ) { if ( v11 ) goto LABEL_16; goto LABEL_38; } if ( v11 ) { LABEL_8: v12 = a1[23]; EVP_CIPHER_CTX_reset(a1); a1[23] = v12; a1[2] = v10; } } if ( !cipher_engine ) { cipher_engine = (_DWORD *)ENGINE_get_cipher_engine(*cipher); if ( !cipher_engine ) goto LABEL_12; goto LABEL_11; } if ( ENGINE_init(cipher_engine) ) { LABEL_11: cipher = (int *)ENGINE_get_cipher((int)cipher_engine, *cipher); if ( !cipher ) { v18 = 0; ERR_put_error(6, 123, 134, (int)"crypto/evp/evp_enc.c", 110); return v18; } LABEL_12: v13 = cipher[8]; a1[1] = (int)cipher_engine; *a1 = (int)cipher; if ( v13 ) { v26 = CRYPTO_zalloc(v13, "crypto/evp/evp_enc.c", 126); v18 = v26; a1[24] = v26; if ( !v26 ) { ERR_put_error(6, 123, 65, (int)"crypto/evp/evp_enc.c", 128); return v18; } v11 = (int *)*a1; } else { v11 = cipher; a1[24] = 0; } v14 = v11[4]; v15 = a1[23] & 1; a1[22] = cipher[2]; a1[23] = v15; if ( (v14 & 0x40) != 0 ) { v18 = EVP_CIPHER_CTX_ctrl((int)a1); if ( !v18 ) { ERR_put_error(6, 123, 134, (int)"crypto/evp/evp_enc.c", 139); return v18; } v11 = (int *)*a1; } LABEL_16: v16 = v11[1]; if ( v16 != 1 && ((v16 - 8) & 0xFFFFFFF7) != 0 ) 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); v18 = a1[23] & 1; if ( !v18 ) { v22 = EVP_CIPHER_CTX_cipher(a1); if ( (EVP_CIPHER_flags(v22) & 0xF0007) == 0x10002 ) { ERR_put_error(6, 123, 170, (int)"crypto/evp/evp_enc.c", 157); return v18; } } v19 = EVP_CIPHER_CTX_cipher(a1); if ( (EVP_CIPHER_flags(v19) & 0x10) == 0 ) { v23 = EVP_CIPHER_CTX_cipher(a1); switch ( EVP_CIPHER_flags(v23) & 0xF0007 ) { case 0: case 1: break; case 2: goto LABEL_40; case 3: case 4: a1[20] = 0; LABEL_40: if ( 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); if ( a5 ) { v24 = EVP_CIPHER_CTX_iv_length(a1); memcpy(a1 + 4, a5, v24); } v25 = EVP_CIPHER_CTX_iv_length(a1); memcpy(a1 + 8, a1 + 4, v25); break; case 5: a1[20] = 0; if ( a5 ) { v27 = EVP_CIPHER_CTX_iv_length(a1); memcpy(a1 + 8, a5, v27); } break; default: return 0; } } v20 = *a1; if ( a4 || (*(_DWORD *)(v20 + 16) & 0x20) != 0 ) { v18 = (*(int (__fastcall **)(int *, int, void *, int))(v20 + 20))(a1, a4, a5, v10); if ( !v18 ) return v18; v20 = *a1; } v18 = 1; a1[26] = *(_DWORD *)(v20 + 4) - 1; a1[3] = 0; a1[25] = 0; return v18; } ERR_put_error(6, 123, 134, (int)"crypto/evp/evp_enc.c", 95); return 0; }
GD Web Decomp Icon

GD Web Decomp

Raw Source