Function at 0x3a98ba430
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x48
xor ebp, ebp
mov rdi, rcx
mov rbx, rdx
mov r13d, r9d
mov rsi, r8
call fcn.3a98b9f70
mov eax, dword [rdi + 0x3278]
xor r10d, r10d
imul r9, rax, 0x11d8
mov qword [rsp + 0x30], rax
mov r12, rax
xor eax, eax
lea rdx, [rdi + r9]
nop dword [rax]
mov r8d, dword [rdi + rax*4 + 0xe50]
lea ecx, [r8 + r8*2]
add ebp, ecx
movzx ecx, byte [rdx + rax + 0x2097]
add rax, 1
imul ecx, r8d
add r10d, ecx
cmp rax, 8
jne 0x3a98ba478
add r10d, 0x18
mov eax, dword [rsp + 0xb0]
mov r14, qword [rbx + 0x20]
cmp r10d, ebp
sbb rcx, rcx
not rcx
add rcx, 2
cmp r10d, ebp
lea rbp, [rdi + rax*8 + 0x3280]
mov eax, dword [rdi + 0x1c]
sbb r8d, r8d
xor r12d, 1
mov r10, qword [rbx + 0x18]
mov dword [rsp + 0x2c], eax
mov eax, dword [rdi + 0x18]
imul r12, r12, 0x11d8
not r8d
sub r14, r10
add r8d, 2
mov dword [rsp + 0x38], eax
mov rax, qword [rbx]
lea r11, [rdi + r12 + 0x1d0c]
shl rax, 3
or rax, rcx
mov rcx, qword [rbx + 8]
mov qword [rbx], rax
lea r15, [rcx + 3]
mov qword [rbx + 8], r15
cmp r14, 5
jle 0x3a98baa98
lea ecx, [r15 - 0x10]
shr rax, cl
mov word [r10], ax
mov rcx, qword [rbx + 8]
mov rax, qword [rbx + 0x18]
mov r14, qword [rbx + 0x20]
mov r10, rcx
and ecx, 0xf
shr r10, 4
mov qword [rbx + 8], rcx
add rcx, 1
lea r10, [rax + r10*2]
mov rax, qword [rbx]
mov qword [rbx + 0x18], r10
sub r14, r10
add rax, rax
cmp r13d, 0x8000
je 0x3a98ba850
mov qword [rbx], rax
mov qword [rbx + 8], rcx
cmp r14, 5
jle 0x3a98ba5a1
sub ecx, 0x10
shr rax, cl
mov word [r10], ax
mov rcx, qword [rbx + 8]
mov rax, qword [rbx + 0x18]
mov r14, qword [rbx + 0x20]
mov r10, rcx
and ecx, 0xf
shr r10, 4
mov qword [rbx + 8], rcx
lea r10, [rax + r10*2]
mov rax, qword [rbx]
mov qword [rbx + 0x18], r10
sub r14, r10
cmp dword [rsp + 0x38], 0xf
jbe 0x3a98ba5fc
shl rax, 8
mov r15, rax
mov eax, r13d
shr eax, 0x10
or rax, r15
lea r15, [rcx + 8]
mov qword [rbx], rax
mov qword [rbx + 8], r15
cmp r14, 5
jle 0x3a98bab81
lea ecx, [r15 - 0x10]
shr rax, cl
mov word [r10], ax
mov rcx, qword [rbx + 8]
mov rax, qword [rbx + 0x18]
mov r14, qword [rbx + 0x20]
mov r10, rcx
and ecx, 0xf
shr r10, 4
lea r10, [rax + r10*2]
mov rax, qword [rbx]
mov qword [rbx + 0x18], r10
sub r14, r10
shl rax, 0x10
movzx r13d, r13w
add rcx, 0x10
or r13, rax
mov qword [rbx + 8], rcx
mov qword [rbx], r13
cmp r14, 5
jle 0x3a98ba63b
sub ecx, 0x10
shr r13, cl
mov word [r10], r13w
mov rax, qword [rbx + 8]
mov rcx, rax
and eax, 0xf
shr rcx, 4
mov qword [rbx + 8], rax
add rcx, rcx
add qword [rbx + 0x18], rcx
mov ecx, dword [rsp + 0x2c]
lea rax, [rdi + r9 + 0x1d0c]
lea r13, [rdi + r9 + 0x1e0c]
lea r14, [r11 + 0x100]
lea r15, [rdi + r9 + 0x1f9d]
sub ecx, 0x100
lea r12, [rdi + r12 + 0x1f9d]
mov dword [rsp + 0x2c], ecx
cmp r8d, 2
je 0x3a98baab8
mov r8, r11
mov rdx, rax
mov r9d, 0x100
mov rcx, rbx
call fcn.3a98ba010
mov r9d, dword [rsp + 0x2c]
mov r8, r14
mov rdx, r13
mov rcx, rbx
call fcn.3a98ba010
mov r8, r12
mov rdx, r15
mov rcx, rbx
mov r9d, 0xf9
call fcn.3a98ba010
mov dword [rsp + 0x2c], 0x32
mov rax, qword [rsp + 0x30]
imul r10, rax, 0x11d8
imul r11, rax, 0x476
add r10, rdi
jmp 0x3a98ba780
sub r9d, 3
and r15d, 7
shr r8d, 3
movzx r12d, byte [r15 + r10 + 0x2097]
mov ecx, r9d
shl rax, cl
or rax, r8
mov ecx, r12d
add r9, r12
shl rax, cl
lea rcx, [r15 + r11 + 0x738]
add rdx, r9
mov ecx, dword [rdi + rcx*4 + 0xc]
or rax, rcx
mov r8, qword [rbx + 0x18]
mov rcx, qword [rbx + 0x20]
mov qword [rbx + 8], rdx
mov qword [rbx], rax
sub rcx, r8
cmp rcx, 5
jle 0x3a98ba77c
lea ecx, [rdx - 0x10]
shr rax, cl
mov word [r8], ax
mov eax, dword [rbx + 8]
mov rdx, qword [rbx + 0x18]
lea ecx, [rax - 0x20]
mov rax, qword [rbx]
shr rax, cl
mov word [rdx + 2], ax
mov eax, dword [rbx + 8]
mov rdx, qword [rbx + 0x18]
lea ecx, [rax - 0x30]
mov rax, qword [rbx]
shr rax, cl
mov word [rdx + 4], ax
mov rax, qword [rbx + 8]
mov rdx, rax
and eax, 0xf
shr rdx, 4
mov qword [rbx + 8], rax
add rdx, rdx
add qword [rbx + 0x18], rdx
add rbp, 8
mov r9d, dword [rbp]
mov r12d, r9d
and r12d, 0x1ff
shr r9d, 9
jne 0x3a98ba878
test r12d, r12d
je 0x3a98baa46
mov edx, dword [rbp + 4]
mov rcx, qword [0x3a9979b40]
mov eax, r12d
add rsi, rax
mov r15d, edx
and edx, 0x3ff
lea r13d, [rdx - 0x100]
shr r15d, 0xa
shr r13d, 3
lea r8d, [r15 - 2]
mov eax, r13d
movzx r9d, byte [rcx + rax]
mov rcx, qword [0x3a9979b50]
sub r8d, dword [rcx + rax*4]
mov rax, qword [rbx]
mov r14, r9
movzx ecx, byte [rdx + r10 + 0x1d0c]
lea rdx, [rdx + r11 + 0x3b0]
mov edx, dword [rdi + rdx*4 + 8]
shl rax, cl
or rax, rdx
movzx edx, cl
add rdx, qword [rbx + 8]
cmp r12d, 8
jbe 0x3a98ba831
sub r12d, 9
movzx ecx, byte [r12 + r10 + 0x1f9d]
lea r12, [r12 + r11 + 0x640]
mov r12d, dword [rdi + r12*4 + 8]
shl rax, cl
add rdx, rcx
or rax, r12
mov ecx, dword [rsp + 0x2c]
cmp r13d, ecx
jae 0x3a98ba6e0
mov ecx, r14d
add rdx, r14
shl rax, cl
or rax, r8
jmp 0x3a98ba719
or rax, 1
mov qword [rbx + 8], rcx
mov qword [rbx], rax
cmp r14, 5
jle 0x3a98ba63b
sub ecx, 0x10
shr rax, cl
mov word [r10], ax
jmp 0x3a98ba622
cmp r9d, 2
jbe 0x3a98ba98c
mov qword [rsp + 0x30], rbp
nop word [rax + rax]
movzx eax, byte [rsi]
movzx r14d, byte [rsi + 1]
mov rbp, qword [rbx]
movzx r13d, byte [rsi + 2]
movzx r8d, byte [rax + r10 + 0x1d0c]
movzx edx, byte [r14 + r10 + 0x1d0c]
lea rax, [rax + r11 + 0x3b0]
mov eax, dword [rdi + rax*4 + 8]
mov rcx, r8
mov r15, rdx
add r8, rdx
add r8, qword [rbx + 8]
movzx edx, byte [r13 + r10 + 0x1d0c]
shl rbp, cl
mov ecx, r15d
or rax, rbp
shl rax, cl
lea rcx, [r14 + r11 + 0x3b0]
mov ecx, dword [rdi + rcx*4 + 8]
or rax, rcx
mov ecx, edx
shl rax, cl
lea rcx, [r13 + r11 + 0x3b0]
mov ecx, dword [rdi + rcx*4 + 8]
or rax, rcx
movzx ecx, dl
mov rdx, qword [rbx + 0x20]
add rcx, r8
mov r8, qword [rbx + 0x18]
mov qword [rbx], rax
mov qword [rbx + 8], rcx
sub rdx, r8
cmp rdx, 5
jle 0x3a98ba96c
sub ecx, 0x10
shr rax, cl
mov word [r8], ax
mov eax, dword [rbx + 8]
mov rdx, qword [rbx + 0x18]
lea ecx, [rax - 0x20]
mov rax, qword [rbx]
shr rax, cl
mov word [rdx + 2], ax
mov eax, dword [rbx + 8]
mov rdx, qword [rbx + 0x18]
lea ecx, [rax - 0x30]
mov rax, qword [rbx]
shr rax, cl
mov word [rdx + 4], ax
mov rax, qword [rbx + 8]
mov rdx, rax
and eax, 0xf
shr rdx, 4
mov qword [rbx + 8], rax
add rdx, rdx
add qword [rbx + 0x18], rdx
sub r9d, 3
add rsi, 3
cmp r9d, 2
ja 0x3a98ba890
mov rbp, qword [rsp + 0x30]
test r9d, r9d
je 0x3a98ba798
movzx edx, byte [rsi]
mov rax, qword [rbx]
mov r13, qword [rbx + 0x18]
mov r8, qword [rbx + 0x20]
movzx ecx, byte [rdx + r10 + 0x1d0c]
lea rdx, [rdx + r11 + 0x3b0]
mov edx, dword [rdi + rdx*4 + 8]
sub r8, r13
shl rax, cl
or rax, rdx
movzx edx, cl
add rdx, qword [rbx + 8]
mov qword [rbx], rax
mov qword [rbx + 8], rdx
cmp r9d, 1
je 0x3a98baa60
movzx r9d, byte [rsi + 1]
movzx ecx, byte [r9 + r10 + 0x1d0c]
lea r9, [r9 + r11 + 0x3b0]
mov r9d, dword [rdi + r9*4 + 8]
shl rax, cl
add rcx, rdx
or rax, r9
mov qword [rbx + 8], rcx
mov qword [rbx], rax
cmp r8, 5
jle 0x3a98baa39
sub ecx, 0x10
shr rax, cl
mov word [r13], ax
mov eax, dword [rbx + 8]
mov rdx, qword [rbx + 0x18]
lea ecx, [rax - 0x20]
mov rax, qword [rbx]
shr rax, cl
mov word [rdx + 2], ax
mov rax, qword [rbx + 8]
mov rdx, rax
and eax, 0xf
shr rdx, 4
mov qword [rbx + 8], rax
add rdx, rdx
add qword [rbx + 0x18], rdx
add rsi, 2
test r12d, r12d
jne 0x3a98ba7a1
xor dword [rdi + 0x3278], 1
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
cmp r8, 5
jle 0x3a98baa8a
lea ecx, [rdx - 0x10]
shr rax, cl
mov word [r13], ax
mov rax, qword [rbx + 8]
mov rdx, rax
and eax, 0xf
shr rdx, 4
mov qword [rbx + 8], rax
add rdx, rdx
add qword [rbx + 0x18], rdx
add rsi, 1
jmp 0x3a98ba798
add rax, rax
add rcx, 4
cmp r13d, 0x8000
je 0x3a98bab71
mov qword [rbx + 8], rcx
jmp 0x3a98ba5a1
mov qword [rsp + 0x38], r11
xor r8d, r8d
mov rcx, qword [rbx]
mov r10, qword [rbx + 0x18]
mov r11, qword [rbx + 0x20]
lea r9, [rcx*8]
movzx ecx, byte [rdx + r8 + 0x2097]
sub r11, r10
or r9, rcx
mov rcx, qword [rbx + 8]
mov qword [rbx], r9
add rcx, 3
mov qword [rbx + 8], rcx
cmp r11, 5
jle 0x3a98bab1a
sub ecx, 0x10
shr r9, cl
mov word [r10], r9w
mov rcx, qword [rbx + 8]
mov r9, rcx
and ecx, 0xf
shr r9, 4
mov qword [rbx + 8], rcx
add r9, r9
add qword [rbx + 0x18], r9
add r8, 1
cmp r8, 8
jne 0x3a98baac0
mov r11, qword [rsp + 0x38]
mov rdx, rax
mov r9d, 0x100
mov rcx, rbx
mov r8, r11
call fcn.3a98ba010
mov r9d, dword [rsp + 0x2c]
mov r8, r14
mov rdx, r13
mov rcx, rbx
call fcn.3a98ba010
mov r8, r12
mov rdx, r15
mov rcx, rbx
mov r9d, 0xf9
call fcn.3a98ba010
mov dword [rsp + 0x2c], 8
jmp 0x3a98ba6bd
or rax, 1
mov qword [rbx + 8], rcx
mov qword [rbx], rax
jmp 0x3a98ba63b
movzx r13d, r13w
shl rax, 0x10
add rcx, 0x18
or r13, rax
mov qword [rbx + 8], rcx
mov qword [rbx], r13
jmp 0x3a98ba63b