Function at 0x40aaa0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x10
mov esi, ecx
test edx, edx
je 0x40aab5
push esi
call fcn.0040ade0
jmp 0x40aabb
push esi
call fcn.0040b270
add esp, 4
lea ebp, [esi + 0x9272]
cmp ebp, dword [esi + 0x28]
jae 0x40ad5d
mov edi, 1
jmp 0x40aaeb
shr edi, 1
cmp ebp, dword [esi + 0x28]
jae 0x40ad63
cmp edi, 1
jne 0x40aafb
movzx edi, byte [ebp]
inc ebp
or edi, 0x100
mov eax, edi
xor eax, 0xfffffffe
mov ecx, edi
or ecx, 1
test ecx, eax
je 0x40ac10
movzx edx, byte [ebp]
movzx eax, word [edx + edx + 0x44202e]
movzx ebx, word [esi + eax*2 + 0x8852]
mov ecx, dword [esi + 0x44]
shl ebx, cl
movzx eax, byte [esi + eax + 0x8f12]
add eax, ecx
movzx ecx, byte [ebp + 1]
mov dword [esp + 8], ecx
or ebx, dword [esi + 0x48]
movzx ecx, byte [ebp + 2]
mov dword [esi + 0x48], ebx
mov dword [esi + 0x44], eax
cmp eax, 8
mov dword [esp], ecx
jae 0x40abc1
mov dword [esp + 4], edi
mov edi, edx
movzx edx, byte [edx + 0x442288]
and edi, dword [edx*4 + 0x442244]
mov ecx, eax
shl edi, cl
or edi, ebx
mov ecx, edi
mov dword [esi + 0x48], edi
add eax, edx
mov dword [esi + 0x44], eax
mov edx, edi
cmp eax, 8
jae 0x40abf1
mov ecx, dword [esp]
mov ebx, ecx
shl ebx, 8
add ebx, dword [esp + 8]
cmp ebx, 0x200
mov dword [esp + 0xc], ebp
mov edi, edx
jb 0x40ac80
mov edx, ecx
lea ecx, [ecx + 0x441fae]
lea edx, [edx + 0x442588]
jmp 0x40ac8c
shr ebx, 8
mov dword [esi + 0x48], ebx
add eax, 0xfffffff8
mov dword [esi + 0x44], eax
cmp eax, 7
jbe 0x40ab4d
mov ecx, dword [esi + 0x30]
cmp ecx, dword [esi + 0x34]
jae 0x40abb0
lea eax, [ecx + 1]
mov dword [esi + 0x30], eax
mov byte [ecx], bl
mov eax, dword [esi + 0x44]
mov ebx, dword [esi + 0x48]
jmp 0x40abb0
shr edx, 8
mov dword [esi + 0x48], edx
add eax, 0xfffffff8
mov dword [esi + 0x44], eax
cmp eax, 7
jbe 0x40ab78
mov ecx, dword [esi + 0x30]
cmp ecx, dword [esi + 0x34]
jae 0x40abe0
lea eax, [ecx + 1]
mov dword [esi + 0x30], eax
mov byte [ecx], dl
mov eax, dword [esi + 0x44]
mov edx, dword [esi + 0x48]
jmp 0x40abe0
movzx edx, byte [ebp]
movzx ebx, word [esi + edx*2 + 0x8852]
mov eax, dword [esi + 0x44]
mov ecx, eax
shl ebx, cl
inc ebp
movzx ecx, byte [esi + edx + 0x8f12]
or ebx, dword [esi + 0x48]
mov dword [esi + 0x48], ebx
add ecx, eax
mov dword [esi + 0x44], ecx
cmp ecx, 8
jae 0x40ac65
jmp 0x40aae0
shr ebx, 8
mov dword [esi + 0x48], ebx
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
cmp ecx, 7
jbe 0x40aae0
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x40ac50
lea ecx, [eax + 1]
mov dword [esi + 0x30], ecx
mov byte [eax], bl
mov ecx, dword [esi + 0x44]
mov ebx, dword [esi + 0x48]
jmp 0x40ac50
lea ecx, [ebx + 0x441dae]
lea edx, [ebx + 0x442388]
mov dword [esp], edx
movzx ebp, byte [ecx]
movzx edx, word [esi + ebp*2 + 0x8a92]
mov ecx, eax
shl edx, cl
or edx, edi
movzx ecx, byte [esi + ebp + 0x9032]
add ecx, eax
mov eax, dword [esp]
movzx eax, byte [eax]
mov dword [esi + 0x48], edx
mov dword [esi + 0x44], ecx
cmp ecx, 8
jb 0x40ad00
mov edi, dword [esp + 4]
jmp 0x40ace1
shr edx, 8
mov dword [esi + 0x48], edx
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
cmp ecx, 7
jbe 0x40ad04
mov ebp, dword [esi + 0x30]
cmp ebp, dword [esi + 0x34]
jae 0x40acd0
lea ecx, [ebp + 1]
mov dword [esi + 0x30], ecx
mov byte [ebp], dl
mov ecx, dword [esi + 0x44]
mov edx, dword [esi + 0x48]
jmp 0x40acd0
mov edi, dword [esp + 4]
mov ebp, dword [esp + 0xc]
add ebp, 3
and ebx, dword [eax*4 + 0x442244]
shl ebx, cl
or ebx, edx
mov dword [esi + 0x48], ebx
add ecx, eax
mov dword [esi + 0x44], ecx
cmp ecx, 8
jae 0x40ad45
jmp 0x40aae0
shr ebx, 8
mov dword [esi + 0x48], ebx
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
cmp ecx, 7
jbe 0x40aae0
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x40ad30
lea ecx, [eax + 1]
mov dword [esi + 0x30], ecx
mov byte [eax], bl
mov ecx, dword [esi + 0x44]
mov ebx, dword [esi + 0x48]
jmp 0x40ad30
mov ecx, dword [esi + 0x44]
mov ebx, dword [esi + 0x48]
movzx eax, word [esi + 0x8a52]
movzx edx, byte [esi + 0x9012]
shl eax, cl
or eax, ebx
mov dword [esi + 0x48], eax
add edx, ecx
mov dword [esi + 0x44], edx
cmp edx, 8
jae 0x40adba
mov ecx, dword [esi + 0x30]
xor eax, eax
cmp ecx, dword [esi + 0x34]
setb al
add esp, 0x10
pop esi
pop edi
pop ebx
pop ebp
ret
shr eax, 8
mov dword [esi + 0x48], eax
mov ecx, edx
not ecx
and ecx, 8
and edx, 0xfffffff7
sub edx, ecx
mov dword [esi + 0x44], edx
cmp edx, 7
jbe 0x40ad82
mov ecx, dword [esi + 0x30]
cmp ecx, dword [esi + 0x34]
jae 0x40ada0
lea edx, [ecx + 1]
mov dword [esi + 0x30], edx
mov byte [ecx], al
mov edx, dword [esi + 0x44]
mov eax, dword [esi + 0x48]
jmp 0x40ada0