Function at 0x180002ae0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x2d0]
sub rsp, 0x3d0
mov qword [rsp + 0x78], 0xfffffffffffffffe
mov qword [rsp + 0x420], rbx
mov rax, qword [0x1800357b8]
xor rax, rsp
mov qword [rbp + 0x2c0], rax
mov r14, r8
mov rsi, rdx
mov r15, rcx
mov rdx, rcx
lea rcx, [rbp + 0x90]
call fcn.180004690
nop
mov rax, qword [rbp + 0x90]
movsxd rax, dword [rax + 4]
lea r13, vtable.std::basic_filebuf_char__struct_std::char_traits_char__.0
lea r12, vtable.std::basic_streambuf_char__struct_std::char_traits_char__.0
lea rdi, vtable.std::ios_base.0
test byte [rbp + rax + 0xa0], 6
jne 0x180002f6d
xor ebx, ebx
mov qword [rsp + 0x40], rbx
mov byte [rsp + 0x48], 1
mov rax, qword [rbp + rax + 0xd8]
mov qword [rsp + 0x30], rax
test rax, rax
sete byte [rsp + 0x38]
mov qword [rbp + 0x1b8], 0xf
mov qword [rbp + 0x1b0], rbx
mov byte [rbp + 0x1a0], bl
movaps xmm0, xmmword [rsp + 0x40]
movdqa xmmword [rsp + 0x40], xmm0
movaps xmm1, xmmword [rsp + 0x30]
movdqa xmmword [rsp + 0x30], xmm1
lea r8, [rsp + 0x40]
lea rdx, [rsp + 0x30]
lea rcx, [rbp + 0x1a0]
call fcn.18000b950
nop
lea rcx, [rbp + 0xa0]
call fcn.180006af0
test rax, rax
jne 0x180002c05
mov rax, qword [rbp + 0x90]
movsxd rcx, dword [rax + 4]
lea rcx, [rbp + rcx + 0x90]
mov edx, dword [rcx + 0x10]
or edx, 2
cmp qword [rcx + 0x48], rbx
jne 0x180002bfd
or edx, 4
xor r8d, r8d
call fcn.180002710
mov eax, ebx
lea rcx, [rbp + 0x1c0]
nop
mov byte [rcx], al
inc eax
lea rcx, [rcx + 1]
cmp eax, 0x100
jl 0x180002c10
mov r8d, ebx
or r9, 0xffffffffffffffff
inc r9
cmp byte [rsi + r9], r8b
jne 0x180002c26
mov r10d, ebx
lea r11, [rbp + 0x1c0]
nop dword [rax]
movzx edi, byte [r11]
mov eax, r10d
cdq
idiv r9d
movsxd rax, edx
movsx ecx, byte [rax + rsi]
add r8d, ecx
add r8d, edi
and r8d, 0x800000ff
jge 0x180002c6e
dec r8d
or r8d, 0xffffff00
inc r8d
movsxd rax, r8d
lea rcx, [rbp + 0x1c0]
add rcx, rax
movzx eax, byte [rcx]
mov byte [r11], al
mov byte [rcx], dil
inc r10d
inc r11
cmp r10d, 0x100
jl 0x180002c40
mov r9d, ebx
mov r10, rbx
test r14, r14
je 0x180002d45
lea eax, [rbx + 1]
and eax, 0x800000ff
jge 0x180002cb5
dec eax
or eax, 0xffffff00
inc eax
movsxd rbx, eax
lea r8, [rbp + 0x1c0]
add r8, rbx
movzx eax, byte [r8]
add r9d, eax
and r9d, 0x800000ff
jge 0x180002cdf
dec r9d
or r9d, 0xffffff00
inc r9d
movsxd rax, r9d
lea rdx, [rbp + 0x1c0]
add rdx, rax
movzx ecx, byte [r8]
movzx eax, byte [rdx]
mov byte [r8], al
mov byte [rdx], cl
movzx ecx, byte [r8]
movzx eax, byte [rdx]
add ecx, eax
and ecx, 0x800000ff
jge 0x180002d13
dec ecx
or ecx, 0xffffff00
inc ecx
lea r8, [rbp + 0x1a0]
cmp qword [rbp + 0x1b8], 0x10
cmovae r8, qword [rbp + 0x1a0]
movzx eax, cl
movzx ecx, byte [rbp + rax + 0x1c0]
xor byte [r8 + r10], cl
inc r10
cmp r10, r14
jb 0x180002ca2
mov rdx, r15
lea rcx, [rbp - 0x80]
call fcn.180005290
nop
mov rcx, qword [rbp - 0x80]
movsxd rax, dword [rcx + 4]
test byte [rbp + rax - 0x70], 6
jne 0x180002e85
lea rdx, [rbp + 0x1a0]
cmp qword [rbp + 0x1b8], 0x10
cmovae rdx, qword [rbp + 0x1a0]
mov r8, qword [rbp + 0x1b0]
lea rcx, [rbp - 0x80]
call fcn.180004330
lea rcx, [rbp - 0x78]
call fcn.180006af0
test rax, rax
jne 0x180002e81
mov rax, qword [rbp - 0x80]
movsxd rcx, dword [rax + 4]
mov eax, dword [rbp + rcx - 0x70]
or eax, 2
cmp qword [rbp + rcx - 0x38], 0
jne 0x180002db8
or eax, 4
and eax, 0x17
mov dword [rbp + rcx - 0x70], eax
mov ecx, dword [rbp + rcx - 0x6c]
and ecx, eax
je 0x180002e81
mov dword [rsp + 0x30], 1
lea rax, [0x180036bd0]
lea rdx, [rsp + 0x30]
mov qword [rsp + 0x38], rax
movaps xmm0, xmmword [rsp + 0x30]
movdqa xmmword [rsp + 0x30], xmm0
test cl, 4
je 0x180002e23
lea r8, str.ios_base::badbit_set
lea rcx, [rsp + 0x50]
call fcn.180002410
lea rax, vtable.std::ios_base::failure.0
mov qword [rsp + 0x50], rax
lea rdx, [0x1800340a8]
lea rcx, [rsp + 0x50]
call fcn.18000fc08
int3
test cl, 2
lea rcx, [rsp + 0x50]
je 0x180002e57
lea r8, str.ios_base::failbit_set
call fcn.180002410
lea rax, vtable.std::ios_base::failure.0
mov qword [rsp + 0x50], rax
lea rdx, [0x1800340a8]
lea rcx, [rsp + 0x50]
call fcn.18000fc08
int3
lea r8, str.ios_base::eofbit_set
call fcn.180002410
lea rax, vtable.std::ios_base::failure.0
mov qword [rsp + 0x50], rax
lea rdx, [0x1800340a8]
lea rcx, [rsp + 0x50]
call fcn.18000fc08
int3
mov rcx, qword [rbp - 0x80]
movsxd rax, dword [rcx + 4]
lea rcx, vtable.std::basic_ofstream_char__struct_std::char_traits_char__.0
mov qword [rbp + rax - 0x80], rcx
mov rax, qword [rbp - 0x80]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0xa8]
mov dword [rsp + rcx + 0x7c], edx
mov qword [rbp - 0x78], r13
cmp qword [rbp + 0x18], 0
je 0x180002ed9
mov rax, qword [rbp - 0x60]
lea rcx, [rbp + 8]
cmp qword [rax], rcx
jne 0x180002ed9
mov rdx, qword [rbp - 8]
mov rcx, qword [rbp - 0x10]
mov qword [rax], rcx
mov rax, qword [rbp - 0x40]
mov qword [rax], rcx
sub edx, ecx
mov rax, qword [rbp - 0x28]
mov dword [rax], edx
cmp byte [rbp + 0x10], 0
je 0x180002ee8
lea rcx, [rbp - 0x78]
call fcn.180006af0
mov qword [rbp - 0x78], r12
mov rbx, qword [rbp - 0x18]
test rbx, rbx
je 0x180002f1e
mov rcx, qword [rbx]
test rcx, rcx
je 0x180002f16
mov rax, qword [rcx]
call qword [rax + 0x10]
test rax, rax
je 0x180002f16
mov r8, qword [rax]
mov edx, 1
mov rcx, rax
call qword [r8]
mov rcx, rbx
call fcn.18000ec80
mov rax, qword [rbp - 0x80]
movsxd rcx, dword [rax + 4]
lea rax, vtable.std::basic_ostream_char__struct_std::char_traits_char__.0
mov qword [rbp + rcx - 0x80], rax
mov rax, qword [rbp - 0x80]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0x10]
mov dword [rsp + rcx + 0x7c], edx
lea rdi, vtable.std::ios_base.0
mov qword [rbp + 0x28], rdi
lea rcx, [rbp + 0x28]
call fcn.18000c2ac
nop
cmp qword [rbp + 0x1b8], 0x10
jb 0x180002f6d
mov rcx, qword [rbp + 0x1a0]
call fcn.18000ec80
nop
mov rax, qword [rbp + 0x90]
movsxd rcx, dword [rax + 4]
lea rax, vtable.std::basic_ifstream_char__struct_std::char_traits_char__.0
mov qword [rbp + rcx + 0x90], rax
mov rax, qword [rbp + 0x90]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0xb0]
mov dword [rbp + rcx + 0x8c], edx
mov qword [rbp + 0xa0], r13
cmp qword [rbp + 0x130], 0
je 0x180002fe9
lea rcx, [rbp + 0x120]
mov rax, qword [rbp + 0xb8]
cmp qword [rax], rcx
jne 0x180002fe9
mov rdx, qword [rbp + 0x110]
mov rcx, qword [rbp + 0x108]
mov qword [rax], rcx
mov rax, qword [rbp + 0xd8]
mov qword [rax], rcx
sub edx, ecx
mov rax, qword [rbp + 0xf0]
mov dword [rax], edx
cmp byte [rbp + 0x128], 0
je 0x180002ffe
lea rcx, [rbp + 0xa0]
call fcn.180006af0
mov qword [rbp + 0xa0], r12
mov rbx, qword [rbp + 0x100]
test rbx, rbx
je 0x18000303a
mov rcx, qword [rbx]
test rcx, rcx
je 0x180003032
mov rax, qword [rcx]
call qword [rax + 0x10]
test rax, rax
je 0x180003032
mov r8, qword [rax]
mov edx, 1
mov rcx, rax
call qword [r8]
mov rcx, rbx
call fcn.18000ec80
mov rax, qword [rbp + 0x90]
movsxd rcx, dword [rax + 4]
lea rax, vtable.std::basic_istream_char__struct_std::char_traits_char__.0
mov qword [rbp + rcx + 0x90], rax
mov rax, qword [rbp + 0x90]
movsxd rcx, dword [rax + 4]
lea edx, [rcx - 0x18]
mov dword [rbp + rcx + 0x8c], edx
mov qword [rbp + 0x140], rdi
lea rcx, [rbp + 0x140]
call fcn.18000c2ac
mov rcx, qword [rbp + 0x2c0]
xor rcx, rsp
call fcn.18000cec0
mov rbx, qword [rsp + 0x420]
add rsp, 0x3d0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret