Function at 0x18000971c
Capabilities:
Encode data using base64 via winapi

Disassembly:
mov rax, rsp
mov qword [rax + 0x20], r9
mov dword [rax + 0x18], r8d
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x78
mov r12, rdx
mov r15, rcx
xor edi, edi
mov qword [rax - 0x60], rdi
mov dword [rax - 0x50], 0xb0b5f11e
and dword [rax - 0x4c], edi
lea r14d, [rdi + 1]
mov dword [rax - 0x48], r14d
and dword [rax - 0x44], edi
and dword [rax - 0x40], edi
and dword [rax - 0x3c], edi
lea rax, [0x18003a518]
lea r13, str.capi
test rcx, rcx
cmovne r13, rax
mov qword [rsp + 0xc8], r13
xor esi, esi
lea rcx, str._tPrivate_export_:
call fcn.180002da0
test r12, r12
je 0x1800098bc
lea rax, [rsp + 0xc0]
mov qword [rsp + 0x28], rax
and qword [rsp + 0x20], rsi
xor r9d, r9d
lea esi, [rdi + 7]
mov r8d, esi
xor edx, edx
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CryptExportKey]
test eax, eax
je 0x1800098a3
mov r14d, dword [rsp + 0xc0]
add r14d, 0x18
mov dword [rsp + 0x40], r14d
mov edx, r14d
lea ecx, [rdi + 0x40]
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rdi, rax
test rax, rax
je 0x180009b31
lea rcx, [rax + 0x18]
lea rax, [rsp + 0xc0]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rcx
xor r9d, r9d
mov r8d, esi
xor edx, edx
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CryptExportKey]
test eax, eax
je 0x18000987e
cmp dword [rdi + 0x1c], 0x2200
je 0x180009848
cmp dword [rdi + 0x1c], 0x2400
je 0x18000983f
lea rax, [0x180038958]
lea rcx, str.keyx.rsa.pvk
cmp dword [rdi + 0x1c], 0xa400
cmove rax, rcx
jmp 0x18000984f
lea rax, str.sign.rsa.pvk
jmp 0x18000984f
lea rax, str.sign.dsa.pvk
mov qword [rsp + 0x50], rax
mov eax, dword [rsp + 0xc0]
mov dword [rsp + 0x6c], eax
mov rax, qword [rsp + 0x58]
mov qword [rdi], rax
mov rax, qword [rsp + 0x60]
mov qword [rdi + 8], rax
mov rax, qword [rsp + 0x68]
mov qword [rdi + 0x10], rax
jmp 0x180009b31
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.ERROR_kuhl_m_crypto_exportKeyToFile___CryptExportKey_data___0x_08x__n
call fcn.180002da0
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rdi, rax
jmp 0x180009b31
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.ERROR_kuhl_m_crypto_exportKeyToFile___CryptExportKey_init___0x_08x__n
call fcn.180002da0
jmp 0x180009b31
test r15, r15
je 0x180009b31
and qword [rsp + 0x30], 0
and qword [rsp + 0x28], 0
lea r9, [rsp + 0xb0]
mov r8d, r14d
lea rdx, str.Algorithm_Group
mov rcx, r15
call fcn.180001a48
test eax, eax
je 0x180009b22
xor r14d, r14d
mov dword [rsp + 0x44], r14d
mov r12, qword [rsp + 0xb0]
cmp r14d, 4
jae 0x180009939
mov r13d, r14d
shl r13, 5
lea rcx, [0x18002f670]
add r13, rcx
mov rdx, qword [r13]
mov rcx, r12
call fcn.180011f6c
test eax, eax
jne 0x18000992f
mov rsi, r13
jmp 0x180009939
inc r14d
mov dword [rsp + 0x44], r14d
jmp 0x180009903
test rsi, rsi
je 0x180009b02
and dword [rsp + 0x38], 0
lea rax, [rsp + 0xc0]
mov qword [rsp + 0x30], rax
and dword [rsp + 0x28], 0
and qword [rsp + 0x20], 0
xor r9d, r9d
mov r8, qword [rsi + 8]
xor edx, edx
mov rcx, r15
call qword [sym.imp.ncrypt.dll_NCryptExportKey]
test eax, eax
jne 0x180009aed
mov eax, dword [rsi + 0x18]
neg eax
sbb r14, r14
and r14d, 0x18
mov eax, dword [rsp + 0xc0]
add r14, rax
mov dword [rsp + 0x40], r14d
mov edx, r14d
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rdi, rax
mov qword [rsp + 0x48], rax
test rax, rax
je 0x180009b11
mov eax, dword [rsi + 0x18]
neg eax
sbb rcx, rcx
and ecx, 0x18
add rcx, rdi
and dword [rsp + 0x38], 0
lea rax, [rsp + 0xc0]
mov qword [rsp + 0x30], rax
mov eax, dword [rsp + 0xc0]
mov dword [rsp + 0x28], eax
mov qword [rsp + 0x20], rcx
xor r9d, r9d
mov r8, qword [rsi + 8]
xor edx, edx
mov rcx, r15
call qword [sym.imp.ncrypt.dll_NCryptExportKey]
test eax, eax
jne 0x180009ac7
mov rax, qword [rsi + 0x10]
mov qword [rsp + 0x50], rax
cmp dword [rsi + 0x18], 0
je 0x180009a36
mov eax, dword [rsp + 0xc0]
mov dword [rsp + 0x6c], eax
mov rax, qword [rsp + 0x58]
mov qword [rdi], rax
mov rax, qword [rsp + 0x60]
mov qword [rdi + 8], rax
mov rax, qword [rsp + 0x68]
mov qword [rdi + 0x10], rax
jmp 0x180009b11
and dword [rsp + 0xd0], 0
lea rax, [rsp + 0xd0]
mov qword [rsp + 0x20], rax
xor r9d, r9d
mov r8d, 0x80000001
mov r14d, dword [rsp + 0x40]
mov edx, r14d
mov rcx, rdi
call qword [sym.imp.CRYPT32.dll_CryptBinaryToStringA]
test eax, eax
je 0x180009a86
lea r9, [rsp + 0xd0]
lea r8, [rsp + 0xb8]
mov edx, r14d
mov rcx, rdi
call fcn.1800056e4
jmp 0x180009a88
xor eax, eax
test eax, eax
je 0x180009ab1
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rdi, qword [rsp + 0xb8]
mov qword [rsp + 0x48], rdi
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_lstrlenA]
mov dword [rsp + 0x40], eax
jmp 0x180009b11
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.ERROR_kuhl_m_crypto_exportKeyToFile___kull_m_string_EncodeB64_headers__0x_08x__n
call fcn.180002da0
jmp 0x180009b11
mov r8d, eax
mov rdx, qword [rsi + 8]
lea rcx, str.ERROR_kuhl_m_crypto_exportKeyToFile___NCryptExportKey__s____data_:_0x_08x_n
call fcn.180002da0
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rdi, rax
mov qword [rsp + 0x48], rax
jmp 0x180009b11
mov r8d, eax
mov rdx, qword [rsi + 8]
lea rcx, str.ERROR_kuhl_m_crypto_exportKeyToFile___NCryptExportKey__s____init_:_0x_08x_n
call fcn.180002da0
jmp 0x180009b11
mov rdx, r12
lea rcx, str.ERROR_kuhl_m_crypto_exportKeyToFile___No_suitable_export_type_for_key_group:__s_n
call fcn.180002da0
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov r13, qword [rsp + 0xc8]
jmp 0x180009b31
test rdi, rdi
je 0x180009ba3
mov rax, qword [rsp + 0x50]
mov qword [rsp + 0x20], rax
mov r9, qword [rsp + 0xd8]
mov rdx, r13
call fcn.180009bb4
mov rsi, rax
test rax, rax
je 0x180009b9a
mov r8d, dword [rsp + 0x40]
mov rdx, rdi
mov rcx, rax
call fcn.1800021c0
test eax, eax
je 0x180009b7d
mov rdx, rsi
lea rcx, str.OK____s_n
call fcn.180002da0
jmp 0x180009b91
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.ERROR_kuhl_m_crypto_exportKeyToFile___kull_m_file_writeData__0x_08x__n
call fcn.180002da0
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_LocalFree]
add rsp, 0x78
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
ret