Function at 0x4af850
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 0x4af956
inc dword [rbx + 8]
mov eax, dword [rbx + 8]
inc dword [rbx + 0x18]
inc qword [rbx]
cmp eax, dword [rbx + 0xc]
jne 0x4afa81
cmp eax, 0xffffffff
jne 0x4af8e3
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 0x4af8da
nop
nop
mov eax, dword [r8 + rcx*4]
cmp eax, edx
ja 0x4af8cc
mov eax, esi
jmp 0x4af8ce
sub eax, edx
mov dword [r8 + rcx*4], eax
inc rcx
cmp rcx, r9
jb 0x4af8c0
sub dword [rbx + 0xc], edx
sub dword [rbx + 8], edx
sub dword [rbx + 0x10], edx
cmp byte [rbx + 0x20], sil
jne 0x4af8fc
mov eax, dword [rbx + 0x10]
sub eax, dword [rbx + 8]
cmp dword [rbx + 0x58], eax
jne 0x4af8fc
mov rcx, rbx
call fcn.004ae010
mov eax, dword [rbx + 0x1c]
cmp dword [rbx + 0x18], eax
jne 0x4af907
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 0x4af937
test edx, edx
je 0x4af93a
mov eax, 1
jmp 0x4af93a
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 0x4afa81
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.004aeb90
inc dword [rbx + 8]
mov eax, dword [rbx + 8]
inc dword [rbx + 0x18]
inc qword [rbx]
cmp eax, dword [rbx + 0xc]
jne 0x4afa81
cmp eax, 0xffffffff
jne 0x4afa13
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 0x4afa0a
nop
nop
mov eax, dword [r8 + rcx*4]
cmp eax, edx
ja 0x4af9fc
mov eax, esi
jmp 0x4af9fe
sub eax, edx
mov dword [r8 + rcx*4], eax
inc rcx
cmp rcx, r9
jb 0x4af9f0
sub dword [rbx + 0xc], edx
sub dword [rbx + 8], edx
sub dword [rbx + 0x10], edx
cmp byte [rbx + 0x20], sil
jne 0x4afa2c
mov eax, dword [rbx + 0x10]
sub eax, dword [rbx + 8]
cmp dword [rbx + 0x58], eax
jne 0x4afa2c
mov rcx, rbx
call fcn.004ae010
mov eax, dword [rbx + 0x1c]
cmp dword [rbx + 0x18], eax
jne 0x4afa37
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 0x4afa67
test edx, edx
je 0x4afa6a
mov eax, 1
jmp 0x4afa6a
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 0x4af870
mov rdi, qword [rsp + 0x68]
mov rsi, qword [rsp + 0x60]
mov rbx, qword [rsp + 0x58]
add rsp, 0x48
ret