{"type": "func", "start": 8868000, "end": 8868276, "name": "CMS_dataInit", "pseudocode": "// \n// CMS_dataInit from 0x8750a0 to 0x8751b4 (276 bytes)\n// \n// 2 xrefs:\n// > sub_872AE8 @ 0x872b38\n// > <???> @ 0x69e8c\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_dataInit(int *a1, int *a2)\n{\n  int *v4; // r6\n  int *result; // r0\n  int *v6; // r0\n\n  if ( a2 )\n  {\n    v4 = a2;\n  }\n  else\n  {\n    v6 = cms_content_bio(a1);\n    v4 = v6;\n    if ( !v6 )\n    {\n      ERR_put_error(46, 111, 127, (int)\"crypto/cms/cms_lib.c\", 64);\n      return nullptr;\n    }\n  }\n  switch ( (unsigned int)OBJ_obj2nid(*a1) )\n  {\n    case 0x15u:\n      return v4;\n    case 0x16u:\n      result = (int *)cms_SignedData_init_bio(a1);\n      goto LABEL_8;\n    case 0x17u:\n      result = (int *)cms_EnvelopedData_init_bio((int)a1);\n      if ( !result )\n        goto LABEL_11;\n      goto LABEL_9;\n    case 0x19u:\n      result = (int *)cms_DigestedData_init_bio(a1);\n      goto LABEL_8;\n    case 0x1Au:\n      result = (int *)cms_EncryptedData_init_bio(a1);\nLABEL_8:\n      if ( result )\n      {\nLABEL_9:\n        result = BIO_push(result, (int)v4);\n      }\n      else\n      {\nLABEL_11:\n        if ( !a2 )\n        {\n          BIO_free(v4);\n          result = nullptr;\n        }\n      }\n      break;\n    default:\n      ERR_put_error(46, 111, 156, (int)\"crypto/cms/cms_lib.c\", 94);\n      result = nullptr;\n      break;\n  }\n  return result;\n}", "assembly": "; \n; CMS_dataInit from 0x8750a0 to 0x8751b4 (276 bytes)\n; \n; 2 xrefs:\n; > sub_872AE8 @ 0x872b38\n; > <???> @ 0x69e8c\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, 0x8750a0\nSUBS            R5, R1, #0                                             ; +0x4, 0x8750a4\nSUB             SP, SP, #8                                             ; +0x8, 0x8750a8\nMOV             R4, R0                                                 ; +0xc, 0x8750ac\nMOVNE           R6, R5                                                 ; +0x10, 0x8750b0\nBEQ             loc_875180                                             ; +0x14, 0x8750b4\nLDR             R0, [R4]                                               ; +0x18, 0x8750b8\nBL              OBJ_obj2nid                                            ; +0x1c, 0x8750bc\nSUB             R0, R0, #0x15                                          ; +0x20, 0x8750c0\nCMP             R0, #5; switch 6 cases                                 ; +0x24, 0x8750c4\nADDLS           PC, PC, R0,LSL#2; switch jump                          ; +0x28, 0x8750c8\nB               def_8750C8; jumptable 008750C8 default case, case 3    ; +0x2c, 0x8750cc\nB               loc_8750E8; jumptable 008750C8 case 0                  ; +0x30, 0x8750d0\nB               loc_8750F4; jumptable 008750C8 case 1                  ; +0x34, 0x8750d4\nB               loc_875114; jumptable 008750C8 case 2                  ; +0x38, 0x8750d8\nB               def_8750C8; jumptable 008750C8 default case, case 3    ; +0x3c, 0x8750dc\nB               loc_87513C; jumptable 008750C8 case 4                  ; +0x40, 0x8750e0\nB               loc_875148; jumptable 008750C8 case 5                  ; +0x44, 0x8750e4\nMOV             R0, R6; jumptable 008750C8 case 0                      ; +0x48, 0x8750e8\nADD             SP, SP, #8                                             ; +0x4c, 0x8750ec\nPOP             {R4-R6,PC}                                             ; +0x50, 0x8750f0\nMOV             R0, R4; jumptable 008750C8 case 1                      ; +0x54, 0x8750f4\nBL              cms_SignedData_init_bio                                ; +0x58, 0x8750f8\nCMP             R0, #0                                                 ; +0x5c, 0x8750fc\nBEQ             loc_875124                                             ; +0x60, 0x875100\nMOV             R1, R6                                                 ; +0x64, 0x875104\nADD             SP, SP, #8                                             ; +0x68, 0x875108\nPOP             {R4-R6,LR}                                             ; +0x6c, 0x87510c\nB               BIO_push                                               ; +0x70, 0x875110\nMOV             R0, R4; jumptable 008750C8 case 2                      ; +0x74, 0x875114\nBL              cms_EnvelopedData_init_bio                             ; +0x78, 0x875118\nCMP             R0, #0                                                 ; +0x7c, 0x87511c\nBNE             loc_875104                                             ; +0x80, 0x875120\nCMP             R5, #0                                                 ; +0x84, 0x875124\nBNE             loc_8750EC                                             ; +0x88, 0x875128\nMOV             R0, R6                                                 ; +0x8c, 0x87512c\nBL              BIO_free                                               ; +0x90, 0x875130\nMOV             R0, R5                                                 ; +0x94, 0x875134\nB               loc_8750EC                                             ; +0x98, 0x875138\nMOV             R0, R4; jumptable 008750C8 case 4                      ; +0x9c, 0x87513c\nBL              cms_DigestedData_init_bio                              ; +0xa0, 0x875140\nB               loc_8750FC                                             ; +0xa4, 0x875144\nMOV             R0, R4; jumptable 008750C8 case 5                      ; +0xa8, 0x875148\nBL              cms_EncryptedData_init_bio                             ; +0xac, 0x87514c\nB               loc_8750FC                                             ; +0xb0, 0x875150\nMOV             R3, #0x5E ; '^'; jumptable 008750C8 default case, case 3 ; +0xb4, 0x875154\nSTR             R3, [SP,#8+var_8]                                      ; +0xb8, 0x875158\nLDR             R3, =(aCryptoCmsCmsLi - 0x875174); \"crypto/cms/cms_lib.c\" ; +0xbc, 0x87515c\nMOV             R0, #0x2E ; '.'                                        ; +0xc0, 0x875160\nMOV             R1, #0x6F ; 'o'                                        ; +0xc4, 0x875164\nMOV             R2, #0x9C                                              ; +0xc8, 0x875168\nADD             R3, PC, R3; \"crypto/cms/cms_lib.c\"                     ; +0xcc, 0x87516c\nBL              ERR_put_error                                          ; +0xd0, 0x875170\nMOV             R0, #0                                                 ; +0xd4, 0x875174\nADD             SP, SP, #8                                             ; +0xd8, 0x875178\nPOP             {R4-R6,PC}                                             ; +0xdc, 0x87517c\nBL              cms_content_bio                                        ; +0xe0, 0x875180\nSUBS            R6, R0, #0                                             ; +0xe4, 0x875184\nBNE             loc_8750B8                                             ; +0xe8, 0x875188\nMOV             R3, #0x40 ; '@'                                        ; +0xec, 0x87518c\nSTR             R3, [SP,#8+var_8]                                      ; +0xf0, 0x875190\nLDR             R3, =(aCryptoCmsCmsLi - 0x8751AC); \"crypto/cms/cms_lib.c\" ; +0xf4, 0x875194\nMOV             R0, #0x2E ; '.'                                        ; +0xf8, 0x875198\nMOV             R1, #0x6F ; 'o'                                        ; +0xfc, 0x87519c\nMOV             R2, #0x7F                                              ; +0x100, 0x8751a0\nADD             R3, PC, R3; \"crypto/cms/cms_lib.c\"                     ; +0x104, 0x8751a4\nBL              ERR_put_error                                          ; +0x108, 0x8751a8\nMOV             R0, R6                                                 ; +0x10c, 0x8751ac\nB               loc_8750EC                                             ; +0x110, 0x8751b0", "xrefs": ["sub_872AE8 @ 0x872b38", "<???> @ 0x69e8c"], "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"}