Function at 0x140053170
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push rbx
push rsi
push r14
sub rsp, 0x30
mov qword [rsp + 0x60], r12
mov qword [rsp + 0x28], r13
mov rsi, r8
mov r13d, r9d
mov r14, rdx
mov rbx, rcx
test rdx, rdx
jne 0x1400531a4
call fcn.140053c00
mov r14d, dword [rbx]
cdqe
add rax, rbx
add r14, rax
cmp word [rsi + 0x16], 0x10
mov qword [rsp + 0x50], rbp
je 0x1400531c8
cmp dword [rbx + 8], 0
jl 0x1400531c8
mov eax, dword [rsi + 4]
dec eax
imul eax, dword [rsi + 8]
movsxd rbp, eax
add rbp, qword [rsi + 0x30]
jmp 0x1400531cc
mov rbp, qword [rsi + 0x30]
cmp dword [rbx + 0x10], 3
mov r12, r14
jne 0x1400531d9
add r14, 0xc
mov eax, dword [rbx + 8]
mov qword [rsp + 0x58], rdi
cdq
xor eax, edx
sub eax, edx
test eax, eax
jle 0x14005365c
mov qword [rsp + 0x20], r15
mov r15d, eax
nop word [rax + rax]
movzx eax, word [rbx + 0xe]
mov rcx, r14
mov r9, rbp
cmp ax, 1
jne 0x140053224
movsxd r8, dword [rsi + 8]
mov rdx, r14
mov rcx, rbp
call fcn.1401bd6e0
jmp 0x140053615
cmp ax, 4
jne 0x14005326f
xor edx, edx
cmp dword [rbx + 4], edx
jle 0x140053615
nop word [rax + rax]
movzx eax, byte [rcx]
inc edx
inc r9
shr al, 4
mov byte [r9 - 1], al
cmp edx, dword [rbx + 4]
je 0x140053263
movzx eax, byte [rcx]
inc r9
and al, 0xf
inc rcx
mov byte [r9 - 1], al
inc edx
cmp edx, dword [rbx + 4]
jl 0x140053240
jmp 0x140053615
cmp ax, 8
jne 0x140053289
movsxd r8, dword [rbx + 4]
mov rdx, r14
mov rcx, rbp
call fcn.1401bd6e0
jmp 0x140053615
cmp ax, 0x10
jne 0x1400533e4
xor r10d, r10d
cmp dword [r12], 0xf800
jne 0x140053341
cmp dword [rbx + 4], r10d
jle 0x140053615
nop
movzx eax, word [rcx]
inc r10d
lea r9, [r9 + 3]
shr eax, 0xb
lea rcx, [rcx + 2]
imul r8d, eax, 0xff
mov eax, 0x8421085
mul r8d
sub r8d, edx
shr r8d, 1
add r8d, edx
shr r8d, 4
mov byte [r9 - 3], r8b
movzx eax, word [rcx - 2]
shr eax, 6
and eax, 0x1f
imul r8d, eax, 0xff
mov eax, 0x8421085
mul r8d
sub r8d, edx
shr r8d, 1
add r8d, edx
shr r8d, 4
mov byte [r9 - 2], r8b
movzx eax, word [rcx - 2]
and eax, 0x1f
imul r8d, eax, 0xff
mov eax, 0x8421085
mul r8d
sub r8d, edx
shr r8d, 1
add r8d, edx
shr r8d, 4
mov byte [r9 - 1], r8b
cmp r10d, dword [rbx + 4]
jl 0x1400532b0
jmp 0x140053615
cmp dword [rbx + 4], r10d
jle 0x140053615
nop dword [rax + rax]
movzx eax, word [rcx]
inc r10d
lea r9, [r9 + 3]
shr eax, 0xa
lea rcx, [rcx + 2]
and eax, 0x1f
imul r8d, eax, 0xff
mov eax, 0x8421085
mul r8d
sub r8d, edx
shr r8d, 1
add r8d, edx
shr r8d, 4
mov byte [r9 - 3], r8b
movzx eax, word [rcx - 2]
shr eax, 5
and eax, 0x1f
imul r8d, eax, 0xff
mov eax, 0x8421085
mul r8d
sub r8d, edx
shr r8d, 1
add r8d, edx
shr r8d, 4
mov byte [r9 - 2], r8b
movzx eax, word [rcx - 2]
and eax, 0x1f
imul r8d, eax, 0xff
mov eax, 0x8421085
mul r8d
sub r8d, edx
shr r8d, 1
add r8d, edx
shr r8d, 4
mov byte [r9 - 1], r8b
cmp r10d, dword [rbx + 4]
jl 0x140053350
jmp 0x140053615
test byte [rsi + 0xc], 0x40
je 0x1400534bb
cmp ax, 0x18
jne 0x140053428
xor edx, edx
cmp dword [rbx + 4], edx
jle 0x14005346e
nop dword [rax + rax]
movzx eax, byte [rcx]
inc edx
add r9, 3
mov byte [r9 - 3], al
movzx eax, byte [rcx + 1]
add rcx, 3
mov byte [r9 - 2], al
movzx eax, byte [rcx - 1]
mov byte [r9 - 1], al
cmp edx, dword [rbx + 4]
jl 0x140053400
jmp 0x14005346e
cmp word [rsi + 0x12], 4
jne 0x14005346e
cmp ax, 0x20
jne 0x140053615
xor edx, edx
cmp dword [rbx + 4], edx
jle 0x14005346e
movzx eax, byte [rcx]
inc edx
add r9, 4
mov byte [r9 - 4], al
movzx eax, byte [rcx + 1]
add rcx, 4
mov byte [r9 - 3], al
movzx eax, byte [rcx - 2]
mov byte [r9 - 2], al
movzx eax, byte [rcx - 1]
mov byte [r9 - 1], al
cmp edx, dword [rbx + 4]
jl 0x140053440
cmp word [rbx + 0xe], 0x20
jne 0x140053615
xor edx, edx
cmp dword [rbx + 4], edx
jle 0x140053615
add r9, 2
nop dword [rax + rax]
movzx eax, byte [rcx]
inc edx
lea rcx, [rcx + 4]
mov byte [r9 - 2], al
movzx eax, byte [rcx - 3]
lea r9, [r9 + 3]
mov byte [r9 - 4], al
movzx eax, byte [rcx - 2]
mov byte [r9 - 3], al
cmp edx, dword [rbx + 4]
jl 0x140053490
jmp 0x140053615
cmp ax, 0x18
jne 0x1400534fc
xor r8d, r8d
cmp dword [rbx + 4], r8d
jle 0x140053615
lea rdx, [rbp + 1]
movzx eax, byte [rcx]
inc r8d
lea rcx, [rcx + 3]
mov byte [rdx + 1], al
movzx eax, byte [rcx - 2]
lea rdx, [rdx + 3]
mov byte [rdx - 3], al
movzx eax, byte [rcx - 1]
mov byte [rdx - 4], al
cmp r8d, dword [rbx + 4]
jl 0x1400534d2
jmp 0x140053615
cmp ax, 0x20
jne 0x140053615
cmp word [rsi + 0x12], 4
jne 0x1400535de
test r13d, r13d
je 0x14005359f
xor r10d, r10d
cmp dword [rbx + 4], r10d
jle 0x140053615
lea r9, [rbp + 3]
nop dword [rax + rax]
movzx r11d, byte [rcx]
lea rcx, [rcx + 4]
mov byte [r9 - 1], r11b
movzx edi, byte [rcx - 3]
mov byte [r9 - 2], dil
movzx edx, byte [rcx - 2]
mov byte [r9 - 3], dl
movzx eax, byte [rcx - 1]
mov byte [r9], al
test al, al
je 0x140053590
movzx r8d, al
movzx eax, dl
imul eax, eax, 0xff
cdq
idiv r8d
mov byte [r9 - 3], al
movzx eax, dil
imul eax, eax, 0xff
cdq
idiv r8d
mov byte [r9 - 2], al
movzx eax, r11b
imul eax, eax, 0xff
cdq
idiv r8d
mov byte [r9 - 1], al
inc r10d
add r9, 4
cmp r10d, dword [rbx + 4]
jl 0x140053530
jmp 0x140053615
xor r8d, r8d
cmp dword [rbx + 4], r8d
jle 0x140053615
lea rdx, [rbp + 1]
nop dword [rax]
movzx eax, byte [rcx]
inc r8d
lea rcx, [rcx + 4]
mov byte [rdx + 1], al
movzx eax, byte [rcx - 3]
lea rdx, [rdx + 4]
mov byte [rdx - 4], al
movzx eax, byte [rcx - 2]
mov byte [rdx - 5], al
movzx eax, byte [rcx - 1]
mov byte [rdx - 2], al
cmp r8d, dword [rbx + 4]
jl 0x1400535b0
jmp 0x140053615
xor r8d, r8d
cmp dword [rbx + 4], r8d
jle 0x140053615
lea rdx, [rbp + 1]
nop dword [rax + rax]
movzx eax, byte [rcx]
inc r8d
lea rcx, [rcx + 4]
mov byte [rdx + 1], al
movzx eax, byte [rcx - 3]
lea rdx, [rdx + 3]
mov byte [rdx - 3], al
movzx eax, byte [rcx - 2]
mov byte [rdx - 4], al
cmp r8d, dword [rbx + 4]
jl 0x1400535f0
movzx eax, word [rbx + 0xe]
imul eax, dword [rbx + 4]
add eax, 0x1f
cdq
and edx, 0x1f
add eax, edx
sar eax, 5
shl eax, 2
cdqe
add r14, rax
cmp word [rsi + 0x16], 0x10
je 0x140053647
cmp dword [rbx + 8], 0
jl 0x140053647
movsxd rax, dword [rsi + 8]
sub rbp, rax
jmp 0x14005364e
movsxd rax, dword [rsi + 8]
add rbp, rax
dec r15
jne 0x140053200
mov r15, qword [rsp + 0x20]
movzx eax, word [rbx + 0xe]
mov r13, qword [rsp + 0x28]
mov r12, qword [rsp + 0x60]
cmp ax, 1
jne 0x14005367e
mov eax, 1
mov word [rsi + 0xc], ax
jmp 0x140053788
cmp ax, 8
ja 0x140053788
mov rcx, rbx
call fcn.140053bc0
test eax, eax
jle 0x140053788
mov r14d, dword [rbx]
mov edi, 4
mov ecx, edi
inc r14
call fcn.140063420
mov word [rsi + 0xc], di
xor ebp, ebp
mov qword [rsi + 0x28], rax
movzx ecx, byte [rbx + 0xe]
mov eax, 1
shl ax, cl
mov rcx, rbx
mov word [rsi + 0x20], ax
call fcn.140053bc0
test eax, eax
jle 0x140053721
xor edi, edi
add r14, rbx
nop word [rax + rax]
movzx eax, byte [r14 + 1]
mov rcx, qword [rsi + 0x28]
inc ebp
mov byte [rdi + rcx], al
movzx eax, byte [r14]
mov rcx, qword [rsi + 0x28]
mov byte [rcx + rdi + 0x100], al
movzx eax, byte [r14 - 1]
mov rcx, qword [rsi + 0x28]
mov byte [rcx + rdi + 0x200], al
mov rcx, rbx
lea rdi, [rdi + 1]
lea r14, [r14 + 4]
call fcn.140053bc0
cmp ebp, eax
jl 0x1400536e0
movsx r9d, word [rsi + 0x20]
xor ecx, ecx
test r9d, r9d
jle 0x140053760
mov r8, qword [rsi + 0x28]
xor edx, edx
movzx eax, byte [rdx + r8]
cmp eax, ecx
je 0x140053756
movzx eax, byte [rdx + r8 + 0x100]
cmp eax, ecx
je 0x140053756
movzx eax, byte [rdx + r8 + 0x200]
cmp eax, ecx
jne 0x140053760
inc ecx
inc rdx
cmp ecx, r9d
jl 0x140053733
cmp ecx, r9d
jne 0x140053788
mov rcx, qword [rsi + 0x28]
mov eax, 2
mov word [rsi + 0xc], ax
mov eax, 0x100
mov word [rsi + 0x20], ax
call fcn.1401be23c
mov qword [rsi + 0x28], 0
mov rdi, qword [rsp + 0x58]
mov rbp, qword [rsp + 0x50]
add rsp, 0x30
pop r14
pop rsi
pop rbx
ret