{"type": "func", "start": 8416184, "end": 8416432, "name": "EVP_PKEY_keygen", "pseudocode": "// \n// EVP_PKEY_keygen from 0x806bb8 to 0x806cb0 (248 bytes)\n// \n// 5 xrefs:\n// > ssl_generate_pkey @ 0x78f04c\n// > ssl_generate_pkey_curve @ 0x78f114\n// > EVP_PKEY_new_mac_key @ 0x806d70\n// > cms_RecipientInfo_kari_init @ 0x874af8\n// > <???> @ 0x5ae3c\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_keygen(_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 + 32)) == nullptr )\n  {\n    ERR_put_error(6, 146, 150, (int)\"crypto/evp/pmeth_gn.c\", 91);\n    return -2;\n  }\n  if ( a1[4] != 4 )\n  {\n    ERR_put_error(6, 146, 151, (int)\"crypto/evp/pmeth_gn.c\", 95);\n    return -1;\n  }\n  if ( !a2 )\n    return -1;\n  if ( *a2 )\n  {\n    result = v3(a1);\n    goto LABEL_8;\n  }\n  v7 = EVP_PKEY_new();\n  *a2 = (int)v7;\n  if ( !v7 )\n    return -1;\n  result = (*(int (__fastcall **)(_DWORD *))(*a1 + 32))(a1);\nLABEL_8:\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_keygen from 0x806bb8 to 0x806cb0 (248 bytes)\n; \n; 5 xrefs:\n; > ssl_generate_pkey @ 0x78f04c\n; > ssl_generate_pkey_curve @ 0x78f114\n; > EVP_PKEY_new_mac_key @ 0x806d70\n; > cms_RecipientInfo_kari_init @ 0x874af8\n; > <???> @ 0x5ae3c\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, 0x806bb8\nSUBS            R4, R0, #0                                             ; +0x4, 0x806bbc\nSUB             SP, SP, #0xC                                           ; +0x8, 0x806bc0\nBEQ             loc_806C88                                             ; +0xc, 0x806bc4\nLDR             R3, [R4]                                               ; +0x10, 0x806bc8\nCMP             R3, #0                                                 ; +0x14, 0x806bcc\nBEQ             loc_806C88                                             ; +0x18, 0x806bd0\nLDR             R3, [R3,#0x20]                                         ; +0x1c, 0x806bd4\nCMP             R3, #0                                                 ; +0x20, 0x806bd8\nBEQ             loc_806C88                                             ; +0x24, 0x806bdc\nLDR             R2, [R4,#0x10]                                         ; +0x28, 0x806be0\nCMP             R2, #4                                                 ; +0x2c, 0x806be4\nBNE             loc_806C60                                             ; +0x30, 0x806be8\nCMP             R1, #0                                                 ; +0x34, 0x806bec\nMOV             R5, R1                                                 ; +0x38, 0x806bf0\nBEQ             loc_806C58                                             ; +0x3c, 0x806bf4\nLDR             R1, [R1]                                               ; +0x40, 0x806bf8\nCMP             R1, #0                                                 ; +0x44, 0x806bfc\nBEQ             loc_806C3C                                             ; +0x48, 0x806c00\nMOV             R0, R4                                                 ; +0x4c, 0x806c04\nBLX             R3                                                     ; +0x50, 0x806c08\nSUBS            R4, R0, #0                                             ; +0x54, 0x806c0c\nMOVGT           R0, R4                                                 ; +0x58, 0x806c10\nBLE             loc_806C20                                             ; +0x5c, 0x806c14\nADD             SP, SP, #0xC                                           ; +0x60, 0x806c18\nPOP             {R4,R5,PC}                                             ; +0x64, 0x806c1c\nLDR             R0, [R5]                                               ; +0x68, 0x806c20\nBL              EVP_PKEY_free                                          ; +0x6c, 0x806c24\nMOV             R3, #0                                                 ; +0x70, 0x806c28\nMOV             R0, R4                                                 ; +0x74, 0x806c2c\nSTR             R3, [R5]                                               ; +0x78, 0x806c30\nADD             SP, SP, #0xC                                           ; +0x7c, 0x806c34\nPOP             {R4,R5,PC}                                             ; +0x80, 0x806c38\nBL              EVP_PKEY_new                                           ; +0x84, 0x806c3c\nCMP             R0, #0                                                 ; +0x88, 0x806c40\nMOV             R1, R0                                                 ; +0x8c, 0x806c44\nSTR             R0, [R5]                                               ; +0x90, 0x806c48\nLDRNE           R3, [R4]                                               ; +0x94, 0x806c4c\nLDRNE           R3, [R3,#0x20]                                         ; +0x98, 0x806c50\nBNE             loc_806C04                                             ; +0x9c, 0x806c54\nMOV             R0, #0xFFFFFFFF                                        ; +0xa0, 0x806c58\nB               loc_806C18                                             ; +0xa4, 0x806c5c\nMOV             R3, #0x5F ; '_'                                        ; +0xa8, 0x806c60\nSTR             R3, [SP,#0xC+var_C]                                    ; +0xac, 0x806c64\nLDR             R3, =(aCryptoEvpPmeth_0 - 0x806C80); \"crypto/evp/pmeth_gn.c\" ; +0xb0, 0x806c68\nMOV             R0, #6                                                 ; +0xb4, 0x806c6c\nMOV             R1, #0x92                                              ; +0xb8, 0x806c70\nMOV             R2, #0x97                                              ; +0xbc, 0x806c74\nADD             R3, PC, R3; \"crypto/evp/pmeth_gn.c\"                    ; +0xc0, 0x806c78\nBL              ERR_put_error                                          ; +0xc4, 0x806c7c\nMOV             R0, #0xFFFFFFFF                                        ; +0xc8, 0x806c80\nB               loc_806C18                                             ; +0xcc, 0x806c84\nMOV             R3, #0x5B ; '['                                        ; +0xd0, 0x806c88\nSTR             R3, [SP,#0xC+var_C]                                    ; +0xd4, 0x806c8c\nLDR             R3, =(aCryptoEvpPmeth_0 - 0x806CA8); \"crypto/evp/pmeth_gn.c\" ; +0xd8, 0x806c90\nMOV             R0, #6                                                 ; +0xdc, 0x806c94\nMOV             R1, #0x92                                              ; +0xe0, 0x806c98\nMOV             R2, #0x96                                              ; +0xe4, 0x806c9c\nADD             R3, PC, R3; \"crypto/evp/pmeth_gn.c\"                    ; +0xe8, 0x806ca0\nBL              ERR_put_error                                          ; +0xec, 0x806ca4\nMOV             R0, #0xFFFFFFFE                                        ; +0xf0, 0x806ca8\nB               loc_806C18                                             ; +0xf4, 0x806cac", "xrefs": ["ssl_generate_pkey @ 0x78f04c", "ssl_generate_pkey_curve @ 0x78f114", "EVP_PKEY_new_mac_key @ 0x806d70", "cms_RecipientInfo_kari_init @ 0x874af8", "<???> @ 0x5ae3c"], "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"}