{"type": "func", "start": 8415748, "end": 8416040, "name": "EVP_PKEY_paramgen", "pseudocode": "// \n// EVP_PKEY_paramgen from 0x806a04 to 0x806b28 (292 bytes)\n// \n// 2 xrefs:\n// > tls_process_key_exchange @ 0x7a33b0\n// > <???> @ 0x5d20c\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_paramgen(_DWORD *a1, int *a2)\n{\n  int (__fastcall *v3)(_DWORD *); // r3\n  int result; // r0\n  int v6; // r4\n  _DWORD *v7; // r1\n\n  if ( !a1 || !*a1 || (v3 = *(int (__fastcall **)(_DWORD *))(*a1 + 24)) == nullptr )\n  {\n    ERR_put_error(6, 148, 150, (int)\"crypto/evp/pmeth_gn.c\", 40);\n    return -2;\n  }\n  if ( a1[4] != 2 )\n  {\n    ERR_put_error(6, 148, 151, (int)\"crypto/evp/pmeth_gn.c\", 45);\n    return -1;\n  }\n  if ( !a2 )\n    return -1;\n  if ( *a2 )\n  {\n    result = v3(a1);\n  }\n  else\n  {\n    v7 = EVP_PKEY_new();\n    *a2 = (int)v7;\n    if ( !v7 )\n    {\n      ERR_put_error(6, 148, 65, (int)\"crypto/evp/pmeth_gn.c\", 56);\n      return -1;\n    }\n    result = (*(int (__fastcall **)(_DWORD *))(*a1 + 24))(a1);\n  }\n  v6 = result;\n  if ( result <= 0 )\n  {\n    EVP_PKEY_free(*a2);\n    *a2 = 0;\n    return v6;\n  }\n  return result;\n}", "assembly": "; \n; EVP_PKEY_paramgen from 0x806a04 to 0x806b28 (292 bytes)\n; \n; 2 xrefs:\n; > tls_process_key_exchange @ 0x7a33b0\n; > <???> @ 0x5d20c\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,R5,LR}                                             ; +0x0, 0x806a04\nSUBS            R4, R0, #0                                             ; +0x4, 0x806a08\nSUB             SP, SP, #0xC                                           ; +0x8, 0x806a0c\nBEQ             loc_806AD0                                             ; +0xc, 0x806a10\nLDR             R3, [R4]                                               ; +0x10, 0x806a14\nCMP             R3, #0                                                 ; +0x14, 0x806a18\nBEQ             loc_806AD0                                             ; +0x18, 0x806a1c\nLDR             R3, [R3,#0x18]                                         ; +0x1c, 0x806a20\nCMP             R3, #0                                                 ; +0x20, 0x806a24\nBEQ             loc_806AD0                                             ; +0x24, 0x806a28\nLDR             R2, [R4,#0x10]                                         ; +0x28, 0x806a2c\nCMP             R2, #2                                                 ; +0x2c, 0x806a30\nBNE             loc_806AA8                                             ; +0x30, 0x806a34\nCMP             R1, #0                                                 ; +0x34, 0x806a38\nMOV             R5, R1                                                 ; +0x38, 0x806a3c\nBEQ             loc_806AF8                                             ; +0x3c, 0x806a40\nLDR             R1, [R1]                                               ; +0x40, 0x806a44\nCMP             R1, #0                                                 ; +0x44, 0x806a48\nBEQ             loc_806A88                                             ; +0x48, 0x806a4c\nMOV             R0, R4                                                 ; +0x4c, 0x806a50\nBLX             R3                                                     ; +0x50, 0x806a54\nSUBS            R4, R0, #0                                             ; +0x54, 0x806a58\nMOVGT           R0, R4                                                 ; +0x58, 0x806a5c\nBLE             loc_806A6C                                             ; +0x5c, 0x806a60\nADD             SP, SP, #0xC                                           ; +0x60, 0x806a64\nPOP             {R4,R5,PC}                                             ; +0x64, 0x806a68\nLDR             R0, [R5]                                               ; +0x68, 0x806a6c\nBL              EVP_PKEY_free                                          ; +0x6c, 0x806a70\nMOV             R3, #0                                                 ; +0x70, 0x806a74\nMOV             R0, R4                                                 ; +0x74, 0x806a78\nSTR             R3, [R5]                                               ; +0x78, 0x806a7c\nADD             SP, SP, #0xC                                           ; +0x7c, 0x806a80\nPOP             {R4,R5,PC}                                             ; +0x80, 0x806a84\nBL              EVP_PKEY_new                                           ; +0x84, 0x806a88\nCMP             R0, #0                                                 ; +0x88, 0x806a8c\nMOV             R1, R0                                                 ; +0x8c, 0x806a90\nSTR             R0, [R5]                                               ; +0x90, 0x806a94\nBEQ             loc_806B00                                             ; +0x94, 0x806a98\nLDR             R3, [R4]                                               ; +0x98, 0x806a9c\nLDR             R3, [R3,#0x18]                                         ; +0x9c, 0x806aa0\nB               loc_806A50                                             ; +0xa0, 0x806aa4\nMOV             R3, #0x2D ; '-'                                        ; +0xa4, 0x806aa8\nSTR             R3, [SP,#0xC+var_C]                                    ; +0xa8, 0x806aac\nLDR             R3, =(aCryptoEvpPmeth_0 - 0x806AC8); \"crypto/evp/pmeth_gn.c\" ; +0xac, 0x806ab0\nMOV             R0, #6                                                 ; +0xb0, 0x806ab4\nMOV             R1, #0x94                                              ; +0xb4, 0x806ab8\nMOV             R2, #0x97                                              ; +0xb8, 0x806abc\nADD             R3, PC, R3; \"crypto/evp/pmeth_gn.c\"                    ; +0xbc, 0x806ac0\nBL              ERR_put_error                                          ; +0xc0, 0x806ac4\nMOV             R0, #0xFFFFFFFF                                        ; +0xc4, 0x806ac8\nB               loc_806A64                                             ; +0xc8, 0x806acc\nMOV             R3, #0x28 ; '('                                        ; +0xcc, 0x806ad0\nSTR             R3, [SP,#0xC+var_C]                                    ; +0xd0, 0x806ad4\nLDR             R3, =(aCryptoEvpPmeth_0 - 0x806AF0); \"crypto/evp/pmeth_gn.c\" ; +0xd4, 0x806ad8\nMOV             R0, #6                                                 ; +0xd8, 0x806adc\nMOV             R1, #0x94                                              ; +0xdc, 0x806ae0\nMOV             R2, #0x96                                              ; +0xe0, 0x806ae4\nADD             R3, PC, R3; \"crypto/evp/pmeth_gn.c\"                    ; +0xe4, 0x806ae8\nBL              ERR_put_error                                          ; +0xe8, 0x806aec\nMOV             R0, #0xFFFFFFFE                                        ; +0xec, 0x806af0\nB               loc_806A64                                             ; +0xf0, 0x806af4\nMOV             R0, #0xFFFFFFFF                                        ; +0xf4, 0x806af8\nB               loc_806A64                                             ; +0xf8, 0x806afc\nMOV             R3, #0x38 ; '8'                                        ; +0xfc, 0x806b00\nSTR             R3, [SP,#0xC+var_C]                                    ; +0x100, 0x806b04\nLDR             R3, =(aCryptoEvpPmeth_0 - 0x806B20); \"crypto/evp/pmeth_gn.c\" ; +0x104, 0x806b08\nMOV             R0, #6                                                 ; +0x108, 0x806b0c\nMOV             R1, #0x94                                              ; +0x10c, 0x806b10\nMOV             R2, #0x41 ; 'A'                                        ; +0x110, 0x806b14\nADD             R3, PC, R3; \"crypto/evp/pmeth_gn.c\"                    ; +0x114, 0x806b18\nBL              ERR_put_error                                          ; +0x118, 0x806b1c\nMOV             R0, #0xFFFFFFFF                                        ; +0x11c, 0x806b20\nB               loc_806A64                                             ; +0x120, 0x806b24", "xrefs": ["tls_process_key_exchange @ 0x7a33b0", "<???> @ 0x5d20c"], "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"}