Function at 0x14009a830
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push r15
push r14
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x80
mov rdi, rdx
mov rsi, qword [rcx + 8]
mov r15d, dword [rdx + 0x40]
and r15d, dword [rdx + 0x30]
mov eax, dword [rsi + 0x50]
mov dword [rsp + 0x30], eax
mov qword [rsp + 0x34], 4
mov dword [rsp + 0x3c], 0
mov dword [rsp + 0x50], eax
mov qword [rsp + 0x54], 5
mov dword [rsp + 0x5c], 0
movups xmm0, xmmword [rsp + 0x30]
movaps xmmword [rsp + 0x70], xmm0
movaps xmmword [rsp + 0x60], xmm0
mov eax, dword [rdx]
test al, al
jns 0x14009a8b3
movzx edx, byte [rsi + 0x48]
and edx, 1
xor edx, 0xb1
mov rcx, rsi
call fcn.140056810
mov ebx, eax
test eax, eax
jne 0x14009abd5
mov eax, dword [rdi]
test al, 0x10
jne 0x14009a8f3
lea r14, [rsp + 0x70]
nop dword [rax]
test r15d, r15d
je 0x14009a936
tzcnt eax, r15d
lea ebp, [r15 - 1]
and ebp, r15d
mov dword [rsp + 0x74], eax
mov rcx, rsi
mov edx, 0x299
mov r8, r14
call fcn.140056840
mov r15d, ebp
test eax, eax
je 0x14009a8c0
mov ebx, eax
jmp 0x14009abd5
lea r8, [rsp + 0x50]
mov rcx, rsi
mov edx, 0x299
call fcn.140056840
mov ebx, eax
test eax, eax
jne 0x14009abd5
lea r8, [rsp + 0x50]
lea r9, [rsp + 0x30]
mov rcx, rsi
mov edx, 0x1b7
call fcn.140056870
mov ebx, eax
test eax, eax
jne 0x14009abd5
and r15d, 0xffffffdf
jmp 0x14009a8b7
movzx eax, byte [rdi + 6]
cmp eax, 4
je 0x14009a980
cmp eax, 0xff
je 0x14009a980
mov dword [rsp + 0x64], eax
test byte [rdi], 0x10
jne 0x14009a95b
lea r8, [rsp + 0x60]
lea r9, [rsp + 0x30]
jmp 0x14009a969
cmp al, 5
je 0x14009a980
lea r8, [rsp + 0x60]
lea r9, [rsp + 0x50]
mov rcx, rsi
mov edx, 0x1b7
call fcn.140056870
mov ebx, eax
test eax, eax
jne 0x14009abd5
movzx eax, byte [rdi + 0xd]
cmp al, byte [rdi + 0xa]
jb 0x14009a9c0
neg eax
mov qword [rsp + 0x20], 4
mov dword [rsp + 0x28], eax
sar eax, 0x1f
mov dword [rsp + 0x2c], eax
lea r8, [rsp + 0x30]
lea r9, [rsp + 0x20]
mov rcx, rsi
mov edx, reloc.WS2_32.dll_socket
call fcn.140056870
mov ebx, eax
test eax, eax
jne 0x14009abd5
mov eax, dword [rdi + 0x2c]
test eax, eax
je 0x14009a9fd
mov qword [rsp + 0x20], 4
mov dword [rsp + 0x28], eax
mov dword [rsp + 0x2c], 0
lea r8, [rsp + 0x30]
lea r9, [rsp + 0x20]
mov rcx, rsi
mov edx, 0x310
call fcn.140056870
mov ebx, eax
test eax, eax
jne 0x14009abd5
movzx eax, byte [rdi + 0xd]
cmp al, byte [rdi + 0xa]
jb 0x14009aa53
mov eax, dword [rdi + 0x20]
cmp eax, 0xffffffff
je 0x14009aa53
mov ecx, dword [rsp + 0x34]
mov edx, 0xf8
and edx, dword [rsp + 0x30]
or edx, 2
mov dword [rsp + 0x20], edx
mov dword [rsp + 0x24], ecx
mov dword [rsp + 0x28], 0
mov dword [rsp + 0x2c], eax
lea r8, [rsp + 0x20]
lea r9, [rsp + 0x60]
mov rcx, rsi
mov edx, 0x1b7
call fcn.140056870
mov ebx, eax
test eax, eax
jne 0x14009abd5
movaps xmm0, xmmword [0x14010ccd0]
movaps xmmword [rsp + 0x20], xmm0
mov eax, dword [rdi + 0x60]
mov ecx, dword [rsp + 0x34]
mov edx, 0xf8
and edx, dword [rsp + 0x30]
or edx, 2
mov dword [rsp + 0x40], edx
mov dword [rsp + 0x44], ecx
mov dword [rsp + 0x48], 0
mov dword [rsp + 0x4c], eax
mov r12d, dword [rdi + 0x44]
and r12d, dword [rdi + 0x34]
je 0x14009ab13
mov dword [rsp + 0x20], 0x10000161
mov qword [rsp + 0x28], 0
mov eax, dword [rdi]
test eax, 0x10000
mov ecx, 0x1ba
mov edx, 0x4a8
cmove edx, ecx
mov ecx, 0x1dd
mov ebp, 0x4c6
cmove ebp, ecx
test al, 0x40
cmovne ebp, edx
lea r14, [rsp + 0x40]
lea r15, [rsp + 0x20]
nop word cs:[rax + rax]
tzcnt eax, r12d
mov dword [rsp + 0x24], eax
mov rcx, rsi
mov edx, ebp
mov r8, r14
mov r9, r15
call fcn.140056870
test eax, eax
jne 0x14009a8ec
add dword [rsp + 0x4c], 0x10
lea eax, [r12 - 1]
and eax, r12d
mov r12d, eax
jne 0x14009aae0
mov r12d, dword [rdi + 0x48]
and r12d, dword [rdi + 0x38]
je 0x14009ab71
mov dword [rsp + 0x20], 0x289
mov qword [rsp + 0x28], 0
lea r14, [rsp + 0x40]
lea r15, [rsp + 0x20]
nop dword [rax + rax]
tzcnt eax, r12d
mov dword [rsp + 0x24], eax
mov rcx, rsi
mov edx, 0x167
mov r8, r14
mov r9, r15
call fcn.140056870
test eax, eax
jne 0x14009a8ec
lea eax, [r12 - 1]
and eax, r12d
mov r12d, eax
jne 0x14009ab40
mov r15d, dword [rdi + 0x4c]
xor ebx, ebx
and r15d, dword [rdi + 0x3c]
je 0x14009abd5
mov dword [rsp + 0x20], 0x8000391
mov qword [rsp + 0x28], 0
lea rdi, [rsp + 0x40]
lea r14, [rsp + 0x20]
nop dword [rax + rax]
tzcnt eax, r15d
mov dword [rsp + 0x24], eax
mov rcx, rsi
mov edx, 0x1d3
mov r8, rdi
mov r9, r14
call fcn.140056870
test eax, eax
jne 0x14009a8ec
add dword [rsp + 0x4c], 8
lea eax, [r15 - 1]
and eax, r15d
mov r15d, eax
jne 0x14009aba0
mov eax, ebx
add rsp, 0x80
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r14
pop r15
ret