Function at 0x408540
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 0x408555
push esi
call fcn.00408870
jmp 0x40855b
push esi
call fcn.00408d00
add esp, 4
lea ebp, [esi + 0x9272]
cmp ebp, dword [esi + 0x28]
jae 0x4087fd
mov edi, 1
jmp 0x40858b
shr edi, 1
cmp ebp, dword [esi + 0x28]
jae 0x408803
cmp edi, 1
jne 0x40859b
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 0x4086b0
movzx edx, byte [ebp]
movzx eax, word [edx + edx + 0x440bea]
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 0x408661
mov dword [esp + 4], edi
mov edi, edx
movzx edx, byte [edx + 0x440e44]
and edi, dword [edx*4 + 0x440e00]
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 0x408691
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 0x408720
mov edx, ecx
lea ecx, [ecx + 0x440b6a]
lea edx, [edx + 0x441144]
jmp 0x40872c
shr ebx, 8
mov dword [esi + 0x48], ebx
add eax, 0xfffffff8
mov dword [esi + 0x44], eax
cmp eax, 7
jbe 0x4085ed
mov ecx, dword [esi + 0x30]
cmp ecx, dword [esi + 0x34]
jae 0x408650
lea eax, [ecx + 1]
mov dword [esi + 0x30], eax
mov byte [ecx], bl
mov eax, dword [esi + 0x44]
mov ebx, dword [esi + 0x48]
jmp 0x408650
shr edx, 8
mov dword [esi + 0x48], edx
add eax, 0xfffffff8
mov dword [esi + 0x44], eax
cmp eax, 7
jbe 0x408618
mov ecx, dword [esi + 0x30]
cmp ecx, dword [esi + 0x34]
jae 0x408680
lea eax, [ecx + 1]
mov dword [esi + 0x30], eax
mov byte [ecx], dl
mov eax, dword [esi + 0x44]
mov edx, dword [esi + 0x48]
jmp 0x408680
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 0x408705
jmp 0x408580
shr ebx, 8
mov dword [esi + 0x48], ebx
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
cmp ecx, 7
jbe 0x408580
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x4086f0
lea ecx, [eax + 1]
mov dword [esi + 0x30], ecx
mov byte [eax], bl
mov ecx, dword [esi + 0x44]
mov ebx, dword [esi + 0x48]
jmp 0x4086f0
lea ecx, [ebx + 0x44096a]
lea edx, [ebx + 0x440f44]
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 0x4087a0
mov edi, dword [esp + 4]
jmp 0x408781
shr edx, 8
mov dword [esi + 0x48], edx
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
cmp ecx, 7
jbe 0x4087a4
mov ebp, dword [esi + 0x30]
cmp ebp, dword [esi + 0x34]
jae 0x408770
lea ecx, [ebp + 1]
mov dword [esi + 0x30], ecx
mov byte [ebp], dl
mov ecx, dword [esi + 0x44]
mov edx, dword [esi + 0x48]
jmp 0x408770
mov edi, dword [esp + 4]
mov ebp, dword [esp + 0xc]
add ebp, 3
and ebx, dword [eax*4 + 0x440e00]
shl ebx, cl
or ebx, edx
mov dword [esi + 0x48], ebx
add ecx, eax
mov dword [esi + 0x44], ecx
cmp ecx, 8
jae 0x4087e5
jmp 0x408580
shr ebx, 8
mov dword [esi + 0x48], ebx
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
cmp ecx, 7
jbe 0x408580
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x4087d0
lea ecx, [eax + 1]
mov dword [esi + 0x30], ecx
mov byte [eax], bl
mov ecx, dword [esi + 0x44]
mov ebx, dword [esi + 0x48]
jmp 0x4087d0
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 0x408851
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 edx, 0xfffffff8
mov dword [esi + 0x44], edx
cmp edx, 7
jbe 0x408822
mov ecx, dword [esi + 0x30]
cmp ecx, dword [esi + 0x34]
jae 0x408840
lea edx, [ecx + 1]
mov dword [esi + 0x30], edx
mov byte [ecx], al
mov edx, dword [esi + 0x44]
mov eax, dword [esi + 0x48]
jmp 0x408840