Function at 0x14012f160
Capabilities:
Read file on windows

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r14
lea rbp, [rsp - 0x37]
sub rsp, 0xa0
xor ebx, ebx
lea rdx, [0x14014e9c8]
mov r14d, ebx
mov qword [rbp + 0x7f], rbx
mov dword [rbp + 0x77], ebx
mov rdi, rcx
mov dword [rbp + 0x6f], ebx
call fcn.1400a001c
mov rsi, rax
test rax, rax
jne 0x14012f1c1
mov r9, rdi
lea r8, str.Couldnt_open_file__s
lea rdx, str.stream_secure_channel
xor ecx, ecx
call fcn.1400cf640
xor eax, eax
add rsp, 0xa0
pop r14
pop rdi
pop rsi
pop rbx
pop rbp
ret
xor edx, edx
mov qword [rsp + 0x90], r15
mov rcx, rsi
lea r8d, [rdx + 2]
call fcn.140097498
mov rcx, rsi
call fcn.140097b5c
xor r8d, r8d
movsxd r15, eax
xor edx, edx
mov rcx, rsi
call fcn.140097498
cmp r15d, 1
jge 0x14012f214
mov r9, rdi
lea r8, str.Couldnt_determine_file_size_of__s
lea rdx, str.stream_secure_channel
xor ecx, ecx
call fcn.1400cf640
xor eax, eax
jmp 0x14012f5bb
mov qword [rsp + 0xd0], r12
mov rcx, r15
mov qword [rsp + 0x98], r13
mov r13, r15
call fcn.1400c5fd0
mov r9, rsi
mov r8, r15
mov edx, 1
mov rcx, rax
mov r12, rax
call fcn.140096344
mov rcx, rsi
call fcn.1400969d4
lea rdx, str._____BEGIN_CERTIFICATE_____
mov rcx, r12
call fcn.14008a420
lea rdx, str._____BEGIN_ENCRYPTED_PRIVATE_KEY_____
mov rcx, r12
mov r15, rax
call fcn.14008a420
test rax, rax
je 0x14012f28d
lea r8, str.Detected_unsupported_encrypted_private_key
xor ecx, ecx
lea rdx, str.stream_secure_channel
call fcn.1400cf640
jmp 0x14012f569
lea rdx, str._____BEGIN_RSA_PRIVATE_KEY_____
mov rcx, r12
call fcn.14008a420
mov rsi, rax
test rax, rax
jne 0x14012f2d8
lea rdx, str._____BEGIN_PRIVATE_KEY_____
mov rcx, r12
call fcn.14008a420
mov rsi, rax
test rax, rax
jne 0x14012f2d8
mov r9, rdi
lea r8, str.Cant_find_private_key_in__s
lea rdx, str.stream_secure_channel
xor ecx, ecx
call fcn.1400cf640
jmp 0x14012f569
mov rax, 0xffffffffffffffff
nop
inc rax
cmp byte [r15 + rax], bl
jne 0x14012f2e0
mov dword [rbp + 0xf], eax
lea rdx, [rbp + 0xf]
lea rax, [rbp + 0x7f]
mov qword [rbp + 0x17], r15
xor r15d, r15d
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x48], r15
mov r8d, 0x3ffe
mov qword [rsp + 0x40], r15
mov qword [rsp + 0x38], r15
mov qword [rsp + 0x30], r15
lea r9d, [r15 + 0xe]
mov qword [rsp + 0x28], r15
lea ecx, [r15 + 2]
mov dword [rsp + 0x20], r15d
call qword [sym.imp.CRYPT32.dll_CryptQueryObject]
cmp qword [rbp + 0x7f], rbx
jne 0x14012f35f
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9, rdi
lea r8, str.Failed_to_extract_public_key_from__s._Error_0x_.8X
lea rdx, str.stream_secure_channel
mov dword [rsp + 0x20], eax
xor ecx, ecx
call fcn.1400cf640
jmp 0x14012f569
mov qword [rsp + 0x30], r15
lea rax, [rbp + 0x6f]
mov qword [rsp + 0x28], r15
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], rax
xor edx, edx
mov rcx, rsi
call qword [sym.imp.CRYPT32.dll_CryptStringToBinaryA]
test eax, eax
jne 0x14012f399
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, str.Failed_to_convert_base64_private_key._Error_0x_.8X
jmp 0x14012f558
mov ecx, dword [rbp + 0x6f]
call fcn.1400c5fd0
mov rbx, rax
mov qword [rsp + 0x30], r15
lea rax, [rbp + 0x6f]
mov qword [rsp + 0x28], r15
mov r9, rbx
mov qword [rsp + 0x20], rax
xor r8d, r8d
xor edx, edx
mov rcx, rsi
call qword [sym.imp.CRYPT32.dll_CryptStringToBinaryA]
test eax, eax
jne 0x14012f3de
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, str.Failed_to_convert_base64_private_key._Error_0x_.8X
jmp 0x14012f558
mov r9d, dword [rbp + 0x6f]
lea rax, [rbp + 0x77]
mov qword [rsp + 0x38], rax
mov r8, rbx
mov qword [rsp + 0x30], r15
mov edx, 0x2b
mov qword [rsp + 0x28], r15
mov ecx, 0x10001
mov dword [rsp + 0x20], r15d
call qword [sym.imp.CRYPT32.dll_CryptDecodeObjectEx]
test eax, eax
jne 0x14012f473
mov qword [rbp - 9], r15
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov qword [rsp + 0x30], r15
xor r9d, r9d
mov r8d, eax
mov dword [rsp + 0x28], r15d
lea rax, [rbp - 9]
xor edx, edx
mov ecx, 0x3100
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_FormatMessageA]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9, qword [rbp - 9]
lea r8, str.Failed_to_parse_private_key.__s__0x_.8X_
lea rdx, str.stream_secure_channel
mov dword [rsp + 0x20], eax
xor ecx, ecx
call fcn.1400cf640
mov rcx, qword [rbp - 9]
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x14012f569
mov ecx, dword [rbp + 0x77]
call fcn.1400c5fd0
mov r9d, dword [rbp + 0x6f]
mov r14, rax
lea rax, [rbp + 0x77]
mov r8, rbx
mov qword [rsp + 0x38], rax
mov edx, 0x2b
mov qword [rsp + 0x30], r14
mov ecx, 0x10001
mov qword [rsp + 0x28], r15
mov dword [rsp + 0x20], r15d
call qword [sym.imp.CRYPT32.dll_CryptDecodeObjectEx]
test eax, eax
jne 0x14012f4c3
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, str.Failed_to_parse_private_key._Error_0x_.8X
jmp 0x14012f558
mov r9d, 1
mov dword [rsp + 0x20], 0xf0000000
lea r8, str.Microsoft_Enhanced_Cryptographic_Provider_v1.0
xor edx, edx
lea rcx, [rbp - 1]
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextA]
test eax, eax
jne 0x14012f4f7
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, str.CryptAcquireContext_failed_with_error_0x_.8X
jmp 0x14012f558
mov r8d, dword [rbp + 0x77]
lea rax, [rbp + 7]
mov rcx, qword [rbp - 1]
xor r9d, r9d
mov qword [rsp + 0x28], rax
mov rdx, r14
mov dword [rsp + 0x20], r15d
call qword [sym.imp.ADVAPI32.dll_CryptImportKey]
test eax, eax
jne 0x14012f52c
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, str.CryptImportKey_for_private_key_failed_with_error_0x_.8X
jmp 0x14012f558
mov r9, qword [rbp - 1]
xor r8d, r8d
mov rcx, qword [rbp + 0x7f]
lea edx, [r8 + 1]
call qword [sym.imp.CRYPT32.dll_CertSetCertificateContextProperty]
test eax, eax
je 0x14012f54b
mov rax, qword [rbp + 0x7f]
jmp 0x14012f5ab
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r8, str.Cant_associate_private_key_with_public_key:_0x_.8X
mov r9d, eax
lea rdx, str.stream_secure_channel
xor ecx, ecx
call fcn.1400cf640
xor eax, eax
mov rdi, r12
mov rcx, r13
rep stosb byte [rdi], al
mov rcx, r12
call fcn.1400c5f70
test rbx, rbx
je 0x14012f592
mov ecx, dword [rbp + 0x6f]
xor eax, eax
mov rdi, rbx
rep stosb byte [rdi], al
mov rcx, rbx
call fcn.1400c5f70
test r14, r14
je 0x14012f5a9
mov ecx, dword [rbp + 0x77]
xor eax, eax
mov rdi, r14
rep stosb byte [rdi], al
mov rcx, r14
call fcn.1400c5f70
xor eax, eax
mov r13, qword [rsp + 0x98]
mov r12, qword [rsp + 0xd0]
mov r15, qword [rsp + 0x90]
add rsp, 0xa0
pop r14
pop rdi
pop rsi
pop rbx
pop rbp
ret