{"type": "func", "start": 14801816, "end": 14802428, "name": "CMS_add0_recipient_key", "pseudocode": "// \n// CMS_add0_recipient_key from 0xe1db98 to 0xe1ddfc (612 bytes)\n// \n// 1 xrefs:\n// > <???> @ 0x84750\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\n__int64 __fastcall CMS_add0_recipient_key(\n        __int64 *a1,\n        unsigned int a2,\n        __int64 a3,\n        __int64 a4,\n        __int64 a5,\n        int a6,\n        __int64 a7,\n        __int64 a8,\n        __int64 a9)\n{\n  __int64 v16; // x23\n  __int64 v17; // x20\n  __int64 v19; // x0\n  __int64 v20; // x0\n  _QWORD *v21; // x19\n  __int64 v22; // x0\n  __int64 v23; // x1\n  __int64 *v24; // x0\n  __int64 v25; // x0\n  __int64 v26; // x1\n  _QWORD *v27; // x0\n  __int64 *v28; // x19\n  char **v29; // x0\n  __int64 v30; // [xsp+78h] [xbp+78h]\n\n  v16 = cms_get0_enveloped(a1);\n  if ( !v16 )\n  {\n    v17 = 0;\n    goto LABEL_5;\n  }\n  if ( !a2 )\n  {\n    switch ( a4 )\n    {\n      case 24LL:\n        a2 = 789;\n        goto LABEL_12;\n      case 32LL:\n        a2 = 790;\n        goto LABEL_12;\n      case 16LL:\n        a2 = 788;\n        goto LABEL_12;\n    }\n    v17 = 0;\n    ERR_put_error(46, 100, 118, (__int64)\"crypto/cms/cms_env.c\", 490);\nLABEL_5:\n    ASN1_item_free(v17, CMS_RecipientInfo_it);\n    return 0;\n  }\n  if ( a2 - 788 > 2 || (v19 = qword_F85B00[a2 - 788]) == 0 )\n  {\n    v17 = 0;\n    ERR_put_error(46, 100, 153, (__int64)\"crypto/cms/cms_env.c\", 500);\n    goto LABEL_5;\n  }\n  if ( a4 != v19 )\n  {\n    v17 = 0;\n    ERR_put_error(46, 100, 118, (__int64)\"crypto/cms/cms_env.c\", 505);\n    goto LABEL_5;\n  }\nLABEL_12:\n  v17 = ASN1_item_new((__int64)CMS_RecipientInfo_it);\n  if ( !v17 )\n    goto LABEL_20;\n  v20 = ASN1_item_new((__int64)&CMS_KEKRecipientInfo_it);\n  *(_QWORD *)(v17 + 8) = v20;\n  v21 = (_QWORD *)v20;\n  if ( !v20 )\n    goto LABEL_20;\n  *(_DWORD *)v17 = 2;\n  if ( a8 )\n  {\n    v30 = *(_QWORD *)(v20 + 8);\n    v22 = ASN1_item_new((__int64)&CMS_OtherKeyAttribute_it);\n    v23 = v21[1];\n    *(_QWORD *)(v30 + 16) = v22;\n    if ( !*(_QWORD *)(v23 + 16) )\n      goto LABEL_20;\n  }\n  if ( !(unsigned int)OPENSSL_sk_push(*(int **)(v16 + 16), v17) )\n  {\nLABEL_20:\n    ERR_put_error(46, 100, 65, (__int64)\"crypto/cms/cms_env.c\", 554);\n    goto LABEL_5;\n  }\n  v24 = (__int64 *)v21[1];\n  *v21 = 4;\n  v21[4] = a3;\n  v25 = *v24;\n  v21[5] = a4;\n  ASN1_STRING_set0(v25, a5, a6);\n  v26 = v21[1];\n  v27 = *(_QWORD **)(v26 + 16);\n  *(_QWORD *)(v26 + 8) = a7;\n  if ( v27 )\n  {\n    *v27 = a8;\n    v27[1] = a9;\n  }\n  v28 = (__int64 *)v21[2];\n  v29 = OBJ_nid2obj(a2);\n  X509_ALGOR_set0(v28, (__int64)v29, 0xFFFFFFFF, 0);\n  return v17;\n}", "assembly": "; \n; CMS_add0_recipient_key from 0xe1db98 to 0xe1ddfc (612 bytes)\n; \n; 1 xrefs:\n; > <???> @ 0x84750\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nSTP             X29, X30, [SP,#var_80]!                                ; +0x0, 0xe1db98\nMOV             X29, SP                                                ; +0x4, 0xe1db9c\nSTR             D8, [SP,#0x80+var_20]                                  ; +0x8, 0xe1dba0\nFMOV            D8, X2                                                 ; +0xc, 0xe1dba4\nSTP             X21, X22, [SP,#0x80+var_60]                            ; +0x10, 0xe1dba8\nSTP             X23, X24, [SP,#0x80+var_50]                            ; +0x14, 0xe1dbac\nSTP             X27, X28, [SP,#0x80+var_30]                            ; +0x18, 0xe1dbb0\nSTP             X25, X26, [SP,#0x80+var_40]                            ; +0x1c, 0xe1dbb4\nSTP             X19, X20, [SP,#0x80+var_70]                            ; +0x20, 0xe1dbb8\nMOV             W21, W1                                                ; +0x24, 0xe1dbbc\nMOV             X22, X3                                                ; +0x28, 0xe1dbc0\nMOV             X28, X4                                                ; +0x2c, 0xe1dbc4\nMOV             X27, X5                                                ; +0x30, 0xe1dbc8\nMOV             X26, X6                                                ; +0x34, 0xe1dbcc\nMOV             X24, X7                                                ; +0x38, 0xe1dbd0\nBL              cms_get0_enveloped                                     ; +0x3c, 0xe1dbd4\nMOV             X23, X0                                                ; +0x40, 0xe1dbd8\nCBZ             X0, loc_E1DDF0                                         ; +0x44, 0xe1dbdc\nCBZ             W21, loc_E1DC44                                        ; +0x48, 0xe1dbe0\nSUB             W0, W21, #0x314                                        ; +0x4c, 0xe1dbe4\nCMP             W0, #2                                                 ; +0x50, 0xe1dbe8\nB.LS            loc_E1DC84                                             ; +0x54, 0xe1dbec\nADRP            X3, #aCryptoCmsCmsEn@PAGE; \"crypto/cms/cms_env.c\"      ; +0x58, 0xe1dbf0\nMOV             W0, #0x2E ; '.'                                        ; +0x5c, 0xe1dbf4\nMOV             W1, #0x64 ; 'd'                                        ; +0x60, 0xe1dbf8\nMOV             W2, #0x99                                              ; +0x64, 0xe1dbfc\nADD             X3, X3, #aCryptoCmsCmsEn@PAGEOFF; \"crypto/cms/cms_env.c\" ; +0x68, 0xe1dc00\nMOV             W4, #0x1F4                                             ; +0x6c, 0xe1dc04\nMOV             X20, #0                                                ; +0x70, 0xe1dc08\nADRP            X25, #CMS_RecipientInfo_it_ptr@PAGE                    ; +0x74, 0xe1dc0c\nBL              ERR_put_error                                          ; +0x78, 0xe1dc10\nLDR             X1, [X25,#CMS_RecipientInfo_it_ptr@PAGEOFF]; CMS_RecipientInfo_it ; +0x7c, 0xe1dc14\nMOV             X0, X20                                                ; +0x80, 0xe1dc18\nBL              ASN1_item_free                                         ; +0x84, 0xe1dc1c\nMOV             X0, #0                                                 ; +0x88, 0xe1dc20\nLDP             X19, X20, [SP,#0x80+var_70]                            ; +0x8c, 0xe1dc24\nLDP             X21, X22, [SP,#0x80+var_60]                            ; +0x90, 0xe1dc28\nLDP             X23, X24, [SP,#0x80+var_50]                            ; +0x94, 0xe1dc2c\nLDP             X25, X26, [SP,#0x80+var_40]                            ; +0x98, 0xe1dc30\nLDP             X27, X28, [SP,#0x80+var_30]                            ; +0x9c, 0xe1dc34\nLDR             D8, [SP,#0x80+var_20]                                  ; +0xa0, 0xe1dc38\nLDP             X29, X30, [SP+0x80+var_80],#0x80                       ; +0xa4, 0xe1dc3c\nRET                                                                    ; +0xa8, 0xe1dc40\nCMP             X22, #0x18                                             ; +0xac, 0xe1dc44\nB.EQ            loc_E1DDC0                                             ; +0xb0, 0xe1dc48\nCMP             X22, #0x20 ; ' '                                       ; +0xb4, 0xe1dc4c\nB.EQ            loc_E1DDB8                                             ; +0xb8, 0xe1dc50\nCMP             X22, #0x10                                             ; +0xbc, 0xe1dc54\nB.EQ            loc_E1DDB0                                             ; +0xc0, 0xe1dc58\nADRP            X3, #aCryptoCmsCmsEn@PAGE; \"crypto/cms/cms_env.c\"      ; +0xc4, 0xe1dc5c\nMOV             W0, #0x2E ; '.'                                        ; +0xc8, 0xe1dc60\nMOV             W1, #0x64 ; 'd'                                        ; +0xcc, 0xe1dc64\nMOV             W2, #0x76 ; 'v'                                        ; +0xd0, 0xe1dc68\nADD             X3, X3, #aCryptoCmsCmsEn@PAGEOFF; \"crypto/cms/cms_env.c\" ; +0xd4, 0xe1dc6c\nMOV             W4, #0x1EA                                             ; +0xd8, 0xe1dc70\nMOV             X20, #0                                                ; +0xdc, 0xe1dc74\nADRP            X25, #CMS_RecipientInfo_it_ptr@PAGE                    ; +0xe0, 0xe1dc78\nBL              ERR_put_error                                          ; +0xe4, 0xe1dc7c\nB               loc_E1DC14                                             ; +0xe8, 0xe1dc80\nADRL            X1, qword_F85B00                                       ; +0xec, 0xe1dc84\nLDR             X0, [X1,W0,UXTW#3]                                     ; +0xf4, 0xe1dc8c\nCBZ             X0, loc_E1DBF0                                         ; +0xf8, 0xe1dc90\nCMP             X22, X0                                                ; +0xfc, 0xe1dc94\nB.NE            loc_E1DDC8                                             ; +0x100, 0xe1dc98\nADRP            X25, #CMS_RecipientInfo_it_ptr@PAGE                    ; +0x104, 0xe1dc9c\nLDR             X0, [X25,#CMS_RecipientInfo_it_ptr@PAGEOFF]; CMS_RecipientInfo_it ; +0x108, 0xe1dca0\nBL              ASN1_item_new                                          ; +0x10c, 0xe1dca4\nMOV             X20, X0                                                ; +0x110, 0xe1dca8\nCBZ             X0, loc_E1DD90                                         ; +0x114, 0xe1dcac\nADRP            X0, #CMS_KEKRecipientInfo_it_ptr@PAGE                  ; +0x118, 0xe1dcb0\nLDR             X0, [X0,#CMS_KEKRecipientInfo_it_ptr@PAGEOFF]; CMS_KEKRecipientInfo_it ; +0x11c, 0xe1dcb4\nBL              ASN1_item_new                                          ; +0x120, 0xe1dcb8\nSTR             X0, [X20,#8]                                           ; +0x124, 0xe1dcbc\nMOV             X19, X0                                                ; +0x128, 0xe1dcc0\nCBZ             X0, loc_E1DD90                                         ; +0x12c, 0xe1dcc4\nMOV             W0, #2                                                 ; +0x130, 0xe1dcc8\nSTR             W0, [X20]                                              ; +0x134, 0xe1dccc\nCBZ             X24, loc_E1DCFC                                        ; +0x138, 0xe1dcd0\nADRP            X0, #CMS_OtherKeyAttribute_it_ptr@PAGE                 ; +0x13c, 0xe1dcd4\nLDR             X2, [X19,#8]                                           ; +0x140, 0xe1dcd8\nSTR             X2, [X29,#0x80+var_8]                                  ; +0x144, 0xe1dcdc\nLDR             X0, [X0,#CMS_OtherKeyAttribute_it_ptr@PAGEOFF]; CMS_OtherKeyAttribute_it ; +0x148, 0xe1dce0\nBL              ASN1_item_new                                          ; +0x14c, 0xe1dce4\nLDR             X2, [X29,#0x80+var_8]                                  ; +0x150, 0xe1dce8\nLDR             X1, [X19,#8]                                           ; +0x154, 0xe1dcec\nSTR             X0, [X2,#0x10]                                         ; +0x158, 0xe1dcf0\nLDR             X0, [X1,#0x10]                                         ; +0x15c, 0xe1dcf4\nCBZ             X0, loc_E1DD90                                         ; +0x160, 0xe1dcf8\nLDR             X0, [X23,#0x10]                                        ; +0x164, 0xe1dcfc\nMOV             X1, X20                                                ; +0x168, 0xe1dd00\nBL              OPENSSL_sk_push                                        ; +0x16c, 0xe1dd04\nCBZ             W0, loc_E1DD90                                         ; +0x170, 0xe1dd08\nLDR             X0, [X19,#8]                                           ; +0x174, 0xe1dd0c\nMOV             X2, #4                                                 ; +0x178, 0xe1dd10\nMOV             X1, X28                                                ; +0x17c, 0xe1dd14\nSTR             X2, [X19]                                              ; +0x180, 0xe1dd18\nSTR             D8, [X19,#0x20]                                        ; +0x184, 0xe1dd1c\nMOV             W2, W27                                                ; +0x188, 0xe1dd20\nLDR             X0, [X0]                                               ; +0x18c, 0xe1dd24\nSTR             X22, [X19,#0x28]                                       ; +0x190, 0xe1dd28\nBL              ASN1_STRING_set0                                       ; +0x194, 0xe1dd2c\nLDR             X1, [X19,#8]                                           ; +0x198, 0xe1dd30\nLDR             X0, [X1,#0x10]                                         ; +0x19c, 0xe1dd34\nSTR             X26, [X1,#8]                                           ; +0x1a0, 0xe1dd38\nCBZ             X0, loc_E1DD4C                                         ; +0x1a4, 0xe1dd3c\nLDR             X1, [X29,#0x80+arg_0]                                  ; +0x1a8, 0xe1dd40\nSTR             X24, [X0]                                              ; +0x1ac, 0xe1dd44\nSTR             X1, [X0,#8]                                            ; +0x1b0, 0xe1dd48\nMOV             W0, W21                                                ; +0x1b4, 0xe1dd4c\nLDR             X19, [X19,#0x10]                                       ; +0x1b8, 0xe1dd50\nBL              OBJ_nid2obj                                            ; +0x1bc, 0xe1dd54\nMOV             X1, X0                                                 ; +0x1c0, 0xe1dd58\nMOV             W2, #0xFFFFFFFF                                        ; +0x1c4, 0xe1dd5c\nMOV             X0, X19                                                ; +0x1c8, 0xe1dd60\nMOV             X3, #0                                                 ; +0x1cc, 0xe1dd64\nBL              X509_ALGOR_set0                                        ; +0x1d0, 0xe1dd68\nMOV             X0, X20                                                ; +0x1d4, 0xe1dd6c\nLDP             X19, X20, [SP,#0x80+var_70]                            ; +0x1d8, 0xe1dd70\nLDP             X21, X22, [SP,#0x80+var_60]                            ; +0x1dc, 0xe1dd74\nLDP             X23, X24, [SP,#0x80+var_50]                            ; +0x1e0, 0xe1dd78\nLDP             X25, X26, [SP,#0x80+var_40]                            ; +0x1e4, 0xe1dd7c\nLDP             X27, X28, [SP,#0x80+var_30]                            ; +0x1e8, 0xe1dd80\nLDR             D8, [SP,#0x80+var_20]                                  ; +0x1ec, 0xe1dd84\nLDP             X29, X30, [SP+0x80+var_80],#0x80                       ; +0x1f0, 0xe1dd88\nRET                                                                    ; +0x1f4, 0xe1dd8c\nADRP            X3, #aCryptoCmsCmsEn@PAGE; \"crypto/cms/cms_env.c\"      ; +0x1f8, 0xe1dd90\nMOV             W0, #0x2E ; '.'                                        ; +0x1fc, 0xe1dd94\nMOV             W1, #0x64 ; 'd'                                        ; +0x200, 0xe1dd98\nMOV             W2, #0x41 ; 'A'                                        ; +0x204, 0xe1dd9c\nADD             X3, X3, #aCryptoCmsCmsEn@PAGEOFF; \"crypto/cms/cms_env.c\" ; +0x208, 0xe1dda0\nMOV             W4, #0x22A                                             ; +0x20c, 0xe1dda4\nBL              ERR_put_error                                          ; +0x210, 0xe1dda8\nB               loc_E1DC14                                             ; +0x214, 0xe1ddac\nMOV             W21, #0x314                                            ; +0x218, 0xe1ddb0\nB               loc_E1DC9C                                             ; +0x21c, 0xe1ddb4\nMOV             W21, #0x316                                            ; +0x220, 0xe1ddb8\nB               loc_E1DC9C                                             ; +0x224, 0xe1ddbc\nMOV             W21, #0x315                                            ; +0x228, 0xe1ddc0\nB               loc_E1DC9C                                             ; +0x22c, 0xe1ddc4\nADRP            X3, #aCryptoCmsCmsEn@PAGE; \"crypto/cms/cms_env.c\"      ; +0x230, 0xe1ddc8\nMOV             W0, #0x2E ; '.'                                        ; +0x234, 0xe1ddcc\nMOV             W1, #0x64 ; 'd'                                        ; +0x238, 0xe1ddd0\nMOV             W2, #0x76 ; 'v'                                        ; +0x23c, 0xe1ddd4\nADD             X3, X3, #aCryptoCmsCmsEn@PAGEOFF; \"crypto/cms/cms_env.c\" ; +0x240, 0xe1ddd8\nMOV             W4, #0x1F9                                             ; +0x244, 0xe1dddc\nMOV             X20, #0                                                ; +0x248, 0xe1dde0\nADRP            X25, #CMS_RecipientInfo_it_ptr@PAGE                    ; +0x24c, 0xe1dde4\nBL              ERR_put_error                                          ; +0x250, 0xe1dde8\nB               loc_E1DC14                                             ; +0x254, 0xe1ddec\nMOV             X20, X0                                                ; +0x258, 0xe1ddf0\nADRP            X25, #CMS_RecipientInfo_it_ptr@PAGE                    ; +0x25c, 0xe1ddf4\nB               loc_E1DC14                                             ; +0x260, 0xe1ddf8", "xrefs": ["<???> @ 0x84750"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}