Function at 0x18006fac4
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x38
mov r9d, dword [rcx + 0x24]
lea rdx, [rcx + 0xa8]
mov eax, dword [rcx + 0x54]
mov r11d, r9d
mov r10d, dword [rcx + 0x50]
and r11d, 0x7fff
mov edi, dword [rcx + 0x28]
mov rbx, rcx
mov r13d, dword [rcx + 0x2c]
mov r15d, 1
mov rsi, qword [rcx + 0x30]
mov r12, qword [rcx + 0x38]
mov dword [rsp + 0x98], r11d
mov dword [rsp + 0x90], r9d
mov dword [rsp + 0x80], eax
mov dword [rsp + 0x88], r10d
mov dword [rsp + 0x20], 8
mov rcx, qword [rbx + 0xb8]
mov qword [rsp + 0x28], rdx
test rcx, rcx
jne 0x18006fb51
cmp dword [rdx], ecx
je 0x18006fc45
test edi, edi
je 0x18006fc45
mov r14d, 0x1000
lea ebp, [rdi + r9]
and ebp, 0x7fff
sub r14d, edi
cmp rcx, r14
jae 0x18006fb70
mov r14d, dword [rbx + 0xb8]
mov eax, r14d
add edi, r14d
sub rcx, rax
mov qword [rbx + 0xb8], rcx
test r14d, r14d
je 0x18006fc26
mov rdx, qword [rbx + 0xb0]
mov eax, 0x8000
sub eax, ebp
mov ecx, ebp
cmp eax, r14d
mov r15d, r14d
cmovb r15d, eax
add rcx, 0xc8
add rcx, rbx
mov r8d, r15d
call sub.msvcrt.dll_memcpy
cmp ebp, 0x101
jae 0x18006fbe6
mov rdx, qword [rbx + 0xb0]
mov eax, 0x101
sub eax, ebp
mov ecx, ebp
cmp r15d, eax
cmovb eax, r15d
add rcx, 0x80c8
add rcx, rbx
mov r8d, eax
call sub.msvcrt.dll_memcpy
add ebp, r15d
mov eax, r15d
add qword [rbx + 0xb0], rax
and ebp, 0x7fff
sub r14d, r15d
jne 0x18006fb89
mov r10d, dword [rsp + 0x88]
lea rdx, [rbx + 0xa8]
mov r9d, dword [rsp + 0x90]
lea r15d, [r14 + 1]
mov r11d, dword [rsp + 0x98]
mov qword [rsp + 0x28], rdx
mov r14d, 0x8000
mov eax, r14d
sub eax, edi
cmp eax, r13d
cmovb r13d, eax
cmp dword [rdx], 0
jne 0x18006fc6e
cmp edi, 0x1000
jae 0x18006fc77
mov eax, dword [rsp + 0x80]
mov dword [rbx + 0x54], eax
mov eax, r15d
mov dword [rbx + 0x24], r9d
mov dword [rbx + 0x28], edi
mov dword [rbx + 0x2c], r13d
mov qword [rbx + 0x30], rsi
mov qword [rbx + 0x38], r12
mov dword [rbx + 0x50], r10d
jmp 0x180070024
cmp edi, 4
jb 0x18006ff18
lea rbp, [rbx + 0x192a2]
mov r8d, r15d
mov r15d, r11d
add r15, 0xc8
add r15, rbx
mov r11d, dword [r15]
and r11d, 0xffffff
mov eax, r11d
mov ecx, r11d
shr rcx, 0x11
xor rcx, rax
movzx eax, r9w
and ecx, 0xfff
movzx edx, word [rbx + rcx*2 + 0x292aa]
sub ax, dx
mov word [rbx + rcx*2 + 0x292aa], r9w
movzx r14d, ax
cmp r14d, r13d
ja 0x18006fe10
and edx, 0x7fff
lea r9, [rbx + 0xc8]
add r9, rdx
mov eax, dword [r9]
and eax, 0xffffff
cmp eax, r11d
jne 0x18006fe10
mov r8, r15
mov ebp, 0x20
add r9, 2
add r8, 2
movzx eax, word [r9]
cmp word [r8], ax
jne 0x18006fd46
add r9, 2
add r8, 2
movzx eax, word [r9]
cmp word [r8], ax
jne 0x18006fd46
add r9, 2
add r8, 2
movzx eax, word [r9]
cmp word [r8], ax
jne 0x18006fd46
add r9, 2
add r8, 2
movzx eax, word [r9]
cmp word [r8], ax
jne 0x18006fd46
add ebp, 0xffffffff
jne 0x18006fcf9
mov al, byte [r9]
xor ecx, ecx
mov rdx, r8
sub rdx, r15
sar rdx, 1
cmp byte [r8], al
sete cl
lea eax, [rcx + rdx*2]
test ebp, ebp
jne 0x18006fd6d
mov eax, r14d
neg eax
sbb eax, eax
and eax, 0x102
cmp eax, 3
jb 0x18006fdfe
jne 0x18006fd81
cmp r14d, 0x2000
jae 0x18006fdfe
cmp eax, edi
lea r9, [0x180000000]
mov r8d, edi
lea rbp, [rbx + 0x192a2]
cmovb r8d, eax
mov r15d, 1
dec r14d
mov dword [rsi + 1], r14d
mov edx, r14d
lea eax, [r8 - 3]
shr rdx, 8
mov byte [rsi], al
add rsi, 3
mov al, byte [r12]
shr al, 1
or al, 0x80
mov byte [r12], al
mov eax, r14d
and eax, 0x1ff
cmp r14d, 0x200
movzx ecx, byte [rax + r9 + 0xcd830]
movzx eax, byte [rdx + r9 + 0xcd1e0]
cmovb eax, ecx
add word [rbx + rax*2 + 0x840a], r15w
lea eax, [r8 - 3]
movzx eax, word [r9 + rax*2 + 0xcd630]
jmp 0x18006fe23
mov r15d, 1
lea rbp, [rbx + 0x192a2]
mov r8d, r15d
jmp 0x18006fe16
mov r15d, 1
movzx eax, r11b
mov byte [rsi], al
add rsi, r15
shr byte [r12], 1
add word [rbx + rax*2 + 0x81ca], r15w
add r10d, 0xffffffff
mov dword [rsp + 0x88], r10d
mov ecx, r10d
jne 0x18006fe4e
mov r10d, 8
mov r12, rsi
mov dword [rsp + 0x88], r10d
mov r9d, dword [rsp + 0x90]
lea rax, [rsi + 1]
mov r11d, dword [rsp + 0x98]
test ecx, ecx
mov ecx, dword [rsp + 0x80]
mov r14d, 0x8000
cmovne rax, rsi
add ecx, r8d
add r9d, r8d
mov dword [rsp + 0x80], ecx
mov rsi, rax
mov dword [rsp + 0x90], r9d
lea eax, [r8 + r13]
mov r13d, r14d
cmp eax, r14d
cmovb r13d, eax
add r11d, r8d
and r11d, 0x7fff
sub edi, r8d
mov dword [rsp + 0x98], r11d
cmp rsi, rbp
jbe 0x18006ff0f
mov dword [rbx + 0x54], ecx
xor edx, edx
mov rcx, rbx
mov dword [rbx + 0x24], r9d
mov dword [rbx + 0x28], edi
mov dword [rbx + 0x2c], r13d
mov qword [rbx + 0x30], rsi
mov qword [rbx + 0x38], r12
mov dword [rbx + 0x50], r10d
call fcn.18006f51c
test eax, eax
jne 0x18007001f
mov eax, dword [rbx + 0x54]
mov r10d, dword [rbx + 0x50]
mov rsi, qword [rbx + 0x30]
mov r12, qword [rbx + 0x38]
mov r9d, dword [rsp + 0x90]
mov r11d, dword [rsp + 0x98]
mov dword [rsp + 0x80], eax
mov dword [rsp + 0x88], r10d
cmp edi, 4
jae 0x18006fc7e
test edi, edi
je 0x180070015
mov r8d, dword [rsp + 0x80]
lea rbp, [rbx + 0x192a2]
add r8d, r15d
mov eax, r11d
lea rcx, [rsi + 1]
mov dword [rsp + 0x80], r8d
movzx edx, byte [rax + rbx + 0xc8]
mov byte [rsi], dl
shr byte [r12], 1
add r10d, 0xffffffff
mov eax, r10d
cmove r10d, dword [rsp + 0x20]
test eax, eax
mov dword [rsp + 0x88], r10d
cmovne rcx, r12
neg eax
mov r12, rcx
sbb rax, rax
add word [rbx + rdx*2 + 0x81ca], r15w
add rax, 2
add r9d, r15d
add rsi, rax
mov dword [rsp + 0x90], r9d
lea eax, [r13 + 1]
mov r13d, r14d
cmp eax, r14d
inc r11d
cmovb r13d, eax
and r11d, 0x7fff
dec edi
mov dword [rsp + 0x98], r11d
cmp rsi, rbp
jbe 0x18007000d
mov qword [rbx + 0x38], rcx
xor edx, edx
mov rcx, rbx
mov dword [rbx + 0x24], r9d
mov dword [rbx + 0x28], edi
mov dword [rbx + 0x2c], r13d
mov dword [rbx + 0x54], r8d
mov qword [rbx + 0x30], rsi
mov dword [rbx + 0x50], r10d
call fcn.18006f51c
test eax, eax
jne 0x18007001f
mov r8d, dword [rbx + 0x54]
mov r10d, dword [rbx + 0x50]
mov rsi, qword [rbx + 0x30]
mov r12, qword [rbx + 0x38]
mov r9d, dword [rsp + 0x90]
mov r11d, dword [rsp + 0x98]
mov dword [rsp + 0x80], r8d
mov dword [rsp + 0x88], r10d
test edi, edi
jne 0x18006ff2f
mov rdx, qword [rsp + 0x28]
jmp 0x18006fb30
not eax
shr eax, 0x1f
add rsp, 0x38
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret