Function at 0x180157950
Capabilities:
Encrypt data using rc4 prga

Disassembly:
mov qword [rsp + 0x10], rdx
push rbx
push r12
sub rsp, 0x78
mov r8d, dword [rcx + 0x64]
mov rbx, rcx
mov r9d, dword [rcx + 0x3c]
mov r10, rdx
mov ecx, dword [rcx + 0x48]
lea eax, [r9 + r8]
cmp eax, ecx
jbe 0x1801579c6
mov r8d, ecx
sub r8d, r9d
cmp r8d, 3
jae 0x1801579c6
xor r12d, r12d
mov dword [rdx], r12d
inc dword [rbx + 0x5c]
mov eax, dword [rbx + 0x5c]
mov ecx, eax
cmp eax, dword [rbx + 0x60]
cmove ecx, r12d
mov dword [rbx + 0x5c], ecx
lea rcx, [rbx + 8]
call fcn.18015bb70
test eax, eax
jne 0x180157c01
cmp dword [rbx + 0x3c], 0x7fffffff
jne 0x1801579bb
mov rcx, rbx
call fcn.18015bc00
mov eax, r12d
add rsp, 0x78
pop r12
pop rbx
ret
mov qword [rsp + 0x70], rbp
mov ecx, r9d
sub ecx, dword [rbx + 0x60]
xor r12d, r12d
cmp r9d, dword [rbx + 0x60]
mov edx, 2
mov qword [rsp + 0x68], rsi
mov rsi, r9
mov qword [rsp + 0x60], rdi
mov edi, r12d
cmova edi, ecx
mov qword [rsp + 0x58], r13
add rsi, qword [rbx + 0x30]
mov qword [rsp + 0x50], r14
mov qword [rsp + 0x48], r15
mov dword [rsp + 0x20], edi
movzx eax, byte [rsi]
movzx ecx, byte [rsi + 1]
shl rcx, 8
xor rcx, rax
mov dword [rsp + 0xa8], edx
mov rax, qword [rbx + 0x68]
mov dword [rsp + 0xa0], edx
mov r11d, dword [rax + rcx*4]
mov dword [rax + rcx*4], r9d
mov eax, dword [rbx + 0x5c]
mov rcx, qword [rbx + 0x70]
add eax, eax
mov qword [rsp + 0x30], rcx
lea r15, [rcx + rax*4]
lea r9, [r15 + 4]
mov qword [rsp + 0x28], r9
cmp r11d, edi
jbe 0x180157a86
mov rcx, qword [rbx + 0x30]
lea edx, [r11 + 2]
movzx eax, byte [rsi + 2]
cmp byte [rdx + rcx], al
lea edx, [r12 + 2]
je 0x180157a86
mov dword [r10 + 4], edx
lea r13d, [r12 + 3]
mov eax, dword [rbx + 0x3c]
sub eax, r11d
mov dword [rsp + 0x90], edx
dec eax
mov dword [r10 + 8], eax
mov ebp, dword [rbx + 0x78]
jmp 0x180157aa1
mov ebp, dword [rbx + 0x78]
mov ecx, 1
mov dword [rsp + 0x90], ecx
mov r13d, ecx
cmp r11d, edi
jbe 0x180157b9d
mov eax, r13d
lea r14, [r10 + rax*4]
nop dword [rax + rax]
mov eax, ebp
dec ebp
test eax, eax
je 0x180157b9d
mov r9d, dword [rbx + 0x3c]
mov ecx, dword [rbx + 0x5c]
sub r9d, r11d
cmp r9d, ecx
ja 0x180157ad0
sub ecx, r9d
jmp 0x180157ad8
mov eax, dword [rbx + 0x60]
sub eax, r9d
add ecx, eax
mov rax, qword [rsp + 0x30]
add ecx, ecx
mov r10d, r11d
add r10, qword [rbx + 0x30]
cmp dword [rsp + 0xa0], edx
lea rdi, [rax + rcx*4]
mov eax, edx
cmovb eax, dword [rsp + 0xa0]
movzx ecx, byte [rax + rsi]
cmp byte [rax + r10], cl
jne 0x180157b4d
inc eax
cmp eax, r8d
je 0x180157b21
nop dword [rax]
movzx ecx, byte [rax + rsi]
cmp byte [rax + r10], cl
jne 0x180157b21
inc eax
cmp eax, r8d
jne 0x180157b10
cmp dword [rsp + 0x90], eax
jae 0x180157b4d
mov dword [r14], eax
lea ecx, [r9 - 1]
mov dword [r14 + 4], ecx
add r13d, 2
add r14, 8
mov dword [rsp + 0x90], eax
cmp eax, r8d
je 0x180157c09
movzx ecx, byte [rax + rsi]
cmp byte [rax + r10], cl
jae 0x180157b71
mov r9, qword [rsp + 0x28]
mov edx, eax
mov dword [r15], r11d
lea r15, [rdi + 4]
mov rdi, r15
mov dword [rsp + 0xa8], eax
jmp 0x180157b8f
mov rcx, qword [rsp + 0x28]
mov r9, rdi
mov edx, dword [rsp + 0xa8]
mov qword [rsp + 0x28], rdi
mov dword [rsp + 0xa0], eax
mov dword [rcx], r11d
mov r11d, dword [rdi]
cmp r11d, dword [rsp + 0x20]
ja 0x180157ab0
mov dword [r15], r12d
mov dword [r9], r12d
mov rcx, qword [rsp + 0x98]
lea eax, [r13 - 1]
mov dword [rcx], eax
inc dword [rbx + 0x5c]
mov eax, dword [rbx + 0x5c]
mov ecx, eax
cmp eax, dword [rbx + 0x60]
cmove ecx, r12d
mov dword [rbx + 0x5c], ecx
lea rcx, [rbx + 8]
call fcn.18015bb70
mov r15, qword [rsp + 0x48]
mov r14, qword [rsp + 0x50]
mov r13, qword [rsp + 0x58]
mov rdi, qword [rsp + 0x60]
mov rsi, qword [rsp + 0x68]
mov rbp, qword [rsp + 0x70]
test eax, eax
jne 0x180157c01
cmp dword [rbx + 0x3c], 0x7fffffff
jne 0x180157bff
mov rcx, rbx
call fcn.18015bc00
xor eax, eax
add rsp, 0x78
pop r12
pop rbx
ret
mov eax, dword [rdi]
mov rcx, qword [rsp + 0x28]
mov dword [r15], eax
mov eax, dword [rdi + 4]
mov dword [rcx], eax
jmp 0x180157ba3