{"type": "func", "start": 8868284, "end": 8868660, "name": "CMS_dataFinal", "pseudocode": "// \n// CMS_dataFinal from 0x8751bc to 0x875334 (376 bytes)\n// \n// 2 xrefs:\n// > sub_872AE8 @ 0x872b54\n// > <???> @ 0x69e9c\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_dataFinal(int *a1, _DWORD *a2)\n{\n  int v4; // r0\n  _DWORD **v5; // r4\n  char *v6; // r0\n  _DWORD *type; // r0\n  _DWORD *v9; // r7\n  int v10; // r8\n  int v11; // [sp+Ch] [bp-4h] BYREF\n\n  v4 = CMS_get0_content(a1);\n  v5 = (_DWORD **)v4;\n  if ( !v4 )\n    return 0;\n  if ( *(_DWORD *)v4 && (*(_DWORD *)(*(_DWORD *)v4 + 12) & 0x20) != 0 )\n  {\n    type = BIO_find_type(a2, 1025);\n    v9 = type;\n    if ( !type )\n    {\n      ERR_put_error(46, 110, 105, (int)\"crypto/cms/cms_lib.c\", 119);\n      return 0;\n    }\n    v10 = BIO_ctrl(type, 3, 0, (int)&v11);\n    BIO_set_flags((int)v9, 512);\n    BIO_ctrl(v9, 130, 0, 0);\n    ASN1_STRING_set0(*v5, v11, v10);\n    (*v5)[3] &= ~0x20u;\n  }\n  v6 = OBJ_obj2nid(*a1);\n  if ( v6 == (_BYTE *)&dword_14 + 3 )\n    return 1;\n  if ( (int)v6 > 23 )\n  {\n    if ( v6 != (_BYTE *)&dword_18 + 2 && v6 != (_BYTE *)&stru_30C.st_value + 2 )\n    {\n      if ( v6 == (_BYTE *)&dword_18 + 1 )\n        return cms_DigestedData_do_final(a1, a2, 0);\n      goto LABEL_14;\n    }\n    return 1;\n  }\n  if ( v6 == (_BYTE *)&dword_14 + 1 )\n    return 1;\n  if ( v6 != (_BYTE *)&dword_14 + 2 )\n  {\nLABEL_14:\n    ERR_put_error(46, 110, 156, (int)\"crypto/cms/cms_lib.c\", 146);\n    return 0;\n  }\n  return cms_SignedData_final(a1, a2);\n}", "assembly": "; \n; CMS_dataFinal from 0x8751bc to 0x875334 (376 bytes)\n; \n; 2 xrefs:\n; > sub_872AE8 @ 0x872b54\n; > <???> @ 0x69e9c\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, 0x8751bc\nSUB             SP, SP, #0x10                                          ; +0x4, 0x8751c0\nMOV             R6, R1                                                 ; +0x8, 0x8751c4\nMOV             R5, R0                                                 ; +0xc, 0x8751c8\nBL              CMS_get0_content                                       ; +0x10, 0x8751cc\nSUBS            R4, R0, #0                                             ; +0x14, 0x8751d0\nBEQ             loc_875300                                             ; +0x18, 0x8751d4\nLDR             R3, [R4]                                               ; +0x1c, 0x8751d8\nCMP             R3, #0                                                 ; +0x20, 0x8751dc\nBEQ             loc_8751F0                                             ; +0x24, 0x8751e0\nLDR             R3, [R3,#0xC]                                          ; +0x28, 0x8751e4\nTST             R3, #0x20                                              ; +0x2c, 0x8751e8\nBNE             loc_875288                                             ; +0x30, 0x8751ec\nLDR             R0, [R5]                                               ; +0x34, 0x8751f0\nBL              OBJ_obj2nid                                            ; +0x38, 0x8751f4\nCMP             R0, #0x17                                              ; +0x3c, 0x8751f8\nBEQ             loc_8752F4                                             ; +0x40, 0x8751fc\nBLE             loc_875238                                             ; +0x44, 0x875200\nCMP             R0, #0x1A                                              ; +0x48, 0x875204\nBEQ             loc_8752F4                                             ; +0x4c, 0x875208\nLDR             R2, =0x312                                             ; +0x50, 0x87520c\nCMP             R0, R2                                                 ; +0x54, 0x875210\nBEQ             loc_8752F4                                             ; +0x58, 0x875214\nCMP             R0, #0x19                                              ; +0x5c, 0x875218\nBNE             loc_87525C                                             ; +0x60, 0x87521c\nMOV             R0, R5                                                 ; +0x64, 0x875220\nMOV             R1, R6                                                 ; +0x68, 0x875224\nMOV             R2, #0                                                 ; +0x6c, 0x875228\nBL              cms_DigestedData_do_final                              ; +0x70, 0x87522c\nADD             SP, SP, #0x10                                          ; +0x74, 0x875230\nPOP             {R4-R8,PC}                                             ; +0x78, 0x875234\nCMP             R0, #0x15                                              ; +0x7c, 0x875238\nBEQ             loc_8752F4                                             ; +0x80, 0x87523c\nCMP             R0, #0x16                                              ; +0x84, 0x875240\nBNE             loc_87525C                                             ; +0x88, 0x875244\nMOV             R0, R5                                                 ; +0x8c, 0x875248\nMOV             R1, R6                                                 ; +0x90, 0x87524c\nBL              cms_SignedData_final                                   ; +0x94, 0x875250\nADD             SP, SP, #0x10                                          ; +0x98, 0x875254\nPOP             {R4-R8,PC}                                             ; +0x9c, 0x875258\nMOV             R3, #0x92                                              ; +0xa0, 0x87525c\nSTR             R3, [SP,#0x10+var_10]                                  ; +0xa4, 0x875260\nLDR             R3, =(aCryptoCmsCmsLi - 0x87527C); \"crypto/cms/cms_lib.c\" ; +0xa8, 0x875264\nMOV             R0, #0x2E ; '.'                                        ; +0xac, 0x875268\nMOV             R1, #0x6E ; 'n'                                        ; +0xb0, 0x87526c\nMOV             R2, #0x9C                                              ; +0xb4, 0x875270\nADD             R3, PC, R3; \"crypto/cms/cms_lib.c\"                     ; +0xb8, 0x875274\nBL              ERR_put_error                                          ; +0xbc, 0x875278\nMOV             R0, #0                                                 ; +0xc0, 0x87527c\nADD             SP, SP, #0x10                                          ; +0xc4, 0x875280\nPOP             {R4-R8,PC}                                             ; +0xc8, 0x875284\nMOV             R0, R6                                                 ; +0xcc, 0x875288\nLDR             R1, =0x401                                             ; +0xd0, 0x87528c\nBL              BIO_find_type                                          ; +0xd4, 0x875290\nSUBS            R7, R0, #0                                             ; +0xd8, 0x875294\nBEQ             loc_87530C                                             ; +0xdc, 0x875298\nMOV             R2, #0                                                 ; +0xe0, 0x87529c\nADD             R3, SP, #0x10+var_4                                    ; +0xe4, 0x8752a0\nMOV             R1, #3                                                 ; +0xe8, 0x8752a4\nBL              BIO_ctrl                                               ; +0xec, 0x8752a8\nMOV             R1, #0x200                                             ; +0xf0, 0x8752ac\nMOV             R8, R0                                                 ; +0xf4, 0x8752b0\nMOV             R0, R7                                                 ; +0xf8, 0x8752b4\nBL              BIO_set_flags                                          ; +0xfc, 0x8752b8\nMOV             R2, #0                                                 ; +0x100, 0x8752bc\nMOV             R3, R2                                                 ; +0x104, 0x8752c0\nMOV             R1, #0x82                                              ; +0x108, 0x8752c4\nMOV             R0, R7                                                 ; +0x10c, 0x8752c8\nBL              BIO_ctrl                                               ; +0x110, 0x8752cc\nMOV             R2, R8                                                 ; +0x114, 0x8752d0\nLDR             R0, [R4]                                               ; +0x118, 0x8752d4\nLDR             R1, [SP,#0x10+var_4]                                   ; +0x11c, 0x8752d8\nBL              ASN1_STRING_set0                                       ; +0x120, 0x8752dc\nLDR             R2, [R4]                                               ; +0x124, 0x8752e0\nLDR             R3, [R2,#0xC]                                          ; +0x128, 0x8752e4\nBIC             R3, R3, #0x20 ; ' '                                    ; +0x12c, 0x8752e8\nSTR             R3, [R2,#0xC]                                          ; +0x130, 0x8752ec\nB               loc_8751F0                                             ; +0x134, 0x8752f0\nMOV             R0, #1                                                 ; +0x138, 0x8752f4\nADD             SP, SP, #0x10                                          ; +0x13c, 0x8752f8\nPOP             {R4-R8,PC}                                             ; +0x140, 0x8752fc\nMOV             R0, R4                                                 ; +0x144, 0x875300\nADD             SP, SP, #0x10                                          ; +0x148, 0x875304\nPOP             {R4-R8,PC}                                             ; +0x14c, 0x875308\nMOV             R3, #0x77 ; 'w'                                        ; +0x150, 0x87530c\nSTR             R3, [SP,#0x10+var_10]                                  ; +0x154, 0x875310\nLDR             R3, =(aCryptoCmsCmsLi - 0x87532C); \"crypto/cms/cms_lib.c\" ; +0x158, 0x875314\nMOV             R0, #0x2E ; '.'                                        ; +0x15c, 0x875318\nMOV             R1, #0x6E ; 'n'                                        ; +0x160, 0x87531c\nMOV             R2, #0x69 ; 'i'                                        ; +0x164, 0x875320\nADD             R3, PC, R3; \"crypto/cms/cms_lib.c\"                     ; +0x168, 0x875324\nBL              ERR_put_error                                          ; +0x16c, 0x875328\nMOV             R0, R7                                                 ; +0x170, 0x87532c\nB               loc_875254                                             ; +0x174, 0x875330", "xrefs": ["sub_872AE8 @ 0x872b54", "<???> @ 0x69e9c"], "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"}