Function at 0x422570
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x18
mov ebx, ecx
mov esi, dword [esp + 0x2c]
mov byte [esp + 2], 0
mov dword [esp + 0xc], ecx
jmp 0x4225dc
mov eax, dword [esp + 0x2c]
push dword [eax]
call fcn.004088f0
add esp, 4
mov ebx, dword [esp + 8]
mov esi, dword [esp + 0x2c]
mov dword [esi], ebx
mov edx, dword [esp + 4]
lea eax, [ebx + edx]
mov dword [esi + 4], eax
mov eax, dword [esp + 0x10]
add eax, ebx
mov dword [esi + 8], eax
mov ecx, dword [esp + 0x14]
movzx eax, byte [esp + 3]
mov ebp, ebx
mov ebx, dword [esp + 0xc]
mov byte [ebp + edx], al
inc dword [esi + 4]
cmp byte [esp + 2], 0xa
je 0x42279b
push 0xadeee8f4
push dword [0x44fdc0]
call fcn.004431d0
add esp, 8
push 8
push 1
lea ecx, [esp + 0xa]
push ecx
push dword [ebx]
call eax
test eax, eax
setg cl
jg 0x42260c
cmp dword [ebx], 0xffffffff
jne 0x422763
test eax, eax
jle 0x422799
movzx eax, byte [esp + 2]
mov ebp, dword [esi]
mov edi, dword [esi + 4]
mov edx, edi
sub edx, ebp
cmp edi, dword [esi + 8]
jne 0x4225ca
mov byte [esp + 3], al
mov dword [esp + 0x14], ecx
lea eax, [edx + 1]
mov esi, edx
shr esi, 1
mov dword [esp + 4], edx
lea ecx, [esi + edx]
cmp ecx, eax
ja 0x422643
mov ecx, eax
mov dword [esp + 0x10], ecx
push ecx
call fcn.004088e0
add esp, 4
mov ebx, eax
test ebp, ebp
je 0x4225a2
cmp ebx, ebp
mov edx, dword [esp + 4]
mov dword [esp + 8], ebx
jbe 0x422722
cmp edi, ebx
jbe 0x422722
test edx, edx
je 0x422590
mov edx, dword [esp + 4]
mov eax, edx
and eax, 0xfffffffe
add eax, eax
mov ecx, edx
xor ecx, 1
sub eax, ecx
lea ecx, [eax + ebp]
add eax, dword [esp + 8]
mov esi, edx
and esi, 7
je 0x4226b4
neg esi
xor edx, edx
nop
nop
movzx ebx, byte [ecx + edx]
mov byte [eax + edx], bl
dec edx
cmp esi, edx
jne 0x4226a0
add ecx, edx
add eax, edx
add edx, dword [esp + 4]
sub ebp, edi
cmp ebp, 0xfffffff8
ja 0x422590
neg edx
xor esi, esi
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
movzx ebx, byte [ecx + esi]
mov byte [eax + esi], bl
movzx ebx, byte [ecx + esi - 1]
mov byte [eax + esi - 1], bl
movzx ebx, byte [ecx + esi - 2]
mov byte [eax + esi - 2], bl
movzx ebx, byte [ecx + esi - 3]
mov byte [eax + esi - 3], bl
movzx ebx, byte [ecx + esi - 4]
mov byte [eax + esi - 4], bl
movzx ebx, byte [ecx + esi - 5]
mov byte [eax + esi - 5], bl
movzx ebx, byte [ecx + esi - 6]
mov byte [eax + esi - 6], bl
movzx ebx, byte [ecx + esi - 7]
mov byte [eax + esi - 7], bl
add esi, 0xfffffff8
cmp edx, esi
jne 0x4226d0
jmp 0x422590
mov ecx, edx
shr ecx, 2
mov eax, ebp
mov edi, ebx
xchg esi, eax
rep movsd dword es:[edi], dword [esi]
xchg esi, eax
mov eax, edx
and edx, 0xfffffffc
add ebx, edx
add edx, ebp
and esi, 1
mov ebp, edx
mov edi, ebx
mov ecx, esi
xchg esi, ebp
rep movsw word es:[edi], word [esi]
xchg esi, ebp
test al, 1
je 0x422590
mov ecx, dword [esp + 4]
and ecx, 2
movzx edx, byte [edx + ecx]
mov byte [ebx + ecx], dl
jmp 0x422590
push 0x59ea2086
push dword [0x44fdc0]
call fcn.004431d0
add esp, 8
push 2
push dword [ebx]
call eax
push 0x2e775759
push dword [0x44fdc0]
call fcn.004431d0
add esp, 8
push dword [ebx]
call eax
mov dword [ebx], 0xffffffff
xor ecx, ecx
mov eax, ecx
add esp, 0x18
pop esi
pop edi
pop ebx
pop ebp
ret 4