{"type": "func", "start": 8356420, "end": 8356700, "name": "ENGINE_load_private_key", "pseudocode": "// \n// ENGINE_load_private_key from 0x7f8244 to 0x7f835c (280 bytes)\n// \n// 2 xrefs:\n// > sub_643938 @ 0x6447aa\n// > <???> @ 0x5545c\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 ENGINE_load_private_key(int a1, int a2, int a3, int a4)\n{\n  int (__fastcall *v8)(int, int, int, int); // r4\n  int result; // r0\n\n  if ( a1 )\n  {\n    CRYPTO_THREAD_write_lock(global_engine_lock);\n    if ( *(_DWORD *)(a1 + 84) )\n    {\n      CRYPTO_THREAD_unlock(global_engine_lock);\n      v8 = *(int (__fastcall **)(int, int, int, int))(a1 + 60);\n      if ( v8 )\n      {\n        result = v8(a1, a2, a3, a4);\n        if ( !result )\n        {\n          ERR_put_error(38, 150, 128, \"crypto/engine/eng_pkey.c\", 78);\n          return 0;\n        }\n      }\n      else\n      {\n        ERR_put_error(38, 150, 125, \"crypto/engine/eng_pkey.c\", 72);\n        return 0;\n      }\n    }\n    else\n    {\n      CRYPTO_THREAD_unlock(global_engine_lock);\n      ERR_put_error(38, 150, 117, \"crypto/engine/eng_pkey.c\", 66);\n      return 0;\n    }\n  }\n  else\n  {\n    ERR_put_error(38, 150, 67, \"crypto/engine/eng_pkey.c\", 60);\n    return 0;\n  }\n  return result;\n}", "assembly": "; \n; ENGINE_load_private_key from 0x7f8244 to 0x7f835c (280 bytes)\n; \n; 2 xrefs:\n; > sub_643938 @ 0x6447aa\n; > <???> @ 0x5545c\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-R9,LR}                                             ; +0x0, 0x7f8244\nSUBS            R6, R0, #0                                             ; +0x4, 0x7f8248\nSUB             SP, SP, #0xC                                           ; +0x8, 0x7f824c\nBEQ             loc_7F82E4                                             ; +0xc, 0x7f8250\nLDR             R5, =(global_engine_lock_ptr - 0x7F8264)               ; +0x10, 0x7f8254\nMOV             R9, R1                                                 ; +0x14, 0x7f8258\nLDR             R5, [PC,R5]; global_engine_lock                        ; +0x18, 0x7f825c\nMOV             R8, R2                                                 ; +0x1c, 0x7f8260\nLDR             R0, [R5]                                               ; +0x20, 0x7f8264\nMOV             R7, R3                                                 ; +0x24, 0x7f8268\nBL              CRYPTO_THREAD_write_lock                               ; +0x28, 0x7f826c\nLDR             R4, [R6,#0x54]                                         ; +0x2c, 0x7f8270\nLDR             R0, [R5]                                               ; +0x30, 0x7f8274\nCMP             R4, #0                                                 ; +0x34, 0x7f8278\nBEQ             loc_7F82B8                                             ; +0x38, 0x7f827c\nBL              CRYPTO_THREAD_unlock                                   ; +0x3c, 0x7f8280\nLDR             R4, [R6,#0x3C]                                         ; +0x40, 0x7f8284\nCMP             R4, #0                                                 ; +0x44, 0x7f8288\nBEQ             loc_7F830C                                             ; +0x48, 0x7f828c\nMOV             R0, R6                                                 ; +0x4c, 0x7f8290\nMOV             R1, R9                                                 ; +0x50, 0x7f8294\nMOV             R2, R8                                                 ; +0x54, 0x7f8298\nMOV             R3, R7                                                 ; +0x58, 0x7f829c\nBLX             R4                                                     ; +0x5c, 0x7f82a0\nSUBS            R4, R0, #0                                             ; +0x60, 0x7f82a4\nMOVNE           R0, R4                                                 ; +0x64, 0x7f82a8\nBEQ             loc_7F8334                                             ; +0x68, 0x7f82ac\nADD             SP, SP, #0xC                                           ; +0x6c, 0x7f82b0\nPOP             {R4-R9,PC}                                             ; +0x70, 0x7f82b4\nBL              CRYPTO_THREAD_unlock                                   ; +0x74, 0x7f82b8\nMOV             R3, #0x42 ; 'B'                                        ; +0x78, 0x7f82bc\nSTR             R3, [SP,#0xC+var_C]                                    ; +0x7c, 0x7f82c0\nLDR             R3, =(aCryptoEngineEn_5 - 0x7F82DC); \"crypto/engine/eng_pkey.c\" ; +0x80, 0x7f82c4\nMOV             R0, #0x26 ; '&'                                        ; +0x84, 0x7f82c8\nMOV             R1, #0x96                                              ; +0x88, 0x7f82cc\nMOV             R2, #0x75 ; 'u'                                        ; +0x8c, 0x7f82d0\nADD             R3, PC, R3; \"crypto/engine/eng_pkey.c\"                 ; +0x90, 0x7f82d4\nBL              ERR_put_error                                          ; +0x94, 0x7f82d8\nMOV             R0, R4                                                 ; +0x98, 0x7f82dc\nB               loc_7F82B0                                             ; +0x9c, 0x7f82e0\nMOV             R3, #0x3C ; '<'                                        ; +0xa0, 0x7f82e4\nSTR             R3, [SP,#0xC+var_C]                                    ; +0xa4, 0x7f82e8\nLDR             R3, =(aCryptoEngineEn_5 - 0x7F8304); \"crypto/engine/eng_pkey.c\" ; +0xa8, 0x7f82ec\nMOV             R0, #0x26 ; '&'                                        ; +0xac, 0x7f82f0\nMOV             R1, #0x96                                              ; +0xb0, 0x7f82f4\nMOV             R2, #0x43 ; 'C'                                        ; +0xb4, 0x7f82f8\nADD             R3, PC, R3; \"crypto/engine/eng_pkey.c\"                 ; +0xb8, 0x7f82fc\nBL              ERR_put_error                                          ; +0xbc, 0x7f8300\nMOV             R0, R6                                                 ; +0xc0, 0x7f8304\nB               loc_7F82B0                                             ; +0xc4, 0x7f8308\nMOV             R3, #0x48 ; 'H'                                        ; +0xc8, 0x7f830c\nSTR             R3, [SP,#0xC+var_C]                                    ; +0xcc, 0x7f8310\nLDR             R3, =(aCryptoEngineEn_5 - 0x7F832C); \"crypto/engine/eng_pkey.c\" ; +0xd0, 0x7f8314\nMOV             R0, #0x26 ; '&'                                        ; +0xd4, 0x7f8318\nMOV             R1, #0x96                                              ; +0xd8, 0x7f831c\nMOV             R2, #0x7D ; '}'                                        ; +0xdc, 0x7f8320\nADD             R3, PC, R3; \"crypto/engine/eng_pkey.c\"                 ; +0xe0, 0x7f8324\nBL              ERR_put_error                                          ; +0xe4, 0x7f8328\nMOV             R0, R4                                                 ; +0xe8, 0x7f832c\nB               loc_7F82B0                                             ; +0xec, 0x7f8330\nMOV             R3, #0x4E ; 'N'                                        ; +0xf0, 0x7f8334\nSTR             R3, [SP,#0xC+var_C]                                    ; +0xf4, 0x7f8338\nLDR             R3, =(aCryptoEngineEn_5 - 0x7F8354); \"crypto/engine/eng_pkey.c\" ; +0xf8, 0x7f833c\nMOV             R0, #0x26 ; '&'                                        ; +0xfc, 0x7f8340\nMOV             R1, #0x96                                              ; +0x100, 0x7f8344\nMOV             R2, #0x80                                              ; +0x104, 0x7f8348\nADD             R3, PC, R3; \"crypto/engine/eng_pkey.c\"                 ; +0x108, 0x7f834c\nBL              ERR_put_error                                          ; +0x10c, 0x7f8350\nMOV             R0, R4                                                 ; +0x110, 0x7f8354\nB               loc_7F82B0                                             ; +0x114, 0x7f8358", "xrefs": ["sub_643938 @ 0x6447aa", "<???> @ 0x5545c"], "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"}