{"type": "func", "start": 10600216, "end": 10600548, "name": "EVP_PKEY_CTX_new_id", "pseudocode": "// \n// EVP_PKEY_CTX_new_id from 0xa1bf18 to 0xa1c064 (332 bytes)\n// \n// 8 xrefs:\n// > ssl_generate_pkey_curve @ 0x9a3cc0\n// > ssl_generate_pkey_curve @ 0x9a3d50\n// > tls_process_key_exchange @ 0x9b7f68\n// > sub_9CEC08 @ 0x9cec38\n// > tls1_final_finish_mac @ 0x9cf734\n// > tls1_generate_master_secret @ 0x9cf91c\n// > EVP_PKEY_new_mac_key @ 0xa1b92c\n// > <???> @ 0x748fc\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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 12:07:53 +0000\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 0xa1bf18 to 0xa1c064 (332 bytes)\n; \n; 8 xrefs:\n; > ssl_generate_pkey_curve @ 0x9a3cc0\n; > ssl_generate_pkey_curve @ 0x9a3d50\n; > tls_process_key_exchange @ 0x9b7f68\n; > sub_9CEC08 @ 0x9cec38\n; > tls1_final_finish_mac @ 0x9cf734\n; > tls1_generate_master_secret @ 0x9cf91c\n; > EVP_PKEY_new_mac_key @ 0xa1b92c\n; > <???> @ 0x748fc\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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 12:07:53 +0000\n; \nCMN             R0, #1                                                 ; +0x0, 0xa1bf18\nPUSH            {R4-R7,LR}                                             ; +0x4, 0xa1bf1c\nMOV             R6, R0                                                 ; +0x8, 0xa1bf20\nSUB             SP, SP, #0xC                                           ; +0xc, 0xa1bf24\nMOVEQ           R0, #0                                                 ; +0x10, 0xa1bf28\nBEQ             loc_A1BFB8                                             ; +0x14, 0xa1bf2c\nCMP             R1, #0                                                 ; +0x18, 0xa1bf30\nMOV             R5, R1                                                 ; +0x1c, 0xa1bf34\nBEQ             loc_A1BFC0                                             ; +0x20, 0xa1bf38\nMOV             R0, R1                                                 ; +0x24, 0xa1bf3c\nBL              ENGINE_init                                            ; +0x28, 0xa1bf40\nSUBS            R4, R0, #0                                             ; +0x2c, 0xa1bf44\nBEQ             loc_A1BFE8                                             ; +0x30, 0xa1bf48\nMOV             R1, R6                                                 ; +0x34, 0xa1bf4c\nMOV             R0, R5                                                 ; +0x38, 0xa1bf50\nBL              ENGINE_get_pkey_meth                                   ; +0x3c, 0xa1bf54\nMOV             R6, R0                                                 ; +0x40, 0xa1bf58\nCMP             R6, #0                                                 ; +0x44, 0xa1bf5c\nBEQ             loc_A1C010                                             ; +0x48, 0xa1bf60\nLDR             R7, =(aCryptoEvpPmeth_1 - 0xA1BF74); \"crypto/evp/pmeth_lib.c\" ; +0x4c, 0xa1bf64\nMOV             R0, #0x28 ; '('                                        ; +0x50, 0xa1bf68\nADD             R7, PC, R7; \"crypto/evp/pmeth_lib.c\"                   ; +0x54, 0xa1bf6c\nMOV             R1, R7                                                 ; +0x58, 0xa1bf70\nMOV             R2, #0x77 ; 'w'                                        ; +0x5c, 0xa1bf74\nBL              CRYPTO_zalloc                                          ; +0x60, 0xa1bf78\nSUBS            R4, R0, #0                                             ; +0x64, 0xa1bf7c\nBEQ             loc_A1C038                                             ; +0x68, 0xa1bf80\nLDR             R3, [R6,#8]                                            ; +0x6c, 0xa1bf84\nMOV             R7, #0                                                 ; +0x70, 0xa1bf88\nCMP             R3, R7                                                 ; +0x74, 0xa1bf8c\nSTR             R5, [R4,#4]                                            ; +0x78, 0xa1bf90\nSTR             R6, [R4]                                               ; +0x7c, 0xa1bf94\nSTR             R7, [R4,#0x10]                                         ; +0x80, 0xa1bf98\nSTR             R7, [R4,#8]                                            ; +0x84, 0xa1bf9c\nMOVEQ           R0, R4                                                 ; +0x88, 0xa1bfa0\nBEQ             loc_A1BFB8                                             ; +0x8c, 0xa1bfa4\nBLX             R3                                                     ; +0x90, 0xa1bfa8\nCMP             R0, R7                                                 ; +0x94, 0xa1bfac\nMOV             R0, R4                                                 ; +0x98, 0xa1bfb0\nBLE             loc_A1BFDC                                             ; +0x9c, 0xa1bfb4\nADD             SP, SP, #0xC                                           ; +0xa0, 0xa1bfb8\nPOP             {R4-R7,PC}                                             ; +0xa4, 0xa1bfbc\nBL              ENGINE_get_pkey_meth_engine                            ; +0xa8, 0xa1bfc0\nSUBS            R5, R0, #0                                             ; +0xac, 0xa1bfc4\nBNE             loc_A1BF4C                                             ; +0xb0, 0xa1bfc8\nMOV             R0, R6                                                 ; +0xb4, 0xa1bfcc\nBL              EVP_PKEY_meth_find                                     ; +0xb8, 0xa1bfd0\nMOV             R6, R0                                                 ; +0xbc, 0xa1bfd4\nB               loc_A1BF5C                                             ; +0xc0, 0xa1bfd8\nBL              EVP_PKEY_CTX_free                                      ; +0xc4, 0xa1bfdc\nMOV             R0, R7                                                 ; +0xc8, 0xa1bfe0\nB               loc_A1BFB8                                             ; +0xcc, 0xa1bfe4\nMOV             R3, #0x61 ; 'a'                                        ; +0xd0, 0xa1bfe8\nSTR             R3, [SP,#0xC+var_C]                                    ; +0xd4, 0xa1bfec\nLDR             R3, =(aCryptoEvpPmeth_1 - 0xA1C008); \"crypto/evp/pmeth_lib.c\" ; +0xd8, 0xa1bff0\nMOV             R0, #6                                                 ; +0xdc, 0xa1bff4\nMOV             R1, #0x9D                                              ; +0xe0, 0xa1bff8\nMOV             R2, #0x26 ; '&'                                        ; +0xe4, 0xa1bffc\nADD             R3, PC, R3; \"crypto/evp/pmeth_lib.c\"                   ; +0xe8, 0xa1c000\nBL              ERR_put_error                                          ; +0xec, 0xa1c004\nMOV             R0, R4                                                 ; +0xf0, 0xa1c008\nB               loc_A1BFB8                                             ; +0xf4, 0xa1c00c\nMOV             R3, #0x73 ; 's'                                        ; +0xf8, 0xa1c010\nSTR             R3, [SP,#0xC+var_C]                                    ; +0xfc, 0xa1c014\nLDR             R3, =(aCryptoEvpPmeth_1 - 0xA1C030); \"crypto/evp/pmeth_lib.c\" ; +0x100, 0xa1c018\nMOV             R0, #6                                                 ; +0x104, 0xa1c01c\nMOV             R1, #0x9D                                              ; +0x108, 0xa1c020\nMOV             R2, #0x9C                                              ; +0x10c, 0xa1c024\nADD             R3, PC, R3; \"crypto/evp/pmeth_lib.c\"                   ; +0x110, 0xa1c028\nBL              ERR_put_error                                          ; +0x114, 0xa1c02c\nMOV             R0, R6                                                 ; +0x118, 0xa1c030\nB               loc_A1BFB8                                             ; +0x11c, 0xa1c034\nMOV             R0, R5                                                 ; +0x120, 0xa1c038\nBL              ENGINE_finish                                          ; +0x124, 0xa1c03c\nMOV             R2, #0x7C ; '|'                                        ; +0x128, 0xa1c040\nSTR             R2, [SP,#0xC+var_C]                                    ; +0x12c, 0xa1c044\nMOV             R0, #6                                                 ; +0x130, 0xa1c048\nMOV             R3, R7                                                 ; +0x134, 0xa1c04c\nMOV             R1, #0x9D                                              ; +0x138, 0xa1c050\nMOV             R2, #0x41 ; 'A'                                        ; +0x13c, 0xa1c054\nBL              ERR_put_error                                          ; +0x140, 0xa1c058\nMOV             R0, R4                                                 ; +0x144, 0xa1c05c\nB               loc_A1BFB8                                             ; +0x148, 0xa1c060", "xrefs": ["ssl_generate_pkey_curve @ 0x9a3cc0", "ssl_generate_pkey_curve @ 0x9a3d50", "tls_process_key_exchange @ 0x9b7f68", "sub_9CEC08 @ 0x9cec38", "tls1_final_finish_mac @ 0x9cf734", "tls1_generate_master_secret @ 0x9cf91c", "EVP_PKEY_new_mac_key @ 0xa1b92c", "<???> @ 0x748fc"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "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"}