{"type": "func", "start": 8869788, "end": 8869996, "name": "CMS_add0_CertificateChoices", "pseudocode": "// \n// CMS_add0_CertificateChoices from 0x87579c to 0x87586c (208 bytes)\n// \n// 2 xrefs:\n// > CMS_add0_cert @ 0x875954\n// > <???> @ 0x6a4ac\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_DWORD *__fastcall CMS_add0_CertificateChoices(int *a1)\n{\n  char *v2; // r0\n  int **v3; // r5\n  _DWORD *v4; // r4\n  int v5; // r5\n  _DWORD *result; // r0\n  int *v7; // r0\n\n  v2 = OBJ_obj2nid(*a1);\n  if ( v2 != (_BYTE *)&dword_14 + 2 )\n  {\n    if ( v2 == (_BYTE *)&dword_14 + 3 )\n    {\n      v3 = *(int ***)(a1[1] + 4);\n      if ( v3 )\n        goto LABEL_4;\n    }\n    else\n    {\n      ERR_put_error(46, 128, 152, (int)\"crypto/cms/cms_lib.c\", 354);\n    }\n    return nullptr;\n  }\n  v3 = (int **)(a1[1] + 12);\n  if ( a1[1] == -12 )\n    return nullptr;\nLABEL_4:\n  if ( !*v3 )\n  {\n    v7 = OPENSSL_sk_new_null();\n    *v3 = v7;\n    if ( !v7 )\n      return nullptr;\n  }\n  v4 = ASN1_item_new((int)CMS_CertificateChoices_it);\n  if ( !v4 )\n    return nullptr;\n  v5 = OPENSSL_sk_push(*v3, (int)v4);\n  result = v4;\n  if ( !v5 )\n  {\n    ASN1_item_free(v4, CMS_CertificateChoices_it);\n    return nullptr;\n  }\n  return result;\n}", "assembly": "; \n; CMS_add0_CertificateChoices from 0x87579c to 0x87586c (208 bytes)\n; \n; 2 xrefs:\n; > CMS_add0_cert @ 0x875954\n; > <???> @ 0x6a4ac\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\nPUSH            {R4-R6,LR}                                             ; +0x0, 0x87579c\nMOV             R4, R0                                                 ; +0x4, 0x8757a0\nSUB             SP, SP, #8                                             ; +0x8, 0x8757a4\nLDR             R0, [R0]                                               ; +0xc, 0x8757a8\nBL              OBJ_obj2nid                                            ; +0x10, 0x8757ac\nCMP             R0, #0x16                                              ; +0x14, 0x8757b0\nBEQ             loc_875848                                             ; +0x18, 0x8757b4\nCMP             R0, #0x17                                              ; +0x1c, 0x8757b8\nBNE             loc_87581C                                             ; +0x20, 0x8757bc\nLDR             R3, [R4,#4]                                            ; +0x24, 0x8757c0\nLDR             R5, [R3,#4]                                            ; +0x28, 0x8757c4\nCMP             R5, #0                                                 ; +0x2c, 0x8757c8\nBEQ             loc_87583C                                             ; +0x30, 0x8757cc\nLDR             R3, [R5]                                               ; +0x34, 0x8757d0\nCMP             R3, #0                                                 ; +0x38, 0x8757d4\nBEQ             loc_875858                                             ; +0x3c, 0x8757d8\nLDR             R6, =(CMS_CertificateChoices_it_ptr - 0x8757E8)        ; +0x40, 0x8757dc\nLDR             R6, [PC,R6]; CMS_CertificateChoices_it                 ; +0x44, 0x8757e0\nMOV             R0, R6                                                 ; +0x48, 0x8757e4\nBL              ASN1_item_new                                          ; +0x4c, 0x8757e8\nSUBS            R4, R0, #0                                             ; +0x50, 0x8757ec\nBEQ             loc_87583C                                             ; +0x54, 0x8757f0\nLDR             R0, [R5]                                               ; +0x58, 0x8757f4\nMOV             R1, R4                                                 ; +0x5c, 0x8757f8\nBL              OPENSSL_sk_push                                        ; +0x60, 0x8757fc\nSUBS            R5, R0, #0                                             ; +0x64, 0x875800\nMOV             R0, R4                                                 ; +0x68, 0x875804\nBNE             loc_875840                                             ; +0x6c, 0x875808\nMOV             R1, R6                                                 ; +0x70, 0x87580c\nBL              ASN1_item_free                                         ; +0x74, 0x875810\nMOV             R0, R5                                                 ; +0x78, 0x875814\nB               loc_875840                                             ; +0x7c, 0x875818\nLDR             R3, =0x162                                             ; +0x80, 0x87581c\nSTR             R3, [SP,#8+var_8]                                      ; +0x84, 0x875820\nLDR             R3, =(aCryptoCmsCmsLi - 0x87583C); \"crypto/cms/cms_lib.c\" ; +0x88, 0x875824\nMOV             R0, #0x2E ; '.'                                        ; +0x8c, 0x875828\nMOV             R1, #0x80                                              ; +0x90, 0x87582c\nMOV             R2, #0x98                                              ; +0x94, 0x875830\nADD             R3, PC, R3; \"crypto/cms/cms_lib.c\"                     ; +0x98, 0x875834\nBL              ERR_put_error                                          ; +0x9c, 0x875838\nMOV             R0, #0                                                 ; +0xa0, 0x87583c\nADD             SP, SP, #8                                             ; +0xa4, 0x875840\nPOP             {R4-R6,PC}                                             ; +0xa8, 0x875844\nLDR             R5, [R4,#4]                                            ; +0xac, 0x875848\nADDS            R5, R5, #0xC                                           ; +0xb0, 0x87584c\nBNE             loc_8757D0                                             ; +0xb4, 0x875850\nB               loc_87583C                                             ; +0xb8, 0x875854\nBL              OPENSSL_sk_new_null                                    ; +0xbc, 0x875858\nCMP             R0, #0                                                 ; +0xc0, 0x87585c\nSTR             R0, [R5]                                               ; +0xc4, 0x875860\nBEQ             loc_87583C                                             ; +0xc8, 0x875864\nB               loc_8757DC                                             ; +0xcc, 0x875868", "xrefs": ["CMS_add0_cert @ 0x875954", "<???> @ 0x6a4ac"], "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"}