Function at 0x18000707c
Capabilities:
Encrypt or decrypt via wincrypt
Generate random numbers via winapi

Disassembly:
mov rax, rsp
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r15
sub rsp, 0x50
mov rbx, rcx
xor ebp, ebp
and qword [rax + 0x10], rbp
mov rcx, rdx
mov r15, r9
mov r12, r8
mov rsi, rdx
call fcn.180006648
mov r8, qword [rbx + 0x20]
lea r13d, [rbp + 0x10]
lea edi, [rbp + 0x20]
mov r9d, r13d
add r8, rdi
lea rcx, [rsi + 4]
mov edx, r13d
call fcn.180007750
mov rax, qword [rbx + 0xa0]
test rax, rax
je 0x180007257
cmp dword [rax + 0x14], ebp
je 0x180007257
cmp dword [rax + 0x44], ebp
je 0x180007250
mov rcx, qword [rax + 8]
lea r9, [rsp + 0x98]
xor r8d, r8d
xor edx, edx
call qword [sym.imp.ADVAPI32.dll_CryptDuplicateKey]
test eax, eax
je 0x18000716e
mov rcx, qword [rsp + 0x98]
lea r8, [rsp + 0x90]
xor r9d, r9d
mov dword [rsp + 0x90], 1
lea edx, [rbp + 4]
call qword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x18000716e
mov rcx, qword [rbx + 0xa0]
lea r8, [rsp + 0x40]
mov edx, r13d
mov rcx, qword [rcx]
call qword [sym.imp.ADVAPI32.dll_CryptGenRandom]
test eax, eax
jne 0x180007150
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
mov rcx, qword [rsp + 0x98]
lea r8, [rsp + 0x40]
xor r9d, r9d
lea edx, [r9 + 1]
call qword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
jne 0x18000717b
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
jmp 0x180007257
mov ecx, 1
call qword [sym.imp.WS2_32.dll_htonl]
mov edi, dword [rsi + 0x28]
and edi, 0xfffffff0
mov dword [rsi + 0x14], eax
add edi, r13d
lea ecx, [rdi + 0x30]
call fcn.180017740
mov qword [r12], rax
mov qword [rsp + 0xa0], rax
lea r13, [rax + 0x20]
mov eax, dword [rsi + 0x28]
mov dword [r15], eax
lea rbx, [r13 + 0x10]
mov edx, dword [rsi + 0x28]
mov rcx, rbx
mov r8, qword [rsi + 0x20]
mov r9d, edx
call fcn.180007750
mov rcx, qword [rsp + 0x98]
xor r9d, r9d
mov dword [rsp + 0x30], edi
xor edx, edx
mov qword [rsp + 0x28], r15
mov qword [rsp + 0x20], rbx
lea r8d, [r9 + 1]
call qword [sym.imp.ADVAPI32.dll_CryptEncrypt]
test eax, eax
jne 0x1800071f7
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
mov ecx, dword [r15]
add ecx, 0x18
call qword [sym.imp.WS2_32.dll_ntohl]
mov rcx, qword [rsp + 0xa0]
mov edi, 0x20
mov dword [rsi + 0x18], eax
mov r9d, edi
add dword [r15], 0x30
mov edx, edi
mov r8, rsi
call fcn.180007750
test r13, r13
jne 0x18000723b
call fcn.18001b6d0
mov dword [rax], socket
call fcn.18001b5b0
jmp 0x180007257
mov r8d, reloc.WS2_32.dll_recv
lea rdx, [rsp + 0x40]
mov rcx, r13
call fcn.180015ec0
jmp 0x180007257
mov dword [rax + 0x44], 1
mov rdx, qword [r12]
test rdx, rdx
jne 0x1800072aa
mov eax, dword [rsi + 0x28]
add eax, 0x20
mov ecx, eax
mov dword [r15], eax
call fcn.180017740
xor ecx, ecx
mov qword [r12], rax
mov rbx, rax
call qword [sym.imp.WS2_32.dll_htonl]
mov r9, rdi
mov r8, rsi
mov rdx, rdi
mov dword [rsi + 0x14], eax
mov rcx, rbx
call fcn.180007750
mov edx, dword [rsi + 0x28]
lea rcx, [rbx + 0x20]
mov r8, qword [rsi + 0x20]
mov r9d, edx
call fcn.180007750
mov rdx, qword [r12]
mov r8d, dword [r15]
add rdx, 4
sub r8d, 4
mov rcx, rsi
call fcn.1800065f0
mov rcx, qword [rsp + 0x98]
test rcx, rcx
je 0x1800072d0
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov eax, ebp
add rsp, 0x50
pop r15
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret