Function at 0x180022410
Capabilities:
Encrypt data using rc4 prga

Disassembly:
mov dword [rsp + 0x20], r9d
mov qword [rsp + 0x18], r8
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
sub rsp, 0x58
mov rax, qword [rsp + 0x60]
mov qword [rsp + 0x40], rax
mov rax, qword [rsp + 0x70]
movsx eax, byte [rax]
test eax, eax
jne 0x180022445
mov byte [rsp + 0x21], 1
jmp 0x18002244a
mov byte [rsp + 0x21], 0
movzx eax, byte [rsp + 0x21]
mov byte [rsp + 0x20], al
mov dword [rsp + 0x30], 1
cmp dword [rsp + 0x78], 0
jne 0x18002246c
mov eax, dword [rsp + 0x78]
dec eax
mov dword [rsp + 0x78], eax
mov rax, qword [rsp + 0x70]
movsx eax, byte [rax]
cmp eax, 0x52
jne 0x180022498
mov rax, qword [rsp + 0x70]
inc rax
mov qword [rsp + 0x70], rax
mov eax, dword [rsp + 0x78]
dec eax
mov dword [rsp + 0x78], eax
mov dword [rsp + 0x30], 0xffffffff
jmp 0x1800224b1
mov rax, qword [rsp + 0x70]
inc rax
mov qword [rsp + 0x70], rax
mov eax, dword [rsp + 0x78]
dec eax
mov dword [rsp + 0x78], eax
mov rax, qword [rsp + 0x70]
movsx eax, byte [rax]
test eax, eax
je 0x180022663
movzx eax, byte [rsp + 0x20]
test eax, eax
jne 0x180022663
cmp dword [rsp + 0x78], 2
jb 0x180022663
cmp qword [rsp + 0x68], 0
jne 0x1800224eb
mov eax, 0xffffffff
jmp 0x180022682
mov rax, qword [rsp + 0x70]
movsx eax, byte [rax]
cmp eax, 0x20
jne 0x1800224fa
jmp 0x18002249a
mov rax, qword [rsp + 0x70]
movsx eax, byte [rax]
cmp eax, 0x3b
jne 0x180022511
mov eax, 1
jmp 0x180022682
mov rax, qword [rsp + 0x70]
movsx eax, byte [rax]
cmp eax, 0x2a
jne 0x1800225a7
mov dword [rsp + 0x34], 0
mov rax, qword [rsp + 0x70]
inc rax
mov qword [rsp + 0x70], rax
lea rdx, [rsp + 0x34]
mov rcx, qword [rsp + 0x70]
call fcn.180007580
mov dword [rsp + 0x24], eax
mov eax, dword [rsp + 0x68]
cmp dword [rsp + 0x24], eax
jle 0x18002255e
mov eax, 0xffffffff
jmp 0x180022682
mov eax, dword [rsp + 0x34]
mov rcx, qword [rsp + 0x70]
add rcx, rax
mov rax, rcx
mov qword [rsp + 0x70], rax
mov eax, dword [rsp + 0x24]
imul eax, dword [rsp + 0x30]
cdqe
mov rcx, qword [rsp + 0x40]
add rcx, rax
mov rax, rcx
mov qword [rsp + 0x40], rax
movsxd rax, dword [rsp + 0x24]
mov rcx, qword [rsp + 0x68]
sub rcx, rax
mov rax, rcx
mov qword [rsp + 0x68], rax
jmp 0x18002249a
mov rax, qword [rsp + 0x40]
movzx eax, byte [rax]
mov byte [rsp + 0x20], al
mov eax, 1
imul rax, rax, 0
mov rcx, qword [rsp + 0x70]
movzx ecx, byte [rcx + rax]
call fcn.180007550
mov dword [rsp + 0x28], eax
mov eax, 1
imul rax, rax, 1
mov rcx, qword [rsp + 0x70]
movzx ecx, byte [rcx + rax]
call fcn.180007550
mov dword [rsp + 0x2c], eax
cmp dword [rsp + 0x28], 0
jge 0x1800225fc
movzx eax, byte [rsp + 0x20]
sar eax, 4
mov dword [rsp + 0x28], eax
cmp dword [rsp + 0x2c], 0
jge 0x18002260f
movzx eax, byte [rsp + 0x20]
and eax, 0xf
mov dword [rsp + 0x2c], eax
mov eax, dword [rsp + 0x28]
shl eax, 4
or eax, dword [rsp + 0x2c]
movzx ecx, byte [rsp + 0x20]
xor eax, ecx
mov byte [rsp + 0x20], al
mov rax, qword [rsp + 0x70]
inc rax
mov qword [rsp + 0x70], rax
mov eax, dword [rsp + 0x78]
dec eax
mov dword [rsp + 0x78], eax
mov rax, qword [rsp + 0x68]
dec rax
mov qword [rsp + 0x68], rax
movsxd rax, dword [rsp + 0x30]
mov rcx, qword [rsp + 0x40]
add rcx, rax
mov rax, rcx
mov qword [rsp + 0x40], rax
jmp 0x18002249a
movzx eax, byte [rsp + 0x20]
test eax, eax
jne 0x180022676
mov dword [rsp + 0x38], 1
jmp 0x18002267e
mov dword [rsp + 0x38], 0
mov eax, dword [rsp + 0x38]
add rsp, 0x58
ret