Function at 0x140041320
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push r12
push r13
sub rsp, 0x18
mov r13, rcx
xor r12d, r12d
mov rcx, qword [rcx]
mov r11, rdx
cmp dword [r13 + 0x14], r12d
jle 0x140041609
mov qword [rsp + 0x38], rbx
mov qword [rsp + 0x40], rbp
mov qword [rsp + 0x48], rsi
mov qword [rsp + 0x10], rdi
mov qword [rsp + 8], r14
mov qword [rsp], r15
nop dword [rax + rax]
movsxd rax, dword [r13 + 0x1c]
mov rdi, rcx
mov r15d, dword [rdi]
lea rcx, [rcx + rax*4]
dec r15d
mov qword [rsp + 0x30], rcx
test r15d, r15d
jle 0x1400415df
mov rdx, qword [r11]
add rdi, 4
mov r8d, dword [r13 + 0xc]
xor r10d, r10d
add r8d, r12d
mov eax, dword [rdx + 0xc]
mov ebx, dword [rdi]
imul eax, r8d
sub r8d, dword [r11 + 0x18]
movsxd rcx, eax
mov eax, r8d
add rcx, qword [rdx]
cdq
mov qword [r11 + 0x20], rcx
mov rcx, qword [r11 + 8]
idiv dword [rcx + 0x18]
imul edx, dword [rcx + 0xc]
movsxd rax, edx
add rax, qword [rcx]
sub r15d, 1
mov qword [r11 + 0x28], rax
js 0x140041568
nop word [rax + rax]
mov esi, dword [rdi + 4]
lea rdi, [rdi + 8]
mov r14d, dword [rdi]
mov ecx, ebx
mov r9d, r14d
sar ecx, 8
sar r9d, 8
cmp r9d, ecx
jne 0x1400413fb
mov eax, r14d
sub eax, ebx
imul eax, esi
add r10d, eax
jmp 0x14004155b
movzx eax, bl
mov ebx, 0x100
sub ebx, eax
imul ebx, esi
add ebx, r10d
sar ebx, 8
test ebx, ebx
jle 0x14004147c
mov rax, qword [r11]
mov r8, qword [r11 + 8]
mov edx, dword [rax + 0x10]
mov eax, ecx
sub eax, dword [r11 + 0x14]
imul edx, ecx
movsxd r10, edx
cdq
idiv dword [r8 + 0x14]
mov rax, qword [r11 + 0x28]
imul edx, dword [r8 + 0x10]
add r10, qword [r11 + 0x20]
movsxd r8, edx
movzx edx, byte [r8 + rax]
mov r8d, dword [r11 + 0x10]
movzx eax, dl
mov edx, 0x100
cmp ebx, 0xff
jge 0x14004145e
imul r8d, ebx
sar r8d, 8
inc r8d
imul r8d, eax
movzx eax, byte [r10]
shr r8d, 8
sub edx, r8d
imul edx, eax
sar edx, 8
add dl, r8b
mov byte [r10], dl
test esi, esi
jle 0x140041553
inc ecx
sub r9d, ecx
test r9d, r9d
jle 0x140041553
mov rax, qword [r11]
movsxd rdx, dword [rax + 0x10]
mov eax, edx
imul eax, ecx
sub ecx, dword [r11 + 0x14]
movsxd r10, eax
mov eax, dword [r11 + 0x10]
add r10, qword [r11 + 0x20]
imul eax, esi
sar eax, 8
cmp eax, 0xfe
jge 0x14004150d
lea ebx, [rax + 1]
mov rbp, rdx
mov r8, qword [r11 + 8]
mov eax, ecx
cdq
inc ecx
dec r9d
idiv dword [r8 + 0x14]
mov eax, dword [r8 + 0x10]
imul eax, edx
movsxd rdx, eax
mov rax, qword [r11 + 0x28]
movzx r8d, byte [rdx + rax]
mov edx, 0x100
movzx eax, byte [r10]
imul r8d, ebx
shr r8d, 8
sub edx, r8d
imul edx, eax
sar edx, 8
add dl, r8b
mov byte [r10], dl
add r10, rbp
test r9d, r9d
jg 0x1400414c0
jmp 0x140041553
mov rbx, rdx
mov r8, qword [r11 + 8]
mov eax, ecx
cdq
inc ecx
dec r9d
idiv dword [r8 + 0x14]
mov eax, dword [r8 + 0x10]
imul eax, edx
movsxd rdx, eax
mov rax, qword [r11 + 0x28]
movzx r8d, byte [rdx + rax]
mov edx, 0x100
movzx eax, byte [r10]
sub edx, r8d
imul edx, eax
sar edx, 8
add dl, r8b
mov byte [r10], dl
add r10, rbx
test r9d, r9d
jg 0x140041510
movzx r10d, r14b
imul r10d, esi
sub r15d, 1
mov ebx, r14d
jns 0x1400413d0
sar r10d, 8
test r10d, r10d
jle 0x1400415da
mov r8, qword [r11 + 8]
mov rcx, qword [r11]
sar ebx, 8
mov edx, dword [rcx + 0x10]
imul edx, ebx
sub ebx, dword [r11 + 0x14]
mov eax, ebx
movsxd r9, edx
cdq
idiv dword [r8 + 0x14]
mov rax, qword [r11 + 0x28]
imul edx, dword [r8 + 0x10]
add r9, qword [r11 + 0x20]
movsxd rcx, edx
mov edx, dword [r11 + 0x10]
movzx r8d, byte [rcx + rax]
mov ecx, 0x100
movzx eax, r8b
cmp r10d, 0xff
jge 0x1400415c1
imul edx, r10d
sar edx, 8
inc edx
imul edx, eax
movzx eax, byte [r9]
shr edx, 8
sub ecx, edx
imul ecx, eax
sar ecx, 8
add cl, dl
mov byte [r9], cl
mov rcx, qword [rsp + 0x30]
inc r12d
cmp r12d, dword [r13 + 0x14]
jl 0x140041360
mov r15, qword [rsp]
mov r14, qword [rsp + 8]
mov rdi, qword [rsp + 0x10]
mov rsi, qword [rsp + 0x48]
mov rbp, qword [rsp + 0x40]
mov rbx, qword [rsp + 0x38]
add rsp, 0x18
pop r13
pop r12
ret