{"type": "func", "start": 8869148, "end": 8869316, "name": "CMS_set_detached", "pseudocode": "// \n// CMS_set_detached from 0x87551c to 0x8755c4 (168 bytes)\n// \n// 2 xrefs:\n// > cms_Data_create @ 0x8755ec\n// > <???> @ 0x6a46c\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_set_detached(int *a1, int a2)\n{\n  int *v3; // r0\n  int *v4; // r4\n  int v5; // r5\n\n  v3 = (int *)CMS_get0_content(a1);\n  v4 = v3;\n  if ( !v3 )\n    return 0;\n  if ( a2 )\n  {\n    ASN1_OCTET_STRING_free(*v3);\n    *v4 = 0;\n    return 1;\n  }\n  else\n  {\n    v5 = *v3;\n    if ( *v3 || (v5 = ASN1_OCTET_STRING_new(), (*v4 = v5) != 0) )\n    {\n      *(_DWORD *)(v5 + 12) |= 0x20u;\n      return 1;\n    }\n    else\n    {\n      ERR_put_error(46, 147, 65, (int)\"crypto/cms/cms_lib.c\", 280);\n      return 0;\n    }\n  }\n}", "assembly": "; \n; CMS_set_detached from 0x87551c to 0x8755c4 (168 bytes)\n; \n; 2 xrefs:\n; > cms_Data_create @ 0x8755ec\n; > <???> @ 0x6a46c\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,R5,LR}                                             ; +0x0, 0x87551c\nSUB             SP, SP, #0xC                                           ; +0x4, 0x875520\nMOV             R5, R1                                                 ; +0x8, 0x875524\nBL              CMS_get0_content                                       ; +0xc, 0x875528\nSUBS            R4, R0, #0                                             ; +0x10, 0x87552c\nBEQ             loc_87557C                                             ; +0x14, 0x875530\nCMP             R5, #0                                                 ; +0x18, 0x875534\nBNE             loc_875560                                             ; +0x1c, 0x875538\nLDR             R5, [R4]                                               ; +0x20, 0x87553c\nCMP             R5, #0                                                 ; +0x24, 0x875540\nBEQ             loc_875588                                             ; +0x28, 0x875544\nLDR             R3, [R5,#0xC]                                          ; +0x2c, 0x875548\nMOV             R0, #1                                                 ; +0x30, 0x87554c\nORR             R3, R3, #0x20 ; ' '                                    ; +0x34, 0x875550\nSTR             R3, [R5,#0xC]                                          ; +0x38, 0x875554\nADD             SP, SP, #0xC                                           ; +0x3c, 0x875558\nPOP             {R4,R5,PC}                                             ; +0x40, 0x87555c\nLDR             R0, [R4]                                               ; +0x44, 0x875560\nBL              ASN1_OCTET_STRING_free                                 ; +0x48, 0x875564\nMOV             R3, #0                                                 ; +0x4c, 0x875568\nMOV             R0, #1                                                 ; +0x50, 0x87556c\nSTR             R3, [R4]                                               ; +0x54, 0x875570\nADD             SP, SP, #0xC                                           ; +0x58, 0x875574\nPOP             {R4,R5,PC}                                             ; +0x5c, 0x875578\nMOV             R0, R4                                                 ; +0x60, 0x87557c\nADD             SP, SP, #0xC                                           ; +0x64, 0x875580\nPOP             {R4,R5,PC}                                             ; +0x68, 0x875584\nBL              ASN1_OCTET_STRING_new                                  ; +0x6c, 0x875588\nCMP             R0, #0                                                 ; +0x70, 0x87558c\nMOV             R5, R0                                                 ; +0x74, 0x875590\nSTR             R0, [R4]                                               ; +0x78, 0x875594\nBNE             loc_875548                                             ; +0x7c, 0x875598\nMOV             R3, #0x118                                             ; +0x80, 0x87559c\nSTR             R3, [SP,#0xC+var_C]                                    ; +0x84, 0x8755a0\nLDR             R3, =(aCryptoCmsCmsLi - 0x8755BC); \"crypto/cms/cms_lib.c\" ; +0x88, 0x8755a4\nMOV             R0, #0x2E ; '.'                                        ; +0x8c, 0x8755a8\nMOV             R1, #0x93                                              ; +0x90, 0x8755ac\nMOV             R2, #0x41 ; 'A'                                        ; +0x94, 0x8755b0\nADD             R3, PC, R3; \"crypto/cms/cms_lib.c\"                     ; +0x98, 0x8755b4\nBL              ERR_put_error                                          ; +0x9c, 0x8755b8\nMOV             R0, R5                                                 ; +0xa0, 0x8755bc\nB               loc_875558                                             ; +0xa4, 0x8755c0", "xrefs": ["cms_Data_create @ 0x8755ec", "<???> @ 0x6a46c"], "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"}