Function at 0x404580
Capabilities:
Encode data using xor
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x34
mov ecx, 8
xor eax, eax
mov edx, 7
push ebx
push ebp
push esi
push edi
lea edi, [esp + 0x20]
rep stosd dword es:[edi], eax
mov ecx, dword [esp + 0x48]
stosw word es:[edi], ax
lea eax, [ecx + 0x20]
mov esi, dword [eax - 4]
mov edi, dword [eax]
sub edi, esi
mov dword [eax], edi
add eax, 0xfffffffc
dec edx
jne 0x4045a2
xor ebp, ebp
mov eax, 8
mov dword [esp + 0x48], ebp
mov dword [esp + 0x10], ecx
mov dword [esp + 0x18], 9
mov edx, dword [esp + 0x10]
mov ecx, 0x80000000
mov ebx, dword [edx]
mov edx, ebx
mov dword [esp + 0x1c], ebx
shr edx, 0x1f
and dl, 1
xor esi, esi
mov edi, ebx
and edi, ecx
je 0x4045eb
test dl, dl
je 0x4045fc
test edi, edi
jne 0x4045f3
test dl, dl
jne 0x4045fc
shr ecx, 1
inc esi
cmp si, 0x20
jb 0x4045e1
mov ebx, esi
mov cl, 7
shr ebx, 2
sub cl, bl
mov dword [esp + 0x48], 4
movzx si, cl
shl cl, 1
add cl, dl
lea edi, [esi*4 + 4]
mov byte [esp + 0x14], cl
mov edx, 3
mov bl, byte [esp + 0x14]
mov ecx, ebp
and ecx, 0xffff
lea esi, [esp + ecx + 0x20]
mov cl, dl
shr bl, cl
mov ecx, eax
add eax, 0xffff
and ecx, 0xffff
and bl, 1
dec ecx
shl bl, cl
mov cl, byte [esi]
or cl, bl
test ax, ax
mov byte [esi], cl
jne 0x40465d
mov eax, 8
inc ebp
mov ecx, dword [esp + 0x48]
dec edx
dec ecx
mov dword [esp + 0x48], ecx
jne 0x404625
test di, di
mov dword [esp + 0x48], ebp
jbe 0x4046c9
and edi, 0xffff
xor ebp, ebp
mov edx, edi
mov ecx, dword [esp + 0x48]
mov ebx, dword [esp + 0x1c]
and ecx, 0xffff
lea esi, [esp + ecx + 0x20]
mov ecx, edi
sub ecx, ebp
dec ecx
shr ebx, cl
mov ecx, eax
add eax, 0xffff
and ecx, 0xffff
and bl, 1
dec ecx
shl bl, cl
mov cl, byte [esi]
or cl, bl
test ax, ax
mov byte [esi], cl
jne 0x4046c1
mov ecx, dword [esp + 0x48]
mov eax, 8
inc ecx
mov dword [esp + 0x48], ecx
inc ebp
dec edx
jne 0x40467c
mov ebp, dword [esp + 0x48]
mov edx, dword [esp + 0x10]
mov ecx, dword [esp + 0x18]
add edx, 4
dec ecx
mov dword [esp + 0x10], edx
mov dword [esp + 0x18], ecx
jne 0x4045c8
cmp ax, 8
je 0x4046ea
inc ebp
mov ebx, dword [esp + 0x4c]
mov ecx, 0xa
xor eax, eax
mov edi, ebx
rep stosd dword es:[edi], eax
call fcn.00404560
mov esi, ebp
mov byte [ebx], al
and esi, 0xffff
call fcn.00404560
and eax, 0xff
mov ecx, 0x26
cdq
sub ecx, esi
lea ebp, [ebx + 1]
idiv ecx
mov al, byte [ebx]
xor cx, cx
add dl, 2
mov byte [esp + 0x14], dl
sub al, dl
mov edi, dword [esp + 0x14]
mov cl, dl
mov byte [ebp], al
and edi, 0xff
mov eax, ecx
lea edx, [edi + esi]
and eax, 0xffff
cmp eax, edx
jge 0x40475a
inc ecx
mov byte [eax + ebx], 1
mov eax, ecx
and eax, 0xffff
cmp eax, edx
jl 0x40474a
lea ecx, [ebx + 2]
mov dword [esp + 0x4c], 0x26
mov dword [esp + 0x48], ecx
mov edx, dword [esp + 0x48]
cmp byte [edx], 0
jne 0x40477d
call fcn.00404560
mov ecx, dword [esp + 0x48]
mov byte [ecx], al
mov ecx, dword [esp + 0x48]
mov eax, dword [esp + 0x4c]
inc ecx
dec eax
mov dword [esp + 0x48], ecx
mov dword [esp + 0x4c], eax
jne 0x404769
mov ecx, esi
lea esi, [esp + 0x20]
mov edx, ecx
add edi, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov eax, ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, 0x27
mov dl, byte [eax - 1]
mov bl, byte [eax]
xor bl, dl
mov byte [eax], bl
inc eax
dec ecx
jne 0x4047ae
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x34
ret