Function at 0x140015320
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub rsp, 0x28
cmp edx, 0x1d
je 0x140015355
cmp edx, 0x32
jne 0x140015366
cmp dword [rcx + 0x30], 1
jbe 0x140015349
cmp byte [rcx + 0x4db0], 0
jne 0x140015349
mov dl, r8b
add rsp, 0x28
jmp 0x140019f20
mov dl, r8b
add rsp, 0x28
jmp 0x14001923c
cmp byte [rcx + 0x4db0], 0
jne 0x140015366
mov dl, r8b
call fcn.140018174
add rsp, 0x28
ret
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x18], rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x40
xor r13d, r13d
mov byte [rcx + 0x4dd0], 1
mov rbx, rcx
cmp byte [rcx + 0x4dc0], r13b
jne 0x1400192cf
call fcn.1400177b4
mov rcx, rbx
call fcn.140017948
test al, al
je 0x140019adf
lea rbp, [rbx + 0xf0]
mov rcx, rbx
lea r15, [rbx + 8]
mov r8, rbp
mov rdx, r15
call fcn.14001645c
test al, al
je 0x140019adf
lea r9, [rbx + 0x104]
mov r8, rbp
mov rdx, r15
mov rcx, rbx
call fcn.140016b84
test al, al
je 0x140019adf
cmp byte [rbx + 0xe8a6], r13b
jne 0x1400192da
jmp 0x140019adf
lea r15, [rcx + 8]
lea rbp, [rcx + 0xf0]
lea r12, [rbx + 0xd8]
mov rax, qword [rbx + 0xe970]
and qword [r12], rax
mov eax, dword [rbx + 0xec]
cmp dword [r15], eax
jl 0x140019366
mov edx, dword [rbx + 0xf8]
dec edx
add edx, dword [rbp]
cmp dword [r15], edx
jg 0x140019314
jne 0x140019356
mov eax, dword [rbx + 0xf4]
cmp dword [rbx + 0xc], eax
jl 0x140019356
cmp byte [rbx + 0x100], r13b
jne 0x140019ad7
mov r8, rbp
mov rdx, r15
mov rcx, rbx
call fcn.14001645c
test al, al
je 0x140019adf
lea r9, [rbx + 0x104]
mov r8, rbp
mov rdx, r15
mov rcx, rbx
call fcn.140016b84
test al, al
je 0x140019adf
jmp 0x1400192f7
mov rcx, rbx
call fcn.140017948
test al, al
je 0x140019ad7
mov rcx, qword [rbx + 0x4ba0]
mov rax, rcx
sub rax, qword [r12]
and rax, qword [rbx + 0xe970]
cmp rax, 0x1004
jae 0x1400193b2
cmp rcx, qword [r12]
je 0x1400193b2
mov rcx, rbx
call fcn.140017d6c
mov rax, qword [rbx + 0x4db8]
cmp qword [rbx + 0x4dc8], rax
jg 0x140019adf
cmp byte [rbx + 0x4dc0], r13b
jne 0x140019f12
movsxd r10, dword [r15]
mov ecx, 8
mov r14, qword [r15 + 0x10]
mov r11d, dword [r15 + 4]
add dword [r9], eax
add dword [rcx], eax
add dword [rcx], eax
add dword [rcx], eax
add dword [rcx], eax
add dword [rcx], eax
add dword [rcx], eax
add dword [rcx], eax
add dword [rcx], eax
add dword [rcx], eax
add dword [rcx], eax
add dword [rcx], eax
adc cl, byte [rbp + 2]
add al, byte [r9]
add dword [rcx], eax
add dword [rcx], esp
or dword [rcx + 2], eax
add dword [rcx], eax
add dword [rbx - 0x66], edx
add dword [rcx + 2], eax
add dword [rcx], eax
add ebx, ebx
insb byte [rdi], dx
add al, 0x41
add al, byte [rcx]
add dword [rcx], eax
pop qword [rcx]
add al, byte [r9]
add dword [rcx], eax
add byte [rax], al
add byte [rax], al
add byte [rax], al
add byte [rax], al
add byte [rbp + 3], al
ret
mov rcx, rbx
call fcn.140017d6c
lea r11, [rsp + 0x40]
mov rbx, qword [r11 + 0x30]
mov rbp, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rdi
ret
mov byte [rbx + 0x4dd0], r13b
jmp 0x140019adf
mov qword [rsp + 0x10], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x430
mov bl, dl
mov rsi, rcx
call fcn.1400159ec
mov dl, bl
mov rcx, rsi
call fcn.1400177b4
mov eax, dword [rsi + 0x30]
lea r15, [rsi + 0x28]
xor ebx, ebx
mov edx, ebx
add eax, eax
je 0x140019f7d
mov eax, edx
inc edx
imul rcx, rax, 0x4af8
add rcx, qword [r15]
mov byte [rcx + 0x4add], bl
mov byte [rcx + 0x4adf], bl
mov eax, dword [rsi + 0x30]
add eax, eax
cmp edx, eax
jb 0x140019f5a
mov rcx, qword [r15]
lea rdx, [rsi + 0x104]
movups xmm0, xmmword [rsi + 0xf0]
mov r8d, 0x4a9c
movups xmmword [rcx + 0x24], xmm0
mov eax, dword [rsi + 0x100]
mov dword [rcx + 0x34], eax
mov rcx, qword [r15]
add rcx, 0x3c
call fcn.140024930
mov dword [rsp + 0x24], ebx
mov r13d, ebx
mov byte [rsp + 0x480], bl
mov byte [rsp + 0x470], bl
mov r14d, ebx
mov rcx, qword [rsi]
mov eax, 0x400000
sub eax, r14d
movsxd rdx, r14d
add rdx, qword [rsi + 0x38]
movsxd r8, eax
and r8, 0xfffffffffffffff0
call fcn.14000e4b0
xor ecx, ecx
mov dword [rsp + 0x20], eax
mov edi, eax
test eax, eax
js 0x14001a303
add r14d, eax
mov dword [rsp + 0x28], r14d
je 0x14001a303
test eax, eax
jle 0x14001a012
cmp r14d, 0x400
jl 0x14001a2f6
cmp r13d, r14d
jge 0x14001a2f6
mov eax, dword [rsi + 0x30]
mov r12d, ecx
mov dword [rsp + 0x488], ecx
mov ebp, ecx
add eax, eax
je 0x14001a146
mov eax, r12d
imul rbx, rax, 0x4af8
mov dword [rsp + 0x24], r12d
add rbx, qword [r15]
lea rbp, [rbx + 8]
mov qword [rbx], rsi
cmp byte [rbx + 0x4adf], cl
je 0x14001a05c
mov dword [rbx + 0x4ad8], r14d
jmp 0x14001a08f
movsxd rdx, r13d
mov rcx, rbp
add rdx, qword [rsi + 0x38]
call fcn.14000bad4
xor ecx, ecx
mov eax, r14d
sub eax, r13d
mov qword [rbp], rcx
mov dword [rbx + 0x4ad8], eax
je 0x14001a13f
mov byte [rbx + 0x4adc], cl
mov byte [rbx + 0x20], cl
mov byte [rbx + 0x38], cl
test edi, edi
mov byte [rbx + 0x4adf], cl
mov dword [rbx + 0x4af0], r12d
lea rdi, [rbx + 0x24]
sete al
mov byte [rbx + 0x4ade], al
cmp byte [rbx + 0x20], cl
jne 0x14001a0dc
mov r8, rdi
mov byte [rbx + 0x20], 1
mov rdx, rbp
mov rcx, rsi
call fcn.14001645c
xor ecx, ecx
test al, al
je 0x14001a137
cmp byte [rbx + 0x35], cl
jne 0x14001a0d5
cmp byte [rsi + 0xe8a6], cl
je 0x14001a137
mov byte [rsi + 0xe8a6], 1
cmp byte [rsp + 0x480], cl
jne 0x14001a0f6
cmp dword [rdi], 0x20000
jg 0x14001a0f6
inc dword [rsp + 0x488]
jmp 0x14001a105
mov byte [rbx + 0x4add], 1
mov byte [rsp + 0x480], 1
mov eax, dword [rbx + 0x30]
inc r12d
add eax, dword [rdi]
add r13d, eax
mov eax, r14d
sub eax, r13d
js 0x14001a11d
cmp byte [rbx + 0x34], cl
jne 0x14001a13f
cmp eax, 0x400
jl 0x14001a13f
mov eax, dword [rsi + 0x30]
add eax, eax
cmp r12d, eax
jae 0x14001a13f
mov edi, dword [rsp + 0x20]
jmp 0x14001a032
mov byte [rsp + 0x470], 1
mov ebp, dword [rsp + 0x488]
xor edx, edx
mov eax, ebp
div dword [rsi + 0x30]
xor edx, edx
mov edi, eax
mov eax, ebp
div dword [rsi + 0x30]
test edx, edx
je 0x14001a15c
inc edi
mov ebx, ecx
test ebp, ebp
je 0x14001a1c0
mov r14d, ecx
mov eax, r14d
lea r8, [rsp + 0x30]
shl rax, 4
inc r14d
add r8, rax
mov eax, ebx
imul rdx, rax, 0x4af8
mov eax, ebp
add rdx, qword [r15]
sub eax, ebx
cmp edi, eax
mov qword [r8], rdx
cmovb eax, edi
mov dword [r8 + 8], eax
cmp r12d, 1
jne 0x14001a1a3
mov rcx, rsi
call fcn.14001a394
jmp 0x14001a1b3
mov rcx, qword [rsi + 0x20]
lea rdx, [0x14001ac80]
call fcn.140012c08
add ebx, edi
cmp ebx, ebp
jb 0x14001a165
mov r14d, dword [rsp + 0x28]
xor ecx, ecx
test r12d, r12d
je 0x14001a2f6
mov rcx, qword [rsi + 0x20]
call fcn.140012f08
xor ecx, ecx
mov edi, ecx
test r12d, r12d
je 0x14001a248
mov ebx, ecx
mov rbp, qword [r15]
add rbp, rbx
cmp byte [rbp + 0x4add], cl
jne 0x14001a208
mov rdx, rbp
mov rcx, rsi
call fcn.140015e10
xor ecx, ecx
test al, al
je 0x14001a303
cmp byte [rbp + 0x4add], cl
je 0x14001a21d
mov rdx, rbp
mov rcx, rsi
call fcn.14001acc0
xor ecx, ecx
test al, al
je 0x14001a303
cmp byte [rbp + 0x4adc], cl
jne 0x14001a303
cmp byte [rbp + 0x4adf], cl
jne 0x14001a279
cmp byte [rbp + 0x34], cl
jne 0x14001a303
inc edi
add rbx, 0x4af8
cmp edi, r12d
jb 0x14001a1dd
cmp byte [rsp + 0x470], cl
jne 0x14001a303
mov ebx, r14d
sub ebx, r13d
cmp ebx, 0x400
jl 0x14001a372
cmp r13d, r14d
jge 0x140019fc5
mov edi, dword [rsp + 0x20]
jmp 0x14001a01b
mov eax, dword [rbp + 8]
sub eax, dword [rsi + 0x38]
add eax, dword [rbp + 0x18]
cmp r14d, eax
jle 0x14001a303
mov rcx, qword [rsi + 0x38]
sub r14d, eax
movsxd rdx, eax
movsxd r8, r14d
add rdx, rcx
call fcn.140024930
mov eax, dword [rbp + 0x2c]
xor ecx, ecx
sub eax, dword [rbp + 8]
add dword [rbp + 0x24], eax
mov qword [rbp + 0x2c], rcx
mov rax, qword [rsi + 0x38]
mov qword [rbp + 0x18], rax
mov dword [rbp + 8], ecx
test edi, edi
je 0x14001a2f3
mov rcx, qword [r15]
mov r8d, 0x4af8
mov rdx, rbp
mov rbx, qword [rcx + 0x4ae0]
mov edi, dword [rcx + 0x4aec]
call fcn.140024930
mov rax, qword [r15]
xor ecx, ecx
mov qword [rax + 0x4ae0], rbx
mov rax, qword [r15]
mov dword [rax + 0x4aec], edi
mov byte [rbp + 0x4adf], cl
mov r13d, ecx
cmp byte [rsp + 0x470], cl
je 0x140019fc5
mov rax, qword [rsi + 0xe970]
mov rcx, rsi
and qword [rsi + 0xd8], rax
call fcn.140017d6c
mov rdx, qword [r15]
mov r8d, 0x4a9c
mov ecx, dword [rsp + 0x24]
imul r9, rcx, 0x4af8
lea rcx, [rsi + 0x104]
movups xmm0, xmmword [r9 + rdx + 0x24]
movups xmmword [rsi + 0xf0], xmm0
mov eax, dword [r9 + rdx + 0x34]
add r9, 0x3c
add rdx, r9
mov dword [rsi + 0x100], eax
mov rbx, qword [rsp + 0x478]
add rsp, 0x430
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
jmp fcn.140024930
test ebx, ebx
js 0x14001a303
jle 0x14001a38c
mov rcx, qword [rsi + 0x38]
movsxd rdx, r13d
add rdx, rcx
movsxd r8, ebx
call fcn.140024930
xor ecx, ecx
mov r13d, ecx
jmp 0x140019fc2