{"type": "func", "start": 8418072, "end": 8418404, "name": "EVP_PKEY_CTX_new_id", "pseudocode": "// \n// EVP_PKEY_CTX_new_id from 0x807318 to 0x807464 (332 bytes)\n// \n// 8 xrefs:\n// > ssl_generate_pkey_curve @ 0x78f0bc\n// > ssl_generate_pkey_curve @ 0x78f14c\n// > tls_process_key_exchange @ 0x7a3364\n// > sub_7BA004 @ 0x7ba034\n// > tls1_final_finish_mac @ 0x7bab30\n// > tls1_generate_master_secret @ 0x7bad18\n// > EVP_PKEY_new_mac_key @ 0x806d2c\n// > <???> @ 0x5ae7c\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_CTX_new_id(int a1, _DWORD *a2)\n{\n  int *result; // r0\n  int pkey_meth_engine; // r5\n  int pkey_meth; // r6\n  int v6; // r4\n  int (*v7)(void); // r3\n  bool v8; // cc\n\n  if ( a1 == -1 )\n    return nullptr;\n  pkey_meth_engine = (int)a2;\n  if ( a2 )\n  {\n    if ( !ENGINE_init(a2) )\n    {\n      ERR_put_error(6, 157, 38, (int)\"crypto/evp/pmeth_lib.c\", 97);\n      return nullptr;\n    }\n    goto LABEL_5;\n  }\n  pkey_meth_engine = ENGINE_get_pkey_meth_engine(a1);\n  if ( pkey_meth_engine )\n  {\nLABEL_5:\n    pkey_meth = ENGINE_get_pkey_meth(pkey_meth_engine, a1);\n    goto LABEL_6;\n  }\n  pkey_meth = EVP_PKEY_meth_find(a1);\nLABEL_6:\n  if ( pkey_meth )\n  {\n    result = (int *)CRYPTO_zalloc(40, \"crypto/evp/pmeth_lib.c\", 119);\n    v6 = (int)result;\n    if ( result )\n    {\n      v7 = *(int (**)(void))(pkey_meth + 8);\n      result[1] = pkey_meth_engine;\n      *result = pkey_meth;\n      result[4] = 0;\n      result[2] = 0;\n      if ( v7 )\n      {\n        v8 = v7() <= 0;\n        result = (int *)v6;\n        if ( v8 )\n        {\n          EVP_PKEY_CTX_free(v6);\n          return nullptr;\n        }\n      }\n    }\n    else\n    {\n      ENGINE_finish(pkey_meth_engine);\n      ERR_put_error(6, 157, 65, (int)\"crypto/evp/pmeth_lib.c\", 124);\n      return nullptr;\n    }\n  }\n  else\n  {\n    ERR_put_error(6, 157, 156, (int)\"crypto/evp/pmeth_lib.c\", 115);\n    return nullptr;\n  }\n  return result;\n}", "assembly": "; \n; EVP_PKEY_CTX_new_id from 0x807318 to 0x807464 (332 bytes)\n; \n; 8 xrefs:\n; > ssl_generate_pkey_curve @ 0x78f0bc\n; > ssl_generate_pkey_curve @ 0x78f14c\n; > tls_process_key_exchange @ 0x7a3364\n; > sub_7BA004 @ 0x7ba034\n; > tls1_final_finish_mac @ 0x7bab30\n; > tls1_generate_master_secret @ 0x7bad18\n; > EVP_PKEY_new_mac_key @ 0x806d2c\n; > <???> @ 0x5ae7c\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\nCMN             R0, #1                                                 ; +0x0, 0x807318\nPUSH            {R4-R7,LR}                                             ; +0x4, 0x80731c\nMOV             R6, R0                                                 ; +0x8, 0x807320\nSUB             SP, SP, #0xC                                           ; +0xc, 0x807324\nMOVEQ           R0, #0                                                 ; +0x10, 0x807328\nBEQ             loc_8073B8                                             ; +0x14, 0x80732c\nCMP             R1, #0                                                 ; +0x18, 0x807330\nMOV             R5, R1                                                 ; +0x1c, 0x807334\nBEQ             loc_8073C0                                             ; +0x20, 0x807338\nMOV             R0, R1                                                 ; +0x24, 0x80733c\nBL              ENGINE_init                                            ; +0x28, 0x807340\nSUBS            R4, R0, #0                                             ; +0x2c, 0x807344\nBEQ             loc_8073E8                                             ; +0x30, 0x807348\nMOV             R1, R6                                                 ; +0x34, 0x80734c\nMOV             R0, R5                                                 ; +0x38, 0x807350\nBL              ENGINE_get_pkey_meth                                   ; +0x3c, 0x807354\nMOV             R6, R0                                                 ; +0x40, 0x807358\nCMP             R6, #0                                                 ; +0x44, 0x80735c\nBEQ             loc_807410                                             ; +0x48, 0x807360\nLDR             R7, =(aCryptoEvpPmeth_1 - 0x807374); \"crypto/evp/pmeth_lib.c\" ; +0x4c, 0x807364\nMOV             R0, #0x28 ; '('                                        ; +0x50, 0x807368\nADD             R7, PC, R7; \"crypto/evp/pmeth_lib.c\"                   ; +0x54, 0x80736c\nMOV             R1, R7                                                 ; +0x58, 0x807370\nMOV             R2, #0x77 ; 'w'                                        ; +0x5c, 0x807374\nBL              CRYPTO_zalloc                                          ; +0x60, 0x807378\nSUBS            R4, R0, #0                                             ; +0x64, 0x80737c\nBEQ             loc_807438                                             ; +0x68, 0x807380\nLDR             R3, [R6,#8]                                            ; +0x6c, 0x807384\nMOV             R7, #0                                                 ; +0x70, 0x807388\nCMP             R3, R7                                                 ; +0x74, 0x80738c\nSTR             R5, [R4,#4]                                            ; +0x78, 0x807390\nSTR             R6, [R4]                                               ; +0x7c, 0x807394\nSTR             R7, [R4,#0x10]                                         ; +0x80, 0x807398\nSTR             R7, [R4,#8]                                            ; +0x84, 0x80739c\nMOVEQ           R0, R4                                                 ; +0x88, 0x8073a0\nBEQ             loc_8073B8                                             ; +0x8c, 0x8073a4\nBLX             R3                                                     ; +0x90, 0x8073a8\nCMP             R0, R7                                                 ; +0x94, 0x8073ac\nMOV             R0, R4                                                 ; +0x98, 0x8073b0\nBLE             loc_8073DC                                             ; +0x9c, 0x8073b4\nADD             SP, SP, #0xC                                           ; +0xa0, 0x8073b8\nPOP             {R4-R7,PC}                                             ; +0xa4, 0x8073bc\nBL              ENGINE_get_pkey_meth_engine                            ; +0xa8, 0x8073c0\nSUBS            R5, R0, #0                                             ; +0xac, 0x8073c4\nBNE             loc_80734C                                             ; +0xb0, 0x8073c8\nMOV             R0, R6                                                 ; +0xb4, 0x8073cc\nBL              EVP_PKEY_meth_find                                     ; +0xb8, 0x8073d0\nMOV             R6, R0                                                 ; +0xbc, 0x8073d4\nB               loc_80735C                                             ; +0xc0, 0x8073d8\nBL              EVP_PKEY_CTX_free                                      ; +0xc4, 0x8073dc\nMOV             R0, R7                                                 ; +0xc8, 0x8073e0\nB               loc_8073B8                                             ; +0xcc, 0x8073e4\nMOV             R3, #0x61 ; 'a'                                        ; +0xd0, 0x8073e8\nSTR             R3, [SP,#0xC+var_C]                                    ; +0xd4, 0x8073ec\nLDR             R3, =(aCryptoEvpPmeth_1 - 0x807408); \"crypto/evp/pmeth_lib.c\" ; +0xd8, 0x8073f0\nMOV             R0, #6                                                 ; +0xdc, 0x8073f4\nMOV             R1, #0x9D                                              ; +0xe0, 0x8073f8\nMOV             R2, #0x26 ; '&'                                        ; +0xe4, 0x8073fc\nADD             R3, PC, R3; \"crypto/evp/pmeth_lib.c\"                   ; +0xe8, 0x807400\nBL              ERR_put_error                                          ; +0xec, 0x807404\nMOV             R0, R4                                                 ; +0xf0, 0x807408\nB               loc_8073B8                                             ; +0xf4, 0x80740c\nMOV             R3, #0x73 ; 's'                                        ; +0xf8, 0x807410\nSTR             R3, [SP,#0xC+var_C]                                    ; +0xfc, 0x807414\nLDR             R3, =(aCryptoEvpPmeth_1 - 0x807430); \"crypto/evp/pmeth_lib.c\" ; +0x100, 0x807418\nMOV             R0, #6                                                 ; +0x104, 0x80741c\nMOV             R1, #0x9D                                              ; +0x108, 0x807420\nMOV             R2, #0x9C                                              ; +0x10c, 0x807424\nADD             R3, PC, R3; \"crypto/evp/pmeth_lib.c\"                   ; +0x110, 0x807428\nBL              ERR_put_error                                          ; +0x114, 0x80742c\nMOV             R0, R6                                                 ; +0x118, 0x807430\nB               loc_8073B8                                             ; +0x11c, 0x807434\nMOV             R0, R5                                                 ; +0x120, 0x807438\nBL              ENGINE_finish                                          ; +0x124, 0x80743c\nMOV             R2, #0x7C ; '|'                                        ; +0x128, 0x807440\nSTR             R2, [SP,#0xC+var_C]                                    ; +0x12c, 0x807444\nMOV             R0, #6                                                 ; +0x130, 0x807448\nMOV             R3, R7                                                 ; +0x134, 0x80744c\nMOV             R1, #0x9D                                              ; +0x138, 0x807450\nMOV             R2, #0x41 ; 'A'                                        ; +0x13c, 0x807454\nBL              ERR_put_error                                          ; +0x140, 0x807458\nMOV             R0, R4                                                 ; +0x144, 0x80745c\nB               loc_8073B8                                             ; +0x148, 0x807460", "xrefs": ["ssl_generate_pkey_curve @ 0x78f0bc", "ssl_generate_pkey_curve @ 0x78f14c", "tls_process_key_exchange @ 0x7a3364", "sub_7BA004 @ 0x7ba034", "tls1_final_finish_mac @ 0x7bab30", "tls1_generate_master_secret @ 0x7bad18", "EVP_PKEY_new_mac_key @ 0x806d2c", "<???> @ 0x5ae7c"], "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"}