Function at 0x4afc80
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub rsp, 0x48
mov qword [rsp + 0x58], rbx
mov qword [rsp + 0x60], rsi
mov qword [rsp + 0x68], rdi
mov edi, edx
mov rbx, rcx
xor esi, esi
nop
nop
mov r10d, dword [rbx + 0x14]
cmp r10d, 3
jae 0x4afd86
inc dword [rbx + 8]
mov eax, dword [rbx + 8]
inc dword [rbx + 0x18]
inc qword [rbx]
cmp eax, dword [rbx + 0xc]
jne 0x4afeb1
cmp eax, 0xffffffff
jne 0x4afd13
mov r9, qword [rbx + 0x478]
mov r8, qword [rbx + 0x28]
mov edx, 0xfffffffe
sub edx, dword [rbx + 0x68]
mov rcx, rsi
and edx, 0xfffffc00
test r9, r9
je 0x4afd0a
nop
nop
mov eax, dword [r8 + rcx*4]
cmp eax, edx
ja 0x4afcfc
mov eax, esi
jmp 0x4afcfe
sub eax, edx
mov dword [r8 + rcx*4], eax
inc rcx
cmp rcx, r9
jb 0x4afcf0
sub dword [rbx + 0xc], edx
sub dword [rbx + 8], edx
sub dword [rbx + 0x10], edx
cmp byte [rbx + 0x20], sil
jne 0x4afd2c
mov eax, dword [rbx + 0x10]
sub eax, dword [rbx + 8]
cmp dword [rbx + 0x58], eax
jne 0x4afd2c
mov rcx, rbx
call fcn.004ae440
mov eax, dword [rbx + 0x1c]
cmp dword [rbx + 0x18], eax
jne 0x4afd37
mov dword [rbx + 0x18], esi
sub eax, dword [rbx + 0x18]
mov r9d, dword [rbx + 8]
mov edx, dword [rbx + 0x10]
mov r8d, dword [rbx + 0x58]
mov ecx, 0xffffffff
sub ecx, r9d
cmp eax, ecx
cmovb ecx, eax
sub edx, r9d
cmp edx, r8d
mov eax, edx
ja 0x4afd67
test edx, edx
je 0x4afd6a
mov eax, 1
jmp 0x4afd6a
sub eax, r8d
cmp eax, ecx
cmovb ecx, eax
mov eax, dword [rbx + 0x24]
cmp edx, eax
cmova edx, eax
lea eax, [r9 + rcx]
mov dword [rbx + 0xc], eax
mov dword [rbx + 0x14], edx
jmp 0x4afeb1
mov rcx, qword [rbx]
mov r8, qword [rbx + 0x28]
movzx eax, byte [rcx + 2]
movzx edx, byte [rcx]
shl edx, 8
or edx, eax
movzx eax, byte [rcx + 1]
mov ecx, r10d
xor edx, dword [rbx + rax*4 + 0x78]
movzx eax, dx
mov r9, rax
mov edx, dword [r8 + rax*4]
mov eax, dword [rbx + 8]
mov dword [r8 + r9*4], eax
mov eax, dword [rbx + 0x3c]
mov r9, qword [rbx]
mov r8d, dword [rbx + 8]
mov dword [rsp + 0x38], eax
mov eax, dword [rbx + 0x1c]
mov dword [rsp + 0x30], eax
mov eax, dword [rbx + 0x18]
mov dword [rsp + 0x28], eax
mov rax, qword [rbx + 0x30]
mov qword [rsp + 0x20], rax
call fcn.004aefc0
inc dword [rbx + 8]
mov eax, dword [rbx + 8]
inc dword [rbx + 0x18]
inc qword [rbx]
cmp eax, dword [rbx + 0xc]
jne 0x4afeb1
cmp eax, 0xffffffff
jne 0x4afe43
mov r9, qword [rbx + 0x478]
mov r8, qword [rbx + 0x28]
mov edx, 0xfffffffe
sub edx, dword [rbx + 0x68]
mov rcx, rsi
and edx, 0xfffffc00
test r9, r9
je 0x4afe3a
nop
nop
mov eax, dword [r8 + rcx*4]
cmp eax, edx
ja 0x4afe2c
mov eax, esi
jmp 0x4afe2e
sub eax, edx
mov dword [r8 + rcx*4], eax
inc rcx
cmp rcx, r9
jb 0x4afe20
sub dword [rbx + 0xc], edx
sub dword [rbx + 8], edx
sub dword [rbx + 0x10], edx
cmp byte [rbx + 0x20], sil
jne 0x4afe5c
mov eax, dword [rbx + 0x10]
sub eax, dword [rbx + 8]
cmp dword [rbx + 0x58], eax
jne 0x4afe5c
mov rcx, rbx
call fcn.004ae440
mov eax, dword [rbx + 0x1c]
cmp dword [rbx + 0x18], eax
jne 0x4afe67
mov dword [rbx + 0x18], esi
sub eax, dword [rbx + 0x18]
mov r9d, dword [rbx + 8]
mov edx, dword [rbx + 0x10]
mov r8d, dword [rbx + 0x58]
mov ecx, 0xffffffff
sub ecx, r9d
cmp eax, ecx
cmovb ecx, eax
sub edx, r9d
cmp edx, r8d
mov eax, edx
ja 0x4afe97
test edx, edx
je 0x4afe9a
mov eax, 1
jmp 0x4afe9a
sub eax, r8d
cmp eax, ecx
cmovb ecx, eax
mov eax, dword [rbx + 0x24]
cmp edx, eax
cmova edx, eax
lea eax, [r9 + rcx]
mov dword [rbx + 0xc], eax
mov dword [rbx + 0x14], edx
add edi, 0xffffffff
jne 0x4afca0
mov rdi, qword [rsp + 0x68]
mov rsi, qword [rsp + 0x60]
mov rbx, qword [rsp + 0x58]
add rsp, 0x48
ret