Function at 0x4af970
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x2c
mov esi, dword [ebp + 8]
mov eax, dword [0x674014]
xor eax, ebp
mov dword [ebp - 0x10], eax
cmp byte [edx + 0xb], 0
js 0x4af997
mov word [edx], 0
mov byte [edx + 0xb], 0
jmp 0x4af9a5
mov eax, dword [edx]
mov word [eax], 0
mov dword [edx + 4], 0
cmp byte [esi + 0xb], 0
mov dword [ebp - 0x2c], edx
js 0x4af9b9
mov word [esi], 0
mov byte [esi + 0xb], 0
jmp 0x4af9c7
mov eax, dword [esi]
mov word [eax], 0
mov dword [esi + 4], 0
movzx eax, byte [ecx + 0xb]
mov esi, ecx
mov dword [ebp - 0x28], eax
test al, al
jns 0x4af9dc
mov esi, dword [ecx]
mov eax, dword [ecx + 4]
mov dword [ebp - 0x28], eax
movzx eax, byte [0x6852c0]
xor edx, edx
mov edi, 3
sub edi, eax
je 0x4afafc
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x18], 0xffffffff
mov dword [ebp - 0x14], 0xffffffff
mov ebx, dword [edx*8 + 0x624784]
mov dword [ebp - 0x38], edx
mov eax, dword [edx*8 + 0x624780]
mov byte [ebp - 0x11], bl
lea ecx, [ebx + ebx]
push ecx
push eax
lea eax, [ebp - 0x1c]
push eax
call fcn.005df8f0
add esp, 0xc
mov word [ebp + ebx*2 - 0x1c], 0
movzx eax, byte [ebp - 0x11]
test al, al
mov ecx, dword [ebp - 0x18]
mov edx, eax
mov dword [ebp - 0x30], ecx
cmovs edx, ecx
cmp edx, dword [ebp - 0x28]
jbe 0x4afa60
test al, al
js 0x4afaa0
mov edi, dword [ebp - 0x34]
jmp 0x4afab5
mov ecx, dword [ebp - 0x1c]
mov dword [ebp - 0x24], ecx
test edx, edx
je 0x4afac3
test al, al
lea edi, [ebp - 0x1c]
cmovs edi, dword [ebp - 0x24]
xor ecx, ecx
nop word cs:[eax + eax]
movzx ebx, word [esi + ecx*2]
cmp bx, word [edi + ecx*2]
jne 0x4afa4f
inc ecx
cmp edx, ecx
jne 0x4afa80
jmp 0x4afac3
push dword [ebp - 0x1c]
call fcn.005dc756
add esp, 4
movzx edi, byte [0x6852c0]
xor edi, 3
mov edx, dword [ebp - 0x38]
inc edx
cmp edx, edi
jb 0x4af9f5
jmp 0x4afafc
test al, al
js 0x4afad2
mov edx, eax
mov ecx, dword [ebp - 0x20]
test edx, edx
jne 0x4afae7
jmp 0x4afafc
push dword [ebp - 0x24]
call fcn.005dc756
add esp, 4
mov ecx, dword [ebp - 0x20]
mov edx, dword [ebp - 0x30]
test edx, edx
je 0x4afafc
movzx eax, byte [ecx + 0xb]
test al, al
js 0x4afaf5
cmp edx, eax
je 0x4afafc
jmp 0x4afb14
mov eax, dword [ecx + 4]
cmp edx, eax
jne 0x4afb12
xor ebx, ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.005dd6f3
mov eax, ebx
add esp, 0x2c
pop esi
pop edi
pop ebx
pop ebp
ret
mov ecx, dword [ecx]
lea edx, [ecx + eax*2]
mov esi, edx
test eax, eax
jle 0x4afb35
mov esi, ecx
nop
cmp word [esi], 0x3d
je 0x4afb30
add esi, 2
dec eax
jne 0x4afb20
mov esi, edx
jmp 0x4afb35
test esi, esi
cmove esi, edx
mov eax, esi
sub eax, ecx
sar eax, 1
cmp esi, edx
mov esi, 0xffffffff
cmovne esi, eax
mov eax, dword [ebp - 0x20]
lea edi, [eax + 0xc]
lea ecx, [ebp - 0x1c]
push edi
push esi
push 0
push eax
call fcn.004ab82c
mov ebx, dword [ebp - 0x2c]
cmp byte [ebx + 0xb], 0
jns 0x4afb6b
push dword [ebx]
call fcn.005dc756
add esp, 4
mov eax, dword [ebp - 0x14]
mov dword [ebx + 8], eax
movsd xmm0, qword [ebp - 0x1c]
movsd qword [ebx], xmm0
cmp esi, 0xffffffff
je 0x4afbb4
inc esi
lea ecx, [ebp - 0x1c]
push edi
push 0xffffffffffffffff
push esi
push dword [ebp - 0x20]
call fcn.004ab82c
mov ecx, dword [ebp + 8]
cmp byte [ecx + 0xb], 0
jns 0x4afba5
push dword [ecx]
call fcn.005dc756
mov ecx, dword [ebp + 8]
add esp, 4
mov eax, dword [ebp - 0x14]
mov dword [ecx + 8], eax
movsd xmm0, qword [ebp - 0x1c]
movsd qword [ecx], xmm0
mov bl, 1
jmp 0x4afafe