Function at 0x140120450
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x38
mov r13d, dword [rsp + 0xa8]
mov rax, qword [rsp + 0xa0]
mov r12, qword [rsp + 0x90]
mov dword [rsp + 0x28], r13d
mov rbx, r9
mov rdi, rdx
mov rbp, r8
mov qword [rsp + 0x20], rax
mov r8, r12
mov rdx, rbx
mov rsi, rcx
mov r9, qword [rsp + 0x98]
call fcn.14013c1a0
cmp rax, 0xffffffffffffff88
ja 0x140120137
cmp rax, r12
jae 0x140120130
mov r9, r12
lea r8, [rbx + rax]
mov rdx, rbp
mov rcx, rdi
sub r9, rax
and r13d, 1
mov qword [rsp + 0x90], rsi
jne 0x140120148
add rsp, 0x38
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
jmp 0x140120450
mov rax, 0xffffffffffffffb8
add rsp, 0x38
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
add rsp, 0x38
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
jmp 0x140120160
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
mov rdi, rdx
mov rdx, qword [rsp + 0x60]
mov rax, rcx
lea rbp, [rcx + rdi]
movzx esi, byte [rdx + 2]
lea r11, [rdx + 4]
test r9, r9
je 0x140120400
movzx edx, byte [r8 + r9 - 1]
lea r12, [r8 + 8]
cmp r9, 7
jbe 0x140120210
mov rcx, 0xffffffffffffffff
test dl, dl
je 0x140120387
cmp r9, 0xffffffffffffff88
ja 0x14012043c
sub r9, 8
lzcnt edx, edx
sub edx, 0x17
lea rbx, [r8 + r9]
mov r10, qword [rbx]
cmp rdi, 3
jg 0x140120295
cmp rbx, r12
jae 0x140120420
cmp r8, rbx
je 0x140120398
mov ecx, edx
mov r10, rbx
shr ecx, 3
mov r12d, ecx
sub r10, r12
cmp r10, r8
jae 0x140120418
mov ecx, r9d
mov r9d, r9d
sub rbx, r9
shl ecx, 3
mov r10, qword [rbx]
sub edx, ecx
jmp 0x140120376
lea rbx, [0x1401dddb4]
movzx r10d, byte [r8]
movsxd rcx, dword [rbx + r9*4]
add rcx, rbx
jmp rcx
movzx ecx, byte [r8 + 6]
shl rcx, 0x30
add r10, rcx
movzx ecx, byte [r8 + 5]
shl rcx, 0x28
add r10, rcx
movzx ecx, byte [r8 + 4]
shl rcx, 0x20
add r10, rcx
movzx ecx, byte [r8 + 3]
shl rcx, 0x18
add r10, rcx
movzx ecx, byte [r8 + 2]
shl rcx, 0x10
add r10, rcx
movzx ecx, byte [r8 + 1]
shl rcx, 8
add r10, rcx
test dl, dl
je 0x140120380
mov ecx, 8
lzcnt edx, edx
mov rbx, r8
sub ecx, r9d
lea edx, [rdx + rcx*8 - 0x17]
cmp rdi, 3
jle 0x140120398
mov r9d, esi
lea r13, [rbp - 3]
neg r9d
and r9d, 0x3f
jmp 0x14012033d
shl ecx, 3
mov r10, qword [r14]
mov rbx, r14
sub edx, ecx
cmp rax, r13
jae 0x140120376
shlx rcx, r10, rdx
shrx rcx, rcx, r9
lea rcx, [r11 + rcx*2]
add rax, 4
movzx r14d, byte [rcx + 1]
movzx ecx, byte [rcx]
add ecx, edx
mov byte [rax - 4], r14b
shlx rdx, r10, rcx
shrx rdx, rdx, r9
lea rdx, [r11 + rdx*2]
movzx r14d, byte [rdx + 1]
movzx edx, byte [rdx]
add edx, ecx
mov byte [rax - 3], r14b
shlx rcx, r10, rdx
shrx rcx, rcx, r9
lea rcx, [r11 + rcx*2]
movzx r14d, byte [rcx + 1]
movzx ecx, byte [rcx]
add ecx, edx
mov byte [rax - 2], r14b
shlx rdx, r10, rcx
shrx rdx, rdx, r9
lea rdx, [r11 + rdx*2]
movzx r14d, byte [rdx + 1]
movzx edx, byte [rdx]
add edx, ecx
mov byte [rax - 1], r14b
cmp edx, 0x40
ja 0x140120376
cmp rbx, r12
jae 0x1401203e0
cmp r8, rbx
je 0x140120398
mov ecx, edx
mov r14, rbx
shr ecx, 3
mov r10d, ecx
sub r14, r10
cmp r14, r8
jae 0x1401202b0
mov rcx, rbx
sub rcx, r8
mov r9d, ecx
shl ecx, 3
sub rbx, r9
sub edx, ecx
mov r10, qword [rbx]
cmp rax, rbp
jb 0x14012039d
cmp r8, rbx
je 0x1401203cc
mov rcx, 0xffffffffffffffec
mov rax, rcx
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
cmp rax, rbp
jae 0x1401203cc
neg esi
and esi, 0x3f
shlx rcx, r10, rdx
shrx rcx, rcx, rsi
lea rcx, [r11 + rcx*2]
add rax, 1
movzx r9d, byte [rcx + 1]
movzx ecx, byte [rcx]
mov byte [rax - 1], r9b
add edx, ecx
cmp rbp, rax
jne 0x1401203a2
cmp r8, rbx
jne 0x140120380
mov rcx, rdi
cmp edx, 0x40
jne 0x140120380
jmp 0x140120387
mov ecx, edx
and edx, 7
shr ecx, 3
sub rbx, rcx
mov r10, qword [rbx]
cmp rax, r13
jb 0x1401202c4
jmp 0x140120376
mov rcx, 0xffffffffffffffb8
mov rax, rcx
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
mov rbx, r10
jmp 0x140120201
mov ecx, edx
and edx, 7
shr ecx, 3
sub rbx, rcx
mov r10, qword [rbx]
cmp rax, rbp
jb 0x14012039d
jmp 0x140120380
mov rcx, r9
jmp 0x140120387
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
mov rax, qword [rsp + 0x60]
movzx edi, byte [rax + 2]
lea rbx, [rax + 4]
mov r10, rcx
mov rbp, rdx
lea r12, [rcx + rdx]
test r9, r9
je 0x140120700
movzx eax, byte [r8 + r9 - 1]
lea r13, [r8 + 8]
cmp r9, 7
jbe 0x140120500
mov rdx, 0xffffffffffffffff
test al, al
je 0x140120687
cmp r9, 0xffffffffffffff88
ja 0x14012073c
sub r9, 8
bsr eax, eax
lea rsi, [r8 + r9]
xor eax, 0x1f
mov r11, qword [rsi]
sub eax, 0x17
cmp rbp, 3
jg 0x140120587
cmp rsi, r13
jae 0x140120720
cmp r8, rsi
je 0x140120698
mov edx, eax
mov rcx, rsi
shr edx, 3
mov r11d, edx
sub rcx, r11
cmp rcx, r8
jae 0x140120718
mov edx, r9d
mov r9d, r9d
sub rsi, r9
shl edx, 3
mov r11, qword [rsi]
sub eax, edx
jmp 0x140120671
lea rcx, [0x1401dddd4]
movzx r11d, byte [r8]
movsxd rdx, dword [rcx + r9*4]
add rdx, rcx
jmp rdx
movzx edx, byte [r8 + 6]
shl rdx, 0x30
add r11, rdx
movzx edx, byte [r8 + 5]
shl rdx, 0x28
add r11, rdx
movzx edx, byte [r8 + 4]
shl rdx, 0x20
add r11, rdx
movzx edx, byte [r8 + 3]
shl rdx, 0x18
add r11, rdx
movzx edx, byte [r8 + 2]
shl rdx, 0x10
add r11, rdx
movzx edx, byte [r8 + 1]
shl rdx, 8
add r11, rdx
test al, al
je 0x140120680
bsr eax, eax
mov edx, 8
mov rsi, r8
xor eax, 0x1f
sub edx, r9d
lea eax, [rax + rdx*8 - 0x17]
cmp rbp, 3
jle 0x140120698
mov r9d, edi
lea r14, [r12 - 3]
neg r9d
and r9d, 0x3f
jmp 0x140120639
shl edx, 3
mov r11, qword [rcx]
mov rsi, rcx
sub eax, edx
cmp r10, r14
jae 0x140120671
mov ecx, eax
mov rdx, r11
add r10, 4
shl rdx, cl
mov ecx, r9d
shr rdx, cl
lea rdx, [rbx + rdx*2]
movzx ecx, byte [rdx + 1]
movzx edx, byte [rdx]
add edx, eax
mov byte [r10 - 4], cl
mov rax, r11
mov ecx, edx
shl rax, cl
mov ecx, r9d
shr rax, cl
lea rax, [rbx + rax*2]
movzx ecx, byte [rax + 1]
movzx eax, byte [rax]
add eax, edx
mov byte [r10 - 3], cl
mov rdx, r11
mov ecx, eax
shl rdx, cl
mov ecx, r9d
shr rdx, cl
lea rdx, [rbx + rdx*2]
movzx ecx, byte [rdx + 1]
movzx edx, byte [rdx]
add edx, eax
mov byte [r10 - 2], cl
mov rax, r11
mov ecx, edx
shl rax, cl
mov ecx, r9d
shr rax, cl
lea rax, [rbx + rax*2]
movzx ecx, byte [rax + 1]
movzx eax, byte [rax]
add eax, edx
mov byte [r10 - 1], cl
cmp eax, 0x40
ja 0x140120671
cmp rsi, r13
jae 0x1401206e0
cmp r8, rsi
je 0x140120698
mov edx, eax
mov rcx, rsi
shr edx, 3
mov r11d, edx
sub rcx, r11
cmp rcx, r8
jae 0x1401205a0
mov rdx, rsi
sub rdx, r8
mov ecx, edx
shl edx, 3
sub rsi, rcx
sub eax, edx
mov r11, qword [rsi]
cmp r10, r12
jb 0x14012069d
cmp r8, rsi
je 0x1401206cf
nop dword [rax + rax]
mov rdx, 0xffffffffffffffec
mov rax, rdx
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
cmp r10, r12
jae 0x1401206cf
neg edi
and edi, 0x3f
mov ecx, eax
mov rdx, r11
add r10, 1
shl rdx, cl
mov ecx, edi
shr rdx, cl
lea rdx, [rbx + rdx*2]
movzx r9d, byte [rdx + 1]
movzx edx, byte [rdx]
mov byte [r10 - 1], r9b
add eax, edx
cmp r12, r10
jne 0x1401206a2
cmp r8, rsi
jne 0x140120680
mov rdx, rbp
cmp eax, 0x40
jne 0x140120680
jmp 0x140120687
mov edx, eax
and eax, 7
shr edx, 3
sub rsi, rdx
mov r11, qword [rsi]
cmp r10, r14
jb 0x1401205b4
jmp 0x140120671
mov rdx, 0xffffffffffffffb8
mov rax, rdx
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
mov rsi, rcx
jmp 0x1401204f3
mov edx, eax
and eax, 7
shr edx, 3
sub rsi, rdx
mov r11, qword [rsi]
cmp rcx, r12
jb 0x14012069d
jmp 0x140120680
mov rdx, r9
jmp 0x140120687