Function at 0x6c6487b0
Capabilities:
Encode data using base64 via winapi
Write file on windows

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xd8
mov eax, dword [rdx + 0x10]
mov r12, rcx
mov rbx, rdx
mov r15, r8
mov rsi, r9
cmp eax, 4
je 0x6c648868
ja 0x6c648830
cmp eax, 2
je 0x6c6487eb
cmp eax, 3
jne 0x6c6488a0
mov rax, qword [rbx + 0x18]
lea r9, [rsp + 0x80]
mov rcx, r12
mov r8d, dword [rax + 0x10]
mov rdx, qword [rax + 8]
mov qword [rsp + 0x20], 0
call qword [sym.imp.kernel32.dll_WriteFile]
mov r14d, eax
mov eax, r14d
add rsp, 0xd8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
cmp eax, 5
jne 0x6c6488a0
mov rcx, qword [rdx + 0x18]
mov r9d, 1
mov qword [rsp + 0x20], r12
mov r8d, 2
mov dword [rsp + 0x28], 0
mov edx, 0x10001
call qword [sym.imp.crypt32.dll_CertSaveStore]
mov r14d, eax
jmp 0x6c648814
mov rcx, qword [rdx + 0x18]
mov r9d, 1
mov qword [rsp + 0x20], r12
mov r8d, 1
mov dword [rsp + 0x28], 0
mov edx, 0x10001
call qword [sym.imp.crypt32.dll_CertSaveStore]
mov r14d, eax
jmp 0x6c648814
mov eax, dword [r15 + 4]
cmp eax, 3
je 0x6c648be0
ja 0x6c648b10
cmp eax, 1
je 0x6c6487eb
cmp eax, 2
jne 0x6c648af0
mov r9d, 0x2000
xor r8d, r8d
mov edx, 1
mov qword [rsp + 0x20], 0
mov ecx, 2
call qword [sym.imp.crypt32.dll_CertOpenStore]
mov r13, rax
test rax, rax
je 0x6c648b00
mov edx, dword [r15 + 8]
mov dword [rsp + 0x70], 0
mov qword [rsp + 0x78], 0
mov qword [rsp + 0x58], 0
test edx, edx
je 0x6c648dab
mov qword [rsp + 0x60], 0
mov eax, dword [rbx + 0x20]
test eax, eax
je 0x6c648d9c
lea rdi, [rsp + 0x80]
mov qword [rsp + 0xa0], 0
lea rdx, [rsp + 0x60]
mov dword [rsp + 0xa0], eax
mov rax, qword [rbx + 0x28]
mov rcx, rdi
mov qword [rsp + 0x80], 0
mov qword [rsp + 0x88], 0
mov qword [rsp + 0x90], 0
mov qword [rsp + 0x98], 0
mov qword [rsp + 0xb0], 0
mov qword [rsp + 0xb8], 0
mov qword [rsp + 0xc0], 0
mov qword [rsp + 0xc8], 0
mov dword [rsp + 0x80], 0x50
mov qword [rsp + 0xa8], rax
call qword [sym.imp.crypt32.dll_CertCreateCertificateChainEngine]
test eax, eax
je 0x6c648cae
mov rcx, qword [rsp + 0x60]
lea rax, [rsp + 0x68]
mov rdx, qword [rbx + 0x18]
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x80], 0
mov qword [rsp + 0x88], 0
mov qword [rsp + 0x90], 0
mov qword [rsp + 0x98], 0
mov dword [rsp + 0x80], 0x20
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x20], rdi
call qword [sym.imp.crypt32.dll_CertGetCertificateChain]
test eax, eax
je 0x6c648cae
mov rdi, qword [sym.imp.crypt32.dll_CertAddCertificateContextToStore]
mov rcx, qword [rsp + 0x68]
xor ebx, ebx
mov qword [rsp + 0x48], rdi
cmp dword [rcx + 0xc], ebx
jbe 0x6c648ca0
mov edi, ebx
xor r14d, r14d
lea rbp, [rsp + 0x58]
shl rdi, 3
jmp 0x6c648aaf
mov rax, qword [rdx + 0x10]
mov r9, rbp
mov r8d, 4
mov rcx, r13
mov rax, qword [rax]
mov rdx, qword [rax + 8]
mov rax, qword [rsp + 0x48]
call rax
mov rcx, qword [rsp + 0x68]
add r14d, 1
test eax, eax
je 0x6c648ca0
mov rdx, qword [rcx + 0x10]
mov rdx, qword [rdx + rdi]
cmp dword [rdx + 0xc], r14d
jbe 0x6c648bd0
mov eax, ebx
or eax, r14d
je 0x6c648a80
mov rdx, qword [rdx + 0x10]
mov eax, r14d
xor r9d, r9d
mov r8d, 4
mov rcx, r13
mov rax, qword [rdx + rax*8]
mov rdx, qword [rax + 8]
call qword [sym.imp.crypt32.dll_CertAddCertificateContextToStore]
jmp 0x6c648a9e
mov rax, qword gs:[0x30]
mov dword [rax + 0x68], 0x80004005
xor r14d, r14d
jmp 0x6c648814
cmp eax, 4
jne 0x6c648af0
mov rax, qword [rbx + 0x18]
mov rsi, qword [sym.imp.crypt32.dll_CryptBinaryToStringA]
xor r9d, r9d
lea rbx, [rsp + 0x80]
mov r8d, 1
mov r15d, dword [rax + 0x10]
mov r13, qword [rax + 8]
mov qword [rsp + 0x20], rbx
mov dword [rsp + 0x80], 0
mov edx, r15d
mov rcx, r13
call rsi
mov r14d, eax
test eax, eax
je 0x6c648814
mov rbp, qword gs:[0x30]
mov rax, qword [rbp + 0x60]
mov r8d, dword [rsp + 0x80]
xor edx, edx
mov rcx, qword [rax + 0x30]
call qword [sym.imp.kernel32.dll_HeapAlloc]
mov rdi, rax
test rax, rax
je 0x6c649028
mov qword [rsp + 0x20], rbx
mov r9, rax
mov edx, r15d
mov rcx, r13
mov r8d, 1
call rsi
mov r14d, eax
test eax, eax
jne 0x6c648ec8
mov rax, qword gs:[0x30]
mov rax, qword [rax + 0x60]
mov r8, rdi
xor edx, edx
mov rcx, qword [rax + 0x30]
call qword [sym.imp.kernel32.dll_HeapFree]
jmp 0x6c648814
add ebx, 1
jmp 0x6c648a60
mov edi, dword [r15 + 8]
mov rsi, qword [sym.imp.crypt32.dll_CertOpenStore]
xor r8d, r8d
xor edx, edx
mov qword [rsp + 0x20], 0
mov r9d, 0x2000
mov ecx, 2
call rsi
mov r13, rax
test rax, rax
je 0x6c648b00
test edi, edi
je 0x6c648d78
mov qword [rsp + 0x20], 0
xor r8d, r8d
xor edx, edx
xor edi, edi
mov r9d, 0x2000
mov ecx, 0xb
call rsi
mov rbp, qword [sym.imp.crypt32.dll_CertAddStoreToCollection]
mov r14, rax
test rax, rax
je 0x6c648ef0
nop word [rax + rax]
cmp dword [rbx + 0x20], edi
jbe 0x6c648efc
mov rdx, qword [rbx + 0x28]
xor r9d, r9d
xor r8d, r8d
mov rcx, r14
call rbp
add edi, 1
mov esi, eax
test eax, eax
jne 0x6c648c50
mov rbx, qword [sym.imp.crypt32.dll_CertCloseStore]
xor edx, edx
mov rcx, r14
call rbx
test esi, esi
jne 0x6c648dc8
xor r14d, r14d
xor edx, edx
mov rcx, r13
call rbx
jmp 0x6c648814
mov dword [rsp + 0x48], eax
call qword [sym.imp.crypt32.dll_CertFreeCertificateChain]
mov eax, dword [rsp + 0x48]
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x6c648cc6
mov dword [rsp + 0x48], eax
call qword [sym.imp.crypt32.dll_CertFreeCertificateChainEngine]
mov eax, dword [rsp + 0x48]
test eax, eax
je 0x6c648d70
mov ebx, dword [r15 + 0xc]
test ebx, ebx
je 0x6c648df7
mov rcx, qword [rsp + 0x58]
test rsi, rsi
je 0x6c648fc3
xor r8d, r8d
mov r9, rsi
mov edx, 2
call qword [sym.imp.crypt32.dll_CertSetCertificateContextProperty]
test eax, eax
je 0x6c648d70
xor ebx, ebx
lea rbp, [rsp + 0x70]
mov r8, qword [r15 + 0x10]
mov rdi, qword [sym.imp.crypt32.dll_PFXExportCertStore]
mov rcx, r13
mov r9d, 6
mov rdx, rbp
call rdi
mov r14d, eax
test eax, eax
jne 0x6c648e1d
nop dword [rax + rax]
test ebx, ebx
je 0x6c648d50
mov rax, qword gs:[0x30]
mov rax, qword [rax + 0x60]
mov r8, rsi
xor edx, edx
mov rcx, qword [rax + 0x30]
call qword [sym.imp.kernel32.dll_HeapFree]
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.crypt32.dll_CertFreeCertificateContext]
xor edx, edx
mov rcx, r13
call qword [sym.imp.crypt32.dll_CertCloseStore]
jmp 0x6c648814
xor r14d, r14d
jmp 0x6c648d50
mov rdx, qword [rbx + 0x18]
xor r9d, r9d
mov r8d, 4
mov rcx, rax
call qword [sym.imp.crypt32.dll_CertAddCertificateContextToStore]
mov rbx, qword [sym.imp.crypt32.dll_CertCloseStore]
mov esi, eax
jmp 0x6c648c7f
xor ecx, ecx
lea rdi, [rsp + 0x80]
jmp 0x6c6489da
mov rdx, qword [rbx + 0x18]
lea r9, [rsp + 0x58]
mov r8d, 4
mov rcx, rax
call qword [sym.imp.crypt32.dll_CertAddCertificateContextToStore]
jmp 0x6c648cc6
mov dword [rsp + 0x28], 0
mov r9d, 1
mov r8d, 2
mov rcx, r13
mov qword [rsp + 0x20], r12
mov edx, 0x10001
call qword [sym.imp.crypt32.dll_CertSaveStore]
mov r14d, eax
jmp 0x6c648c8a
lea rbp, [rsp + 0x70]
mov r8, qword [r15 + 0x10]
mov rdi, qword [sym.imp.crypt32.dll_PFXExportCertStore]
mov rcx, r13
mov r9d, 6
mov rdx, rbp
call rdi
test eax, eax
je 0x6c648d70
mov r14, qword gs:[0x30]
mov rax, qword [r14 + 0x60]
mov r8d, dword [rsp + 0x70]
xor edx, edx
mov rcx, qword [rax + 0x30]
call qword [sym.imp.kernel32.dll_HeapAlloc]
mov qword [rsp + 0x78], rax
test rax, rax
je 0x6c649037
mov r8, qword [r15 + 0x10]
mov r9d, 6
mov rdx, rbp
mov rcx, r13
call rdi
mov r14d, eax
test eax, eax
je 0x6c648d30
lea r15, [rsp + 0x80]
mov r8d, dword [rsp + 0x70]
mov rdx, qword [rsp + 0x78]
mov rcx, r12
mov qword [rsp + 0x20], 0
mov r9, r15
call qword [sym.imp.kernel32.dll_WriteFile]
mov r14d, eax
test eax, eax
je 0x6c648d30
mov eax, dword [rsp + 0x140]
test eax, eax
je 0x6c648d30
mov r9d, dword [rsi + 0x10]
mov r8, qword [rsi + 8]
mov rcx, r15
mov dword [rsp + 0x20], 0x10
mov rdx, qword [rsi]
call qword [sym.imp.advapi32.dll_CryptAcquireContextW]
jmp 0x6c648d30
mov qword [rsp + 0x20], 0
mov r9, rbx
mov rdx, rdi
mov rcx, r12
mov r8d, dword [rsp + 0x80]
call qword [sym.imp.kernel32.dll_WriteFile]
mov r14d, eax
jmp 0x6c648baa
mov rbx, qword [sym.imp.crypt32.dll_CertCloseStore]
jmp 0x6c648c87
lea rax, [rsp + 0x80]
mov r9, r14
xor r8d, r8d
xor ecx, ecx
mov rdx, qword [rbx + 0x18]
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
call qword [sym.imp.crypt32.dll_CertGetCertificateChain]
mov esi, eax
test eax, eax
je 0x6c64900b
mov rcx, qword [rsp + 0x80]
mov rdi, qword [sym.imp.crypt32.dll_CertAddCertificateContextToStore]
xor ebp, ebp
cmp dword [rcx + 0xc], ebp
jbe 0x6c649000
mov ebx, ebp
xor r15d, r15d
shl rbx, 3
nop word [rax + rax]
mov rax, qword [rcx + 0x10]
mov rdx, qword [rax + rbx]
cmp dword [rdx + 0xc], r15d
jbe 0x6c648fbe
mov rax, qword [rdx + 0x10]
mov ecx, r15d
xor r9d, r9d
mov r8d, 4
add r15d, 1
mov rax, qword [rax + rcx*8]
mov rcx, r13
mov rdx, qword [rax + 8]
call rdi
mov rcx, qword [rsp + 0x80]
mov esi, eax
test eax, eax
jne 0x6c648f68
call qword [sym.imp.crypt32.dll_CertFreeCertificateChain]
mov rbx, qword [sym.imp.crypt32.dll_CertCloseStore]
xor edx, edx
mov rcx, r14
call rbx
jmp 0x6c648c87
add ebp, 1
jmp 0x6c648f50
call sym.export_get_private_key_info
mov rsi, rax
test rax, rax
je 0x6c648d70
mov rcx, qword [rsp + 0x58]
mov r9, rax
xor r8d, r8d
mov edx, 2
call qword [sym.imp.crypt32.dll_CertSetCertificateContextProperty]
mov r14d, eax
test eax, eax
je 0x6c648d34
mov ebx, 1
jmp 0x6c648cff
call qword [sym.imp.crypt32.dll_CertFreeCertificateChain]
jmp 0x6c648c71
mov rdx, qword [rbx + 0x18]
xor r9d, r9d
mov r8d, 4
mov rcx, r13
call qword [sym.imp.crypt32.dll_CertAddCertificateContextToStore]
mov esi, eax
jmp 0x6c648c71
mov dword [rbp + 0x68], 0xe
xor r14d, r14d
jmp 0x6c648814
mov dword [r14 + 0x68], 0xe
xor r14d, r14d
jmp 0x6c648d30