Function at 0x40a870
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 8
mov esi, ecx
test edx, edx
je 0x40a885
push esi
call fcn.0040ab60
jmp 0x40a88b
push esi
call fcn.0040aff0
add esp, 4
lea edi, [esi + 0x9272]
cmp edi, dword [esi + 0x28]
jae 0x40aaed
mov eax, 1
jmp 0x40a8bf
mov eax, dword [esp + 4]
shr eax, 1
cmp edi, dword [esi + 0x28]
jae 0x40aaf3
cmp eax, 1
jne 0x40a8cd
movzx eax, byte [edi]
inc edi
or eax, 0x100
mov dword [esp + 4], eax
test al, 1
jne 0x40a940
movzx ebx, byte [edi]
movzx edx, word [esi + ebx*2 + 0x8852]
mov eax, dword [esi + 0x44]
mov ecx, eax
shl edx, cl
inc edi
movzx ecx, byte [esi + ebx + 0x8f12]
or edx, dword [esi + 0x48]
mov dword [esi + 0x48], edx
add ecx, eax
mov dword [esi + 0x44], ecx
cmp ecx, 8
jae 0x40a921
jmp 0x40a8b0
shr edx, 8
mov dword [esi + 0x48], edx
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
cmp ecx, 7
jbe 0x40a8b0
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x40a910
lea ecx, [eax + 1]
mov dword [esi + 0x30], ecx
mov byte [eax], dl
mov ecx, dword [esi + 0x44]
mov edx, dword [esi + 0x48]
jmp 0x40a910
movzx ebx, byte [edi]
movzx ebp, word [ebx + ebx + 0x44702e]
movzx edx, word [esi + ebp*2 + 0x8852]
mov eax, dword [esi + 0x44]
mov ecx, eax
shl edx, cl
movzx ecx, byte [esi + ebp + 0x8f12]
add ecx, eax
movzx eax, byte [edi + 1]
mov dword [esp], eax
or edx, dword [esi + 0x48]
movzx eax, byte [edi + 2]
mov dword [esi + 0x48], edx
mov dword [esi + 0x44], ecx
cmp ecx, 8
jae 0x40a9d1
movzx ebp, byte [ebx + 0x447288]
and ebx, dword [ebp*4 + 0x447244]
shl ebx, cl
or ebx, edx
mov dword [esi + 0x48], ebx
add ecx, ebp
mov dword [esi + 0x44], ecx
cmp ecx, 8
jae 0x40aa01
mov edx, eax
shl edx, 8
add edx, dword [esp]
cmp edx, 0x200
jb 0x40aa20
lea ebp, [eax + 0x446fae]
lea eax, [eax + 0x447588]
jmp 0x40aa2c
shr edx, 8
mov dword [esi + 0x48], edx
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
cmp ecx, 7
jbe 0x40a97d
mov ebp, dword [esi + 0x30]
cmp ebp, dword [esi + 0x34]
jae 0x40a9c0
lea ecx, [ebp + 1]
mov dword [esi + 0x30], ecx
mov byte [ebp], dl
mov ecx, dword [esi + 0x44]
mov edx, dword [esi + 0x48]
jmp 0x40a9c0
shr ebx, 8
mov dword [esi + 0x48], ebx
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
cmp ecx, 7
jbe 0x40a99c
mov edx, dword [esi + 0x30]
cmp edx, dword [esi + 0x34]
jae 0x40a9f0
lea ecx, [edx + 1]
mov dword [esi + 0x30], ecx
mov byte [edx], bl
mov ecx, dword [esi + 0x44]
mov ebx, dword [esi + 0x48]
jmp 0x40a9f0
lea ebp, [edx + 0x446dae]
lea eax, [edx + 0x447388]
movzx ebp, byte [ebp]
movzx eax, byte [eax]
mov dword [esp], eax
movzx eax, word [esi + ebp*2 + 0x8a92]
movzx ebp, byte [esi + ebp + 0x9032]
shl eax, cl
or eax, ebx
mov dword [esi + 0x48], eax
add ebp, ecx
mov dword [esi + 0x44], ebp
cmp ebp, 8
jae 0x40aa9c
mov ecx, ebp
add edi, 3
mov ebx, dword [esp]
and edx, dword [ebx*4 + 0x447244]
shl edx, cl
or edx, eax
mov dword [esi + 0x48], edx
add ecx, ebx
mov dword [esi + 0x44], ecx
cmp ecx, 8
jae 0x40aad5
jmp 0x40a8b0
shr eax, 8
mov dword [esi + 0x48], eax
mov ecx, ebp
and ecx, 0xfffffff7
add ecx, ecx
xor ebp, 8
sub ecx, ebp
mov dword [esi + 0x44], ecx
mov ebp, ecx
cmp ecx, 7
jbe 0x40aa59
mov ecx, dword [esi + 0x30]
cmp ecx, dword [esi + 0x34]
jae 0x40aa80
lea ebx, [ecx + 1]
mov dword [esi + 0x30], ebx
mov byte [ecx], al
mov ebp, dword [esi + 0x44]
mov eax, dword [esi + 0x48]
jmp 0x40aa80
shr edx, 8
mov dword [esi + 0x48], edx
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
cmp ecx, 7
jbe 0x40a8b0
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x40aac0
lea ecx, [eax + 1]
mov dword [esi + 0x30], ecx
mov byte [eax], dl
mov ecx, dword [esi + 0x44]
mov edx, dword [esi + 0x48]
jmp 0x40aac0
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 0x40ab41
mov ecx, dword [esi + 0x30]
xor eax, eax
cmp ecx, dword [esi + 0x34]
setb al
add esp, 8
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 0x40ab12
mov ecx, dword [esi + 0x30]
cmp ecx, dword [esi + 0x34]
jae 0x40ab30
lea edx, [ecx + 1]
mov dword [esi + 0x30], edx
mov byte [ecx], al
mov edi, dword [esi + 0x44]
mov eax, dword [esi + 0x48]
jmp 0x40ab30