{"type": "func", "start": 8870900, "end": 8871168, "name": "CMS_get1_crls", "pseudocode": "// \n// CMS_get1_crls from 0x875bf4 to 0x875d00 (268 bytes)\n// \n// 1 xrefs:\n// > <???> @ 0x6a51c\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\nint *__fastcall CMS_get1_crls(int *a1)\n{\n  char *v2; // r0\n  int v3; // r6\n  int *v4; // r6\n  signed int v5; // r4\n  int *v6; // r7\n  int v7; // r0\n  unsigned int v8; // r1\n  _DWORD *v10; // r5\n\n  v2 = OBJ_obj2nid(*a1);\n  if ( v2 != (_BYTE *)&dword_14 + 2 )\n  {\n    if ( v2 == (_BYTE *)&dword_14 + 3 )\n    {\n      v3 = *(_DWORD *)(a1[1] + 4);\n      if ( v3 )\n      {\n        v4 = (int *)(v3 + 4);\n        goto LABEL_5;\n      }\n    }\n    else\n    {\n      ERR_put_error(46, 132, 152, (int)\"crypto/cms/cms_lib.c\", 431);\n    }\n    return nullptr;\n  }\n  v4 = (int *)(a1[1] + 16);\n  if ( a1[1] == -16 )\n    return nullptr;\nLABEL_5:\n  v5 = 0;\n  v6 = nullptr;\n  while ( 1 )\n  {\n    do\n    {\n      v7 = OPENSSL_sk_num(*v4);\n      v8 = v5;\n      if ( v5++ >= v7 )\n        return v6;\n      v10 = (_DWORD *)OPENSSL_sk_value((_DWORD *)*v4, v8);\n    }\n    while ( *v10 );\n    if ( !v6 )\n    {\n      v6 = OPENSSL_sk_new_null();\n      if ( !v6 )\n        return nullptr;\n    }\n    if ( !OPENSSL_sk_push(v6, v10[1]) )\n      break;\n    X509_CRL_up_ref(v10[1]);\n  }\n  OPENSSL_sk_pop_free((int)v6, (void (__fastcall *)(int))X509_CRL_free);\n  return nullptr;\n}", "assembly": "; \n; CMS_get1_crls from 0x875bf4 to 0x875d00 (268 bytes)\n; \n; 1 xrefs:\n; > <???> @ 0x6a51c\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-R8,LR}                                             ; +0x0, 0x875bf4\nMOV             R4, R0                                                 ; +0x4, 0x875bf8\nSUB             SP, SP, #8                                             ; +0x8, 0x875bfc\nLDR             R0, [R0]                                               ; +0xc, 0x875c00\nBL              OBJ_obj2nid                                            ; +0x10, 0x875c04\nCMP             R0, #0x16                                              ; +0x14, 0x875c08\nBEQ             loc_875CD4                                             ; +0x18, 0x875c0c\nCMP             R0, #0x17                                              ; +0x1c, 0x875c10\nBNE             loc_875C8C                                             ; +0x20, 0x875c14\nLDR             R3, [R4,#4]                                            ; +0x24, 0x875c18\nLDR             R6, [R3,#4]                                            ; +0x28, 0x875c1c\nCMP             R6, #0                                                 ; +0x2c, 0x875c20\nBEQ             loc_875CAC                                             ; +0x30, 0x875c24\nADD             R6, R6, #4                                             ; +0x34, 0x875c28\nMOV             R4, #0                                                 ; +0x38, 0x875c2c\nMOV             R7, R4                                                 ; +0x3c, 0x875c30\nLDR             R0, [R6]                                               ; +0x40, 0x875c34\nBL              OPENSSL_sk_num                                         ; +0x44, 0x875c38\nMOV             R1, R4                                                 ; +0x48, 0x875c3c\nCMP             R4, R0                                                 ; +0x4c, 0x875c40\nADD             R4, R4, #1                                             ; +0x50, 0x875c44\nBGE             loc_875CC8                                             ; +0x54, 0x875c48\nLDR             R0, [R6]                                               ; +0x58, 0x875c4c\nBL              OPENSSL_sk_value                                       ; +0x5c, 0x875c50\nLDR             R3, [R0]                                               ; +0x60, 0x875c54\nMOV             R5, R0                                                 ; +0x64, 0x875c58\nCMP             R3, #0                                                 ; +0x68, 0x875c5c\nBNE             loc_875C34                                             ; +0x6c, 0x875c60\nCMP             R7, #0                                                 ; +0x70, 0x875c64\nBEQ             loc_875CB8                                             ; +0x74, 0x875c68\nMOV             R0, R7                                                 ; +0x78, 0x875c6c\nLDR             R1, [R5,#4]                                            ; +0x7c, 0x875c70\nBL              OPENSSL_sk_push                                        ; +0x80, 0x875c74\nSUBS            R8, R0, #0                                             ; +0x84, 0x875c78\nBEQ             loc_875CE4                                             ; +0x88, 0x875c7c\nLDR             R0, [R5,#4]                                            ; +0x8c, 0x875c80\nBL              X509_CRL_up_ref                                        ; +0x90, 0x875c84\nB               loc_875C34                                             ; +0x94, 0x875c88\nLDR             R3, =0x1AF                                             ; +0x98, 0x875c8c\nSTR             R3, [SP,#8+var_8]                                      ; +0x9c, 0x875c90\nLDR             R3, =(aCryptoCmsCmsLi - 0x875CAC); \"crypto/cms/cms_lib.c\" ; +0xa0, 0x875c94\nMOV             R0, #0x2E ; '.'                                        ; +0xa4, 0x875c98\nMOV             R1, #0x84                                              ; +0xa8, 0x875c9c\nMOV             R2, #0x98                                              ; +0xac, 0x875ca0\nADD             R3, PC, R3; \"crypto/cms/cms_lib.c\"                     ; +0xb0, 0x875ca4\nBL              ERR_put_error                                          ; +0xb4, 0x875ca8\nMOV             R0, #0                                                 ; +0xb8, 0x875cac\nADD             SP, SP, #8                                             ; +0xbc, 0x875cb0\nPOP             {R4-R8,PC}                                             ; +0xc0, 0x875cb4\nBL              OPENSSL_sk_new_null                                    ; +0xc4, 0x875cb8\nSUBS            R7, R0, #0                                             ; +0xc8, 0x875cbc\nBNE             loc_875C6C                                             ; +0xcc, 0x875cc0\nB               loc_875CAC                                             ; +0xd0, 0x875cc4\nMOV             R0, R7                                                 ; +0xd4, 0x875cc8\nADD             SP, SP, #8                                             ; +0xd8, 0x875ccc\nPOP             {R4-R8,PC}                                             ; +0xdc, 0x875cd0\nLDR             R6, [R4,#4]                                            ; +0xe0, 0x875cd4\nADDS            R6, R6, #0x10                                          ; +0xe4, 0x875cd8\nBNE             loc_875C2C                                             ; +0xe8, 0x875cdc\nB               loc_875CAC                                             ; +0xec, 0x875ce0\nLDR             R1, =(X509_CRL_free_ptr - 0x875CF4)                    ; +0xf0, 0x875ce4\nMOV             R0, R7                                                 ; +0xf4, 0x875ce8\nLDR             R1, [PC,R1]; X509_CRL_free                             ; +0xf8, 0x875cec\nBL              OPENSSL_sk_pop_free                                    ; +0xfc, 0x875cf0\nMOV             R0, R8                                                 ; +0x100, 0x875cf4\nADD             SP, SP, #8                                             ; +0x104, 0x875cf8\nPOP             {R4-R8,PC}                                             ; +0x108, 0x875cfc", "xrefs": ["<???> @ 0x6a51c"], "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"}