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

Disassembly:
mov rax, rsp
mov qword [rax + 0x18], rbx
mov qword [rax + 0x20], rbp
push rsi
push rdi
push r12
push r13
push r15
sub rsp, 0x50
mov rbx, rcx
xor ebp, ebp
mov rcx, rdx
and qword [rax + 0x10], rbp
mov r15, r9
mov r12, r8
mov rsi, rdx
call fcn.18000660c
mov r8, qword [rbx + 0x20]
lea edi, [rbp + 0x10]
lea rcx, [rsi + 4]
add r8, 0x20
mov r9d, edi
mov edx, edi
call fcn.180015128
mov rax, qword [rbx + 0xa0]
test rax, rax
je 0x1800071e3
cmp dword [rax + 0x14], ebp
je 0x1800071e3
cmp dword [rax + 0x44], ebp
je 0x1800071dc
mov rcx, qword [rax + 8]
lea r9, [rsp + 0x88]
xor r8d, r8d
xor edx, edx
call qword [sym.imp.ADVAPI32.dll_CryptDuplicateKey]
test eax, eax
jne 0x1800070bc
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
jmp 0x1800071e3
mov rcx, qword [rsp + 0x88]
xor r9d, r9d
lea r8, [rsp + 0x80]
lea edx, [r9 + 4]
mov dword [rsp + 0x80], 1
call qword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x1800070af
mov rcx, qword [rbx + 0xa0]
lea r8, [rsp + 0x40]
mov edx, edi
mov rcx, qword [rcx]
call qword [sym.imp.ADVAPI32.dll_CryptGenRandom]
test eax, eax
jne 0x18000710b
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebp, eax
mov rcx, qword [rsp + 0x88]
xor r9d, r9d
lea r8, [rsp + 0x40]
lea edx, [r9 + 1]
call qword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x1800070af
mov ecx, 1
call qword [sym.imp.WS2_32.dll_htonl]
mov edi, dword [rsi + 0x28]
shr edi, 4
mov dword [rsi + 0x14], eax
inc edi
shl edi, 4
lea ecx, [rdi + 0x30]
call fcn.180013508
mov qword [r12], rax
mov r13, rax
lea rbx, [rax + 0x30]
mov eax, dword [rsi + 0x28]
mov dword [r15], eax
mov edx, dword [rsi + 0x28]
mov r8, qword [rsi + 0x20]
mov r9d, edx
mov rcx, rbx
call fcn.180015128
mov rcx, qword [rsp + 0x88]
xor r9d, r9d
mov dword [rsp + 0x30], edi
lea r8d, [r9 + 1]
xor edx, edx
mov qword [rsp + 0x28], r15
mov qword [rsp + 0x20], rbx
call qword [sym.imp.ADVAPI32.dll_CryptEncrypt]
test eax, eax
jne 0x18000719e
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 edx, 0x20
mov r8, rsi
mov dword [rsi + 0x18], eax
add dword [r15], 0x30
mov r9d, edx
mov rcx, r13
call fcn.180015128
mov edx, 0x10
lea r8, [rsp + 0x40]
lea rcx, [r13 + 0x20]
mov r9d, edx
call fcn.180015128
jmp 0x1800071e3
mov dword [rax + 0x44], 1
cmp qword [r12], 0
jne 0x180007233
mov eax, dword [rsi + 0x28]
add eax, 0x20
mov ecx, eax
mov dword [r15], eax
call fcn.180013508
xor ecx, ecx
mov rbx, rax
mov qword [r12], rax
call qword [sym.imp.WS2_32.dll_htonl]
mov r9d, 0x20
mov r8, rsi
mov rcx, rbx
mov edx, r9d
mov dword [rsi + 0x14], eax
call fcn.180015128
mov edx, dword [rsi + 0x28]
mov r8, qword [rsi + 0x20]
lea rcx, [rbx + 0x20]
mov r9d, edx
call fcn.180015128
mov r8d, dword [r15]
mov rdx, qword [r12]
mov rcx, rsi
sub r8d, 4
add rdx, 4
call fcn.1800065b8
mov rcx, qword [rsp + 0x88]
test rcx, rcx
je 0x18000725d
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
lea r11, [rsp + 0x50]
mov eax, ebp
mov rbx, qword [r11 + 0x40]
mov rbp, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r13
pop r12
pop rdi
pop rsi
ret