// // cms_RecipientInfo_kari_init from 0xa8961c to 0xa897ac (400 bytes) // // 2 xrefs: // > CMS_add1_recipient_cert @ 0xa88c68 // > @ 0x83c4c // // 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:54 +0000 // int __fastcall cms_RecipientInfo_kari_init(_DWORD *a1, int a2, int a3, int a4) { void *v8; // r4 _DWORD *v9; // r7 _DWORD *v10; // r5 int v11; // r0 int *v12; // r0 int *v13; // r5 int *v14; // r0 int v15; // r0 _DWORD *v17; // r0 int v18; // [sp+4h] [bp-8h] BYREF v8 = ASN1_item_new((int)&CMS_KeyAgreeRecipientInfo_it); a1[1] = v8; if ( !v8 ) return 0; *a1 = 1; *(_DWORD *)v8 = 3; v9 = ASN1_item_new((int)CMS_RecipientEncryptedKey_it); if ( OPENSSL_sk_push(*((int **)v8 + 4), (int)v9) ) { if ( (a4 & 0x10000) != 0 ) { v10 = (_DWORD *)*v9; *(_DWORD *)*v9 = 1; v10[1] = ASN1_item_new((int)&CMS_RecipientKeyIdentifier_it); v11 = *(_DWORD *)(*v9 + 4); if ( !v11 || !cms_set1_keyid(v11, a2) ) return 0; } else { v17 = (_DWORD *)*v9; *v17 = 0; if ( !cms_set1_ias(v17 + 1, a2) ) return 0; } v18 = 0; v12 = (int *)EVP_PKEY_CTX_new(a3, nullptr); v13 = v12; if ( v12 ) { if ( EVP_PKEY_keygen_init(v12) <= 0 || EVP_PKEY_keygen(v13, &v18) <= 0 ) goto LABEL_13; EVP_PKEY_CTX_free((int)v13); v14 = (int *)EVP_PKEY_CTX_new(v18, nullptr); v13 = v14; if ( v14 ) { if ( EVP_PKEY_derive_init(v14) > 0 ) { v15 = v18; *((_DWORD *)v8 + 5) = v13; EVP_PKEY_free(v15); EVP_PKEY_up_ref(a3); v9[2] = a3; return 1; } goto LABEL_13; } } v13 = nullptr; LABEL_13: EVP_PKEY_CTX_free((int)v13); EVP_PKEY_free(v18); return 0; } ASN1_item_free(v9, CMS_RecipientEncryptedKey_it); return 0; }
GD Web Decomp Icon

GD Web Decomp

Raw Source