{"type": "func", "start": 8404260, "end": 8404592, "name": "EVP_PKCS82PKEY", "pseudocode": "// \n// EVP_PKCS82PKEY from 0x803d24 to 0x803e70 (332 bytes)\n// \n// 9 xrefs:\n// > d2i_PrivateKey @ 0x7c3b80\n// > d2i_AutoPrivateKey @ 0x7c3d50\n// > PEM_read_bio_PrivateKey @ 0x823504\n// > sub_824818 @ 0x8249d0\n// > sub_824818 @ 0x824a08\n// > PKCS12_parse @ 0x824c64\n// > PKCS12_parse @ 0x824d30\n// > d2i_PKCS8PrivateKey_bio @ 0x8ba83c\n// > <???> @ 0x5e8ac\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_PKCS82PKEY(int a1)\n{\n  int result; // r0\n  int v3; // r4\n  int v4; // r0\n  int (__fastcall *v5)(int, int); // r3\n  int v6; // [sp+Ch] [bp-58h] BYREF\n  _BYTE v7[84]; // [sp+10h] [bp-54h] BYREF\n\n  result = PKCS8_pkey_get0(&v6, nullptr, nullptr, nullptr, a1);\n  if ( result )\n  {\n    v3 = EVP_PKEY_new();\n    if ( v3 )\n    {\n      v4 = OBJ_obj2nid(v6);\n      if ( EVP_PKEY_set_type(v3, v4) )\n      {\n        v5 = *(int (__fastcall **)(int, int))(*(_DWORD *)(v3 + 12) + 36);\n        if ( v5 )\n        {\n          if ( v5(v3, a1) )\n            return v3;\n          ERR_put_error(6, 111, 145, (int)\"crypto/evp/evp_pkey.c\", 44);\n        }\n        else\n        {\n          ERR_put_error(6, 111, 144, (int)\"crypto/evp/evp_pkey.c\", 48);\n        }\n      }\n      else\n      {\n        ERR_put_error(6, 111, 118, (int)\"crypto/evp/evp_pkey.c\", 36);\n        i2t_ASN1_OBJECT((int)v7, 80, v6);\n        ERR_add_error_data(2, \"TYPE=\", v7);\n      }\n      EVP_PKEY_free(v3);\n      return 0;\n    }\n    else\n    {\n      ERR_put_error(6, 111, 65, (int)\"crypto/evp/evp_pkey.c\", 31);\n      return 0;\n    }\n  }\n  return result;\n}", "assembly": "; \n; EVP_PKCS82PKEY from 0x803d24 to 0x803e70 (332 bytes)\n; \n; 9 xrefs:\n; > d2i_PrivateKey @ 0x7c3b80\n; > d2i_AutoPrivateKey @ 0x7c3d50\n; > PEM_read_bio_PrivateKey @ 0x823504\n; > sub_824818 @ 0x8249d0\n; > sub_824818 @ 0x824a08\n; > PKCS12_parse @ 0x824c64\n; > PKCS12_parse @ 0x824d30\n; > d2i_PKCS8PrivateKey_bio @ 0x8ba83c\n; > <???> @ 0x5e8ac\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, 0x803d24\nMOV             R1, #0                                                 ; +0x4, 0x803d28\nSUB             SP, SP, #0x64                                          ; +0x8, 0x803d2c\nSTR             R0, [SP,#0x64+var_64]                                  ; +0xc, 0x803d30\nMOV             R5, R0                                                 ; +0x10, 0x803d34\nMOV             R2, R1                                                 ; +0x14, 0x803d38\nMOV             R3, R1                                                 ; +0x18, 0x803d3c\nADD             R0, SP, #0x64+var_58                                   ; +0x1c, 0x803d40\nBL              PKCS8_pkey_get0                                        ; +0x20, 0x803d44\nCMP             R0, #0                                                 ; +0x24, 0x803d48\nBEQ             loc_803DA0                                             ; +0x28, 0x803d4c\nBL              EVP_PKEY_new                                           ; +0x2c, 0x803d50\nSUBS            R4, R0, #0                                             ; +0x30, 0x803d54\nBEQ             loc_803E24                                             ; +0x34, 0x803d58\nLDR             R0, [SP,#0x64+var_58]                                  ; +0x38, 0x803d5c\nBL              OBJ_obj2nid                                            ; +0x3c, 0x803d60\nMOV             R1, R0                                                 ; +0x40, 0x803d64\nMOV             R0, R4                                                 ; +0x44, 0x803d68\nBL              EVP_PKEY_set_type                                      ; +0x48, 0x803d6c\nCMP             R0, #0                                                 ; +0x4c, 0x803d70\nBEQ             loc_803DA8                                             ; +0x50, 0x803d74\nLDR             R3, [R4,#0xC]                                          ; +0x54, 0x803d78\nLDR             R3, [R3,#0x24]                                         ; +0x58, 0x803d7c\nCMP             R3, #0                                                 ; +0x5c, 0x803d80\nBEQ             loc_803E4C                                             ; +0x60, 0x803d84\nMOV             R1, R5                                                 ; +0x64, 0x803d88\nMOV             R0, R4                                                 ; +0x68, 0x803d8c\nBLX             R3                                                     ; +0x6c, 0x803d90\nCMP             R0, #0                                                 ; +0x70, 0x803d94\nMOVNE           R0, R4                                                 ; +0x74, 0x803d98\nBEQ             loc_803E00                                             ; +0x78, 0x803d9c\nADD             SP, SP, #0x64 ; 'd'                                    ; +0x7c, 0x803da0\nPOP             {R4,R5,PC}                                             ; +0x80, 0x803da4\nMOV             R3, #0x24 ; '$'                                        ; +0x84, 0x803da8\nSTR             R3, [SP,#0x64+var_64]                                  ; +0x88, 0x803dac\nLDR             R3, =(aCryptoEvpEvpPk - 0x803DC8); \"crypto/evp/evp_pkey.c\" ; +0x8c, 0x803db0\nMOV             R0, #6                                                 ; +0x90, 0x803db4\nMOV             R1, #0x6F ; 'o'                                        ; +0x94, 0x803db8\nMOV             R2, #0x76 ; 'v'                                        ; +0x98, 0x803dbc\nADD             R3, PC, R3; \"crypto/evp/evp_pkey.c\"                    ; +0x9c, 0x803dc0\nADD             R5, SP, #0x64+var_54                                   ; +0xa0, 0x803dc4\nBL              ERR_put_error                                          ; +0xa4, 0x803dc8\nMOV             R1, #0x50 ; 'P'                                        ; +0xa8, 0x803dcc\nLDR             R2, [SP,#0x64+var_58]                                  ; +0xac, 0x803dd0\nMOV             R0, R5                                                 ; +0xb0, 0x803dd4\nBL              i2t_ASN1_OBJECT                                        ; +0xb4, 0x803dd8\nLDR             R1, =(aType_1 - 0x803DF0); \"TYPE=\"                     ; +0xb8, 0x803ddc\nMOV             R2, R5                                                 ; +0xbc, 0x803de0\nMOV             R0, #2                                                 ; +0xc0, 0x803de4\nADD             R1, PC, R1; \"TYPE=\"                                    ; +0xc4, 0x803de8\nBL              ERR_add_error_data                                     ; +0xc8, 0x803dec\nMOV             R0, R4                                                 ; +0xcc, 0x803df0\nBL              EVP_PKEY_free                                          ; +0xd0, 0x803df4\nMOV             R0, #0                                                 ; +0xd4, 0x803df8\nB               loc_803DA0                                             ; +0xd8, 0x803dfc\nMOV             R3, #0x2C ; ','                                        ; +0xdc, 0x803e00\nSTR             R3, [SP,#0x64+var_64]                                  ; +0xe0, 0x803e04\nLDR             R3, =(aCryptoEvpEvpPk - 0x803E20); \"crypto/evp/evp_pkey.c\" ; +0xe4, 0x803e08\nMOV             R0, #6                                                 ; +0xe8, 0x803e0c\nMOV             R1, #0x6F ; 'o'                                        ; +0xec, 0x803e10\nMOV             R2, #0x91                                              ; +0xf0, 0x803e14\nADD             R3, PC, R3; \"crypto/evp/evp_pkey.c\"                    ; +0xf4, 0x803e18\nBL              ERR_put_error                                          ; +0xf8, 0x803e1c\nB               loc_803DF0                                             ; +0xfc, 0x803e20\nMOV             R3, #0x1F                                              ; +0x100, 0x803e24\nSTR             R3, [SP,#0x64+var_64]                                  ; +0x104, 0x803e28\nLDR             R3, =(aCryptoEvpEvpPk - 0x803E44); \"crypto/evp/evp_pkey.c\" ; +0x108, 0x803e2c\nMOV             R0, #6                                                 ; +0x10c, 0x803e30\nMOV             R1, #0x6F ; 'o'                                        ; +0x110, 0x803e34\nMOV             R2, #0x41 ; 'A'                                        ; +0x114, 0x803e38\nADD             R3, PC, R3; \"crypto/evp/evp_pkey.c\"                    ; +0x118, 0x803e3c\nBL              ERR_put_error                                          ; +0x11c, 0x803e40\nMOV             R0, R4                                                 ; +0x120, 0x803e44\nB               loc_803DA0                                             ; +0x124, 0x803e48\nMOV             R3, #0x30 ; '0'                                        ; +0x128, 0x803e4c\nSTR             R3, [SP,#0x64+var_64]                                  ; +0x12c, 0x803e50\nLDR             R3, =(aCryptoEvpEvpPk - 0x803E6C); \"crypto/evp/evp_pkey.c\" ; +0x130, 0x803e54\nMOV             R0, #6                                                 ; +0x134, 0x803e58\nMOV             R1, #0x6F ; 'o'                                        ; +0x138, 0x803e5c\nMOV             R2, #0x90                                              ; +0x13c, 0x803e60\nADD             R3, PC, R3; \"crypto/evp/evp_pkey.c\"                    ; +0x140, 0x803e64\nBL              ERR_put_error                                          ; +0x144, 0x803e68\nB               loc_803DF0                                             ; +0x148, 0x803e6c", "xrefs": ["d2i_PrivateKey @ 0x7c3b80", "d2i_AutoPrivateKey @ 0x7c3d50", "PEM_read_bio_PrivateKey @ 0x823504", "sub_824818 @ 0x8249d0", "sub_824818 @ 0x824a08", "PKCS12_parse @ 0x824c64", "PKCS12_parse @ 0x824d30", "d2i_PKCS8PrivateKey_bio @ 0x8ba83c", "<???> @ 0x5e8ac"], "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"}