Function at 0x140041070
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x48
mov r15, r8
mov r13, rdx
mov r12, rcx
mov ecx, dword [rsp + 0xb0]
test ecx, ecx
mov eax, 6
cmovns eax, ecx
movd ebp, xmm3
mov ecx, ebp
and ecx, 0x7fffff
lea r9d, [rcx + rcx]
cmp ebp, 0x7fffff
ja 0x1400410be
test ecx, ecx
mov ebp, 0xffffff82
cmove ebp, ecx
jmp 0x1400410cb
shr ebp, 0x17
or r9d, 0x1000000
add ebp, 0xffffff81
mov ebx, ebp
neg ebx
cmovs ebx, ebp
mov rcx, r15
sub rcx, r13
mov esi, eax
sub rcx, rsi
jl 0x140041108
xor esi, esi
cmp ebx, 0x64
setb sil
xor rsi, 3
cmp ebx, 0xa
mov edi, 1
cmovae rdi, rsi
cmp eax, 1
sbb rdi, 0
add rdi, 4
cmp rcx, rdi
jge 0x14004111a
mov qword [r12], r15
mov dword [r12 + 8], 0x84
jmp 0x140041312
shr ebp, 0x1f
add bpl, bpl
add bpl, 0x2b
cmp eax, 5
ja 0x140041193
lea esi, [rax*4]
lea r8d, [r9 + r9]
lea edi, [r9 + r9]
dec edi
or edi, r9d
mov cl, 0x18
sub cl, sil
mov esi, 1
shl esi, cl
and edi, r8d
and esi, edi
add esi, r9d
mov ecx, esi
shr ecx, 0x18
add cl, 0x30
mov byte [r13], cl
test eax, eax
je 0x14004122c
mov byte [r13 + 1], reloc.WLDAP32.dll_Ordinal_46
mov edx, esi
shr edx, 0x14
and edx, 0xf
lea rcx, [0x14025b760]
movzx edx, byte [rdx + rcx]
mov byte [r13 + 2], dl
cmp eax, 1
jne 0x140041231
add r13, 3
jmp 0x140041294
mov ecx, r9d
shr ecx, 0x18
or cl, 0x30
mov byte [r13], cl
mov byte [r13 + 1], reloc.WLDAP32.dll_Ordinal_46
mov edx, r9d
shr edx, 0x14
and edx, 0xf
lea rcx, [0x14025b760]
movzx edx, byte [rdx + rcx]
mov byte [r13 + 2], dl
mov edx, r9d
shr edx, 0x10
and edx, 0xf
movzx edx, byte [rdx + rcx]
mov byte [r13 + 3], dl
mov edx, r9d
shr edx, 0xc
and edx, 0xf
movzx edx, byte [rdx + rcx]
mov byte [r13 + 4], dl
mov edx, r9d
shr edx, 8
and edx, 0xf
movzx edx, byte [rdx + rcx]
mov byte [r13 + 5], dl
mov edx, r9d
shr edx, 4
and edx, 0xf
movzx edx, byte [rdx + rcx]
mov byte [r13 + 6], dl
and r9d, 0xf
movzx ecx, byte [r9 + rcx]
mov byte [r13 + 7], cl
add r13, 8
add eax, 0xfffffffa
je 0x140041294
mov r14d, eax
mov rcx, r13
mov dl, 0x30
mov r8, r14
call fcn.14021ea60
add r13, r14
jmp 0x140041294
inc r13
jmp 0x140041294
mov edx, esi
shr edx, 0x10
and edx, 0xf
movzx edx, byte [rdx + rcx]
mov byte [r13 + 3], dl
cmp eax, 2
jne 0x14004124c
add r13, 4
jmp 0x140041294
mov edx, esi
shr edx, 0xc
and edx, 0xf
movzx edx, byte [rdx + rcx]
mov byte [r13 + 4], dl
cmp eax, 3
jne 0x140041267
add r13, 5
jmp 0x140041294
mov edx, esi
shr edx, 8
and edx, 0xf
movzx edx, byte [rdx + rcx]
mov byte [r13 + 5], dl
cmp eax, 4
jne 0x140041282
add r13, 6
jmp 0x140041294
shr esi, 4
and esi, 0xf
movzx eax, byte [rsi + rcx]
mov byte [r13 + 6], al
add r13, 7
mov byte [r13], reloc.WS2_32.dll_WSASetLastError
mov byte [r13 + 1], bpl
xor esi, esi
mov eax, 0xcccccccd
nop word cs:[rax + rax]
mov ecx, ebx
imul rcx, rax
shr rcx, 0x23
lea edx, [rcx + rcx]
lea edx, [rdx + rdx*4]
mov ebp, ebx
sub ebp, edx
or bpl, 0x30
mov byte [rsp + rsi + 0x3f], bpl
dec rsi
cmp ebx, 9
mov ebx, ecx
ja 0x1400412b0
add r13, 2
mov r8, rsi
neg r8
mov rcx, r15
sub rcx, r13
mov eax, 0x84
cmp rcx, r8
jl 0x140041309
lea rdx, [rsp + rsi]
add rdx, 0x40
mov rcx, r13
call fcn.14021e3b0
sub r13, rsi
xor eax, eax
mov r15, r13
mov qword [r12], r15
mov dword [r12 + 8], eax
mov rax, r12
add rsp, 0x48
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret