{"type": "func", "start": 14324588, "end": 14324888, "name": "EVP_EncryptFinal_ex", "pseudocode": "// \n// EVP_EncryptFinal_ex from 0xda936c to 0xda9498 (300 bytes)\n// \n// 4 xrefs:\n// > EVP_EncryptFinal @ 0xda9498\n// > EVP_CipherFinal_ex @ 0xda9c38\n// > PEM_ASN1_write_bio @ 0xdc7d5c\n// > <???> @ 0xb2bd8\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\n__int64 __fastcall EVP_EncryptFinal_ex(__int64 *a1, __int64 a2, unsigned int *a3)\n{\n  __int64 v4; // x6\n  unsigned int v6; // w19\n  unsigned int v7; // w3\n  __int64 result; // x0\n  char v9; // w0\n  __int64 v10; // x4\n  unsigned int v11; // w0\n\n  v4 = *a1;\n  if ( (*(_QWORD *)(*a1 + 16) & 0x100000) != 0 )\n  {\n    v11 = (*(__int64 (__fastcall **)(__int64 *, __int64, _QWORD, _QWORD))(v4 + 32))(a1, a2, 0, 0);\n    if ( (v11 & 0x80000000) != 0 )\n    {\n      return 0;\n    }\n    else\n    {\n      *a3 = v11;\n      return 1;\n    }\n  }\n  else\n  {\n    v6 = *(_DWORD *)(v4 + 4);\n    if ( v6 > 0x20 )\n      OPENSSL_die(\"assertion failed: b <= sizeof ctx->buf\", \"crypto/evp/evp_enc.c\", 392);\n    if ( v6 == 1 )\n    {\nLABEL_6:\n      *a3 = 0;\n      return 1;\n    }\n    v7 = *((_DWORD *)a1 + 5);\n    if ( (a1[14] & 0x100) != 0 )\n    {\n      if ( v7 )\n      {\n        ERR_put_error(6, 127, 138, (__int64)\"crypto/evp/evp_enc.c\", 401);\n        return 0;\n      }\n      goto LABEL_6;\n    }\n    v9 = v6 - v7;\n    if ( v6 > v7 )\n    {\n      do\n      {\n        v10 = (__int64)a1 + v7++;\n        *(_BYTE *)(v10 + 56) = v9;\n      }\n      while ( v6 != v7 );\n    }\n    result = (*(__int64 (__fastcall **)(__int64 *, __int64, __int64 *, _QWORD))(v4 + 32))(a1, a2, a1 + 7, v6);\n    if ( (_DWORD)result )\n      *a3 = v6;\n  }\n  return result;\n}", "assembly": "; \n; EVP_EncryptFinal_ex from 0xda936c to 0xda9498 (300 bytes)\n; \n; 4 xrefs:\n; > EVP_EncryptFinal @ 0xda9498\n; > EVP_CipherFinal_ex @ 0xda9c38\n; > PEM_ASN1_write_bio @ 0xdc7d5c\n; > <???> @ 0xb2bd8\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\nSTP             X29, X30, [SP,#var_30]!                                ; +0x0, 0xda936c\nMOV             X5, X0                                                 ; +0x4, 0xda9370\nMOV             X7, X1                                                 ; +0x8, 0xda9374\nMOV             X29, SP                                                ; +0xc, 0xda9378\nLDR             X6, [X0]                                               ; +0x10, 0xda937c\nSTP             X19, X20, [SP,#0x30+var_20]                            ; +0x14, 0xda9380\nSTR             X21, [SP,#0x30+var_10]                                 ; +0x18, 0xda9384\nMOV             X21, X2                                                ; +0x1c, 0xda9388\nLDR             X3, [X6,#0x10]                                         ; +0x20, 0xda938c\nAND             X20, X3, #0x100000                                     ; +0x24, 0xda9390\nTBNZ            W3, #0x14, loc_DA9428                                  ; +0x28, 0xda9394\nLDR             W19, [X6,#4]                                           ; +0x2c, 0xda9398\nCMP             W19, #0x20 ; ' '                                       ; +0x30, 0xda939c\nB.HI            loc_DA9480                                             ; +0x34, 0xda93a0\nCMP             W19, #1                                                ; +0x38, 0xda93a4\nB.EQ            loc_DA93BC                                             ; +0x3c, 0xda93a8\nLDR             X0, [X0,#0x70]                                         ; +0x40, 0xda93ac\nLDR             W3, [X5,#0x14]                                         ; +0x44, 0xda93b0\nTBZ             W0, #8, loc_DA93D4                                     ; +0x48, 0xda93b4\nCBNZ            W3, loc_DA9454                                         ; +0x4c, 0xda93b8\nSTR             WZR, [X21]                                             ; +0x50, 0xda93bc\nMOV             W0, #1                                                 ; +0x54, 0xda93c0\nLDP             X19, X20, [SP,#0x30+var_20]                            ; +0x58, 0xda93c4\nLDR             X21, [SP,#0x30+var_10]                                 ; +0x5c, 0xda93c8\nLDP             X29, X30, [SP+0x30+var_30],#0x30                       ; +0x60, 0xda93cc\nRET                                                                    ; +0x64, 0xda93d0\nSUB             W0, W19, W3                                            ; +0x68, 0xda93d4\nCMP             W19, W3                                                ; +0x6c, 0xda93d8\nUXTB            W0, W0                                                 ; +0x70, 0xda93dc\nB.LS            loc_DA93F8                                             ; +0x74, 0xda93e0\nADD             X4, X5, W3,UXTW                                        ; +0x78, 0xda93e4\nADD             W3, W3, #1                                             ; +0x7c, 0xda93e8\nSTRB            W0, [X4,#0x38]                                         ; +0x80, 0xda93ec\nCMP             W19, W3                                                ; +0x84, 0xda93f0\nB.NE            loc_DA93E4                                             ; +0x88, 0xda93f4\nLDR             X4, [X6,#0x20]                                         ; +0x8c, 0xda93f8\nMOV             X0, X5                                                 ; +0x90, 0xda93fc\nMOV             X1, X7                                                 ; +0x94, 0xda9400\nADD             X2, X5, #0x38 ; '8'                                    ; +0x98, 0xda9404\nMOV             W3, W19                                                ; +0x9c, 0xda9408\nBLR             X4                                                     ; +0xa0, 0xda940c\nCBZ             W0, loc_DA93C4                                         ; +0xa4, 0xda9410\nSTR             W19, [X21]                                             ; +0xa8, 0xda9414\nLDP             X19, X20, [SP,#0x30+var_20]                            ; +0xac, 0xda9418\nLDR             X21, [SP,#0x30+var_10]                                 ; +0xb0, 0xda941c\nLDP             X29, X30, [SP+0x30+var_30],#0x30                       ; +0xb4, 0xda9420\nRET                                                                    ; +0xb8, 0xda9424\nMOV             X2, #0                                                 ; +0xbc, 0xda9428\nLDR             X4, [X6,#0x20]                                         ; +0xc0, 0xda942c\nMOV             X3, X2                                                 ; +0xc4, 0xda9430\nBLR             X4                                                     ; +0xc8, 0xda9434\nTBNZ            W0, #0x1F, loc_DA9478                                  ; +0xcc, 0xda9438\nSTR             W0, [X21]                                              ; +0xd0, 0xda943c\nMOV             W0, #1                                                 ; +0xd4, 0xda9440\nLDP             X19, X20, [SP,#0x30+var_20]                            ; +0xd8, 0xda9444\nLDR             X21, [SP,#0x30+var_10]                                 ; +0xdc, 0xda9448\nLDP             X29, X30, [SP+0x30+var_30],#0x30                       ; +0xe0, 0xda944c\nRET                                                                    ; +0xe4, 0xda9450\nADRP            X3, #aCryptoEvpEvpEn@PAGE; \"crypto/evp/evp_enc.c\"      ; +0xe8, 0xda9454\nMOV             W0, #6                                                 ; +0xec, 0xda9458\nMOV             W1, #0x7F                                              ; +0xf0, 0xda945c\nMOV             W2, #0x8A                                              ; +0xf4, 0xda9460\nADD             X3, X3, #aCryptoEvpEvpEn@PAGEOFF; \"crypto/evp/evp_enc.c\" ; +0xf8, 0xda9464\nMOV             W4, #0x191                                             ; +0xfc, 0xda9468\nBL              ERR_put_error                                          ; +0x100, 0xda946c\nMOV             W0, W20                                                ; +0x104, 0xda9470\nB               loc_DA93C4                                             ; +0x108, 0xda9474\nMOV             W0, #0                                                 ; +0x10c, 0xda9478\nB               loc_DA93C4                                             ; +0x110, 0xda947c\nADRP            X0, #aAssertionFaile_37@PAGE; \"assertion failed: b <= sizeof ctx->buf\" ; +0x114, 0xda9480\nADRP            X1, #aCryptoEvpEvpEn@PAGE; \"crypto/evp/evp_enc.c\"      ; +0x118, 0xda9484\nADD             X0, X0, #aAssertionFaile_37@PAGEOFF; \"assertion failed: b <= sizeof ctx->buf\" ; +0x11c, 0xda9488\nADD             X1, X1, #aCryptoEvpEvpEn@PAGEOFF; \"crypto/evp/evp_enc.c\" ; +0x120, 0xda948c\nMOV             W2, #0x188                                             ; +0x124, 0xda9490\nBL              OPENSSL_die                                            ; +0x128, 0xda9494", "xrefs": ["EVP_EncryptFinal @ 0xda9498", "EVP_CipherFinal_ex @ 0xda9c38", "PEM_ASN1_write_bio @ 0xdc7d5c", "<???> @ 0xb2bd8"], "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"}