Function at 0x477660
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, 0x78
mov qword [rsp + 0x28], rcx
mov qword [rsp + 0x70], rdx
mov r14, qword [rdx + 8]
mov r13, qword [rdx + 0x18]
mov rdi, qword [r14 + r13*8 + 0x220]
mov rcx, qword [r14 + r13*8 + 0x228]
mov qword [rsp + 0x30], rcx
movzx eax, word [rdi + 0xa]
lea r15, [r13 + 1]
lea rsi, [r14 + r13*8 + 0x228]
movzx ecx, word [rcx + 0xa]
mov qword [rsp + 0x38], rcx
mov qword [rsp + 0x60], rax
lea rax, [rax*8]
lea r12, [rax + rax*2]
movzx eax, word [r14 + 0xa]
lea rcx, [r13*8]
lea rbp, [rcx + rcx*2]
lea rcx, [r14 + rbp + 0x10]
mov rdx, qword [r14 + rbp + 0x20]
mov qword [rsp + 0x50], rdx
movups xmm0, xmmword [r14 + rbp + 0x10]
movaps xmmword [rsp + 0x40], xmm0
mov rbx, r13
not rbx
add rax, rbx
shl rax, 3
lea r8, [rax + rax*2]
lea rdx, [r14 + rbp]
add rdx, 0x28
call sub.msvcrt.dll_memmove
movaps xmm0, xmmword [rsp + 0x40]
movups xmmword [rdi + r12 + 0x10], xmm0
mov rax, qword [rsp + 0x50]
mov qword [rdi + r12 + 0x20], rax
mov rax, qword [rsp + 0x30]
lea rdx, [rax + 0x10]
lea rcx, [rdi + r12 + 0x28]
mov rax, qword [rsp + 0x38]
lea rax, [rax*8]
lea r8, [rax + rax*2]
mov qword [rsp + 0x68], r8
call sub.msvcrt.dll_memcpy
movzx eax, word [r14 + 0xa]
lea rcx, [r14 + rbp]
add rcx, 0x118
mov rdx, qword [r14 + rbp + 0x128]
mov qword [rsp + 0x50], rdx
movups xmm0, xmmword [r14 + rbp + 0x118]
movaps xmmword [rsp + 0x40], xmm0
lea rdx, [r14 + rbp]
add rdx, 0x130
add rax, rbx
mov rbx, qword [rsp + 0x30]
shl rax, 3
lea r8, [rax + rax*2]
call sub.msvcrt.dll_memmove
movaps xmm0, xmmword [rsp + 0x40]
movups xmmword [rdi + r12 + 0x118], xmm0
mov rax, qword [rsp + 0x50]
mov qword [rdi + r12 + 0x128], rax
lea rdx, [rbx + 0x118]
lea rcx, [rdi + r12]
add rcx, 0x130
mov r8, qword [rsp + 0x68]
call sub.msvcrt.dll_memcpy
lea rdx, [r14 + r13*8]
add rdx, 0x230
lea r8, [r13*8 + 8]
xor r8, 0xfffffffffffffff8
add r8, 0x60
mov rcx, rsi
call sub.msvcrt.dll_memmove
mov rbp, qword [rsp + 0x38]
mov rdx, qword [rsp + 0x70]
movzx ecx, word [r14 + 0xa]
movzx eax, cx
cmp r15, rax
jae 0x4778bc
mov r11, rbp
mov r9, rdx
mov ecx, r13d
not ecx
lea edx, [rax + rcx]
lea r8, [rax - 2]
sub r8, r13
and rdx, 3
je 0x47784e
mov r10, rbx
xor ebp, ebp
nop dword [rax + rax]
lea ebx, [r15 + rbp]
mov rcx, qword [rsi + rbp*8]
mov qword [rcx], r14
mov word [rcx + 8], bx
add rbp, 1
cmp rdx, rbp
jne 0x477830
add r15, rbp
mov rbx, r10
cmp r8, 3
jb 0x4778b1
nop word cs:[rax + rax]
nop
mov rcx, qword [r14 + r15*8 + 0x220]
mov qword [rcx], r14
mov word [rcx + 8], r15w
mov rcx, qword [r14 + r15*8 + 0x228]
mov qword [rcx], r14
lea edx, [r15 + 1]
mov word [rcx + 8], dx
mov rcx, qword [r14 + r15*8 + 0x230]
mov qword [rcx], r14
lea rdx, [r15 + 2]
mov word [rcx + 8], dx
mov rcx, qword [r14 + r15*8 + 0x238]
mov qword [rcx], r14
add edx, 1
mov word [rcx + 8], dx
add r15, 4
cmp r15, rax
jne 0x477860
movzx ecx, word [r14 + 0xa]
mov rdx, r9
mov rbp, r11
add ecx, 0xffffffff
mov word [r14 + 0xa], cx
movzx eax, word [rdi + 0xa]
add ax, bp
add eax, 1
mov word [rdi + 0xa], ax
cmp qword [rdx], 2
mov r14, rdx
jb 0x4779c6
mov r15, rbp
mov r12, qword [rsp + 0x60]
lea rsi, [r12 + 1]
lea rdx, [rbx + 0x220]
lea rcx, [rdi + rsi*8]
add rcx, 0x220
lea r8, [rbp*8 + 8]
call sub.msvcrt.dll_memcpy
lea rax, [r12 + rbp]
add rax, 2
cmp rsi, rax
jae 0x4779bf
lea eax, [r15 + 1]
and ax, 3
je 0x47795d
mov r8, rbx
movzx eax, ax
lea rdx, [rdi + r12*8]
add rdx, 0x228
xor ecx, ecx
nop dword [rax]
lea ebp, [rsi + rcx]
mov rbx, qword [rdx + rcx*8]
mov qword [rbx], rdi
mov word [rbx + 8], bp
add rcx, 1
cmp rax, rcx
jne 0x477940
add rsi, rcx
mov rbx, r8
cmp r15d, 3
jb 0x4779bf
add r15, r12
nop word cs:[rax + rax]
mov rax, qword [rdi + rsi*8 + 0x220]
mov qword [rax], rdi
mov word [rax + 8], si
mov rax, qword [rdi + rsi*8 + 0x228]
mov qword [rax], rdi
lea ecx, [rsi + 1]
mov word [rax + 8], cx
mov rax, qword [rdi + rsi*8 + 0x230]
mov qword [rax], rdi
lea rcx, [rsi + 2]
mov word [rax + 8], cx
mov rax, qword [rdi + rsi*8 + 0x238]
mov qword [rax], rdi
lea edx, [rcx + 1]
mov word [rax + 8], dx
add rsi, 4
cmp rcx, r15
jne 0x477970
mov edx, 0x280
jmp 0x4779cb
mov edx, 0x220
mov r8d, 8
mov rcx, rbx
call fcn.00409ea0
mov rax, qword [rsp + 0x28]
mov rcx, qword [r14 + 0x10]
mov qword [rax + 0x10], rcx
movups xmm0, xmmword [r14]
movups xmmword [rax], xmm0
mov qword [rax + 0x18], r13
add rsp, 0x78
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret