Function at 0x140049b20
Capabilities:
Encrypt data using rc4 prga

Disassembly:
mov byte [rsp + 0x20], r9b
mov qword [rsp + 0x18], r8
push rbx
push rbp
push rdi
push r13
sub rsp, 0x58
mov rbx, rdx
movzx ebp, r9b
xor r13d, r13d
mov qword [rsp + 0x38], 1
mov rcx, rbx
mov qword [rsp + 0x30], r13
lea rdx, [rsp + 0x30]
mov rdi, r8
call fcn.140048c40
test al, al
je 0x140049b6d
lea eax, [r13 + 1]
add rsp, 0x58
pop r13
pop rdi
pop rbp
pop rbx
ret
mov qword [rsp + 0x80], rsi
lea rsi, [rbx + 8]
mov qword [rsp + 0x50], r12
mov qword [rsp + 0x48], r14
mov qword [rsp + 0x40], r15
mov r15d, 0xffff
mov byte [rsp + 0x20], r13b
cmp byte [rsi], r13b
jne 0x140049bcd
mov rcx, qword [rbx]
test rcx, rcx
je 0x140049bbd
call qword [sym.imp.MSVCP140.dll_public:_unsigned_short_int___cdecl_std::basic_streambuf_wchar_t__struct_std::char_traits_wchar_t__::sgetc_void____ptr64]
cmp r15w, ax
je 0x140049bbd
lea r14, [rbx + 0xa]
mov byte [rsi], 1
mov word [r14], ax
lea rsi, [rbx + 8]
jmp 0x140049bd1
mov byte [rsi], 1
lea r14, [rbx + 0xa]
lea rsi, [rbx + 8]
mov qword [rbx], r13
jmp 0x140049bd1
lea r14, [rbx + 0xa]
movzx edx, word [r14]
xor r8d, r8d
mov rcx, rdi
call qword [sym.imp.MSVCP140.dll_public:_char___cdecl_std::ctype_wchar_t_::narrow_wchar_t__char_const___ptr64]
mov rdi, rsi
cmp al, 0x2b
je 0x140049bf9
cmp al, 0x2d
jne 0x140049c1b
mov byte [rsp + 0x20], 1
lea r14, [rbx + 0xa]
lea rdi, [rbx + 8]
mov rcx, qword [rbx]
test rcx, rcx
je 0x140049c12
call qword [sym.imp.MSVCP140.dll_public:_unsigned_short_int___cdecl_std::basic_streambuf_wchar_t__struct_std::char_traits_wchar_t__::sbumpc_void____ptr64]
cmp r15w, ax
je 0x140049c12
mov byte [rsi], r13b
jmp 0x140049c18
mov qword [rbx], r13
mov byte [rsi], 1
mov rsi, rdi
mov r15d, r13d
mov dword [rsp + 0x24], r13d
mov dword [rsp + 0x28], r13d
mov edi, r13d
mov r13d, ebp
mov r12d, 1
xor r13d, r12d
inc r13d
nop word [rax + rax]
lea rdx, [rsp + 0x30]
mov rcx, rbx
call fcn.140048c40
test al, al
jne 0x140049d8f
cmp byte [rsi], al
jne 0x140049c81
mov rcx, qword [rbx]
test rcx, rcx
je 0x140049c77
call qword [sym.imp.MSVCP140.dll_public:_unsigned_short_int___cdecl_std::basic_streambuf_wchar_t__struct_std::char_traits_wchar_t__::sgetc_void____ptr64]
mov ecx, 0xffff
cmp cx, ax
je 0x140049c77
mov word [r14], ax
jmp 0x140049c7e
mov qword [rbx], 0
mov byte [rsi], 1
mov rcx, qword [rbx]
movzx ebp, word [r14]
test rcx, rcx
je 0x140049ca1
call qword [sym.imp.MSVCP140.dll_public:_unsigned_short_int___cdecl_std::basic_streambuf_wchar_t__struct_std::char_traits_wchar_t__::sbumpc_void____ptr64]
mov ecx, 0xffff
cmp cx, ax
je 0x140049ca1
xor al, al
jmp 0x140049caa
mov qword [rbx], 0
mov al, 1
mov byte [rsi], al
xor r8d, r8d
mov rcx, qword [rsp + 0x90]
movzx edx, bp
call qword [sym.imp.MSVCP140.dll_public:_char___cdecl_std::ctype_wchar_t_::narrow_wchar_t__char_const___ptr64]
cmp byte [rsp + 0x98], 0
movsx r8d, al
lea ecx, [r8 - 0x30]
je 0x140049d08
cmp edi, 1
jne 0x140049d08
cmp r8b, 0x3a
je 0x140049d31
cmp cl, 9
ja 0x140049d7c
test r12d, r12d
jle 0x140049d7c
lea r15d, [r15 + r15*4]
dec r12d
lea r15d, [r15 - 0x18]
lea r15d, [r8 + r15*2]
mov dword [rsp + 0x24], r15d
jmp 0x140049c40
cmp cl, 9
ja 0x140049d83
lea rax, [rsp + 0x28]
cmp edi, 2
lea rdx, [rsp + 0x24]
cmovge rdx, rax
mov eax, dword [rdx]
lea ecx, [rax - 6]
lea ecx, [rax + rcx*4]
lea ecx, [r8 + rcx*2]
mov dword [rdx], ecx
mov r15d, dword [rsp + 0x24]
inc edi
cmp edi, 4
jl 0x140049c40
mov rax, qword [rsp + 0xa0]
imul edx, r15d, 0x3c
add edx, dword [rsp + 0x28]
cmp byte [rsp + 0x20], 0
mov dword [rax], edx
je 0x140049d59
neg edx
mov dword [rax], edx
xor eax, eax
mov r14, qword [rsp + 0x48]
mov r12, qword [rsp + 0x50]
mov rsi, qword [rsp + 0x80]
mov r15, qword [rsp + 0x40]
add rsp, 0x58
pop r13
pop rdi
pop rbp
pop rbx
ret
cmp edi, r13d
jne 0x140049d88
jmp 0x140049d3c
cmp edi, r13d
je 0x140049d3c
mov eax, 2
jmp 0x140049d5b
cmp edi, r13d
je 0x140049d3c
mov eax, 3
jmp 0x140049d5b