Function at 0x180006fa8
Capabilities:
Encrypt or decrypt via wincrypt
Import public key

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x20], rsi
mov dword [rsp + 0x18], r8d
push rbp
push rdi
push r12
push r14
push r15
mov rbp, rsp
sub rsp, 0x60
xor ebx, ebx
xor edi, edi
mov r15, r9
and qword [rbp - 8], rbx
and qword [rbp - 0x10], rbx
and qword [rbp - 0x18], rbx
mov r12, rdx
mov rsi, rcx
test rcx, rcx
jne 0x180006fee
mov ebx, 0xa0
jmp 0x18000720a
and qword [rsp + 0x30], rbx
and qword [rsp + 0x28], rbx
and dword [rbp - 0x20], ebx
lea rax, [rbp - 0x20]
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov qword [rsp + 0x20], rax
call qword [sym.imp.CRYPT32.dll_CryptStringToBinaryA]
mov ecx, dword [rbp - 0x20]
call fcn.180013380
mov r14, rax
test rax, rax
jne 0x18000702c
mov ebx, reloc.WS2_32.dll_ntohl
jmp 0x1800071db
and qword [rsp + 0x30], rbx
and qword [rsp + 0x28], rbx
lea rax, [rbp - 0x20]
mov r9, r14
xor r8d, r8d
xor edx, edx
mov rcx, rsi
mov qword [rsp + 0x20], rax
call qword [sym.imp.CRYPT32.dll_CryptStringToBinaryA]
test eax, eax
jne 0x180007061
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
jmp 0x1800071ca
mov r9d, dword [rbp - 0x20]
and dword [rbp - 0x1c], ebx
lea rax, [rbp - 0x1c]
mov qword [rsp + 0x38], rax
mov esi, 8
mov r8, r14
lea rax, [rbp - 8]
lea r14d, [rsi - 7]
mov edx, esi
mov qword [rsp + 0x30], rax
and qword [rsp + 0x28], rbx
mov ecx, r14d
mov dword [rsp + 0x20], 0x8000
call qword [sym.imp.CRYPT32.dll_CryptDecodeObjectEx]
test eax, eax
je 0x180007054
lea r8, str.Microsoft_Enhanced_Cryptographic_Provider_v1.0
lea rcx, [rbp - 0x10]
mov r9d, r14d
xor edx, edx
mov dword [rsp + 0x20], 0xf0000000
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
jne 0x1800070e6
lea r8, str.Microsoft_Enhanced_Cryptographic_Provider_v1.0
lea rcx, [rbp - 0x10]
mov r9d, r14d
xor edx, edx
mov dword [rsp + 0x20], esi
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
je 0x180007054
mov r8, qword [rbp - 8]
mov rcx, qword [rbp - 0x10]
lea r9, [rbp - 0x18]
mov edx, r14d
call qword [sym.imp.CRYPT32.dll_CryptImportPublicKeyInfo]
test eax, eax
je 0x180007054
mov eax, dword [rbp + 0x40]
mov rcx, qword [rbp - 0x18]
xor r9d, r9d
mov dword [rsp + 0x30], eax
mov dword [rbp + 0x30], eax
lea rax, [rbp + 0x30]
mov qword [rsp + 0x28], rax
and qword [rsp + 0x20], rbx
mov r8d, r14d
xor edx, edx
call qword [sym.imp.ADVAPI32.dll_CryptEncrypt]
mov esi, dword [rbp + 0x30]
mov rcx, r14
mov edx, esi
call fcn.180013c1c
mov rdi, rax
test rax, rax
je 0x180007022
mov r9d, dword [rbp + 0x40]
mov r8, r12
mov edx, esi
mov rcx, rax
call fcn.180014dc8
mov eax, dword [rbp + 0x30]
mov rcx, qword [rbp - 0x18]
mov dword [rsp + 0x30], eax
lea rax, [rbp + 0x40]
xor r9d, r9d
mov qword [rsp + 0x28], rax
mov r8d, r14d
xor edx, edx
mov qword [rsp + 0x20], rdi
call qword [sym.imp.ADVAPI32.dll_CryptEncrypt]
test eax, eax
je 0x180007054
mov ecx, dword [rbp + 0x30]
xor r9d, r9d
test ecx, 0xfffffffe
jbe 0x1800071c1
mov r8b, byte [r9 + rdi]
sub ecx, r9d
sub ecx, r14d
mov cl, byte [rcx + rdi]
mov byte [r9 + rdi], cl
mov eax, dword [rbp + 0x30]
sub eax, r9d
add r9d, r14d
sub eax, r14d
mov byte [rax + rdi], r8b
mov ecx, dword [rbp + 0x30]
mov eax, ecx
shr eax, 1
cmp r9d, eax
jb 0x180007194
mov rax, qword [rbp + 0x50]
mov qword [r15], rdi
mov dword [rax], ecx
test ebx, ebx
je 0x1800071db
test rdi, rdi
je 0x1800071db
mov rcx, rdi
call fcn.180013340
mov rcx, qword [rbp - 8]
test rcx, rcx
je 0x1800071ea
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, qword [rbp - 0x18]
test rcx, rcx
je 0x1800071f9
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov rcx, qword [rbp - 0x10]
test rcx, rcx
je 0x18000720a
xor edx, edx
call qword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
lea r11, [rsp + 0x60]
mov eax, ebx
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rbp
ret