{"type": "func", "start": 10584304, "end": 10584672, "name": "EVP_CIPHER_CTX_copy", "pseudocode": "// \n// EVP_CIPHER_CTX_copy from 0xa180f0 to 0xa18260 (368 bytes)\n// \n// 3 xrefs:\n// > CMAC_CTX_copy @ 0x9edcb0\n// > sub_ACA09C @ 0xaca264\n// > <???> @ 0x79aec\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 12:07:50 +0000\n// \n\nint __fastcall EVP_CIPHER_CTX_copy(int *a1, int *a2)\n{\n  _DWORD *v4; // r0\n  int v5; // r2\n  int v6; // r0\n  void *v7; // r6\n  void *v9; // r0\n\n  if ( a2 && *a2 )\n  {\n    v4 = (_DWORD *)a2[1];\n    if ( v4 && !ENGINE_init(v4) )\n    {\n      ERR_put_error(6, 163, 38, (int)\"crypto/evp/evp_enc.c\", 610);\n      return 0;\n    }\n    else\n    {\n      EVP_CIPHER_CTX_reset(a1);\n      memcpy(a1, a2, 0x8Cu);\n      v5 = *a2;\n      if ( a2[24] && (v6 = *(_DWORD *)(v5 + 32)) != 0 )\n      {\n        v9 = (void *)CRYPTO_malloc(v6, \"crypto/evp/evp_enc.c\", 619);\n        v7 = v9;\n        a1[24] = (int)v9;\n        if ( !v9 )\n        {\n          ERR_put_error(6, 163, 65, (int)\"crypto/evp/evp_enc.c\", 621);\n          return (int)v7;\n        }\n        memcpy(v9, (const void *)a2[24], *(_DWORD *)(*a2 + 32));\n        v5 = *a2;\n        if ( (*(_DWORD *)(*a2 + 16) & 0x400) == 0 )\n          return 1;\n      }\n      else if ( (*(_DWORD *)(v5 + 16) & 0x400) == 0 )\n      {\n        return 1;\n      }\n      return (*(int (__fastcall **)(int *, int, _DWORD, int *))(v5 + 44))(a2, 8, 0, a1);\n    }\n  }\n  else\n  {\n    ERR_put_error(6, 163, 111, (int)\"crypto/evp/evp_enc.c\", 604);\n    return 0;\n  }\n}", "assembly": "; \n; EVP_CIPHER_CTX_copy from 0xa180f0 to 0xa18260 (368 bytes)\n; \n; 3 xrefs:\n; > CMAC_CTX_copy @ 0x9edcb0\n; > sub_ACA09C @ 0xaca264\n; > <???> @ 0x79aec\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 12:07:50 +0000\n; \nPUSH            {R4-R7,LR}                                             ; +0x0, 0xa180f0\nSUBS            R4, R1, #0                                             ; +0x4, 0xa180f4\nSUB             SP, SP, #0xC                                           ; +0x8, 0xa180f8\nBEQ             loc_A18210                                             ; +0xc, 0xa180fc\nLDR             R3, [R4]                                               ; +0x10, 0xa18100\nCMP             R3, #0                                                 ; +0x14, 0xa18104\nBEQ             loc_A18210                                             ; +0x18, 0xa18108\nMOV             R5, R0                                                 ; +0x1c, 0xa1810c\nLDR             R0, [R4,#4]                                            ; +0x20, 0xa18110\nCMP             R0, #0                                                 ; +0x24, 0xa18114\nBEQ             loc_A18128                                             ; +0x28, 0xa18118\nBL              ENGINE_init                                            ; +0x2c, 0xa1811c\nSUBS            R6, R0, #0                                             ; +0x30, 0xa18120\nBEQ             loc_A181E4                                             ; +0x34, 0xa18124\nMOV             R0, R5                                                 ; +0x38, 0xa18128\nBL              EVP_CIPHER_CTX_reset                                   ; +0x3c, 0xa1812c\nMOV             R2, #0x8C; size_t                                      ; +0x40, 0xa18130\nMOV             R0, R5; void *                                         ; +0x44, 0xa18134\nMOV             R1, R4; void *                                         ; +0x48, 0xa18138\nBL              memcpy                                                 ; +0x4c, 0xa1813c\nLDR             R3, [R4,#0x60]                                         ; +0x50, 0xa18140\nLDR             R2, [R4]                                               ; +0x54, 0xa18144\nCMP             R3, #0                                                 ; +0x58, 0xa18148\nBEQ             loc_A1815C                                             ; +0x5c, 0xa1814c\nLDR             R0, [R2,#0x20]                                         ; +0x60, 0xa18150\nCMP             R0, #0                                                 ; +0x64, 0xa18154\nBNE             loc_A18198                                             ; +0x68, 0xa18158\nLDR             R3, [R2,#0x10]                                         ; +0x6c, 0xa1815c\nTST             R3, #0x400                                             ; +0x70, 0xa18160\nMOVEQ           R6, #1                                                 ; +0x74, 0xa18164\nBNE             loc_A18178                                             ; +0x78, 0xa18168\nMOV             R0, R6                                                 ; +0x7c, 0xa1816c\nADD             SP, SP, #0xC                                           ; +0x80, 0xa18170\nPOP             {R4-R7,PC}                                             ; +0x84, 0xa18174\nLDR             R12, [R2,#0x2C]                                        ; +0x88, 0xa18178\nMOV             R0, R4                                                 ; +0x8c, 0xa1817c\nMOV             R3, R5                                                 ; +0x90, 0xa18180\nMOV             R1, #8                                                 ; +0x94, 0xa18184\nMOV             R2, #0                                                 ; +0x98, 0xa18188\nADD             SP, SP, #0xC                                           ; +0x9c, 0xa1818c\nPOP             {R4-R7,LR}                                             ; +0xa0, 0xa18190\nBX              R12                                                    ; +0xa4, 0xa18194\nLDR             R7, =(aCryptoEvpEvpEn - 0xA181A8); \"crypto/evp/evp_enc.c\" ; +0xa8, 0xa18198\nLDR             R2, =0x26B                                             ; +0xac, 0xa1819c\nADD             R7, PC, R7; \"crypto/evp/evp_enc.c\"                     ; +0xb0, 0xa181a0\nMOV             R1, R7                                                 ; +0xb4, 0xa181a4\nBL              CRYPTO_malloc                                          ; +0xb8, 0xa181a8\nCMP             R0, #0                                                 ; +0xbc, 0xa181ac\nMOV             R6, R0                                                 ; +0xc0, 0xa181b0\nSTR             R0, [R5,#0x60]                                         ; +0xc4, 0xa181b4\nBEQ             loc_A18240                                             ; +0xc8, 0xa181b8\nLDR             R3, [R4]                                               ; +0xcc, 0xa181bc\nLDR             R1, [R4,#0x60]; void *                                 ; +0xd0, 0xa181c0\nLDR             R2, [R3,#0x20]; size_t                                 ; +0xd4, 0xa181c4\nBL              memcpy                                                 ; +0xd8, 0xa181c8\nLDR             R2, [R4]                                               ; +0xdc, 0xa181cc\nLDR             R3, [R2,#0x10]                                         ; +0xe0, 0xa181d0\nTST             R3, #0x400                                             ; +0xe4, 0xa181d4\nMOVEQ           R6, #1                                                 ; +0xe8, 0xa181d8\nBEQ             loc_A1816C                                             ; +0xec, 0xa181dc\nB               loc_A18178                                             ; +0xf0, 0xa181e0\nLDR             R3, =0x262                                             ; +0xf4, 0xa181e4\nSTR             R3, [SP,#0xC+var_C]                                    ; +0xf8, 0xa181e8\nLDR             R3, =(aCryptoEvpEvpEn - 0xA18204); \"crypto/evp/evp_enc.c\" ; +0xfc, 0xa181ec\nMOV             R0, #6                                                 ; +0x100, 0xa181f0\nMOV             R1, #0xA3                                              ; +0x104, 0xa181f4\nMOV             R2, #0x26 ; '&'                                        ; +0x108, 0xa181f8\nADD             R3, PC, R3; \"crypto/evp/evp_enc.c\"                     ; +0x10c, 0xa181fc\nBL              ERR_put_error                                          ; +0x110, 0xa18200\nMOV             R0, R6                                                 ; +0x114, 0xa18204\nADD             SP, SP, #0xC                                           ; +0x118, 0xa18208\nPOP             {R4-R7,PC}                                             ; +0x11c, 0xa1820c\nMOV             R3, #0x25C                                             ; +0x120, 0xa18210\nSTR             R3, [SP,#0xC+var_C]                                    ; +0x124, 0xa18214\nLDR             R3, =(aCryptoEvpEvpEn - 0xA18230); \"crypto/evp/evp_enc.c\" ; +0x128, 0xa18218\nMOV             R0, #6                                                 ; +0x12c, 0xa1821c\nMOV             R1, #0xA3                                              ; +0x130, 0xa18220\nMOV             R2, #0x6F ; 'o'                                        ; +0x134, 0xa18224\nADD             R3, PC, R3; \"crypto/evp/evp_enc.c\"                     ; +0x138, 0xa18228\nBL              ERR_put_error                                          ; +0x13c, 0xa1822c\nMOV             R6, #0                                                 ; +0x140, 0xa18230\nMOV             R0, R6                                                 ; +0x144, 0xa18234\nADD             SP, SP, #0xC                                           ; +0x148, 0xa18238\nPOP             {R4-R7,PC}                                             ; +0x14c, 0xa1823c\nLDR             R2, =0x26D                                             ; +0x150, 0xa18240\nSTR             R2, [SP,#0xC+var_C]                                    ; +0x154, 0xa18244\nMOV             R3, R7                                                 ; +0x158, 0xa18248\nMOV             R0, #6                                                 ; +0x15c, 0xa1824c\nMOV             R1, #0xA3                                              ; +0x160, 0xa18250\nMOV             R2, #0x41 ; 'A'                                        ; +0x164, 0xa18254\nBL              ERR_put_error                                          ; +0x168, 0xa18258\nB               loc_A1816C                                             ; +0x16c, 0xa1825c", "xrefs": ["CMAC_CTX_copy @ 0x9edcb0", "sub_ACA09C @ 0xaca264", "<???> @ 0x79aec"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}