{"type": "func", "start": 8787216, "end": 8787408, "name": "ASN1_item_i2d_bio", "pseudocode": "// \n// ASN1_item_i2d_bio from 0x861510 to 0x8615d0 (192 bytes)\n// \n// 12 xrefs:\n// > i2d_PKCS12_bio @ 0x8264e0\n// > i2d_X509_bio @ 0x84837c\n// > i2d_X509_CRL_bio @ 0x8483dc\n// > i2d_PKCS7_bio @ 0x84843c\n// > i2d_X509_REQ_bio @ 0x84849c\n// > i2d_RSAPrivateKey_bio @ 0x848570\n// > i2d_RSAPublicKey_bio @ 0x8485cc\n// > ASN1_item_i2d_fp @ 0x861618\n// > i2d_CMS_bio @ 0x87429c\n// > OCSP_REQ_CTX_i2d @ 0x8b90f4\n// > i2d_ASN1_bio_stream @ 0x8c60d0\n// > <???> @ 0x659ac\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 ASN1_item_i2d_bio(unsigned __int8 *a1, int a2, size_t *a3)\n{\n  int v3; // r5\n  int v5; // r0\n  void *v6; // r6\n  int v7; // r4\n  int v8; // r0\n  int v9; // r6\n  void *v11; // [sp+Ch] [bp-8h] BYREF\n\n  v3 = 0;\n  v11 = nullptr;\n  v5 = ASN1_item_i2d(a3, (int *)&v11, a1);\n  v6 = v11;\n  v7 = v5;\n  if ( v11 )\n  {\n    while ( 1 )\n    {\n      v8 = BIO_write(a2, (int)v6 + v3, v7);\n      if ( v8 == v7 )\n      {\n        v9 = 1;\n        goto LABEL_7;\n      }\n      if ( v8 <= 0 )\n        break;\n      v6 = v11;\n      v3 += v8;\n      v7 -= v8;\n    }\n    v9 = 0;\nLABEL_7:\n    CRYPTO_free(v11, (int)\"crypto/asn1/a_i2d_fp.c\", 106);\n    return v9;\n  }\n  else\n  {\n    ERR_put_error(13, 192, 65, (int)\"crypto/asn1/a_i2d_fp.c\", 91);\n    return 0;\n  }\n}", "assembly": "; \n; ASN1_item_i2d_bio from 0x861510 to 0x8615d0 (192 bytes)\n; \n; 12 xrefs:\n; > i2d_PKCS12_bio @ 0x8264e0\n; > i2d_X509_bio @ 0x84837c\n; > i2d_X509_CRL_bio @ 0x8483dc\n; > i2d_PKCS7_bio @ 0x84843c\n; > i2d_X509_REQ_bio @ 0x84849c\n; > i2d_RSAPrivateKey_bio @ 0x848570\n; > i2d_RSAPublicKey_bio @ 0x8485cc\n; > ASN1_item_i2d_fp @ 0x861618\n; > i2d_CMS_bio @ 0x87429c\n; > OCSP_REQ_CTX_i2d @ 0x8b90f4\n; > i2d_ASN1_bio_stream @ 0x8c60d0\n; > <???> @ 0x659ac\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-R7,LR}                                             ; +0x0, 0x861510\nSUB             SP, SP, #0x14                                          ; +0x4, 0x861514\nMOV             R12, R0                                                ; +0x8, 0x861518\nADD             R3, SP, #0x14+var_4                                    ; +0xc, 0x86151c\nMOV             R5, #0                                                 ; +0x10, 0x861520\nMOV             R0, R2                                                 ; +0x14, 0x861524\nSTR             R5, [R3,#-4]!                                          ; +0x18, 0x861528\nMOV             R7, R1                                                 ; +0x1c, 0x86152c\nMOV             R2, R12                                                ; +0x20, 0x861530\nMOV             R1, R3                                                 ; +0x24, 0x861534\nBL              ASN1_item_i2d                                          ; +0x28, 0x861538\nLDR             R6, [SP,#0x14+var_8]                                   ; +0x2c, 0x86153c\nCMP             R6, R5                                                 ; +0x30, 0x861540\nMOV             R4, R0                                                 ; +0x34, 0x861544\nBNE             loc_861564                                             ; +0x38, 0x861548\nB               loc_8615A8                                             ; +0x3c, 0x86154c\nCMP             R0, #0                                                 ; +0x40, 0x861550\nBLE             loc_8615A0                                             ; +0x44, 0x861554\nLDR             R6, [SP,#0x14+var_8]                                   ; +0x48, 0x861558\nADD             R5, R5, R0                                             ; +0x4c, 0x86155c\nRSB             R4, R0, R4                                             ; +0x50, 0x861560\nADD             R1, R6, R5                                             ; +0x54, 0x861564\nMOV             R0, R7                                                 ; +0x58, 0x861568\nMOV             R2, R4                                                 ; +0x5c, 0x86156c\nBL              BIO_write                                              ; +0x60, 0x861570\nCMP             R0, R4                                                 ; +0x64, 0x861574\nBNE             loc_861550                                             ; +0x68, 0x861578\nMOV             R6, #1                                                 ; +0x6c, 0x86157c\nLDR             R1, =(aCryptoAsn1AI2d - 0x861590); \"crypto/asn1/a_i2d_fp.c\" ; +0x70, 0x861580\nLDR             R0, [SP,#0x14+var_8]                                   ; +0x74, 0x861584\nADD             R1, PC, R1; \"crypto/asn1/a_i2d_fp.c\"                   ; +0x78, 0x861588\nMOV             R2, #0x6A ; 'j'                                        ; +0x7c, 0x86158c\nBL              CRYPTO_free                                            ; +0x80, 0x861590\nMOV             R0, R6                                                 ; +0x84, 0x861594\nADD             SP, SP, #0x14                                          ; +0x88, 0x861598\nPOP             {R4-R7,PC}                                             ; +0x8c, 0x86159c\nMOV             R6, #0                                                 ; +0x90, 0x8615a0\nB               loc_861580                                             ; +0x94, 0x8615a4\nMOV             R3, #0x5B ; '['                                        ; +0x98, 0x8615a8\nSTR             R3, [SP,#0x14+var_14]                                  ; +0x9c, 0x8615ac\nLDR             R3, =(aCryptoAsn1AI2d - 0x8615C8); \"crypto/asn1/a_i2d_fp.c\" ; +0xa0, 0x8615b0\nMOV             R0, #0xD                                               ; +0xa4, 0x8615b4\nMOV             R1, #0xC0                                              ; +0xa8, 0x8615b8\nMOV             R2, #0x41 ; 'A'                                        ; +0xac, 0x8615bc\nADD             R3, PC, R3; \"crypto/asn1/a_i2d_fp.c\"                   ; +0xb0, 0x8615c0\nBL              ERR_put_error                                          ; +0xb4, 0x8615c4\nMOV             R0, R6                                                 ; +0xb8, 0x8615c8\nB               loc_861598                                             ; +0xbc, 0x8615cc", "xrefs": ["i2d_PKCS12_bio @ 0x8264e0", "i2d_X509_bio @ 0x84837c", "i2d_X509_CRL_bio @ 0x8483dc", "i2d_PKCS7_bio @ 0x84843c", "i2d_X509_REQ_bio @ 0x84849c", "i2d_RSAPrivateKey_bio @ 0x848570", "i2d_RSAPublicKey_bio @ 0x8485cc", "ASN1_item_i2d_fp @ 0x861618", "i2d_CMS_bio @ 0x87429c", "OCSP_REQ_CTX_i2d @ 0x8b90f4", "i2d_ASN1_bio_stream @ 0x8c60d0", "<???> @ 0x659ac"], "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"}