Function at 0x40af90
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 0x40afa5
push esi
call fcn.0040b2b0
jmp 0x40afab
push esi
call fcn.0040b740
add esp, 4
lea ebp, [esi + 0x9272]
cmp ebp, dword [esi + 0x28]
jae 0x40b23d
mov ebx, 1
jmp 0x40afdf
mov ebx, dword [esp + 8]
shr ebx, 1
cmp ebp, dword [esi + 0x28]
jae 0x40b243
cmp ebx, 1
jne 0x40afef
movzx ebx, byte [ebp]
inc ebp
or ebx, 0x100
test bl, 1
jne 0x40b060
movzx edi, byte [ebp]
movzx edx, word [esi + edi*2 + 0x8852]
mov eax, dword [esi + 0x44]
mov ecx, eax
shl edx, cl
inc ebp
movzx ecx, byte [esi + edi + 0x8f12]
or edx, dword [esi + 0x48]
mov dword [esi + 0x48], edx
add ecx, eax
mov dword [esi + 0x44], ecx
cmp ecx, 8
jae 0x40b041
jmp 0x40afd4
shr edx, 8
mov dword [esi + 0x48], edx
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
cmp ecx, 7
jbe 0x40afd4
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x40b030
lea ecx, [eax + 1]
mov dword [esi + 0x30], ecx
mov byte [eax], dl
mov ecx, dword [esi + 0x44]
mov edx, dword [esi + 0x48]
jmp 0x40b030
movzx eax, byte [ebp]
mov edi, eax
movzx eax, word [eax + eax + 0x44302e]
movzx edx, word [esi + eax*2 + 0x8852]
mov ecx, dword [esi + 0x44]
shl edx, cl
movzx eax, byte [esi + eax + 0x8f12]
add eax, ecx
movzx ecx, byte [ebp + 1]
mov dword [esp], ecx
or edx, dword [esi + 0x48]
mov dword [esp + 0xc], ebp
movzx ecx, byte [ebp + 2]
mov dword [esp + 4], ecx
mov dword [esi + 0x48], edx
mov dword [esi + 0x44], eax
cmp eax, 8
jae 0x40b111
movzx ebp, byte [edi + 0x443288]
and edi, dword [ebp*4 + 0x443244]
mov ecx, eax
shl edi, cl
or edi, edx
mov edx, edi
mov dword [esi + 0x48], edi
add eax, ebp
mov dword [esi + 0x44], eax
cmp eax, 8
jb 0x40b130
mov edi, dword [esp + 4]
jmp 0x40b0e1
shr edx, 8
mov dword [esi + 0x48], edx
add eax, 0xfffffff8
mov dword [esi + 0x44], eax
cmp eax, 7
jbe 0x40b134
mov ecx, dword [esi + 0x30]
cmp ecx, dword [esi + 0x34]
jae 0x40b0d0
lea eax, [ecx + 1]
mov dword [esi + 0x30], eax
mov byte [ecx], dl
mov eax, dword [esi + 0x44]
mov edx, dword [esi + 0x48]
jmp 0x40b0d0
shr edx, 8
mov dword [esi + 0x48], edx
add eax, 0xfffffff8
mov dword [esi + 0x44], eax
cmp eax, 7
jbe 0x40b0a6
mov ecx, dword [esi + 0x30]
cmp ecx, dword [esi + 0x34]
jae 0x40b100
lea eax, [ecx + 1]
mov dword [esi + 0x30], eax
mov byte [ecx], dl
mov eax, dword [esi + 0x44]
mov edx, dword [esi + 0x48]
jmp 0x40b100
mov edi, dword [esp + 4]
mov dword [esp + 4], edx
mov edx, edi
shl edx, 8
add edx, dword [esp]
cmp edx, 0x200
mov dword [esp + 8], ebx
jb 0x40b160
lea ecx, [edi + 0x442fae]
lea edi, [edi + 0x443588]
jmp 0x40b16c
lea ecx, [edx + 0x442dae]
lea edi, [edx + 0x443388]
mov dword [esp], edi
movzx edi, byte [ecx]
movzx ebx, word [esi + edi*2 + 0x8a92]
mov ecx, eax
shl ebx, cl
mov ebp, ebx
not ebp
mov ecx, dword [esp + 4]
and ebp, ecx
xor ebx, ecx
add ebx, ecx
movzx ecx, byte [esi + edi + 0x9032]
add ecx, eax
mov eax, dword [esp]
movzx eax, byte [eax]
sub ebx, ebp
mov dword [esi + 0x48], ebx
mov dword [esi + 0x44], ecx
cmp ecx, 8
jb 0x40b1e0
mov ebp, dword [esp + 0xc]
jmp 0x40b1c1
shr ebx, 8
mov dword [esi + 0x48], ebx
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
cmp ecx, 7
jbe 0x40b1e4
mov edi, dword [esi + 0x30]
cmp edi, dword [esi + 0x34]
jae 0x40b1b0
lea ecx, [edi + 1]
mov dword [esi + 0x30], ecx
mov byte [edi], bl
mov ecx, dword [esi + 0x44]
mov ebx, dword [esi + 0x48]
jmp 0x40b1b0
mov ebp, dword [esp + 0xc]
add ebp, 3
and edx, dword [eax*4 + 0x443244]
shl edx, cl
or edx, ebx
mov dword [esi + 0x48], edx
add ecx, eax
mov dword [esi + 0x44], ecx
cmp ecx, 8
jb 0x40afd0
mov ebx, dword [esp + 8]
jmp 0x40b225
shr edx, 8
mov dword [esi + 0x48], edx
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
cmp ecx, 7
jbe 0x40afd4
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x40b210
lea ecx, [eax + 1]
mov dword [esi + 0x30], ecx
mov byte [eax], dl
mov ecx, dword [esi + 0x44]
mov edx, dword [esi + 0x48]
jmp 0x40b210
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 0x40b291
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
add edi, 0xfffffff8
mov dword [esi + 0x44], edi
cmp edi, 7
jbe 0x40b262
mov ecx, dword [esi + 0x30]
cmp ecx, dword [esi + 0x34]
jae 0x40b280
lea edx, [ecx + 1]
mov dword [esi + 0x30], edx
mov byte [ecx], al
mov edi, dword [esi + 0x44]
mov eax, dword [esi + 0x48]
jmp 0x40b280