{"type": "func", "start": 16945168, "end": 16945412, "name": "EVP_PKEY2PKCS8", "pseudocode": "// \n// EVP_PKEY2PKCS8 from 0x1029010 to 0x1029104 (244 bytes)\n// \n// 5 xrefs:\n// > i2d_PKCS8PrivateKeyInfo_fp @ 0x106e7e0\n// > i2d_PKCS8PrivateKeyInfo_bio @ 0x106e8c4\n// > i2d_PrivateKey @ 0x108d8ec\n// > sub_10E2EF8 @ 0x10e2f34\n// > <???> @ 0xe6b30\n// \n// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!\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 13:16:15 +0000\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 0x1029010 to 0x1029104 (244 bytes)\n; \n; 5 xrefs:\n; > i2d_PKCS8PrivateKeyInfo_fp @ 0x106e7e0\n; > i2d_PKCS8PrivateKeyInfo_bio @ 0x106e8c4\n; > i2d_PrivateKey @ 0x108d8ec\n; > sub_10E2EF8 @ 0x10e2f34\n; > <???> @ 0xe6b30\n; \n; This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!\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 13:16:15 +0000\n; \nSTP             X29, X30, [SP,#-0x20+var_s0]!                          ; +0x0, 0x1029010\nMOV             X29, SP                                                ; +0x4, 0x1029014\nSTP             X19, X20, [SP,#var_s10]                                ; +0x8, 0x1029018\nMOV             X20, X0                                                ; +0xc, 0x102901c\nBL              PKCS8_PRIV_KEY_INFO_new                                ; +0x10, 0x1029020\nMOV             X19, X0                                                ; +0x14, 0x1029024\nCBZ             X0, loc_10290C0                                        ; +0x18, 0x1029028\nLDR             X2, [X20,#0x10]                                        ; +0x1c, 0x102902c\nCBZ             X2, loc_10290E4                                        ; +0x20, 0x1029030\nLDR             X2, [X2,#0x48]                                         ; +0x24, 0x1029034\nCBZ             X2, loc_10290A0                                        ; +0x28, 0x1029038\nMOV             X1, X20                                                ; +0x2c, 0x102903c\nBLR             X2                                                     ; +0x30, 0x1029040\nCBZ             W0, loc_102906C                                        ; +0x34, 0x1029044\nLDR             X1, [X19,#0x10]                                        ; +0x38, 0x1029048\nFMOV            D0, XZR                                                ; +0x3c, 0x102904c\nLDR             X0, [X1,#8]                                            ; +0x40, 0x1029050\nLDR             W1, [X1]                                               ; +0x44, 0x1029054\nBL              RAND_add                                               ; +0x48, 0x1029058\nMOV             X0, X19                                                ; +0x4c, 0x102905c\nLDP             X19, X20, [SP,#var_s10]                                ; +0x50, 0x1029060\nLDP             X29, X30, [SP+var_s0],#0x20                            ; +0x54, 0x1029064\nRET                                                                    ; +0x58, 0x1029068\nADRP            X3, #aCryptoEvpEvpPk@PAGE; \"crypto/evp/evp_pkey.c\"     ; +0x5c, 0x102906c\nMOV             W0, #6                                                 ; +0x60, 0x1029070\nMOV             W1, #0x71 ; 'q'                                        ; +0x64, 0x1029074\nMOV             W2, #0x92                                              ; +0x68, 0x1029078\nADD             X3, X3, #aCryptoEvpEvpPk@PAGEOFF; \"crypto/evp/evp_pkey.c\" ; +0x6c, 0x102907c\nMOV             W4, #0x48 ; 'H'                                        ; +0x70, 0x1029080\nBL              ERR_put_error                                          ; +0x74, 0x1029084\nMOV             X0, X19                                                ; +0x78, 0x1029088\nBL              PKCS8_PRIV_KEY_INFO_free                               ; +0x7c, 0x102908c\nMOV             X0, #0                                                 ; +0x80, 0x1029090\nLDP             X19, X20, [SP,#var_s10]                                ; +0x84, 0x1029094\nLDP             X29, X30, [SP+var_s0],#0x20                            ; +0x88, 0x1029098\nRET                                                                    ; +0x8c, 0x102909c\nADRP            X3, #aCryptoEvpEvpPk@PAGE; \"crypto/evp/evp_pkey.c\"     ; +0x90, 0x10290a0\nMOV             W0, #6                                                 ; +0x94, 0x10290a4\nMOV             W1, #0x71 ; 'q'                                        ; +0x98, 0x10290a8\nMOV             W2, #0x90                                              ; +0x9c, 0x10290ac\nADD             X3, X3, #aCryptoEvpEvpPk@PAGEOFF; \"crypto/evp/evp_pkey.c\" ; +0xa0, 0x10290b0\nMOV             W4, #0x4C ; 'L'                                        ; +0xa4, 0x10290b4\nBL              ERR_put_error                                          ; +0xa8, 0x10290b8\nB               loc_1029088                                            ; +0xac, 0x10290bc\nMOV             W2, #0x41 ; 'A'                                        ; +0xb0, 0x10290c0\nADRP            X3, #aCryptoEvpEvpPk@PAGE; \"crypto/evp/evp_pkey.c\"     ; +0xb4, 0x10290c4\nMOV             W0, #6                                                 ; +0xb8, 0x10290c8\nMOV             W1, #0x71 ; 'q'                                        ; +0xbc, 0x10290cc\nADD             X3, X3, #aCryptoEvpEvpPk@PAGEOFF; \"crypto/evp/evp_pkey.c\" ; +0xc0, 0x10290d0\nMOV             W4, W2                                                 ; +0xc4, 0x10290d4\nBL              ERR_put_error                                          ; +0xc8, 0x10290d8\nMOV             X0, X19                                                ; +0xcc, 0x10290dc\nB               loc_1029060                                            ; +0xd0, 0x10290e0\nADRP            X3, #aCryptoEvpEvpPk@PAGE; \"crypto/evp/evp_pkey.c\"     ; +0xd4, 0x10290e4\nMOV             W0, #6                                                 ; +0xd8, 0x10290e8\nMOV             W1, #0x71 ; 'q'                                        ; +0xdc, 0x10290ec\nMOV             W2, #0x76 ; 'v'                                        ; +0xe0, 0x10290f0\nADD             X3, X3, #aCryptoEvpEvpPk@PAGEOFF; \"crypto/evp/evp_pkey.c\" ; +0xe4, 0x10290f4\nMOV             W4, #0x50 ; 'P'                                        ; +0xe8, 0x10290f8\nBL              ERR_put_error                                          ; +0xec, 0x10290fc\nB               loc_1029088                                            ; +0xf0, 0x1029100", "xrefs": ["i2d_PKCS8PrivateKeyInfo_fp @ 0x106e7e0", "i2d_PKCS8PrivateKeyInfo_bio @ 0x106e8c4", "i2d_PrivateKey @ 0x108d8ec", "sub_10E2EF8 @ 0x10e2f34", "<???> @ 0xe6b30"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "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"}