Function at 0x498210
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0xd8
mov rbx, rcx
mov qword [rsp + 0x20], 1
lea r9, [0x00798860]
lea r14, [rsp + 0x70]
mov rcx, r14
mov qword [rsp + 0x40], rdx
mov qword [rsp + 0x48], r8
call fcn.00478dab
cmp qword [r14], 0
je 0x4983e8
mov qword [rsp + 0x30], rbx
mov rsi, qword [rsp + 0xa8]
mov r11, qword [rsp + 0xb8]
mov rdx, qword [rsp + 0xc0]
mov r8, qword [rsp + 0xc8]
mov r9, qword [rsp + 0xd0]
mov r12, qword [rsp + 0xa0]
mov rcx, qword [rsp + 0x90]
mov r10, qword [rsp + 0x80]
mov rax, qword [rsp + 0x88]
mov qword [rsp + 0x38], rax
mov r15, qword [rsp + 0xb0]
mov rax, r9
not rax
mov qword [rsp + 0x68], rax
add rax, r11
mov qword [rsp + 0x60], rax
mov rax, r11
sub rax, r9
mov qword [rsp + 0x58], rax
mov qword [rsp + 0x50], r11
mov qword [rsp + 0x28], r10
cmp r10, r15
mov rax, r15
cmovb rax, r10
cmp rsi, 0xffffffffffffffff
cmove rax, r10
cmove r15, r9
lea rbx, [rax - 1]
mov r14, r12
sub r14, r9
cmp r14, rdx
jae 0x498526
movzx r10d, byte [r11 + r14]
bt rcx, r10
jae 0x49836a
mov r11, rsi
mov r10, qword [rsp + 0x60]
lea rbp, [r10 + r12]
mov r10, qword [rsp + 0x68]
add r10, r12
mov rdi, rax
mov rsi, rax
sub rsi, 1
jb 0x498375
cmp rbx, r9
jae 0x498548
lea r13, [r10 + rdi]
cmp r13, rdx
jae 0x498548
mov r13b, byte [r8 + rdi - 1]
cmp r13b, byte [rbp + rdi]
mov rdi, rsi
je 0x498327
add r12, rsi
sub r12, qword [rsp + 0x28]
mov rsi, r11
cmp r11, 0xffffffffffffffff
mov r11, qword [rsp + 0x50]
je 0x4982f3
jmp 0x4983db
mov r12, r14
cmp rsi, 0xffffffffffffffff
je 0x4982f3
jmp 0x4983d8
mov r10, qword [rsp + 0x58]
add r10, r12
mov rsi, qword [rsp + 0x28]
cmp rsi, r15
jae 0x4984ea
cmp rsi, r9
jae 0x498548
lea rdi, [r14 + rsi]
cmp rdi, rdx
jae 0x498548
mov dil, byte [r8 + rsi]
lea rbp, [rsi + 1]
cmp dil, byte [r10 + rsi]
mov rsi, rbp
je 0x498382
sub r12, qword [rsp + 0x38]
mov rsi, r11
cmp r11, 0xffffffffffffffff
mov r11, qword [rsp + 0x50]
je 0x4982f3
mov r15, qword [rsp + 0x38]
mov r10, qword [rsp + 0x28]
jmp 0x4982d9
mov r12, r14
mov r15, r9
mov r10, qword [rsp + 0x28]
jmp 0x4982d9
mov bpl, byte [rsp + 0x8a]
mov r15, qword [rsp + 0xb8]
mov r12, qword [rsp + 0xc0]
mov sil, byte [rsp + 0x89]
mov r14, qword [rsp + 0x80]
test bpl, bpl
jne 0x49852f
mov eax, esi
xor al, 1
mov byte [rsp + 0x89], al
mov rcx, r15
mov rdx, r12
mov r8, r14
call fcn.0051908b
test rdx, rdx
je 0x4984e0
movzx ecx, byte [rax + rdx - 1]
test cl, cl
jns 0x49848f
movzx r8d, byte [rax + rdx - 2]
cmp r8b, 0xc0
jge 0x498470
movzx r9d, byte [rax + rdx - 3]
cmp r9b, 0xc0
jge 0x498476
movzx eax, byte [rax + rdx - 4]
and eax, 7
shl eax, 6
and r9d, 0x3f
or r9d, eax
jmp 0x49847a
and r8d, 0x1f
jmp 0x498485
and r9d, 0xf
shl r9d, 6
and r8d, 0x3f
or r8d, r9d
shl r8d, 6
and ecx, 0x3f
or ecx, r8d
test sil, sil
jne 0x4984e5
cmp ecx, 0x110000
je 0x49852f
mov rax, 0xffffffffffffffff
cmp ecx, 0x80
jb 0x4984cd
mov rax, 0xfffffffffffffffe
cmp ecx, 0x800
jb 0x4984cd
xor eax, eax
cmp ecx, 0x10000
setb al
or rax, 0xfffffffffffffffc
add r14, rax
mov qword [rsp + 0x80], r14
mov sil, 1
jmp 0x498410
test sil, sil
je 0x49852f
mov qword [rsp + 0x30], rbx
mov rdx, qword [rsp + 0x48]
mov rcx, qword [rsp + 0x40]
inc r14
mov r8, r14
call fcn.00516e15
mov rdi, rax
mov rbx, rdx
mov rcx, rax
call fcn.0047be5f
test al, 1
jne 0x498526
shr eax, 0x10
mov rcx, qword [rsp + 0x30]
mov qword [rcx + 8], rbx
mov rbx, rcx
mov word [rcx + 0x10], ax
jmp 0x498531
xor edi, edi
mov rbx, qword [rsp + 0x30]
jmp 0x498531
xor edi, edi
mov qword [rbx], rdi
add rsp, 0xd8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
ud2