{"type": "func", "start": 14811544, "end": 14811844, "name": "CMS_add0_cert", "pseudocode": "// \n// CMS_add0_cert from 0xe20198 to 0xe202c4 (300 bytes)\n// \n// 2 xrefs:\n// > CMS_add1_cert @ 0xe202d4\n// > <???> @ 0x94d58\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_cert(__int64 *a1, __int64 a2)\n{\n  int v4; // w0\n  unsigned int **v5; // x20\n  int v6; // w19\n  bool v7; // cc\n  int v8; // w1\n  __int64 v9; // x0\n  __int64 v11; // x0\n\n  v4 = OBJ_obj2nid(*a1);\n  if ( v4 == 22 )\n  {\n    v5 = (unsigned int **)(a1[1] + 24);\n    if ( a1[1] != -24 )\n      goto LABEL_4;\n    return 0;\n  }\n  if ( v4 != 23 )\n  {\n    ERR_put_error(46, 128, 152, (__int64)\"crypto/cms/cms_lib.c\", 354);\n    return 0;\n  }\n  v5 = *(unsigned int ***)(a1[1] + 8);\n  if ( !v5 )\n    return 0;\nLABEL_4:\n  v6 = 0;\n  while ( 1 )\n  {\n    v7 = v6 < (int)OPENSSL_sk_num(*v5);\n    v8 = v6++;\n    if ( !v7 )\n      break;\n    v9 = OPENSSL_sk_value((__int64)*v5, v8);\n    if ( !*(_DWORD *)v9 && !(unsigned int)X509_cmp(*(_QWORD *)(v9 + 8), a2) )\n    {\n      ERR_put_error(46, 164, 175, (__int64)\"crypto/cms/cms_lib.c\", 394);\n      return 0;\n    }\n  }\n  v11 = CMS_add0_CertificateChoices(a1);\n  if ( !v11 )\n    return 0;\n  *(_QWORD *)(v11 + 8) = a2;\n  *(_DWORD *)v11 = 0;\n  return 1;\n}", "assembly": "; \n; CMS_add0_cert from 0xe20198 to 0xe202c4 (300 bytes)\n; \n; 2 xrefs:\n; > CMS_add1_cert @ 0xe202d4\n; > <???> @ 0x94d58\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_40]!                                ; +0x0, 0xe20198\nMOV             X29, SP                                                ; +0x4, 0xe2019c\nSTR             X23, [SP,#0x40+var_10]                                 ; +0x8, 0xe201a0\nMOV             X23, X0                                                ; +0xc, 0xe201a4\nLDR             X0, [X0]                                               ; +0x10, 0xe201a8\nSTP             X21, X22, [SP,#0x40+var_20]                            ; +0x14, 0xe201ac\nSTP             X19, X20, [SP,#0x40+var_30]                            ; +0x18, 0xe201b0\nMOV             X22, X1                                                ; +0x1c, 0xe201b4\nBL              OBJ_obj2nid                                            ; +0x20, 0xe201b8\nCMP             W0, #0x16                                              ; +0x24, 0xe201bc\nB.EQ            loc_E202B4                                             ; +0x28, 0xe201c0\nCMP             W0, #0x17                                              ; +0x2c, 0xe201c4\nB.NE            loc_E2024C                                             ; +0x30, 0xe201c8\nLDR             X0, [X23,#8]                                           ; +0x34, 0xe201cc\nLDR             X20, [X0,#8]                                           ; +0x38, 0xe201d0\nCBZ             X20, loc_E20268                                        ; +0x3c, 0xe201d4\nMOV             W19, #0                                                ; +0x40, 0xe201d8\nLDR             X0, [X20]                                              ; +0x44, 0xe201dc\nBL              OPENSSL_sk_num                                         ; +0x48, 0xe201e0\nCMP             W19, W0                                                ; +0x4c, 0xe201e4\nMOV             W1, W19                                                ; +0x50, 0xe201e8\nADD             W19, W19, #1                                           ; +0x54, 0xe201ec\nB.GE            loc_E20284                                             ; +0x58, 0xe201f0\nLDR             X0, [X20]                                              ; +0x5c, 0xe201f4\nBL              OPENSSL_sk_value                                       ; +0x60, 0xe201f8\nLDR             W2, [X0]                                               ; +0x64, 0xe201fc\nCBNZ            W2, loc_E201DC                                         ; +0x68, 0xe20200\nLDR             X0, [X0,#8]                                            ; +0x6c, 0xe20204\nMOV             X1, X22                                                ; +0x70, 0xe20208\nBL              X509_cmp                                               ; +0x74, 0xe2020c\nMOV             W21, W0                                                ; +0x78, 0xe20210\nCBNZ            W0, loc_E201DC                                         ; +0x7c, 0xe20214\nADRP            X3, #aCryptoCmsCmsLi@PAGE; \"crypto/cms/cms_lib.c\"      ; +0x80, 0xe20218\nMOV             W0, #0x2E ; '.'                                        ; +0x84, 0xe2021c\nMOV             W1, #0xA4                                              ; +0x88, 0xe20220\nMOV             W2, #0xAF                                              ; +0x8c, 0xe20224\nADD             X3, X3, #aCryptoCmsCmsLi@PAGEOFF; \"crypto/cms/cms_lib.c\" ; +0x90, 0xe20228\nMOV             W4, #0x18A                                             ; +0x94, 0xe2022c\nBL              ERR_put_error                                          ; +0x98, 0xe20230\nLDR             X23, [SP,#0x40+var_10]                                 ; +0x9c, 0xe20234\nMOV             W0, W21                                                ; +0xa0, 0xe20238\nLDP             X19, X20, [SP,#0x40+var_30]                            ; +0xa4, 0xe2023c\nLDP             X21, X22, [SP,#0x40+var_20]                            ; +0xa8, 0xe20240\nLDP             X29, X30, [SP+0x40+var_40],#0x40                       ; +0xac, 0xe20244\nRET                                                                    ; +0xb0, 0xe20248\nADRP            X3, #aCryptoCmsCmsLi@PAGE; \"crypto/cms/cms_lib.c\"      ; +0xb4, 0xe2024c\nMOV             W0, #0x2E ; '.'                                        ; +0xb8, 0xe20250\nMOV             W1, #0x80                                              ; +0xbc, 0xe20254\nMOV             W2, #0x98                                              ; +0xc0, 0xe20258\nADD             X3, X3, #aCryptoCmsCmsLi@PAGEOFF; \"crypto/cms/cms_lib.c\" ; +0xc4, 0xe2025c\nMOV             W4, #0x162                                             ; +0xc8, 0xe20260\nBL              ERR_put_error                                          ; +0xcc, 0xe20264\nMOV             W21, #0                                                ; +0xd0, 0xe20268\nLDR             X23, [SP,#0x40+var_10]                                 ; +0xd4, 0xe2026c\nMOV             W0, W21                                                ; +0xd8, 0xe20270\nLDP             X19, X20, [SP,#0x40+var_30]                            ; +0xdc, 0xe20274\nLDP             X21, X22, [SP,#0x40+var_20]                            ; +0xe0, 0xe20278\nLDP             X29, X30, [SP+0x40+var_40],#0x40                       ; +0xe4, 0xe2027c\nRET                                                                    ; +0xe8, 0xe20280\nMOV             X0, X23                                                ; +0xec, 0xe20284\nBL              CMS_add0_CertificateChoices                            ; +0xf0, 0xe20288\nCBZ             X0, loc_E20268                                         ; +0xf4, 0xe2028c\nSTR             X22, [X0,#8]                                           ; +0xf8, 0xe20290\nMOV             W21, #1                                                ; +0xfc, 0xe20294\nSTR             WZR, [X0]                                              ; +0x100, 0xe20298\nMOV             W0, W21                                                ; +0x104, 0xe2029c\nLDP             X19, X20, [SP,#0x40+var_30]                            ; +0x108, 0xe202a0\nLDP             X21, X22, [SP,#0x40+var_20]                            ; +0x10c, 0xe202a4\nLDR             X23, [SP,#0x40+var_10]                                 ; +0x110, 0xe202a8\nLDP             X29, X30, [SP+0x40+var_40],#0x40                       ; +0x114, 0xe202ac\nRET                                                                    ; +0x118, 0xe202b0\nLDR             X20, [X23,#8]                                          ; +0x11c, 0xe202b4\nADDS            X20, X20, #0x18                                        ; +0x120, 0xe202b8\nB.NE            loc_E201D8                                             ; +0x124, 0xe202bc\nB               loc_E20268                                             ; +0x128, 0xe202c0", "xrefs": ["CMS_add1_cert @ 0xe202d4", "<???> @ 0x94d58"], "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"}