Function at 0x40a670
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0xc
mov esi, ecx
test edx, edx
je 0x40a685
push esi
call fcn.0040a960
jmp 0x40a68b
push esi
call fcn.0040adf0
add esp, 4
lea edi, [esi + 0x9272]
cmp edi, dword [esi + 0x28]
jae 0x40a8ed
mov eax, 1
jmp 0x40a6bf
mov eax, dword [esp + 8]
shr eax, 1
cmp edi, dword [esi + 0x28]
jae 0x40a8f3
cmp eax, 1
jne 0x40a6cd
movzx eax, byte [edi]
inc edi
or eax, 0x100
mov dword [esp + 8], eax
test al, 1
jne 0x40a740
mov ebx, edi
movzx edi, byte [edi]
movzx edx, word [esi + edi*2 + 0x8852]
mov eax, dword [esi + 0x44]
mov ecx, eax
shl edx, cl
inc ebx
movzx ecx, byte [esi + edi + 0x8f12]
or edx, dword [esi + 0x48]
mov dword [esi + 0x48], edx
add ecx, eax
mov dword [esi + 0x44], ecx
mov edi, ebx
cmp ecx, 8
jae 0x40a721
jmp 0x40a6b0
shr edx, 8
mov dword [esi + 0x48], edx
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
cmp ecx, 7
jbe 0x40a6b0
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x40a710
lea ecx, [eax + 1]
mov dword [esi + 0x30], ecx
mov byte [eax], dl
mov ecx, dword [esi + 0x44]
mov edx, dword [esi + 0x48]
jmp 0x40a710
movzx eax, byte [edi]
movzx ebp, word [eax + eax + 0x44502e]
movzx edx, word [esi + ebp*2 + 0x8852]
mov ebx, dword [esi + 0x44]
mov ecx, ebx
shl edx, cl
movzx ecx, byte [esi + ebp + 0x8f12]
add ecx, ebx
movzx ebx, byte [edi + 1]
mov dword [esp + 4], ebx
or edx, dword [esi + 0x48]
movzx ebp, byte [edi + 2]
mov dword [esi + 0x48], edx
mov dword [esi + 0x44], ecx
cmp ecx, 8
jae 0x40a7d1
movzx ebx, byte [eax + 0x445288]
and eax, dword [ebx*4 + 0x445244]
shl eax, cl
or eax, edx
mov dword [esi + 0x48], eax
add ecx, ebx
mov dword [esi + 0x44], ecx
cmp ecx, 8
jae 0x40a801
mov edx, ebp
shl edx, 8
add edx, dword [esp + 4]
cmp edx, 0x200
mov dword [esp], edi
jb 0x40a820
lea ebx, [ebp + 0x444fae]
lea ebp, [ebp + 0x445588]
jmp 0x40a82c
shr edx, 8
mov dword [esi + 0x48], edx
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
cmp ecx, 7
jbe 0x40a77e
mov ebx, dword [esi + 0x30]
cmp ebx, dword [esi + 0x34]
jae 0x40a7c0
lea ecx, [ebx + 1]
mov dword [esi + 0x30], ecx
mov byte [ebx], dl
mov ecx, dword [esi + 0x44]
mov edx, dword [esi + 0x48]
jmp 0x40a7c0
shr eax, 8
mov dword [esi + 0x48], eax
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
cmp ecx, 7
jbe 0x40a79d
mov edx, dword [esi + 0x30]
cmp edx, dword [esi + 0x34]
jae 0x40a7f0
lea ecx, [edx + 1]
mov dword [esi + 0x30], ecx
mov byte [edx], al
mov ecx, dword [esi + 0x44]
mov eax, dword [esi + 0x48]
jmp 0x40a7f0
lea ebp, [edx + 0x445388]
lea ebx, [edx + 0x444dae]
movzx edi, byte [ebx]
movzx ebx, word [esi + edi*2 + 0x8a92]
shl ebx, cl
or ebx, eax
movzx eax, byte [esi + edi + 0x9032]
add eax, ecx
movzx ebp, byte [ebp]
mov dword [esi + 0x48], ebx
mov dword [esi + 0x44], eax
cmp eax, 8
jb 0x40a890
mov edi, dword [esp]
jmp 0x40a871
shr ebx, 8
mov dword [esi + 0x48], ebx
add eax, 0xfffffff8
mov dword [esi + 0x44], eax
cmp eax, 7
jbe 0x40a893
mov ecx, dword [esi + 0x30]
cmp ecx, dword [esi + 0x34]
jae 0x40a860
lea eax, [ecx + 1]
mov dword [esi + 0x30], eax
mov byte [ecx], bl
mov eax, dword [esi + 0x44]
mov ebx, dword [esi + 0x48]
jmp 0x40a860
mov edi, dword [esp]
add edi, 3
and edx, dword [ebp*4 + 0x445244]
mov ecx, eax
shl edx, cl
or edx, ebx
mov dword [esi + 0x48], edx
mov ecx, eax
and ecx, ebp
xor eax, ebp
lea ecx, [eax + ecx*2]
mov dword [esi + 0x44], ecx
cmp ecx, 8
jae 0x40a8d5
jmp 0x40a6b0
shr edx, 8
mov dword [esi + 0x48], edx
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
cmp ecx, 7
jbe 0x40a6b0
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x40a8c0
lea ecx, [eax + 1]
mov dword [esi + 0x30], ecx
mov byte [eax], dl
mov ecx, dword [esi + 0x44]
mov edx, dword [esi + 0x48]
jmp 0x40a8c0
mov ecx, dword [esi + 0x44]
mov edx, dword [esi + 0x48]
movzx eax, word [esi + 0x8a52]
movzx edi, byte [esi + 0x9012]
shl eax, cl
or eax, edx
mov dword [esi + 0x48], eax
add edi, ecx
mov dword [esi + 0x44], edi
cmp edi, 8
jae 0x40a941
mov ecx, dword [esi + 0x30]
xor eax, eax
cmp ecx, dword [esi + 0x34]
setb al
add esp, 0xc
pop esi
pop edi
pop ebx
pop ebp
ret
shr eax, 8
mov dword [esi + 0x48], eax
add edi, 0xfffffff8
mov dword [esi + 0x44], edi
cmp edi, 7
jbe 0x40a912
mov ecx, dword [esi + 0x30]
cmp ecx, dword [esi + 0x34]
jae 0x40a930
lea edx, [ecx + 1]
mov dword [esi + 0x30], edx
mov byte [ecx], al
mov edi, dword [esi + 0x44]
mov eax, dword [esi + 0x48]
jmp 0x40a930