{"type": "func", "start": 16944836, "end": 16945168, "name": "EVP_PKCS82PKEY", "pseudocode": "// \n// EVP_PKCS82PKEY from 0x1028ec4 to 0x1029010 (332 bytes)\n// \n// 9 xrefs:\n// > d2i_PrivateKey @ 0xfe86f8\n// > d2i_AutoPrivateKey @ 0xfe88d4\n// > PEM_read_bio_PrivateKey @ 0x1047138\n// > sub_1048408 @ 0x10485ac\n// > sub_1048408 @ 0x104860c\n// > PKCS12_parse @ 0x1048a10\n// > PKCS12_parse @ 0x1048a44\n// > d2i_PKCS8PrivateKey_bio @ 0x10e2c4c\n// > <???> @ 0x4a5d8\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_PKCS82PKEY(__int64 a1)\n{\n  __int64 v2; // x19\n  unsigned int v3; // w0\n  __int64 (__fastcall *v4)(__int64, __int64); // x2\n  int v5; // w0\n  __int64 v6; // x1\n  __int64 v8; // [xsp+28h] [xbp+28h] BYREF\n  _BYTE v9[80]; // [xsp+30h] [xbp+30h] BYREF\n\n  if ( (unsigned int)PKCS8_pkey_get0(&v8, nullptr, nullptr, nullptr, a1) )\n  {\n    v2 = EVP_PKEY_new();\n    if ( !v2 )\n    {\n      ERR_put_error(6, 111, 65, (__int64)\"crypto/evp/evp_pkey.c\", 31);\n      return 0;\n    }\n    v3 = OBJ_obj2nid(v8);\n    if ( (unsigned int)EVP_PKEY_set_type(v2, v3) )\n    {\n      v4 = *(__int64 (__fastcall **)(__int64, __int64))(*(_QWORD *)(v2 + 16) + 64LL);\n      if ( v4 )\n      {\n        v5 = v4(v2, a1);\n        v6 = v2;\n        if ( v5 )\n          return v6;\n        ERR_put_error(6, 111, 145, (__int64)\"crypto/evp/evp_pkey.c\", 44);\n      }\n      else\n      {\n        ERR_put_error(6, 111, 144, (__int64)\"crypto/evp/evp_pkey.c\", 48);\n      }\n    }\n    else\n    {\n      ERR_put_error(6, 111, 118, (__int64)\"crypto/evp/evp_pkey.c\", 36);\n      i2t_ASN1_OBJECT((__int64)v9, 80, v8);\n      ERR_add_error_data(2, \"TYPE=\", v9);\n    }\n    EVP_PKEY_free(v2);\n    return 0;\n  }\n  return 0;\n}", "assembly": "; \n; EVP_PKCS82PKEY from 0x1028ec4 to 0x1029010 (332 bytes)\n; \n; 9 xrefs:\n; > d2i_PrivateKey @ 0xfe86f8\n; > d2i_AutoPrivateKey @ 0xfe88d4\n; > PEM_read_bio_PrivateKey @ 0x1047138\n; > sub_1048408 @ 0x10485ac\n; > sub_1048408 @ 0x104860c\n; > PKCS12_parse @ 0x1048a10\n; > PKCS12_parse @ 0x1048a44\n; > d2i_PKCS8PrivateKey_bio @ 0x10e2c4c\n; > <???> @ 0x4a5d8\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,#var_80]!                                ; +0x0, 0x1028ec4\nMOV             X1, #0                                                 ; +0x4, 0x1028ec8\nMOV             X29, SP                                                ; +0x8, 0x1028ecc\nSTP             X19, X20, [SP,#0x80+var_70]                            ; +0xc, 0x1028ed0\nMOV             X20, X0                                                ; +0x10, 0x1028ed4\nMOV             X2, X1                                                 ; +0x14, 0x1028ed8\nADD             X0, X29, #0x80+var_58                                  ; +0x18, 0x1028edc\nMOV             X3, X1                                                 ; +0x1c, 0x1028ee0\nMOV             X4, X20                                                ; +0x20, 0x1028ee4\nBL              PKCS8_pkey_get0                                        ; +0x24, 0x1028ee8\nCBZ             W0, loc_1028F44                                        ; +0x28, 0x1028eec\nBL              EVP_PKEY_new                                           ; +0x2c, 0x1028ef0\nMOV             X19, X0                                                ; +0x30, 0x1028ef4\nCBZ             X0, loc_1028FCC                                        ; +0x34, 0x1028ef8\nLDR             X0, [X29,#0x80+var_58]                                 ; +0x38, 0x1028efc\nBL              OBJ_obj2nid                                            ; +0x3c, 0x1028f00\nMOV             W1, W0                                                 ; +0x40, 0x1028f04\nMOV             X0, X19                                                ; +0x44, 0x1028f08\nBL              EVP_PKEY_set_type                                      ; +0x48, 0x1028f0c\nCBZ             W0, loc_1028F58                                        ; +0x4c, 0x1028f10\nLDR             X0, [X19,#0x10]                                        ; +0x50, 0x1028f14\nLDR             X2, [X0,#0x40]                                         ; +0x54, 0x1028f18\nCBZ             X2, loc_1028FF0                                        ; +0x58, 0x1028f1c\nMOV             X1, X20                                                ; +0x5c, 0x1028f20\nMOV             X0, X19                                                ; +0x60, 0x1028f24\nBLR             X2                                                     ; +0x64, 0x1028f28\nMOV             X1, X19                                                ; +0x68, 0x1028f2c\nCBZ             W0, loc_1028FAC                                        ; +0x6c, 0x1028f30\nMOV             X0, X1                                                 ; +0x70, 0x1028f34\nLDP             X19, X20, [SP,#0x80+var_70]                            ; +0x74, 0x1028f38\nLDP             X29, X30, [SP+0x80+var_80],#0x80                       ; +0x78, 0x1028f3c\nRET                                                                    ; +0x7c, 0x1028f40\nMOV             X1, #0                                                 ; +0x80, 0x1028f44\nMOV             X0, X1                                                 ; +0x84, 0x1028f48\nLDP             X19, X20, [SP,#0x80+var_70]                            ; +0x88, 0x1028f4c\nLDP             X29, X30, [SP+0x80+var_80],#0x80                       ; +0x8c, 0x1028f50\nRET                                                                    ; +0x90, 0x1028f54\nADRP            X3, #aCryptoEvpEvpPk@PAGE; \"crypto/evp/evp_pkey.c\"     ; +0x94, 0x1028f58\nMOV             W4, #0x24 ; '$'                                        ; +0x98, 0x1028f5c\nADD             X3, X3, #aCryptoEvpEvpPk@PAGEOFF; \"crypto/evp/evp_pkey.c\" ; +0x9c, 0x1028f60\nMOV             W0, #6                                                 ; +0xa0, 0x1028f64\nMOV             W1, #0x6F ; 'o'                                        ; +0xa4, 0x1028f68\nMOV             W2, #0x76 ; 'v'                                        ; +0xa8, 0x1028f6c\nADD             X20, X29, #0x80+var_50                                 ; +0xac, 0x1028f70\nBL              ERR_put_error                                          ; +0xb0, 0x1028f74\nLDR             X2, [X29,#0x80+var_58]                                 ; +0xb4, 0x1028f78\nMOV             W1, #0x50 ; 'P'                                        ; +0xb8, 0x1028f7c\nMOV             X0, X20                                                ; +0xbc, 0x1028f80\nBL              i2t_ASN1_OBJECT                                        ; +0xc0, 0x1028f84\nADRP            X1, #aType_3@PAGE; \"TYPE=\"                             ; +0xc4, 0x1028f88\nMOV             W0, #2                                                 ; +0xc8, 0x1028f8c\nADD             X1, X1, #aType_3@PAGEOFF; \"TYPE=\"                      ; +0xcc, 0x1028f90\nMOV             X2, X20                                                ; +0xd0, 0x1028f94\nBL              ERR_add_error_data                                     ; +0xd4, 0x1028f98\nMOV             X0, X19                                                ; +0xd8, 0x1028f9c\nBL              EVP_PKEY_free                                          ; +0xdc, 0x1028fa0\nMOV             X1, #0                                                 ; +0xe0, 0x1028fa4\nB               loc_1028F34                                            ; +0xe4, 0x1028fa8\nADRP            X3, #aCryptoEvpEvpPk@PAGE; \"crypto/evp/evp_pkey.c\"     ; +0xe8, 0x1028fac\nMOV             W0, #6                                                 ; +0xec, 0x1028fb0\nMOV             W1, #0x6F ; 'o'                                        ; +0xf0, 0x1028fb4\nMOV             W2, #0x91                                              ; +0xf4, 0x1028fb8\nADD             X3, X3, #aCryptoEvpEvpPk@PAGEOFF; \"crypto/evp/evp_pkey.c\" ; +0xf8, 0x1028fbc\nMOV             W4, #0x2C ; ','                                        ; +0xfc, 0x1028fc0\nBL              ERR_put_error                                          ; +0x100, 0x1028fc4\nB               loc_1028F9C                                            ; +0x104, 0x1028fc8\nADRP            X3, #aCryptoEvpEvpPk@PAGE; \"crypto/evp/evp_pkey.c\"     ; +0x108, 0x1028fcc\nMOV             W1, #0x6F ; 'o'                                        ; +0x10c, 0x1028fd0\nMOV             W0, #6                                                 ; +0x110, 0x1028fd4\nMOV             W2, #0x41 ; 'A'                                        ; +0x114, 0x1028fd8\nADD             X3, X3, #aCryptoEvpEvpPk@PAGEOFF; \"crypto/evp/evp_pkey.c\" ; +0x118, 0x1028fdc\nMOV             W4, #0x1F                                              ; +0x11c, 0x1028fe0\nBL              ERR_put_error                                          ; +0x120, 0x1028fe4\nMOV             X1, X19                                                ; +0x124, 0x1028fe8\nB               loc_1028F34                                            ; +0x128, 0x1028fec\nADRP            X3, #aCryptoEvpEvpPk@PAGE; \"crypto/evp/evp_pkey.c\"     ; +0x12c, 0x1028ff0\nMOV             W0, #6                                                 ; +0x130, 0x1028ff4\nMOV             W1, #0x6F ; 'o'                                        ; +0x134, 0x1028ff8\nMOV             W2, #0x90                                              ; +0x138, 0x1028ffc\nADD             X3, X3, #aCryptoEvpEvpPk@PAGEOFF; \"crypto/evp/evp_pkey.c\" ; +0x13c, 0x1029000\nMOV             W4, #0x30 ; '0'                                        ; +0x140, 0x1029004\nBL              ERR_put_error                                          ; +0x144, 0x1029008\nB               loc_1028F9C                                            ; +0x148, 0x102900c", "xrefs": ["d2i_PrivateKey @ 0xfe86f8", "d2i_AutoPrivateKey @ 0xfe88d4", "PEM_read_bio_PrivateKey @ 0x1047138", "sub_1048408 @ 0x10485ac", "sub_1048408 @ 0x104860c", "PKCS12_parse @ 0x1048a10", "PKCS12_parse @ 0x1048a44", "d2i_PKCS8PrivateKey_bio @ 0x10e2c4c", "<???> @ 0x4a5d8"], "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"}