Function at 0x1401781dc
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov rax, rsp
mov qword [rax + 0x20], r9
mov qword [rax + 0x18], r8
mov qword [rax + 0x10], rdx
mov qword [rax + 8], rcx
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x48]
sub rsp, 0x148
mov rax, qword [rcx]
xor r12d, r12d
mov rbx, rcx
mov dword [rax + 8], r12d
call fcn.1401777f4
mov rcx, qword [rbx]
test eax, eax
jne 0x140178235
mov edx, dword [rcx + 8]
xor r8d, r8d
mov rcx, rbx
call fcn.1401770f8
xor eax, eax
jmp 0x14017870e
mov eax, dword [rcx + 8]
cmp eax, 3
jne 0x140178315
cmp dword [rbx + 0x4850], eax
je 0x140178263
cmp dword [rbx + 0x484c], r12d
jne 0x140178315
cmp dword [rbx + 0x4848], r12d
jne 0x140178315
mov r13d, 1
mov qword [rbp + 0xa8], r13
mov qword [rsp + 0x40], rax
xorps xmm0, xmm0
xorps xmm1, xmm1
mov r15, rax
movdqu xmmword [rsp + 0x50], xmm0
movdqu xmmword [rsp + 0x60], xmm1
test eax, eax
je 0x140178383
mov r14, r12
lea rdi, [rbp - 0x68]
lea rsi, [rbx + 0x46a4]
mov rax, qword [rbx]
mov ecx, dword [rax]
add ecx, 3
call fcn.1403ddfc0
mov qword [rsi + 0x44], rax
test rax, rax
je 0x1401783ad
mov eax, dword [rbx + 0x4688]
cdq
mov dword [rdi + 0x10], r12d
idiv dword [rsi]
mov r9d, eax
mov dword [rdi], eax
mov eax, dword [rbx + 0x468c]
cdq
idiv dword [rsi + 4]
xor edx, edx
mov ecx, eax
mov dword [rdi + 4], eax
sar ecx, 1
mov r8d, eax
mov dword [rdi + 0xc], ecx
mov rcx, qword [rbx]
mov eax, dword [rcx]
mov rcx, qword [rsi + 0x2c]
dec eax
add eax, r9d
mov qword [rdi - 8], rcx
div r9d
mov qword [rdi - 0x10], rcx
mov dword [rdi + 8], eax
cmp r9d, 1
jne 0x14017833d
cmp r8d, r9d
jne 0x14017832e
lea rax, [0x140177a30]
jmp 0x140178368
mov qword [rbp + 0xa8], r12
mov r13, r12
test eax, eax
jg 0x140178270
mov edx, eax
jmp 0x140178223
cmp r8d, 2
jne 0x140178361
lea rax, [0x140177a40]
jmp 0x140178368
cmp r9d, 2
jne 0x140178361
cmp r8d, 1
jne 0x140178352
lea rax, [0x140177a90]
jmp 0x140178368
cmp r8d, 2
jne 0x140178361
mov rax, qword [rbx + 0x4880]
jmp 0x140178368
lea rax, [0x140177e00]
mov qword [rdi - 0x18], rax
inc r14
add rdi, 0x30
add rsi, 0x60
cmp r14, r15
jl 0x1401782a0
mov rcx, qword [rbx]
mov r8d, dword [rcx + 4]
mov r9d, 1
mov edx, dword [rcx]
lea ecx, [r9 + 3]
call fcn.140172b5c
mov rcx, qword [rbx]
mov rdx, rax
mov qword [rsp + 0x48], rax
test rax, rax
jne 0x1401783df
mov edx, dword [rcx + 8]
jmp 0x1401783b3
mov rax, qword [rbx]
mov edx, dword [rax + 8]
xor r8d, r8d
mov rcx, rbx
call fcn.1401770f8
mov rax, qword gs:[0x58]
mov edx, 0x28
mov rcx, qword [rax]
lea rax, [0x1404cabf0]
mov qword [rdx + rcx], rax
jmp 0x14017822e
xor eax, eax
mov dword [rbp + 0xb0], eax
cmp dword [rcx + 4], eax
jbe 0x1401786e1
mov r14, qword [rsp + 0x60]
mov r12, qword [rsp + 0x58]
mov rdi, qword [rsp + 0x50]
imul eax, dword [rcx]
xor r15d, r15d
shl eax, 2
mov esi, eax
add rsi, rdx
mov qword [rsp + 0x70], rsi
cmp qword [rsp + 0x40], r15
jbe 0x1401784d9
mov rsi, qword [rsp + 0x40]
lea r14, [rbx + 0x46c0]
mov rbx, qword [rbp + 0xa8]
lea rdi, [rbp - 0x5c]
mov eax, dword [rdi - 8]
mov r13d, dword [rdi]
mov ecx, dword [rdi - 0xc]
sar eax, 1
cmp r13d, eax
jl 0x14017844e
mov rdx, qword [rdi - 0x14]
mov r8, qword [rdi - 0x1c]
jmp 0x140178456
mov rdx, qword [rdi - 0x1c]
mov r8, qword [rdi - 0x14]
mov r9d, dword [rdi - 4]
mov rax, qword [rdi - 0x24]
mov dword [rsp + 0x20], ecx
mov rcx, qword [r14 + 0x28]
call qword [case.0x140173169.0]
mov qword [rsp + r15*8 + 0x50], rax
lea eax, [r13 + 1]
mov dword [rdi], eax
cmp eax, dword [rdi - 8]
jl 0x14017849d
inc dword [rdi + 4]
and dword [rdi], 0
mov eax, dword [rdi + 4]
mov rcx, qword [rdi - 0x14]
mov qword [rdi - 0x1c], rcx
cmp eax, dword [r14]
jge 0x14017849d
movsxd rax, dword [r14 + 4]
add rax, rcx
mov qword [rdi - 0x14], rax
inc r15
add rdi, 0x30
add r14, 0x60
cmp r15, rsi
jl 0x140178434
mov r14, qword [rsp + 0x60]
mov r12, qword [rsp + 0x58]
mov rdi, qword [rsp + 0x50]
mov rsi, qword [rsp + 0x70]
mov qword [rbp + 0xa8], rbx
mov rbx, qword [rbp + 0x90]
mov r13, qword [rbp + 0xa8]
mov rcx, qword [rbx]
cmp dword [rcx + 8], 3
jne 0x140178556
test r13, r13
je 0x14017852a
xor r8d, r8d
cmp dword [rcx], r8d
jbe 0x1401786c2
add rsi, 3
mov al, byte [r8 + rdi]
xor edx, edx
mov byte [rsi - 3], al
mov rax, qword [rsp + rdx*8 + 0x58]
mov cl, byte [r8 + rax]
mov byte [rdx + rsi - 2], cl
inc rdx
cmp rdx, 2
jl 0x1401784fd
mov byte [rsi], 0xff
inc r8d
mov rax, qword [rbx]
add rsi, 4
cmp r8d, dword [rax]
jb 0x1401784f4
jmp 0x1401786c2
mov edx, dword [rcx]
mov r9, r14
mov rax, qword [rbx + 0x4878]
mov r8, r12
mov dword [rsp + 0x28], 4
mov rcx, rsi
mov dword [rsp + 0x20], edx
mov rdx, rdi
call qword [case.0x140173169.0]
jmp 0x1401786c2
cmp dword [rcx + 8], 4
jne 0x14017869d
mov eax, dword [rbx + 0x484c]
test eax, eax
jne 0x1401785e6
xor r9d, r9d
cmp dword [rcx], r9d
jbe 0x1401786c2
mov r13, qword [rsp + 0x68]
add rsi, 2
movzx r8d, byte [r9 + r13]
movzx ecx, byte [r9 + rdi]
imul ecx, r8d
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [rsi - 2], al
movzx ecx, byte [r9 + r12]
imul ecx, r8d
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [rsi - 1], al
movzx ecx, byte [r9 + r14]
inc r9d
mov byte [rsi + 1], 0xff
imul ecx, r8d
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [rsi], al
lea rsi, [rsi + 4]
mov rax, qword [rbx]
cmp r9d, dword [rax]
jb 0x14017857f
jmp 0x140178694
mov edx, dword [rcx]
cmp eax, 2
mov r10, qword [rbx + 0x4878]
mov r9, r14
mov dword [rsp + 0x28], 4
mov rax, r10
mov dword [rsp + 0x20], edx
mov r8, r12
mov rdx, rdi
mov rcx, rsi
jne 0x14017854b
call qword [case.0x140173169.0]
mov rax, qword [rbx]
xor r8d, r8d
cmp dword [rax], r8d
jbe 0x1401786c2
mov r13, qword [rsp + 0x68]
add rsi, 2
movzx edx, byte [r8 + r13]
inc r8d
mov al, byte [rsi - 2]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [rsi - 2], al
mov al, byte [rsi - 1]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [rsi - 1], al
mov al, byte [rsi]
not al
movzx ecx, al
imul ecx, edx
sub ecx, 0xffffff80
mov eax, ecx
shr eax, 8
add eax, ecx
shr eax, 8
mov byte [rsi], al
lea rsi, [rsi + 4]
mov rax, qword [rbx]
cmp r8d, dword [rax]
jb 0x140178631
mov r13, qword [rbp + 0xa8]
jmp 0x1401786c2
xor edx, edx
cmp dword [rcx], edx
jbe 0x1401786c2
inc rsi
mov cl, byte [rdx + rdi]
inc edx
mov byte [rsi + 1], cl
mov byte [rsi], cl
mov byte [rsi - 1], cl
mov byte [rsi + 2], 0xff
lea rsi, [rsi + 4]
mov rax, qword [rbx]
cmp edx, dword [rax]
jb 0x1401786a6
mov eax, dword [rbp + 0xb0]
mov rcx, qword [rbx]
inc eax
mov rdx, qword [rsp + 0x48]
mov dword [rbp + 0xb0], eax
cmp eax, dword [rcx + 4]
jb 0x1401783ff
mov edx, dword [rcx + 8]
xor r8d, r8d
mov rcx, rbx
call fcn.1401770f8
mov rcx, qword [rbx]
mov rdx, qword [rbp + 0x98]
mov eax, dword [rcx]
mov dword [rdx], eax
mov eax, dword [rcx + 4]
mov rcx, qword [rbp + 0xa0]
mov dword [rcx], eax
mov rax, qword [rsp + 0x48]
add rsp, 0x148
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret