{"type": "func", "start": 8398696, "end": 8398972, "name": "EVP_EncryptFinal_ex", "pseudocode": "// \n// EVP_EncryptFinal_ex from 0x802768 to 0x80287c (276 bytes)\n// \n// 4 xrefs:\n// > EVP_EncryptFinal @ 0x80288c\n// > EVP_CipherFinal_ex @ 0x802e0c\n// > PEM_ASN1_write_bio @ 0x822380\n// > <???> @ 0x6350c\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 EVP_EncryptFinal_ex(_DWORD *a1, int a2, _DWORD *a3)\n{\n  int v3; // r6\n  unsigned int v6; // r7\n  int v7; // r3\n  unsigned int v8; // r0\n  int result; // r0\n  int v11; // r0\n\n  v3 = *a1;\n  if ( (*(_DWORD *)(*a1 + 16) & 0x100000) != 0 )\n  {\n    v11 = (*(int (**)(void))(v3 + 24))();\n    if ( v11 < 0 )\n      return 0;\n    *a3 = v11;\n    return 1;\n  }\n  v6 = *(_DWORD *)(v3 + 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_11:\n    *a3 = 0;\n    return 1;\n  }\n  v7 = a1[23];\n  v8 = a1[3];\n  if ( (v7 & 0x100) != 0 )\n  {\n    if ( v8 )\n    {\n      ERR_put_error(6, 127, 138, (int)\"crypto/evp/evp_enc.c\", 401);\n      return 0;\n    }\n    goto LABEL_11;\n  }\n  if ( v6 > v8 )\n    memset((char *)a1 + v8 + 48, (unsigned __int8)(v6 - v8), v6 - v8);\n  result = (*(int (__fastcall **)(_DWORD *, int, _DWORD *, unsigned int))(v3 + 24))(a1, a2, a1 + 12, v6);\n  if ( result )\n    *a3 = v6;\n  return result;\n}", "assembly": "; \n; EVP_EncryptFinal_ex from 0x802768 to 0x80287c (276 bytes)\n; \n; 4 xrefs:\n; > EVP_EncryptFinal @ 0x80288c\n; > EVP_CipherFinal_ex @ 0x802e0c\n; > PEM_ASN1_write_bio @ 0x822380\n; > <???> @ 0x6350c\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-R9,LR}                                             ; +0x0, 0x802768\nLDR             R6, [R0]                                               ; +0x4, 0x80276c\nSUB             SP, SP, #0xC                                           ; +0x8, 0x802770\nLDR             R3, [R6,#0x10]                                         ; +0xc, 0x802774\nMOV             R5, R0                                                 ; +0x10, 0x802778\nANDS            R4, R3, #0x100000                                      ; +0x14, 0x80277c\nMOV             R8, R2                                                 ; +0x18, 0x802780\nBNE             loc_802810                                             ; +0x1c, 0x802784\nLDR             R7, [R6,#4]                                            ; +0x20, 0x802788\nCMP             R7, #0x20 ; ' '                                        ; +0x24, 0x80278c\nBHI             loc_802864                                             ; +0x28, 0x802790\nCMP             R7, #1                                                 ; +0x2c, 0x802794\nBEQ             loc_8027FC                                             ; +0x30, 0x802798\nLDR             R3, [R0,#0x5C]                                         ; +0x34, 0x80279c\nLDR             R0, [R0,#0xC]                                          ; +0x38, 0x8027a0\nTST             R3, #0x100                                             ; +0x3c, 0x8027a4\nBNE             loc_8027F4                                             ; +0x40, 0x8027a8\nCMP             R7, R0                                                 ; +0x44, 0x8027ac\nMOV             R9, R1                                                 ; +0x48, 0x8027b0\nRSB             R2, R0, R7; size_t                                     ; +0x4c, 0x8027b4\nBLS             loc_8027CC                                             ; +0x50, 0x8027b8\nADD             R0, R0, #0x30 ; '0'                                    ; +0x54, 0x8027bc\nAND             R1, R2, #0xFF; int                                     ; +0x58, 0x8027c0\nADD             R0, R5, R0; void *                                     ; +0x5c, 0x8027c4\nBL              memset                                                 ; +0x60, 0x8027c8\nLDR             R12, [R6,#0x18]                                        ; +0x64, 0x8027cc\nMOV             R1, R9                                                 ; +0x68, 0x8027d0\nMOV             R0, R5                                                 ; +0x6c, 0x8027d4\nADD             R2, R5, #0x30 ; '0'                                    ; +0x70, 0x8027d8\nMOV             R3, R7                                                 ; +0x74, 0x8027dc\nBLX             R12                                                    ; +0x78, 0x8027e0\nCMP             R0, #0                                                 ; +0x7c, 0x8027e4\nSTRNE           R7, [R8]                                               ; +0x80, 0x8027e8\nADD             SP, SP, #0xC                                           ; +0x84, 0x8027ec\nPOP             {R4-R9,PC}                                             ; +0x88, 0x8027f0\nCMP             R0, #0                                                 ; +0x8c, 0x8027f4\nBNE             loc_80283C                                             ; +0x90, 0x8027f8\nMOV             R3, #0                                                 ; +0x94, 0x8027fc\nMOV             R0, #1                                                 ; +0x98, 0x802800\nSTR             R3, [R8]                                               ; +0x9c, 0x802804\nADD             SP, SP, #0xC                                           ; +0xa0, 0x802808\nPOP             {R4-R9,PC}                                             ; +0xa4, 0x80280c\nMOV             R2, #0                                                 ; +0xa8, 0x802810\nLDR             R12, [R6,#0x18]                                        ; +0xac, 0x802814\nMOV             R3, R2                                                 ; +0xb0, 0x802818\nBLX             R12                                                    ; +0xb4, 0x80281c\nCMP             R0, #0                                                 ; +0xb8, 0x802820\nMOVLT           R0, #0                                                 ; +0xbc, 0x802824\nBLT             loc_8027EC                                             ; +0xc0, 0x802828\nSTR             R0, [R8]                                               ; +0xc4, 0x80282c\nMOV             R0, #1                                                 ; +0xc8, 0x802830\nADD             SP, SP, #0xC                                           ; +0xcc, 0x802834\nPOP             {R4-R9,PC}                                             ; +0xd0, 0x802838\nLDR             R3, =0x191                                             ; +0xd4, 0x80283c\nSTR             R3, [SP,#0xC+var_C]                                    ; +0xd8, 0x802840\nLDR             R3, =(aCryptoEvpEvpEn - 0x80285C); \"crypto/evp/evp_enc.c\" ; +0xdc, 0x802844\nMOV             R0, #6                                                 ; +0xe0, 0x802848\nMOV             R1, #0x7F                                              ; +0xe4, 0x80284c\nMOV             R2, #0x8A                                              ; +0xe8, 0x802850\nADD             R3, PC, R3; \"crypto/evp/evp_enc.c\"                     ; +0xec, 0x802854\nBL              ERR_put_error                                          ; +0xf0, 0x802858\nMOV             R0, R4                                                 ; +0xf4, 0x80285c\nB               loc_8027EC                                             ; +0xf8, 0x802860\nLDR             R0, =(aAssertionFaile_37 - 0x802874); \"assertion failed: b <= sizeof ctx->buf\" ; +0xfc, 0x802864\nLDR             R1, =(aCryptoEvpEvpEn - 0x802878); \"crypto/evp/evp_enc.c\" ; +0x100, 0x802868\nADD             R0, PC, R0; \"assertion failed: b <= sizeof ctx->buf\"   ; +0x104, 0x80286c\nADD             R1, PC, R1; \"crypto/evp/evp_enc.c\"                     ; +0x108, 0x802870\nMOV             R2, #0x188                                             ; +0x10c, 0x802874\nBL              OPENSSL_die                                            ; +0x110, 0x802878", "xrefs": ["EVP_EncryptFinal @ 0x80288c", "EVP_CipherFinal_ex @ 0x802e0c", "PEM_ASN1_write_bio @ 0x822380", "<???> @ 0x6350c"], "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"}