Function at 0x180012d49
Capabilities:
Encrypt data using rc4 prga

Disassembly:
test rcx, rcx
je 0x18001308e
mov r11, rsp
push rbp
push rbx
push rsi
lea rbp, [r11 - 0xb68]
sub rsp, 0xc50
mov rax, qword [0x180068008]
xor rax, rsp
mov qword [rbp + 0xb20], rax
mov qword [r11 + 0x18], rdi
mov rsi, rdx
movsxd rdi, dword [rcx + 0x24]
mov rbx, rcx
mov qword [r11 - 0x28], r13
mov qword [r11 - 0x38], r15
cmp edi, 1
je 0x180012d9e
cmp edi, 2
jne 0x180012d99
cmp dword [rdx], 0
jne 0x180012d99
cmp byte [rdx + 8], dil
jb 0x180012d9e
xor r13d, r13d
jmp 0x180012df5
xor edx, edx
lea rcx, [rbp + 0x720]
mov r8d, 0x400
lea r13d, [rdx + 1]
call fcn.1800382d0
xor edx, edx
lea rcx, [rsp + 0x20]
mov r8d, 0x400
call fcn.1800382d0
mov eax, dword [rsi]
mov qword [rsp + 0x20], rax
mov eax, dword [rsi + 4]
mov qword [rsp + 0x28], rax
movzx eax, byte [rsi + 8]
mov qword [rsp + 0x30], rax
mov eax, dword [rbx + 0x10]
mov qword [rsp + 0x38], rax
mov eax, dword [rbx + 0xc]
mov qword [rsp + 0x40], rax
mov qword [rsp + 0x48], rdi
xor edi, edi
mov qword [rsp + 0xc48], r12
cmp dword [rsi], edi
jne 0x180012e5a
cmp byte [rsi + 8], dil
jne 0x180012e5a
mov edi, 2
test r13d, r13d
je 0x180012e5a
mov r12, qword [rsp + 0x50]
lea r8, [rbp + 0x320]
inc r12
lea rdx, [rsp + 0x20]
xor r9d, r9d
mov qword [rsp + 0x50], r12
lea rcx, [rbp + 0x720]
call fcn.1800121e0
xor r9d, r9d
lea r8, [rbp + 0x320]
lea rdx, [rbp + 0x320]
lea rcx, [rbp + 0x720]
call fcn.1800121e0
jmp 0x180012e5f
mov r12, qword [rsp + 0x50]
mov ecx, dword [rbx + 0x18]
xor edx, edx
movzx eax, byte [rsi + 8]
mov r15d, ecx
imul r15d, dword [rsi + 4]
mov r8d, dword [rbx + 0x14]
imul eax, r8d
add eax, edi
add r15d, eax
mov eax, r15d
div ecx
test edx, edx
jne 0x180012e8d
dec ecx
add ecx, r15d
jmp 0x180012e91
lea ecx, [r15 - 1]
cmp edi, r8d
jae 0x180013055
mov qword [rsp + 0xc38], r14
or r11d, 0xffffffff
nop word [rax + rax]
xor edx, edx
lea r14d, [r15 - 1]
mov eax, r15d
div dword [rbx + 0x18]
cmp edx, 1
cmovne r14d, ecx
test r13d, r13d
je 0x180012f21
test dil, 0x7f
jne 0x180012f12
inc r12
lea r8, [rbp + 0x320]
xor r9d, r9d
mov qword [rsp + 0x50], r12
lea rdx, [rsp + 0x20]
lea rcx, [rbp + 0x720]
call fcn.1800121e0
xor r9d, r9d
lea r8, [rbp + 0x320]
lea rdx, [rbp + 0x320]
lea rcx, [rbp + 0x720]
call fcn.1800121e0
or r11d, 0xffffffff
mov eax, edi
and eax, 0x7f
mov r9, qword [rbp + rax*8 + 0x320]
jmp 0x180012f2f
mov rax, qword [rbx]
mov ecx, r14d
shl rcx, 0xa
mov r9, qword [rcx + rax]
mov ecx, dword [rbx + 0x1c]
xor edx, edx
mov r10d, dword [rsi]
mov rax, r9
shr rax, 0x20
div rcx
mov r8, rdx
test r10d, r10d
jne 0x180012f53
cmp byte [rsi + 8], r10b
jne 0x180012f53
mov r8d, dword [rsi + 4]
mov ecx, dword [rsi + 4]
mov dword [rsi + 0xc], edi
test r10d, r10d
jne 0x180012f89
movzx eax, byte [rsi + 8]
test al, al
jne 0x180012f6b
lea eax, [rdi - 1]
jmp 0x180012fab
movzx eax, al
imul eax, dword [rbx + 0x14]
cmp r8, rcx
jne 0x180012f7d
dec eax
add eax, edi
jmp 0x180012fab
xor ecx, ecx
test edi, edi
cmove ecx, r11d
add eax, ecx
jmp 0x180012fab
cmp r8, rcx
jne 0x180012f9a
mov eax, dword [rbx + 0x18]
sub eax, dword [rbx + 0x14]
dec eax
add eax, edi
jmp 0x180012fab
mov eax, dword [rbx + 0x14]
mov ecx, eax
neg eax
not ecx
test edi, edi
cmove eax, ecx
add eax, dword [rbx + 0x18]
mov ecx, eax
lea r11d, [rax - 1]
mov edx, r9d
xor eax, eax
imul rdx, rdx
shr rdx, 0x20
imul rdx, rcx
shr rdx, 0x20
sub r11, rdx
test r10d, r10d
je 0x180012fe3
movzx eax, byte [rsi + 8]
cmp al, 3
jne 0x180012fda
xor eax, eax
jmp 0x180012fe3
movzx eax, al
inc eax
imul eax, dword [rbx + 0x14]
mov ecx, dword [rbx + 0x18]
xor edx, edx
mov r9, qword [rbx]
add rax, r11
div rcx
imul rcx, r8
mov edx, edx
add rdx, rcx
mov r8d, r15d
shl rdx, 0xa
shl r8, 0xa
add rdx, r9
mov ecx, r14d
add r8, r9
shl rcx, 0xa
add rcx, r9
cmp dword [rbx + 8], 0x10
jne 0x180013020
xor r9d, r9d
jmp 0x180013030
test r10d, r10d
jne 0x18001302a
xor r9d, r9d
jmp 0x180013030
mov r9d, 1
call fcn.1800121e0
inc edi
lea ecx, [r14 + 1]
inc r15d
mov r11d, 0xffffffff
cmp edi, dword [rbx + 0x14]
jb 0x180012eb0
mov r14, qword [rsp + 0xc38]
mov r12, qword [rsp + 0xc48]
mov r13, qword [rsp + 0xc40]
mov rdi, qword [rsp + 0xc80]
mov r15, qword [rsp + 0xc30]
mov rcx, qword [rbp + 0xb20]
xor rcx, rsp
call fcn.180032200
add rsp, 0xc50
pop rsi
pop rbx
pop rbp
ret