{"type": "func", "start": 14340740, "end": 14341012, "name": "EVP_PKEY_encrypt", "pseudocode": "// \n// EVP_PKEY_encrypt from 0xdad284 to 0xdad394 (272 bytes)\n// \n// 8 xrefs:\n// > sub_D4843C @ 0xd485cc\n// > tls_construct_client_key_exchange @ 0xd4a8e8\n// > tls_construct_client_key_exchange @ 0xd4a908\n// > PKCS7_dataInit @ 0xdcc7f8\n// > PKCS7_dataInit @ 0xdcc834\n// > CMS_RecipientInfo_encrypt @ 0xe1e4e8\n// > CMS_RecipientInfo_encrypt @ 0xe1e52c\n// > <???> @ 0x4e138\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_PKEY_encrypt(__int64 *a1, __int64 a2, _QWORD *a3)\n{\n  __int64 v4; // x5\n  __int64 (__fastcall *v5)(__int64 *); // x0\n  int v6; // w0\n\n  if ( a1 && (v4 = *a1) != 0 && (v5 = *(__int64 (__fastcall **)(__int64 *))(v4 + 152)) != nullptr )\n  {\n    if ( *((_DWORD *)a1 + 8) == 256 )\n    {\n      if ( (*(_DWORD *)(v4 + 4) & 2) != 0 )\n      {\n        v6 = EVP_PKEY_size(a1[2]);\n        if ( a2 )\n        {\n          if ( (unsigned __int64)v6 > *a3 )\n          {\n            ERR_put_error(6, 105, 155, (__int64)\"crypto/evp/pmeth_fn.c\", 164);\n            return 0;\n          }\n          else\n          {\n            return (*(__int64 (__fastcall **)(__int64 *))(*a1 + 152))(a1);\n          }\n        }\n        else\n        {\n          *a3 = v6;\n          return 1;\n        }\n      }\n      else\n      {\n        return v5(a1);\n      }\n    }\n    else\n    {\n      ERR_put_error(6, 105, 151, (__int64)\"crypto/evp/pmeth_fn.c\", 161);\n      return 0xFFFFFFFFLL;\n    }\n  }\n  else\n  {\n    ERR_put_error(6, 105, 150, (__int64)\"crypto/evp/pmeth_fn.c\", 157);\n    return 4294967294LL;\n  }\n}", "assembly": "; \n; EVP_PKEY_encrypt from 0xdad284 to 0xdad394 (272 bytes)\n; \n; 8 xrefs:\n; > sub_D4843C @ 0xd485cc\n; > tls_construct_client_key_exchange @ 0xd4a8e8\n; > tls_construct_client_key_exchange @ 0xd4a908\n; > PKCS7_dataInit @ 0xdcc7f8\n; > PKCS7_dataInit @ 0xdcc834\n; > CMS_RecipientInfo_encrypt @ 0xe1e4e8\n; > CMS_RecipientInfo_encrypt @ 0xe1e52c\n; > <???> @ 0x4e138\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_40]!                                ; +0x0, 0xdad284\nMOV             X29, SP                                                ; +0x4, 0xdad288\nSTR             X19, [SP,#0x40+var_30]                                 ; +0x8, 0xdad28c\nMOV             X19, X0                                                ; +0xc, 0xdad290\nCBZ             X0, loc_DAD370                                         ; +0x10, 0xdad294\nLDR             X5, [X0]                                               ; +0x14, 0xdad298\nCBZ             X5, loc_DAD370                                         ; +0x18, 0xdad29c\nLDR             X0, [X5,#0x98]                                         ; +0x1c, 0xdad2a0\nCBZ             X0, loc_DAD370                                         ; +0x20, 0xdad2a4\nLDR             W6, [X19,#0x20]                                        ; +0x24, 0xdad2a8\nCMP             W6, #0x100                                             ; +0x28, 0xdad2ac\nB.NE            loc_DAD34C                                             ; +0x2c, 0xdad2b0\nLDR             W5, [X5,#4]                                            ; +0x30, 0xdad2b4\nTBZ             W5, #1, loc_DAD304                                     ; +0x34, 0xdad2b8\nLDR             X0, [X19,#0x10]                                        ; +0x38, 0xdad2bc\nSTR             X4, [X29,#0x40+var_20]                                 ; +0x3c, 0xdad2c0\nSTR             X3, [X29,#0x40+var_18]                                 ; +0x40, 0xdad2c4\nSTR             X2, [X29,#0x40+var_10]                                 ; +0x44, 0xdad2c8\nSTR             X1, [X29,#0x40+var_8]                                  ; +0x48, 0xdad2cc\nBL              EVP_PKEY_size                                          ; +0x4c, 0xdad2d0\nLDR             X1, [X29,#0x40+var_8]                                  ; +0x50, 0xdad2d4\nSXTW            X0, W0                                                 ; +0x54, 0xdad2d8\nLDR             X2, [X29,#0x40+var_10]                                 ; +0x58, 0xdad2dc\nLDR             X3, [X29,#0x40+var_18]                                 ; +0x5c, 0xdad2e0\nLDR             X4, [X29,#0x40+var_20]                                 ; +0x60, 0xdad2e4\nCBZ             X1, loc_DAD340                                         ; +0x64, 0xdad2e8\nLDR             X5, [X2]                                               ; +0x68, 0xdad2ec\nCMP             X0, X5                                                 ; +0x6c, 0xdad2f0\nB.HI            loc_DAD31C                                             ; +0x70, 0xdad2f4\nLDR             X0, [X19]                                              ; +0x74, 0xdad2f8\nLDR             X5, [X0,#0x98]                                         ; +0x78, 0xdad2fc\nB               loc_DAD308                                             ; +0x7c, 0xdad300\nMOV             X5, X0                                                 ; +0x80, 0xdad304\nMOV             X0, X19                                                ; +0x84, 0xdad308\nBLR             X5                                                     ; +0x88, 0xdad30c\nLDR             X19, [SP,#0x40+var_30]                                 ; +0x8c, 0xdad310\nLDP             X29, X30, [SP+0x40+var_40],#0x40                       ; +0x90, 0xdad314\nRET                                                                    ; +0x94, 0xdad318\nADRP            X3, #aCryptoEvpPmeth@PAGE; \"crypto/evp/pmeth_fn.c\"     ; +0x98, 0xdad31c\nMOV             W0, #6                                                 ; +0x9c, 0xdad320\nMOV             W1, #0x69 ; 'i'                                        ; +0xa0, 0xdad324\nMOV             W2, #0x9B                                              ; +0xa4, 0xdad328\nADD             X3, X3, #aCryptoEvpPmeth@PAGEOFF; \"crypto/evp/pmeth_fn.c\" ; +0xa8, 0xdad32c\nMOV             W4, #0xA4                                              ; +0xac, 0xdad330\nBL              ERR_put_error                                          ; +0xb0, 0xdad334\nMOV             W0, #0                                                 ; +0xb4, 0xdad338\nB               loc_DAD310                                             ; +0xb8, 0xdad33c\nSTR             X0, [X2]                                               ; +0xbc, 0xdad340\nMOV             W0, #1                                                 ; +0xc0, 0xdad344\nB               loc_DAD310                                             ; +0xc4, 0xdad348\nADRP            X3, #aCryptoEvpPmeth@PAGE; \"crypto/evp/pmeth_fn.c\"     ; +0xc8, 0xdad34c\nMOV             W0, #6                                                 ; +0xcc, 0xdad350\nMOV             W1, #0x69 ; 'i'                                        ; +0xd0, 0xdad354\nMOV             W2, #0x97                                              ; +0xd4, 0xdad358\nADD             X3, X3, #aCryptoEvpPmeth@PAGEOFF; \"crypto/evp/pmeth_fn.c\" ; +0xd8, 0xdad35c\nMOV             W4, #0xA1                                              ; +0xdc, 0xdad360\nBL              ERR_put_error                                          ; +0xe0, 0xdad364\nMOV             W0, #0xFFFFFFFF                                        ; +0xe4, 0xdad368\nB               loc_DAD310                                             ; +0xe8, 0xdad36c\nADRP            X3, #aCryptoEvpPmeth@PAGE; \"crypto/evp/pmeth_fn.c\"     ; +0xec, 0xdad370\nMOV             W0, #6                                                 ; +0xf0, 0xdad374\nMOV             W1, #0x69 ; 'i'                                        ; +0xf4, 0xdad378\nMOV             W2, #0x96                                              ; +0xf8, 0xdad37c\nADD             X3, X3, #aCryptoEvpPmeth@PAGEOFF; \"crypto/evp/pmeth_fn.c\" ; +0xfc, 0xdad380\nMOV             W4, #0x9D                                              ; +0x100, 0xdad384\nBL              ERR_put_error                                          ; +0x104, 0xdad388\nMOV             W0, #0xFFFFFFFE                                        ; +0x108, 0xdad38c\nB               loc_DAD310                                             ; +0x10c, 0xdad390", "xrefs": ["sub_D4843C @ 0xd485cc", "tls_construct_client_key_exchange @ 0xd4a8e8", "tls_construct_client_key_exchange @ 0xd4a908", "PKCS7_dataInit @ 0xdcc7f8", "PKCS7_dataInit @ 0xdcc834", "CMS_RecipientInfo_encrypt @ 0xe1e4e8", "CMS_RecipientInfo_encrypt @ 0xe1e52c", "<???> @ 0x4e138"], "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"}