{"type": "func", "start": 8414336, "end": 8414624, "name": "EVP_PKEY_decrypt", "pseudocode": "// \n// EVP_PKEY_decrypt from 0x806480 to 0x8065a0 (288 bytes)\n// \n// 6 xrefs:\n// > tls_process_client_key_exchange @ 0x7ab78c\n// > sub_8268D4 @ 0x82694c\n// > sub_8268D4 @ 0x826994\n// > CMS_RecipientInfo_decrypt @ 0x8737d0\n// > CMS_RecipientInfo_decrypt @ 0x873814\n// > <???> @ 0x5d67c\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_PKEY_decrypt(int *a1, int a2, unsigned int *a3, int a4, int a5)\n{\n  int v6; // r12\n  unsigned int v10; // r0\n  int (__fastcall *v12)(int *, int, unsigned int *, int, int); // r12\n\n  if ( a1 && (v6 = *a1) != 0 && *(_DWORD *)(v6 + 88) )\n  {\n    if ( a1[4] == 512 )\n    {\n      if ( (*(_DWORD *)(v6 + 4) & 2) == 0 )\n      {\n        v12 = *(int (__fastcall **)(int *, int, unsigned int *, int, int))(v6 + 88);\n        return v12(a1, a2, a3, a4, a5);\n      }\n      v10 = EVP_PKEY_size(a1[2]);\n      if ( !a2 )\n      {\n        *a3 = v10;\n        return 1;\n      }\n      if ( v10 <= *a3 )\n      {\n        v12 = *(int (__fastcall **)(int *, int, unsigned int *, int, int))(*a1 + 88);\n        return v12(a1, a2, a3, a4, a5);\n      }\n      ERR_put_error(6, 104, 155, (int)\"crypto/evp/pmeth_fn.c\", 198);\n      return 0;\n    }\n    else\n    {\n      ERR_put_error(6, 104, 151, (int)\"crypto/evp/pmeth_fn.c\", 195);\n      return -1;\n    }\n  }\n  else\n  {\n    ERR_put_error(6, 104, 150, (int)\"crypto/evp/pmeth_fn.c\", 191);\n    return -2;\n  }\n}", "assembly": "; \n; EVP_PKEY_decrypt from 0x806480 to 0x8065a0 (288 bytes)\n; \n; 6 xrefs:\n; > tls_process_client_key_exchange @ 0x7ab78c\n; > sub_8268D4 @ 0x82694c\n; > sub_8268D4 @ 0x826994\n; > CMS_RecipientInfo_decrypt @ 0x8737d0\n; > CMS_RecipientInfo_decrypt @ 0x873814\n; > <???> @ 0x5d67c\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-R8,LR}                                             ; +0x0, 0x806480\nSUBS            R4, R0, #0                                             ; +0x4, 0x806484\nSUB             SP, SP, #8                                             ; +0x8, 0x806488\nLDR             R8, [SP,#8+arg_0]                                      ; +0xc, 0x80648c\nBEQ             loc_806578                                             ; +0x10, 0x806490\nLDR             R12, [R4]                                              ; +0x14, 0x806494\nCMP             R12, #0                                                ; +0x18, 0x806498\nBEQ             loc_806578                                             ; +0x1c, 0x80649c\nLDR             R0, [R12,#0x58]                                        ; +0x20, 0x8064a0\nCMP             R0, #0                                                 ; +0x24, 0x8064a4\nBEQ             loc_806578                                             ; +0x28, 0x8064a8\nMOV             R6, R2                                                 ; +0x2c, 0x8064ac\nLDR             R2, [R4,#0x10]                                         ; +0x30, 0x8064b0\nCMP             R2, #0x200                                             ; +0x34, 0x8064b4\nBNE             loc_806524                                             ; +0x38, 0x8064b8\nLDR             R2, [R12,#4]                                           ; +0x3c, 0x8064bc\nMOV             R5, R1                                                 ; +0x40, 0x8064c0\nTST             R2, #2                                                 ; +0x44, 0x8064c4\nMOV             R7, R3                                                 ; +0x48, 0x8064c8\nBEQ             loc_806500                                             ; +0x4c, 0x8064cc\nLDR             R0, [R4,#8]                                            ; +0x50, 0x8064d0\nBL              EVP_PKEY_size                                          ; +0x54, 0x8064d4\nCMP             R5, #0                                                 ; +0x58, 0x8064d8\nSTREQ           R0, [R6]                                               ; +0x5c, 0x8064dc\nMOVEQ           R0, #1                                                 ; +0x60, 0x8064e0\nBEQ             loc_806548                                             ; +0x64, 0x8064e4\nLDR             R3, [R6]                                               ; +0x68, 0x8064e8\nCMP             R0, R3                                                 ; +0x6c, 0x8064ec\nBHI             loc_806550                                             ; +0x70, 0x8064f0\nLDR             R3, [R4]                                               ; +0x74, 0x8064f4\nLDR             R12, [R3,#0x58]                                        ; +0x78, 0x8064f8\nB               loc_806504                                             ; +0x7c, 0x8064fc\nMOV             R12, R0                                                ; +0x80, 0x806500\nMOV             R0, R4                                                 ; +0x84, 0x806504\nMOV             R1, R5                                                 ; +0x88, 0x806508\nMOV             R2, R6                                                 ; +0x8c, 0x80650c\nMOV             R3, R7                                                 ; +0x90, 0x806510\nSTR             R8, [SP,#8+arg_0]                                      ; +0x94, 0x806514\nADD             SP, SP, #8                                             ; +0x98, 0x806518\nPOP             {R4-R8,LR}                                             ; +0x9c, 0x80651c\nBX              R12                                                    ; +0xa0, 0x806520\nMOV             R3, #0xC3                                              ; +0xa4, 0x806524\nSTR             R3, [SP,#8+var_8]                                      ; +0xa8, 0x806528\nLDR             R3, =(aCryptoEvpPmeth - 0x806544); \"crypto/evp/pmeth_fn.c\" ; +0xac, 0x80652c\nMOV             R0, #6                                                 ; +0xb0, 0x806530\nMOV             R1, #0x68 ; 'h'                                        ; +0xb4, 0x806534\nMOV             R2, #0x97                                              ; +0xb8, 0x806538\nADD             R3, PC, R3; \"crypto/evp/pmeth_fn.c\"                    ; +0xbc, 0x80653c\nBL              ERR_put_error                                          ; +0xc0, 0x806540\nMOV             R0, #0xFFFFFFFF                                        ; +0xc4, 0x806544\nADD             SP, SP, #8                                             ; +0xc8, 0x806548\nPOP             {R4-R8,PC}                                             ; +0xcc, 0x80654c\nMOV             R3, #0xC6                                              ; +0xd0, 0x806550\nSTR             R3, [SP,#8+var_8]                                      ; +0xd4, 0x806554\nLDR             R3, =(aCryptoEvpPmeth - 0x806570); \"crypto/evp/pmeth_fn.c\" ; +0xd8, 0x806558\nMOV             R0, #6                                                 ; +0xdc, 0x80655c\nMOV             R1, #0x68 ; 'h'                                        ; +0xe0, 0x806560\nMOV             R2, #0x9B                                              ; +0xe4, 0x806564\nADD             R3, PC, R3; \"crypto/evp/pmeth_fn.c\"                    ; +0xe8, 0x806568\nBL              ERR_put_error                                          ; +0xec, 0x80656c\nMOV             R0, #0                                                 ; +0xf0, 0x806570\nB               loc_806548                                             ; +0xf4, 0x806574\nMOV             R3, #0xBF                                              ; +0xf8, 0x806578\nSTR             R3, [SP,#8+var_8]                                      ; +0xfc, 0x80657c\nLDR             R3, =(aCryptoEvpPmeth - 0x806598); \"crypto/evp/pmeth_fn.c\" ; +0x100, 0x806580\nMOV             R0, #6                                                 ; +0x104, 0x806584\nMOV             R1, #0x68 ; 'h'                                        ; +0x108, 0x806588\nMOV             R2, #0x96                                              ; +0x10c, 0x80658c\nADD             R3, PC, R3; \"crypto/evp/pmeth_fn.c\"                    ; +0x110, 0x806590\nBL              ERR_put_error                                          ; +0x114, 0x806594\nMOV             R0, #0xFFFFFFFE                                        ; +0x118, 0x806598\nB               loc_806548                                             ; +0x11c, 0x80659c", "xrefs": ["tls_process_client_key_exchange @ 0x7ab78c", "sub_8268D4 @ 0x82694c", "sub_8268D4 @ 0x826994", "CMS_RecipientInfo_decrypt @ 0x8737d0", "CMS_RecipientInfo_decrypt @ 0x873814", "<???> @ 0x5d67c"], "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"}