Function at 0x402540
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 8
mov eax, dword [esp + 0x14]
mov cl, byte [eax]
mov dl, byte [eax + 1]
push esi
mov esi, dword [esp + 0x14]
test esi, esi
mov dword [esp + 8], 0
jle 0x402794
push ebx
push ebp
push edi
movzx edi, cl
movzx ebp, dl
lea ebx, [ebx]
lea eax, [edi + 1]
cdq
mov ecx, 0x1ec
idiv ecx
mov ecx, dword [0x4150c4]
mov esi, 0x1ec
push 0x410239
push 0x415638
movzx edi, dl
movzx eax, byte [edi + ecx]
add eax, ebp
mov byte [esp + 0x1a], dl
cdq
idiv esi
movzx ebp, dl
mov bl, byte [ecx + ebp]
lea eax, [ecx + ebp]
mov byte [esp + 0x1b], dl
mov dl, byte [edi + ecx]
mov byte [edi + ecx], bl
mov byte [eax], dl
mov ecx, dword [0x4150c4]
movzx edx, byte [edi + ecx]
movzx eax, byte [ecx + ebp]
add eax, edx
cdq
mov ecx, esi
idiv ecx
mov byte [esp + 0x19], dl
call fcn.00401f40
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00402240
mov edx, dword [esi]
mov eax, dword [edx + 4]
mov cl, byte [eax + esi + 8]
add eax, esi
xor ebx, ebx
test cl, 6
jne 0x402607
mov eax, dword [eax + 0x28]
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0x2c]
cmp eax, 0xffffffff
jne 0x402607
mov ebx, 4
mov eax, dword [esi]
mov ecx, dword [eax + 4]
add ecx, esi
test ebx, ebx
je 0x402629
mov eax, dword [ecx + 8]
mov edx, dword [ecx + 0x28]
or eax, ebx
test edx, edx
jne 0x402621
or eax, 4
push 0
push eax
call fcn.0040c85a
push 0x410239
push 0x415638
call fcn.00401f40
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00402240
mov ecx, dword [esi]
mov edx, dword [ecx + 4]
mov cl, byte [edx + esi + 8]
lea eax, [edx + esi]
xor ebx, ebx
test cl, 6
jne 0x40266d
mov eax, dword [eax + 0x28]
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0x2c]
cmp eax, 0xffffffff
jne 0x40266d
mov ebx, 4
mov eax, dword [esi]
mov ecx, dword [eax + 4]
add ecx, esi
test ebx, ebx
je 0x40268f
mov eax, dword [ecx + 8]
mov edx, dword [ecx + 0x28]
or eax, ebx
test edx, edx
jne 0x402687
or eax, 4
push 0
push eax
call fcn.0040c85a
push 0x410239
push 0x415638
call fcn.00401f40
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00402240
mov ecx, dword [esi]
mov edx, dword [ecx + 4]
mov cl, byte [edx + esi + 8]
lea eax, [edx + esi]
xor ebx, ebx
test cl, 6
jne 0x4026d3
mov eax, dword [eax + 0x28]
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0x2c]
cmp eax, 0xffffffff
jne 0x4026d3
mov ebx, 4
mov eax, dword [esi]
mov ecx, dword [eax + 4]
add ecx, esi
test ebx, ebx
je 0x4026f5
mov eax, dword [ecx + 8]
mov edx, dword [ecx + 0x28]
or eax, ebx
test edx, edx
jne 0x4026ed
or eax, 4
push 0
push eax
call fcn.0040c85a
push 0x410239
push 0x415638
call fcn.00401f40
add esp, 8
mov esi, eax
push 0xa
mov ecx, esi
call fcn.00402240
mov ecx, dword [esi]
mov edx, dword [ecx + 4]
mov cl, byte [edx + esi + 8]
lea eax, [edx + esi]
xor ebx, ebx
test cl, 6
jne 0x402739
mov eax, dword [eax + 0x28]
mov edx, dword [eax]
mov ecx, eax
call dword [edx + 0x2c]
cmp eax, 0xffffffff
jne 0x402739
mov ebx, 4
mov eax, dword [esi]
mov ecx, dword [eax + 4]
add ecx, esi
test ebx, ebx
je 0x40275b
mov eax, dword [ecx + 8]
mov edx, dword [ecx + 0x28]
or eax, ebx
test edx, edx
jne 0x402753
or eax, 4
push 0
push eax
call fcn.0040c85a
movzx ecx, byte [esp + 0x11]
mov edx, dword [0x4150c4]
mov dl, byte [ecx + edx]
mov eax, dword [esp + 0x14]
mov ecx, dword [esp + 0x1c]
xor byte [eax + ecx], dl
mov ecx, dword [esp + 0x20]
inc eax
cmp eax, ecx
mov dword [esp + 0x14], eax
jl 0x402570
mov cl, byte [esp + 0x12]
mov eax, dword [esp + 0x24]
mov dl, byte [esp + 0x13]
pop edi
pop ebp
pop ebx
mov byte [eax], cl
mov byte [eax + 1], dl
pop esi
add esp, 8
ret