Function at 0x18003d3f0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov qword [rsp + 8], rcx
push rbp
push rsi
push r14
sub rsp, 0x30
mov rbp, rcx
xor esi, esi
mov rcx, qword [rcx]
mov r14, rdx
mov dword [rsp], esi
cmp dword [rbp + 0x14], esi
jle 0x18003da09
mov qword [rsp + 0x58], rbx
mov qword [rsp + 0x28], rdi
mov qword [rsp + 0x20], r12
mov qword [rsp + 0x18], r13
mov qword [rsp + 0x10], r15
nop dword [rax]
movsxd rax, dword [rbp + 0x1c]
mov r15, rcx
mov r13d, dword [r15]
lea rcx, [rcx + rax*4]
dec r13d
mov qword [rsp + 8], rcx
test r13d, r13d
jle 0x18003d9e2
mov edx, dword [rbp + 0xc]
add r15, 4
mov rdi, qword [r14 + 8]
add edx, esi
mov r10, qword [r14]
xor r8d, r8d
movsxd rax, edx
sub edx, dword [r14 + 0x18]
mov r9d, dword [r15]
movsxd rcx, dword [r10 + 0x14]
imul rcx, rax
mov eax, edx
add rcx, qword [r10]
cdq
mov qword [r14 + 0x20], rcx
idiv dword [rdi + 0x20]
movsxd rax, dword [rdi + 0x14]
movsxd rcx, edx
imul rcx, rax
add rcx, qword [rdi]
sub r13d, 1
mov qword [r14 + 0x28], rcx
mov dword [rsp + 0x68], r13d
js 0x18003d83e
nop dword [rax]
nop word [rax + rax]
mov ebp, dword [r15 + 4]
lea r15, [r15 + 8]
mov r12d, dword [r15]
mov eax, r12d
cdq
movzx esi, dl
add esi, eax
mov eax, r9d
cdq
sar esi, 8
movzx edx, dl
add eax, edx
sar eax, 8
mov edi, eax
cmp esi, eax
jne 0x18003d4ea
mov eax, r12d
sub eax, r9d
imul eax, ebp
add r8d, eax
jmp 0x18003d81d
movzx eax, r9b
mov ecx, 0x100
sub ecx, eax
imul ecx, ebp
lea eax, [r8 + rcx]
cdq
movzx edx, dl
add eax, edx
sar eax, 8
mov ebx, eax
test eax, eax
jle 0x18003d6b4
mov rax, qword [r14]
mov edx, dword [r14 + 0x14]
mov ecx, dword [rax + 0x18]
mov eax, edi
sub eax, edx
imul ecx, edi
cdq
cmp ebx, 0xff
jl 0x18003d5ee
movsxd rbx, ecx
mov rcx, qword [r14 + 8]
add rbx, qword [r14 + 0x20]
idiv dword [rcx + 0x1c]
movzx r11d, byte [rbx + 1]
imul edx, dword [rcx + 0x18]
movsxd r8, edx
mov edx, 0x100
add r8, qword [r14 + 0x28]
movzx ecx, byte [r8 + 1]
movzx r9d, byte [r8 + 2]
or ecx, 0xff0000
imul ecx, dword [r14 + 0x10]
shl r9d, 0x10
shr ecx, 8
and ecx, 0xff00ff
mov eax, ecx
shr eax, 0x10
sub edx, eax
movzx eax, byte [r8]
or r9d, eax
imul r11d, edx
imul r9d, dword [r14 + 0x10]
movzx eax, byte [rbx]
shr r11d, 8
add r11d, ecx
shr r9d, 8
movzx ecx, byte [rbx + 2]
and r9d, 0xff00ff
shl ecx, 0x10
or ecx, eax
imul ecx, edx
shr ecx, 8
and ecx, 0xff00ff
add r9d, ecx
mov ecx, 0x100
mov eax, r9d
shr eax, 8
and eax, 0xff00ff
sub ecx, eax
mov eax, r11d
shr eax, 8
or ecx, r9d
neg al
and ecx, 0xff00ff
or al, r11b
mov byte [rbx], cl
mov byte [rbx + 1], al
mov eax, ecx
shr eax, 0x10
mov byte [rbx + 2], al
jmp 0x18003d6b4
imul ebx, dword [r14 + 0x10]
movsxd r11, ecx
mov rcx, qword [r14 + 8]
add r11, qword [r14 + 0x20]
sar ebx, 8
idiv dword [rcx + 0x1c]
movzx r10d, byte [r11 + 1]
imul edx, dword [rcx + 0x18]
movsxd r8, edx
mov edx, 0x100
add r8, qword [r14 + 0x28]
movzx ecx, byte [r8 + 1]
movzx r9d, byte [r8 + 2]
or ecx, 0xff0000
imul ecx, ebx
shl r9d, 0x10
shr ecx, 8
and ecx, 0xff00ff
mov eax, ecx
shr eax, 0x10
sub edx, eax
movzx eax, byte [r8]
or r9d, eax
imul r10d, edx
movzx eax, byte [r11]
imul r9d, ebx
shr r10d, 8
add r10d, ecx
movzx ecx, byte [r11 + 2]
shl ecx, 0x10
or ecx, eax
shr r9d, 8
imul ecx, edx
and r9d, 0xff00ff
shr ecx, 8
and ecx, 0xff00ff
add r9d, ecx
mov ecx, 0x100
mov eax, r9d
shr eax, 8
and eax, 0xff00ff
sub ecx, eax
mov eax, r10d
shr eax, 8
or ecx, r9d
neg al
and ecx, 0xff00ff
or al, r10b
mov byte [r11], cl
mov byte [r11 + 1], al
mov eax, ecx
shr eax, 0x10
mov byte [r11 + 2], al
test ebp, ebp
jle 0x18003d815
inc edi
sub esi, edi
test esi, esi
jle 0x18003d815
mov rax, qword [r14]
mov ebx, ebp
imul ebx, dword [r14 + 0x10]
movsxd rdx, dword [rax + 0x18]
mov eax, edx
imul eax, edi
sub edi, dword [r14 + 0x14]
sar ebx, 8
movsxd rcx, eax
add rcx, qword [r14 + 0x20]
cmp ebx, 0xfe
jge 0x18003d7d0
mov r13, rdx
nop dword [rax + rax]
mov r8, qword [r14 + 8]
mov eax, edi
movzx r11d, byte [rcx + 1]
cdq
mov r9d, 0x100
inc edi
dec esi
idiv dword [r8 + 0x1c]
imul edx, dword [r8 + 0x18]
movsxd r8, edx
add r8, qword [r14 + 0x28]
movzx edx, byte [r8 + 1]
movzx r10d, byte [r8 + 2]
or edx, 0xff0000
imul edx, ebx
shl r10d, 0x10
shr edx, 8
and edx, 0xff00ff
mov eax, edx
shr eax, 0x10
sub r9d, eax
movzx eax, byte [r8]
or r10d, eax
imul r11d, r9d
movzx eax, byte [rcx]
imul r10d, ebx
shr r11d, 8
add r11d, edx
movzx edx, byte [rcx + 2]
shl edx, 0x10
or edx, eax
shr r10d, 8
imul edx, r9d
and r10d, 0xff00ff
shr edx, 8
and edx, 0xff00ff
add r10d, edx
mov edx, 0x100
mov eax, r10d
shr eax, 8
and eax, 0xff00ff
sub edx, eax
mov eax, r11d
shr eax, 8
or edx, r10d
neg al
and edx, 0xff00ff
or al, r11b
mov byte [rcx], dl
mov byte [rcx + 1], al
mov eax, edx
shr eax, 0x10
mov byte [rcx + 2], al
add rcx, r13
test esi, esi
jg 0x18003d700
mov r13d, dword [rsp + 0x68]
jmp 0x18003d815
mov r10, rdx
mov r8, qword [r14 + 8]
mov eax, edi
cdq
inc edi
dec esi
idiv dword [r8 + 0x1c]
mov rax, qword [r14 + 0x28]
imul edx, dword [r8 + 0x18]
movsxd rdx, edx
movzx r8d, word [rdx + rax]
movzx r9d, byte [rdx + rax + 2]
mov word [rsp + 0x60], r8w
movzx eax, byte [rsp + 0x61]
mov byte [rcx + 1], al
mov byte [rcx], r8b
mov byte [rcx + 2], r9b
add rcx, r10
test esi, esi
jg 0x18003d7d3
movzx r8d, r12b
imul r8d, ebp
sub r13d, 1
mov r9d, r12d
mov dword [rsp + 0x68], r13d
jns 0x18003d4b0
mov r10, qword [r14]
mov rdi, qword [r14 + 8]
mov esi, dword [rsp]
mov rbp, qword [rsp + 0x50]
mov eax, r8d
cdq
movzx edx, dl
add eax, edx
sar eax, 8
mov ebx, eax
test eax, eax
jle 0x18003d9dd
mov ecx, dword [r10 + 0x18]
mov eax, r9d
cdq
movzx edx, dl
add eax, edx
mov edx, dword [r14 + 0x14]
sar eax, 8
imul ecx, eax
sub eax, edx
cdq
idiv dword [rdi + 0x1c]
imul edx, dword [rdi + 0x18]
movsxd r8, edx
mov edx, 0x100
add r8, qword [r14 + 0x28]
movzx r9d, byte [r8 + 2]
shl r9d, 0x10
cmp ebx, 0xff
jl 0x18003d937
movsxd rbx, ecx
add rbx, qword [r14 + 0x20]
movzx ecx, byte [r8 + 1]
or ecx, 0xff0000
imul ecx, dword [r14 + 0x10]
movzx r11d, byte [rbx + 1]
shr ecx, 8
and ecx, 0xff00ff
mov eax, ecx
shr eax, 0x10
sub edx, eax
movzx eax, byte [r8]
or r9d, eax
imul r11d, edx
imul r9d, dword [r14 + 0x10]
movzx eax, byte [rbx]
shr r11d, 8
add r11d, ecx
shr r9d, 8
movzx ecx, byte [rbx + 2]
and r9d, 0xff00ff
shl ecx, 0x10
or ecx, eax
imul ecx, edx
shr ecx, 8
and ecx, 0xff00ff
add r9d, ecx
mov ecx, 0x100
mov eax, r9d
shr eax, 8
and eax, 0xff00ff
sub ecx, eax
mov eax, r11d
shr eax, 8
or ecx, r9d
neg al
and ecx, 0xff00ff
or al, r11b
mov byte [rbx], cl
mov byte [rbx + 1], al
mov eax, ecx
shr eax, 0x10
mov byte [rbx + 2], al
jmp 0x18003d9dd
imul ebx, dword [r14 + 0x10]
movsxd r11, ecx
add r11, qword [r14 + 0x20]
movzx ecx, byte [r8 + 1]
or ecx, 0xff0000
sar ebx, 8
movzx r10d, byte [r11 + 1]
imul ecx, ebx
shr ecx, 8
and ecx, 0xff00ff
mov eax, ecx
shr eax, 0x10
sub edx, eax
movzx eax, byte [r8]
or r9d, eax
imul r10d, edx
movzx eax, byte [r11]
imul r9d, ebx
shr r10d, 8
add r10d, ecx
movzx ecx, byte [r11 + 2]
shl ecx, 0x10
or ecx, eax
shr r9d, 8
imul ecx, edx
and r9d, 0xff00ff
shr ecx, 8
and ecx, 0xff00ff
add r9d, ecx
mov ecx, 0x100
mov eax, r9d
shr eax, 8
and eax, 0xff00ff
sub ecx, eax
mov eax, r10d
shr eax, 8
or ecx, r9d
neg al
and ecx, 0xff00ff
or al, r10b
mov byte [r11], cl
mov byte [r11 + 1], al
mov eax, ecx
shr eax, 0x10
mov byte [r11 + 2], al
mov rcx, qword [rsp + 8]
inc esi
mov dword [rsp], esi
cmp esi, dword [rbp + 0x14]
jl 0x18003d430
mov r15, qword [rsp + 0x10]
mov r13, qword [rsp + 0x18]
mov r12, qword [rsp + 0x20]
mov rdi, qword [rsp + 0x28]
mov rbx, qword [rsp + 0x58]
add rsp, 0x30
pop r14
pop rsi
pop rbp
ret