Function at 0x4064d0
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 0x4064e5
push esi
call fcn.00406800
jmp 0x4064eb
push esi
call fcn.00406c90
add esp, 4
lea ebp, [esi + 0x9272]
cmp ebp, dword [esi + 0x28]
jae 0x40678d
mov edi, 1
jmp 0x40651b
shr edi, 1
cmp ebp, dword [esi + 0x28]
jae 0x406793
cmp edi, 1
jne 0x40652b
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 0x406640
movzx edx, byte [ebp]
movzx eax, word [edx + edx + 0x43ebea]
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 0x4065f1
mov dword [esp + 4], edi
mov edi, edx
movzx edx, byte [edx + 0x43ee44]
and edi, dword [edx*4 + 0x43ee00]
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 0x406621
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 0x4066b0
mov edx, ecx
lea ecx, [ecx + 0x43eb6a]
lea edx, [edx + 0x43f144]
jmp 0x4066bc
shr ebx, 8
mov dword [esi + 0x48], ebx
add eax, 0xfffffff8
mov dword [esi + 0x44], eax
cmp eax, 7
jbe 0x40657d
mov ecx, dword [esi + 0x30]
cmp ecx, dword [esi + 0x34]
jae 0x4065e0
lea eax, [ecx + 1]
mov dword [esi + 0x30], eax
mov byte [ecx], bl
mov eax, dword [esi + 0x44]
mov ebx, dword [esi + 0x48]
jmp 0x4065e0
shr edx, 8
mov dword [esi + 0x48], edx
add eax, 0xfffffff8
mov dword [esi + 0x44], eax
cmp eax, 7
jbe 0x4065a8
mov ecx, dword [esi + 0x30]
cmp ecx, dword [esi + 0x34]
jae 0x406610
lea eax, [ecx + 1]
mov dword [esi + 0x30], eax
mov byte [ecx], dl
mov eax, dword [esi + 0x44]
mov edx, dword [esi + 0x48]
jmp 0x406610
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 0x406695
jmp 0x406510
shr ebx, 8
mov dword [esi + 0x48], ebx
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
cmp ecx, 7
jbe 0x406510
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x406680
lea ecx, [eax + 1]
mov dword [esi + 0x30], ecx
mov byte [eax], bl
mov ecx, dword [esi + 0x44]
mov ebx, dword [esi + 0x48]
jmp 0x406680
lea ecx, [ebx + 0x43e96a]
lea edx, [ebx + 0x43ef44]
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 0x406730
mov edi, dword [esp + 4]
jmp 0x406711
shr edx, 8
mov dword [esi + 0x48], edx
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
cmp ecx, 7
jbe 0x406734
mov ebp, dword [esi + 0x30]
cmp ebp, dword [esi + 0x34]
jae 0x406700
lea ecx, [ebp + 1]
mov dword [esi + 0x30], ecx
mov byte [ebp], dl
mov ecx, dword [esi + 0x44]
mov edx, dword [esi + 0x48]
jmp 0x406700
mov edi, dword [esp + 4]
mov ebp, dword [esp + 0xc]
add ebp, 3
and ebx, dword [eax*4 + 0x43ee00]
shl ebx, cl
or ebx, edx
mov dword [esi + 0x48], ebx
add ecx, eax
mov dword [esi + 0x44], ecx
cmp ecx, 8
jae 0x406775
jmp 0x406510
shr ebx, 8
mov dword [esi + 0x48], ebx
add ecx, 0xfffffff8
mov dword [esi + 0x44], ecx
cmp ecx, 7
jbe 0x406510
mov eax, dword [esi + 0x30]
cmp eax, dword [esi + 0x34]
jae 0x406760
lea ecx, [eax + 1]
mov dword [esi + 0x30], ecx
mov byte [eax], bl
mov ecx, dword [esi + 0x44]
mov ebx, dword [esi + 0x48]
jmp 0x406760
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 0x4067e1
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 0x4067b2
mov ecx, dword [esi + 0x30]
cmp ecx, dword [esi + 0x34]
jae 0x4067d0
lea edx, [ecx + 1]
mov dword [esi + 0x30], edx
mov byte [ecx], al
mov edx, dword [esi + 0x44]
mov eax, dword [esi + 0x48]
jmp 0x4067d0