Function at 0x401290
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x2c
mov eax, dword [ebp + 0x10]
mov dword [esp + 0x18], edx
mov edx, dword [ebp + 8]
mov dword [esp + 8], ecx
mov ecx, dword [ebp + 0xc]
push ebx
lea eax, [eax + edx*2]
mov dword [esp + 0x24], ecx
add eax, 2
mov dword [esp + 0x10], eax
lea eax, [edx + 1]
mov dword [esp + 8], eax
xor edx, edx
mov eax, 1
shl eax, cl
mov dword [esp + 4], eax
push esi
xor esi, esi
lea ebx, [eax - 1]
mov eax, ecx
xor ecx, ecx
mov dword [esp + 0x18], ebx
bts ecx, eax
cmp eax, 0x20
push edi
cmovae edx, ecx
mov edi, ebx
mov ebx, dword [ebp + 8]
xor ecx, edx
cmp eax, 0x40
cmovae edx, ecx
lea eax, [ebx*2 + 2]
mov ebx, edi
add eax, ecx
adc esi, edx
add eax, 8
adc esi, 0
test esi, esi
ja 0x401575
jb 0x401318
cmp eax, dword [ebp + 0x14]
ja 0x401575
cmp dword [ebp + 8], 0xff
ja 0x401575
mov ecx, dword [esp + 0x2c]
cmp ecx, 0xc
jbe 0x40133a
mov eax, 0xffffffd4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [esp + 0x10]
mov eax, 1
mov word [esp + 0x20], cx
xor edx, edx
dec ecx
mov word [esp + 0x22], ax
shl ax, cl
movzx eax, ax
mov dword [esp + 0x28], eax
test esi, esi
je 0x4013b2
mov esi, dword [esp + 0x14]
mov ebx, dword [esp + 0x24]
add esi, 6
mov ecx, dword [ebp + 0x10]
sub ebx, ecx
lea esi, [esi + edi*4]
movzx eax, word [ebx + ecx]
cmp ax, 0xffff
jne 0x401388
mov byte [esi], dl
dec edi
sub esi, 4
mov eax, 1
jmp 0x40139d
cmp ax, word [esp + 0x28]
jl 0x40139a
xor eax, eax
mov word [esp + 0x22], ax
movzx eax, word [ebx + ecx]
movzx eax, ax
mov word [ecx], ax
inc edx
add ecx, 2
cmp edx, dword [esp + 0x10]
jb 0x401371
mov ebx, dword [esp + 0x1c]
mov esi, dword [esp + 0x10]
mov ecx, dword [esp + 0x14]
mov eax, dword [esp + 0x20]
mov dword [ecx], eax
mov eax, dword [esp + 0xc]
mov ecx, eax
shr eax, 1
shr ecx, 3
add eax, 3
cmp edi, ebx
jne 0x4014b5
add eax, ecx
xor esi, esi
mov dword [esp + 0x28], eax
xorps xmm0, xmm0
xor eax, eax
mov dword [esp + 0x20], esi
movlpd qword [esp + 0x30], xmm0
cmp dword [esp + 0x10], eax
jbe 0x40145d
mov edx, dword [esp + 0x34]
mov ebx, dword [esp + 0x30]
mov edi, dword [esp + 0x18]
nop dword [eax + eax]
mov ecx, dword [esp + 0x24]
mov dword [esi + edi], ebx
mov dword [esi + edi + 4], edx
movsx ecx, word [ecx + eax*2]
mov dword [esp + 0x30], ecx
cmp ecx, 8
jle 0x401440
add edi, esi
add ecx, 0xfffffff7
shr ecx, 2
and ecx, 0x3ffffffe
mov dword [edi + 8], ebx
lea esi, [edi + 8]
mov dword [edi + 0xc], edx
add edi, 0x10
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x30]
mov esi, dword [esp + 0x20]
mov edi, dword [esp + 0x18]
add esi, ecx
inc eax
add ebx, 0x1010101
mov dword [esp + 0x20], esi
adc edx, 0x1010101
cmp eax, dword [esp + 0x10]
jb 0x401400
mov ebx, dword [esp + 0x1c]
xor edx, edx
xor esi, esi
cmp dword [esp + 0xc], edx
jbe 0x401513
mov edi, dword [esp + 0x18]
nop
movzx eax, byte [esi + edi]
mov ecx, edx
mov edi, dword [esp + 0x14]
and ecx, ebx
mov byte [edi + ecx*4 + 6], al
mov edi, dword [esp + 0x18]
mov ecx, dword [esp + 0x28]
add ecx, edx
and ecx, ebx
movzx eax, byte [esi + edi + 1]
add esi, 2
mov edi, dword [esp + 0x14]
mov byte [edi + ecx*4 + 6], al
mov eax, dword [esp + 0x28]
mov edi, dword [esp + 0x18]
lea edx, [edx + eax*2]
and edx, ebx
cmp esi, dword [esp + 0xc]
jb 0x401470
mov edx, dword [esp + 0xc]
jmp 0x40151b
add ecx, eax
xor edx, edx
xor eax, eax
mov dword [esp + 0x20], edx
test esi, esi
je 0x401513
mov ebx, dword [esp + 0x24]
movsx edx, word [ebx + edx*2]
test edx, edx
jle 0x4014f8
mov esi, dword [esp + 0x14]
mov ebx, dword [esp + 0x20]
mov byte [esi + eax*4 + 6], bl
add eax, ecx
mov ebx, dword [esp + 0x1c]
and eax, ebx
cmp eax, edi
jbe 0x4014ef
add eax, ecx
and eax, ebx
cmp eax, edi
ja 0x4014e7
sub edx, 1
jne 0x4014d3
mov esi, dword [esp + 0x10]
mov edx, dword [esp + 0x20]
inc edx
mov dword [esp + 0x20], edx
cmp edx, esi
jb 0x4014c3
test eax, eax
je 0x401513
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [esp + 0xc]
test edx, edx
je 0x40156c
mov edi, dword [esp + 0x14]
movzx ebx, dx
add edi, 7
movzx eax, byte [edi - 1]
lea edi, [edi + 4]
mov ecx, dword [ebp + 0x10]
movzx esi, word [ecx + eax*2]
lea ecx, [ecx + eax*2]
mov edx, esi
mov dword [esp + 0x30], 0
lea eax, [esi + 1]
mov word [ecx], ax
mov cl, byte [esp + 0x2c]
bsr eax, edx
setne dl
neg dl
sbb dl, dl
and dl, al
sub cl, dl
shl si, cl
sub si, bx
mov byte [edi - 4], cl
sub dword [esp + 0xc], 1
mov word [edi - 7], si
jne 0x401525
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
mov eax, 0xffffffd2
pop ebx
mov esp, ebp
pop ebp
ret