Function at 0x401560
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push rbp
mov rbp, rsp
sub rsp, 0x40
mov qword [rbp + 0x10], rcx
mov qword [rbp + 0x18], rdx
mov dword [rbp + 0x20], r8d
mov qword [rbp + 0x28], r9
mov qword [rbp - 8], 0
mov rax, qword [rbp + 0x28]
mov eax, dword [rax]
and eax, 7
mov dword [rbp - 0x14], eax
cmp qword [rbp + 0x18], 4
ja 0x40159d
mov eax, 0
jmp 0x40185f
add dword [rbp + 0x20], 5
mov qword [rbp - 0x10], 0xffffffffffffffff
mov rdx, qword [rbp + 0x10]
mov rax, qword [rbp - 8]
add rax, rdx
mov qword [rbp - 0x20], rax
mov rax, qword [rbp + 0x18]
lea rdx, [rax - 4]
mov rax, qword [rbp + 0x10]
add rax, rdx
mov qword [rbp - 0x30], rax
jmp 0x4015e8
mov rax, qword [rbp - 0x20]
movzx eax, byte [rax]
movzx eax, al
and eax, 0xfe
cmp eax, 0xe8
je 0x4015f4
add qword [rbp - 0x20], 1
mov rax, qword [rbp - 0x20]
cmp rax, qword [rbp - 0x30]
jb 0x4015cd
jmp 0x4015f5
nop
mov rdx, qword [rbp - 0x20]
mov rax, qword [rbp + 0x10]
sub rdx, rax
mov rax, rdx
mov qword [rbp - 8], rax
mov rax, qword [rbp - 0x20]
cmp rax, qword [rbp - 0x30]
jae 0x401825
mov rax, qword [rbp - 8]
sub rax, qword [rbp - 0x10]
mov qword [rbp - 0x10], rax
cmp qword [rbp - 0x10], 3
jbe 0x401634
mov dword [rbp - 0x14], 0
jmp 0x4016b8
mov rax, qword [rbp - 0x10]
sub eax, 1
mov edx, dword [rbp - 0x14]
mov ecx, eax
shl edx, cl
mov eax, edx
and eax, 7
mov dword [rbp - 0x14], eax
cmp dword [rbp - 0x14], 0
je 0x4016b8
mov edx, dword [rbp - 0x14]
lea rax, [0x00411008]
movzx eax, byte [rdx + rax]
movzx eax, al
mov edx, 4
sub edx, eax
mov eax, edx
movsxd rdx, eax
mov rax, qword [rbp - 0x20]
add rax, rdx
movzx eax, byte [rax]
mov byte [rbp - 0x31], al
mov edx, dword [rbp - 0x14]
lea rax, section..rdata
movzx eax, byte [rdx + rax]
test al, al
je 0x401698
cmp byte [rbp - 0x31], 0
je 0x401698
cmp byte [rbp - 0x31], 0xff
jne 0x4016b8
mov rax, qword [rbp - 8]
mov qword [rbp - 0x10], rax
mov eax, dword [rbp - 0x14]
add eax, eax
and eax, 6
or eax, 1
mov dword [rbp - 0x14], eax
add qword [rbp - 8], 1
jmp 0x401820
mov rax, qword [rbp - 8]
mov qword [rbp - 0x10], rax
mov rax, qword [rbp - 0x20]
add rax, 4
movzx eax, byte [rax]
test al, al
je 0x4016e2
mov rax, qword [rbp - 0x20]
add rax, 4
movzx eax, byte [rax]
cmp al, 0xff
jne 0x40180d
mov rax, qword [rbp - 0x20]
add rax, 4
movzx eax, byte [rax]
movzx eax, al
shl eax, 0x18
mov edx, eax
mov rax, qword [rbp - 0x20]
add rax, 3
movzx eax, byte [rax]
movzx eax, al
shl eax, 0x10
or edx, eax
mov rax, qword [rbp - 0x20]
add rax, 2
movzx eax, byte [rax]
movzx eax, al
shl eax, 8
or edx, eax
mov rax, qword [rbp - 0x20]
add rax, 1
movzx eax, byte [rax]
movzx eax, al
or eax, edx
mov dword [rbp - 0x24], eax
cmp dword [rbp + 0x30], 0
je 0x401749
mov rax, qword [rbp - 8]
mov edx, eax
mov eax, dword [rbp + 0x20]
add edx, eax
mov eax, dword [rbp - 0x24]
add eax, edx
mov dword [rbp - 0x28], eax
jmp 0x40175c
mov rax, qword [rbp - 8]
mov edx, eax
mov eax, dword [rbp + 0x20]
add edx, eax
mov eax, dword [rbp - 0x24]
sub eax, edx
mov dword [rbp - 0x28], eax
cmp dword [rbp - 0x14], 0
je 0x4017ba
mov edx, dword [rbp - 0x14]
lea rax, [0x00411008]
movzx eax, byte [rdx + rax]
movzx eax, al
shl eax, 3
mov dword [rbp - 0x38], eax
mov eax, 0x18
sub eax, dword [rbp - 0x38]
mov edx, dword [rbp - 0x28]
mov ecx, eax
shr edx, cl
mov eax, edx
mov byte [rbp - 0x39], al
cmp byte [rbp - 0x39], 0
je 0x401799
cmp byte [rbp - 0x39], 0xff
jne 0x4017bd
mov eax, 0x20
sub eax, dword [rbp - 0x38]
mov edx, 1
mov ecx, eax
shl edx, cl
mov eax, edx
sub eax, 1
xor eax, dword [rbp - 0x28]
mov dword [rbp - 0x24], eax
jmp 0x40172e
nop
jmp 0x4017be
nop
mov eax, dword [rbp - 0x28]
shr eax, 0x18
and eax, 1
mov edx, eax
mov rax, qword [rbp - 0x20]
add rax, 4
neg edx
mov byte [rax], dl
mov eax, dword [rbp - 0x28]
shr eax, 0x10
mov edx, eax
mov rax, qword [rbp - 0x20]
add rax, 3
mov byte [rax], dl
mov eax, dword [rbp - 0x28]
shr eax, 8
mov edx, eax
mov rax, qword [rbp - 0x20]
add rax, 2
mov byte [rax], dl
mov rax, qword [rbp - 0x20]
add rax, 1
mov edx, dword [rbp - 0x28]
mov byte [rax], dl
add qword [rbp - 8], 5
jmp 0x401820
mov eax, dword [rbp - 0x14]
add eax, eax
and eax, 6
or eax, 1
mov dword [rbp - 0x14], eax
add qword [rbp - 8], 1
jmp 0x4015a9
nop
mov rax, qword [rbp - 8]
sub rax, qword [rbp - 0x10]
mov qword [rbp - 0x10], rax
cmp qword [rbp - 0x10], 3
ja 0x401850
mov rax, qword [rbp - 0x10]
sub eax, 1
mov edx, dword [rbp - 0x14]
mov ecx, eax
shl edx, cl
mov eax, edx
and eax, 7
mov edx, eax
jmp 0x401855
mov edx, 0
mov rax, qword [rbp + 0x28]
mov dword [rax], edx
mov rax, qword [rbp - 8]
add rsp, 0x40
pop rbp
ret