{"type": "func", "start": 16958792, "end": 16959120, "name": "EVP_PKEY_CTX_new_id", "pseudocode": "// \n// EVP_PKEY_CTX_new_id from 0x102c548 to 0x102c690 (328 bytes)\n// \n// 8 xrefs:\n// > ssl_generate_pkey_curve @ 0xfb6b28\n// > ssl_generate_pkey_curve @ 0xfb6bb4\n// > tls_process_key_exchange @ 0xfc9938\n// > sub_FDECD4 @ 0xfded28\n// > tls1_final_finish_mac @ 0xfdf77c\n// > tls1_generate_master_secret @ 0xfdf950\n// > EVP_PKEY_new_mac_key @ 0x102bfc4\n// > <???> @ 0xec4d0\n// \n// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!\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 13:16:17 +0000\n// \n\n__int64 __fastcall EVP_PKEY_CTX_new_id(unsigned int a1, __int64 a2)\n{\n  __int64 pkey_meth_engine; // x20\n  __int64 pkey_meth; // x21\n  __int64 result; // x0\n  __int64 v6; // x19\n  int (*v7)(void); // x1\n  bool v8; // cc\n\n  pkey_meth_engine = a2;\n  if ( a1 == -1 )\n    return 0;\n  if ( a2 )\n  {\n    if ( !(unsigned int)ENGINE_init(a2) )\n    {\n      ERR_put_error(6, 157, 38, (__int64)\"crypto/evp/pmeth_lib.c\", 97);\n      return 0;\n    }\n    goto LABEL_4;\n  }\n  pkey_meth_engine = ENGINE_get_pkey_meth_engine(a1);\n  if ( pkey_meth_engine )\n  {\nLABEL_4:\n    pkey_meth = ENGINE_get_pkey_meth(pkey_meth_engine, a1);\n    goto LABEL_5;\n  }\n  pkey_meth = EVP_PKEY_meth_find(a1);\nLABEL_5:\n  if ( pkey_meth )\n  {\n    result = CRYPTO_zalloc(80, \"crypto/evp/pmeth_lib.c\", 119);\n    v6 = result;\n    if ( result )\n    {\n      v7 = *(int (**)(void))(pkey_meth + 8);\n      *(_QWORD *)(result + 8) = pkey_meth_engine;\n      *(_QWORD *)result = pkey_meth;\n      *(_DWORD *)(result + 32) = 0;\n      *(_QWORD *)(result + 16) = 0;\n      if ( v7 )\n      {\n        v8 = v7() <= 0;\n        result = v6;\n        if ( v8 )\n        {\n          EVP_PKEY_CTX_free(v6);\n          return 0;\n        }\n      }\n    }\n    else\n    {\n      ENGINE_finish(pkey_meth_engine);\n      ERR_put_error(6, 157, 65, (__int64)\"crypto/evp/pmeth_lib.c\", 124);\n      return 0;\n    }\n  }\n  else\n  {\n    ERR_put_error(6, 157, 156, (__int64)\"crypto/evp/pmeth_lib.c\", 115);\n    return 0;\n  }\n  return result;\n}", "assembly": "; \n; EVP_PKEY_CTX_new_id from 0x102c548 to 0x102c690 (328 bytes)\n; \n; 8 xrefs:\n; > ssl_generate_pkey_curve @ 0xfb6b28\n; > ssl_generate_pkey_curve @ 0xfb6bb4\n; > tls_process_key_exchange @ 0xfc9938\n; > sub_FDECD4 @ 0xfded28\n; > tls1_final_finish_mac @ 0xfdf77c\n; > tls1_generate_master_secret @ 0xfdf950\n; > EVP_PKEY_new_mac_key @ 0x102bfc4\n; > <???> @ 0xec4d0\n; \n; This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!\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 13:16:17 +0000\n; \nSTP             X29, X30, [SP,#-0x30+var_s0]!                          ; +0x0, 0x102c548\nCMN             W0, #1                                                 ; +0x4, 0x102c54c\nMOV             X29, SP                                                ; +0x8, 0x102c550\nSTP             X19, X20, [SP,#var_s10]                                ; +0xc, 0x102c554\nSTP             X21, X22, [SP,#var_s20]                                ; +0x10, 0x102c558\nMOV             W19, W0                                                ; +0x14, 0x102c55c\nMOV             X20, X1                                                ; +0x18, 0x102c560\nB.EQ            loc_102C5E4                                            ; +0x1c, 0x102c564\nCBZ             X1, loc_102C5F8                                        ; +0x20, 0x102c568\nMOV             X0, X1                                                 ; +0x24, 0x102c56c\nBL              ENGINE_init                                            ; +0x28, 0x102c570\nCBZ             W0, loc_102C620                                        ; +0x2c, 0x102c574\nMOV             X0, X20                                                ; +0x30, 0x102c578\nMOV             W1, W19                                                ; +0x34, 0x102c57c\nBL              ENGINE_get_pkey_meth                                   ; +0x38, 0x102c580\nMOV             X21, X0                                                ; +0x3c, 0x102c584\nCBZ             X21, loc_102C644                                       ; +0x40, 0x102c588\nADRP            X22, #aCryptoEvpPmeth_1@PAGE; \"crypto/evp/pmeth_lib.c\" ; +0x44, 0x102c58c\nMOV             X0, #0x50 ; 'P'                                        ; +0x48, 0x102c590\nADD             X22, X22, #aCryptoEvpPmeth_1@PAGEOFF; \"crypto/evp/pmeth_lib.c\" ; +0x4c, 0x102c594\nMOV             W2, #0x77 ; 'w'                                        ; +0x50, 0x102c598\nMOV             X1, X22                                                ; +0x54, 0x102c59c\nBL              CRYPTO_zalloc                                          ; +0x58, 0x102c5a0\nMOV             X19, X0                                                ; +0x5c, 0x102c5a4\nCBZ             X0, loc_102C668                                        ; +0x60, 0x102c5a8\nLDR             X1, [X21,#8]                                           ; +0x64, 0x102c5ac\nSTR             X20, [X0,#8]                                           ; +0x68, 0x102c5b0\nSTR             X21, [X0]                                              ; +0x6c, 0x102c5b4\nSTR             WZR, [X0,#0x20]                                        ; +0x70, 0x102c5b8\nSTR             XZR, [X0,#0x10]                                        ; +0x74, 0x102c5bc\nCBZ             X1, loc_102C5D4                                        ; +0x78, 0x102c5c0\nBLR             X1                                                     ; +0x7c, 0x102c5c4\nCMP             W0, WZR                                                ; +0x80, 0x102c5c8\nMOV             X0, X19                                                ; +0x84, 0x102c5cc\nB.LE            loc_102C614                                            ; +0x88, 0x102c5d0\nLDP             X19, X20, [SP,#var_s10]                                ; +0x8c, 0x102c5d4\nLDP             X21, X22, [SP,#var_s20]                                ; +0x90, 0x102c5d8\nLDP             X29, X30, [SP+var_s0],#0x30                            ; +0x94, 0x102c5dc\nRET                                                                    ; +0x98, 0x102c5e0\nMOV             X0, #0                                                 ; +0x9c, 0x102c5e4\nLDP             X19, X20, [SP,#var_s10]                                ; +0xa0, 0x102c5e8\nLDP             X21, X22, [SP,#var_s20]                                ; +0xa4, 0x102c5ec\nLDP             X29, X30, [SP+var_s0],#0x30                            ; +0xa8, 0x102c5f0\nRET                                                                    ; +0xac, 0x102c5f4\nBL              ENGINE_get_pkey_meth_engine                            ; +0xb0, 0x102c5f8\nMOV             X20, X0                                                ; +0xb4, 0x102c5fc\nCBNZ            X0, loc_102C578                                        ; +0xb8, 0x102c600\nMOV             W0, W19                                                ; +0xbc, 0x102c604\nBL              EVP_PKEY_meth_find                                     ; +0xc0, 0x102c608\nMOV             X21, X0                                                ; +0xc4, 0x102c60c\nB               loc_102C588                                            ; +0xc8, 0x102c610\nBL              EVP_PKEY_CTX_free                                      ; +0xcc, 0x102c614\nMOV             X0, #0                                                 ; +0xd0, 0x102c618\nB               loc_102C5D4                                            ; +0xd4, 0x102c61c\nADRP            X3, #aCryptoEvpPmeth_1@PAGE; \"crypto/evp/pmeth_lib.c\"  ; +0xd8, 0x102c620\nMOV             W0, #6                                                 ; +0xdc, 0x102c624\nMOV             W1, #0x9D                                              ; +0xe0, 0x102c628\nMOV             W2, #0x26 ; '&'                                        ; +0xe4, 0x102c62c\nADD             X3, X3, #aCryptoEvpPmeth_1@PAGEOFF; \"crypto/evp/pmeth_lib.c\" ; +0xe8, 0x102c630\nMOV             W4, #0x61 ; 'a'                                        ; +0xec, 0x102c634\nBL              ERR_put_error                                          ; +0xf0, 0x102c638\nMOV             X0, #0                                                 ; +0xf4, 0x102c63c\nB               loc_102C5D4                                            ; +0xf8, 0x102c640\nADRP            X3, #aCryptoEvpPmeth_1@PAGE; \"crypto/evp/pmeth_lib.c\"  ; +0xfc, 0x102c644\nMOV             W0, #6                                                 ; +0x100, 0x102c648\nMOV             W1, #0x9D                                              ; +0x104, 0x102c64c\nMOV             W2, #0x9C                                              ; +0x108, 0x102c650\nADD             X3, X3, #aCryptoEvpPmeth_1@PAGEOFF; \"crypto/evp/pmeth_lib.c\" ; +0x10c, 0x102c654\nMOV             W4, #0x73 ; 's'                                        ; +0x110, 0x102c658\nBL              ERR_put_error                                          ; +0x114, 0x102c65c\nMOV             X0, X21                                                ; +0x118, 0x102c660\nB               loc_102C5D4                                            ; +0x11c, 0x102c664\nMOV             X0, X20                                                ; +0x120, 0x102c668\nBL              ENGINE_finish                                          ; +0x124, 0x102c66c\nMOV             W0, #6                                                 ; +0x128, 0x102c670\nMOV             W1, #0x9D                                              ; +0x12c, 0x102c674\nMOV             W2, #0x41 ; 'A'                                        ; +0x130, 0x102c678\nMOV             X3, X22                                                ; +0x134, 0x102c67c\nMOV             W4, #0x7C ; '|'                                        ; +0x138, 0x102c680\nBL              ERR_put_error                                          ; +0x13c, 0x102c684\nMOV             X0, X19                                                ; +0x140, 0x102c688\nB               loc_102C5D4                                            ; +0x144, 0x102c68c", "xrefs": ["ssl_generate_pkey_curve @ 0xfb6b28", "ssl_generate_pkey_curve @ 0xfb6bb4", "tls_process_key_exchange @ 0xfc9938", "sub_FDECD4 @ 0xfded28", "tls1_final_finish_mac @ 0xfdf77c", "tls1_generate_master_secret @ 0xfdf950", "EVP_PKEY_new_mac_key @ 0x102bfc4", "<???> @ 0xec4d0"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "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"}