Function at 0x6161250
Capabilities:
Encrypt data using rc4 prga

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x27]
sub rsp, 0x90
xor edi, edi
mov word [rbp - 0x29], 0x15ff
mov qword [rbp - 0x21], rdi
mov r15b, dil
mov dword [rbp - 0x47], edi
mov r12b, dil
mov qword [rbp - 0x43], rdi
mov r13d, edi
mov qword [rbp - 0x31], rdi
mov rbx, rcx
mov byte [rbp + 0x67], dil
mov dword [rbp + 0x6f], edi
mov qword [rcx + 0x20], rdi
mov dword [rbp - 0x27], 2
mov word [rbp - 0x23], 0x8eb
mov word [rbp - 0x49], 0x25ff
mov qword [rbp - 0x39], 0x25ff0e70
movzx r14d, r15b
lea rdx, [rbp - 9]
add r14, qword [rbx]
movzx r12d, r12b
mov rcx, r14
add r12, qword [rbx + 0x10]
call fcn.06160228
test dword [rbp + 0x18], 0x1000
mov r8d, eax
jne 0x6161555
mov rsi, r14
cmp r15b, 5
jb 0x61612ff
mov edx, 1
mov qword [rbp - 0x43], r14
lea rsi, [rbp - 0x49]
lea r8d, [rdx + 0xd]
jmp 0x61613f0
mov al, byte [rbp + 4]
and al, 0xc7
cmp al, 5
jne 0x6161351
movzx eax, byte [rbp - 9]
lea rdi, [rbp - 0x19]
mov rcx, r8
mov edx, r14d
rep movsb byte [rdi], byte [rsi]
mov ecx, dword [rbp + 0x18]
lea rsi, [rbp - 0x19]
shr rcx, 2
sub edx, r12d
add edx, dword [rbp + 0x14]
and ecx, 0xf
sub rax, rcx
mov dword [rbp + rax - 0x1d], edx
cmp byte [rbp + 2], 0xff
jne 0x616145f
cmp byte [rbp + 6], 4
jne 0x616145f
mov edx, 1
jmp 0x61613f0
movzx edx, byte [rbp + 2]
cmp dl, 0xe8
jne 0x6161375
movsxd rax, dword [rbp + 0xc]
lea rsi, [rbp - 0x29]
movzx ecx, byte [rbp - 9]
add rax, r14
add rcx, rax
mov qword [rbp - 0x21], rcx
jmp 0x6161459
mov al, dl
and al, 0xfd
cmp al, 0xe9
jne 0x61613c5
movzx ecx, byte [rbp - 9]
movsx rax, byte [rbp + 0xc]
add rcx, r14
cmp dl, 0xeb
je 0x6161392
movsxd rax, dword [rbp + 0xc]
add rcx, rax
mov rax, qword [rbx]
cmp rax, rcx
ja 0x61613b5
add rax, 5
cmp rcx, rax
jae 0x61613b5
cmp r13, rcx
cmovae rcx, r13
mov r13, rcx
jmp 0x616145f
mov qword [rbp - 0x43], rcx
lea rsi, [rbp - 0x49]
mov r8d, 0xe
jmp 0x61613e8
mov cl, dl
and cl, 0xf0
cmp cl, 0x70
je 0x61613f5
mov al, dl
and al, 0xfc
cmp al, 0xe0
je 0x61613f5
mov al, byte [rbp + 3]
and al, 0xf0
cmp al, 0x80
je 0x61613f5
and dl, 0xfe
cmp dl, 0xc2
jne 0x616145f
cmp r14, r13
mov edx, edi
setae dl
mov dword [rbp + 0x6f], edx
jmp 0x6161462
movzx edi, byte [rbp - 9]
add rdi, r14
cmp cl, 0x70
je 0x616140d
mov al, dl
and al, 0xfc
cmp al, 0xe0
movsxd rax, dword [rbp + 0xc]
jne 0x6161412
movsx rax, byte [rbp + 0xc]
add rdi, rax
mov rax, qword [rbx]
cmp rax, rdi
ja 0x6161432
add rax, 5
cmp rdi, rax
jae 0x6161432
cmp r13, rdi
cmovae rdi, r13
mov r13, rdi
jmp 0x616145f
mov al, dl
and al, 0xfc
cmp al, 0xe0
je 0x6161555
movzx ecx, byte [rbp + 3]
lea rsi, [rbp - 0x39]
cmp dl, 0xf
mov qword [rbp - 0x31], rdi
cmovne ecx, edx
and cl, 0xf
xor cl, 0x71
mov byte [rbp - 0x39], cl
mov r8d, 0x10
mov edx, dword [rbp + 0x6f]
cmp r14, r13
jae 0x6161474
movzx eax, byte [rbp - 9]
cmp r8d, eax
jne 0x6161555
movzx r12d, byte [rbp + 0x67]
lea eax, [r8 + r12]
cmp eax, 0x32
ja 0x6161555
cmp dword [rbx + 0x24], 8
jae 0x6161555
mov eax, dword [rbx + 0x24]
mov edi, r12d
mov r14d, 1
mov ecx, r8d
mov byte [rax + rbx + 0x28], r15b
mov eax, dword [rbx + 0x24]
mov byte [rax + rbx + 0x30], r12b
add r12b, r8b
add rdi, qword [rbx + 0x10]
add dword [rbx + 0x24], r14d
rep movsb byte [rdi], byte [rsi]
add r15b, byte [rbp - 9]
xor edi, edi
mov byte [rbp + 0x67], r12b
test edx, edx
je 0x61612b5
cmp r15b, 5
jae 0x616152a
mov rdi, qword [rbx]
lea edx, [r14 + 4]
movzx esi, r15b
movzx ecx, r15b
sub edx, esi
add rcx, rdi
call fcn.06161574
test eax, eax
jne 0x616152a
lea eax, [r14 + 1]
cmp r15b, al
jae 0x6161504
sub eax, esi
mov edx, eax
call fcn.06161574
test eax, eax
je 0x6161555
lea rcx, [rdi - 5]
call fcn.061601b8
test eax, eax
je 0x6161555
mov rcx, qword [rbx]
mov edx, 5
sub rcx, 5
call fcn.06161574
test eax, eax
je 0x6161555
mov dword [rbx + 0x20], r14d
mov rcx, qword [rbx + 8]
mov r8d, 0xe
mov qword [rbp - 0x43], rcx
mov rcx, qword [rbx + 0x10]
movzx edx, r12b
add rcx, rdx
lea rdx, [rbp - 0x49]
mov qword [rbx + 0x18], rcx
call sub.msvcrt.dll_memcpy
mov eax, r14d
jmp 0x6161557
xor eax, eax
mov rbx, qword [rsp + 0xe0]
add rsp, 0x90
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret