{"type": "func", "start": 14331056, "end": 14331300, "name": "EVP_PKEY2PKCS8", "pseudocode": "// \n// EVP_PKEY2PKCS8 from 0xdaacb0 to 0xdaada4 (244 bytes)\n// \n// 5 xrefs:\n// > i2d_PKCS8PrivateKeyInfo_fp @ 0xdf04a0\n// > i2d_PKCS8PrivateKeyInfo_bio @ 0xdf0584\n// > i2d_PrivateKey @ 0xe0f5ec\n// > sub_E64EF8 @ 0xe64f34\n// > <???> @ 0xb04c0\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\n__int64 __fastcall EVP_PKEY2PKCS8(__int64 a1)\n{\n  __int64 v2; // x19\n  __int64 v3; // x2\n  unsigned int (*v4)(void); // x2\n\n  v2 = PKCS8_PRIV_KEY_INFO_new();\n  if ( !v2 )\n  {\n    ERR_put_error(6, 113, 65, (__int64)\"crypto/evp/evp_pkey.c\", 65);\n    return 0;\n  }\n  v3 = *(_QWORD *)(a1 + 16);\n  if ( !v3 )\n  {\n    ERR_put_error(6, 113, 118, (__int64)\"crypto/evp/evp_pkey.c\", 80);\n    goto LABEL_8;\n  }\n  v4 = *(unsigned int (**)(void))(v3 + 72);\n  if ( !v4 )\n  {\n    ERR_put_error(6, 113, 144, (__int64)\"crypto/evp/evp_pkey.c\", 76);\n    goto LABEL_8;\n  }\n  if ( !v4() )\n  {\n    ERR_put_error(6, 113, 146, (__int64)\"crypto/evp/evp_pkey.c\", 72);\nLABEL_8:\n    PKCS8_PRIV_KEY_INFO_free(v2);\n    return 0;\n  }\n  RAND_add(*(_QWORD *)(*(_QWORD *)(v2 + 16) + 8LL), **(unsigned int **)(v2 + 16), 0.0);\n  return v2;\n}", "assembly": "; \n; EVP_PKEY2PKCS8 from 0xdaacb0 to 0xdaada4 (244 bytes)\n; \n; 5 xrefs:\n; > i2d_PKCS8PrivateKeyInfo_fp @ 0xdf04a0\n; > i2d_PKCS8PrivateKeyInfo_bio @ 0xdf0584\n; > i2d_PrivateKey @ 0xe0f5ec\n; > sub_E64EF8 @ 0xe64f34\n; > <???> @ 0xb04c0\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\nSTP             X29, X30, [SP,#-0x20+var_s0]!                          ; +0x0, 0xdaacb0\nMOV             X29, SP                                                ; +0x4, 0xdaacb4\nSTP             X19, X20, [SP,#var_s10]                                ; +0x8, 0xdaacb8\nMOV             X20, X0                                                ; +0xc, 0xdaacbc\nBL              PKCS8_PRIV_KEY_INFO_new                                ; +0x10, 0xdaacc0\nMOV             X19, X0                                                ; +0x14, 0xdaacc4\nCBZ             X0, loc_DAAD60                                         ; +0x18, 0xdaacc8\nLDR             X2, [X20,#0x10]                                        ; +0x1c, 0xdaaccc\nCBZ             X2, loc_DAAD84                                         ; +0x20, 0xdaacd0\nLDR             X2, [X2,#0x48]                                         ; +0x24, 0xdaacd4\nCBZ             X2, loc_DAAD40                                         ; +0x28, 0xdaacd8\nMOV             X1, X20                                                ; +0x2c, 0xdaacdc\nBLR             X2                                                     ; +0x30, 0xdaace0\nCBZ             W0, loc_DAAD0C                                         ; +0x34, 0xdaace4\nLDR             X1, [X19,#0x10]                                        ; +0x38, 0xdaace8\nFMOV            D0, XZR                                                ; +0x3c, 0xdaacec\nLDR             X0, [X1,#8]                                            ; +0x40, 0xdaacf0\nLDR             W1, [X1]                                               ; +0x44, 0xdaacf4\nBL              RAND_add                                               ; +0x48, 0xdaacf8\nMOV             X0, X19                                                ; +0x4c, 0xdaacfc\nLDP             X19, X20, [SP,#var_s10]                                ; +0x50, 0xdaad00\nLDP             X29, X30, [SP+var_s0],#0x20                            ; +0x54, 0xdaad04\nRET                                                                    ; +0x58, 0xdaad08\nADRP            X3, #aCryptoEvpEvpPk@PAGE; \"crypto/evp/evp_pkey.c\"     ; +0x5c, 0xdaad0c\nMOV             W0, #6                                                 ; +0x60, 0xdaad10\nMOV             W1, #0x71 ; 'q'                                        ; +0x64, 0xdaad14\nMOV             W2, #0x92                                              ; +0x68, 0xdaad18\nADD             X3, X3, #aCryptoEvpEvpPk@PAGEOFF; \"crypto/evp/evp_pkey.c\" ; +0x6c, 0xdaad1c\nMOV             W4, #0x48 ; 'H'                                        ; +0x70, 0xdaad20\nBL              ERR_put_error                                          ; +0x74, 0xdaad24\nMOV             X0, X19                                                ; +0x78, 0xdaad28\nBL              PKCS8_PRIV_KEY_INFO_free                               ; +0x7c, 0xdaad2c\nMOV             X0, #0                                                 ; +0x80, 0xdaad30\nLDP             X19, X20, [SP,#var_s10]                                ; +0x84, 0xdaad34\nLDP             X29, X30, [SP+var_s0],#0x20                            ; +0x88, 0xdaad38\nRET                                                                    ; +0x8c, 0xdaad3c\nADRP            X3, #aCryptoEvpEvpPk@PAGE; \"crypto/evp/evp_pkey.c\"     ; +0x90, 0xdaad40\nMOV             W0, #6                                                 ; +0x94, 0xdaad44\nMOV             W1, #0x71 ; 'q'                                        ; +0x98, 0xdaad48\nMOV             W2, #0x90                                              ; +0x9c, 0xdaad4c\nADD             X3, X3, #aCryptoEvpEvpPk@PAGEOFF; \"crypto/evp/evp_pkey.c\" ; +0xa0, 0xdaad50\nMOV             W4, #0x4C ; 'L'                                        ; +0xa4, 0xdaad54\nBL              ERR_put_error                                          ; +0xa8, 0xdaad58\nB               loc_DAAD28                                             ; +0xac, 0xdaad5c\nMOV             W2, #0x41 ; 'A'                                        ; +0xb0, 0xdaad60\nADRP            X3, #aCryptoEvpEvpPk@PAGE; \"crypto/evp/evp_pkey.c\"     ; +0xb4, 0xdaad64\nMOV             W0, #6                                                 ; +0xb8, 0xdaad68\nMOV             W1, #0x71 ; 'q'                                        ; +0xbc, 0xdaad6c\nADD             X3, X3, #aCryptoEvpEvpPk@PAGEOFF; \"crypto/evp/evp_pkey.c\" ; +0xc0, 0xdaad70\nMOV             W4, W2                                                 ; +0xc4, 0xdaad74\nBL              ERR_put_error                                          ; +0xc8, 0xdaad78\nMOV             X0, X19                                                ; +0xcc, 0xdaad7c\nB               loc_DAAD00                                             ; +0xd0, 0xdaad80\nADRP            X3, #aCryptoEvpEvpPk@PAGE; \"crypto/evp/evp_pkey.c\"     ; +0xd4, 0xdaad84\nMOV             W0, #6                                                 ; +0xd8, 0xdaad88\nMOV             W1, #0x71 ; 'q'                                        ; +0xdc, 0xdaad8c\nMOV             W2, #0x76 ; 'v'                                        ; +0xe0, 0xdaad90\nADD             X3, X3, #aCryptoEvpEvpPk@PAGEOFF; \"crypto/evp/evp_pkey.c\" ; +0xe4, 0xdaad94\nMOV             W4, #0x50 ; 'P'                                        ; +0xe8, 0xdaad98\nBL              ERR_put_error                                          ; +0xec, 0xdaad9c\nB               loc_DAAD28                                             ; +0xf0, 0xdaada0", "xrefs": ["i2d_PKCS8PrivateKeyInfo_fp @ 0xdf04a0", "i2d_PKCS8PrivateKeyInfo_bio @ 0xdf0584", "i2d_PrivateKey @ 0xe0f5ec", "sub_E64EF8 @ 0xe64f34", "<???> @ 0xb04c0"], "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"}