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 + 0x1c], edx
mov edx, dword [ebp + 8]
mov dword [esp + 0x10], ecx
mov ecx, dword [ebp + 0xc]
push ebx
lea eax, [eax + edx*2]
add eax, 2
mov dword [esp + 0x18], eax
lea eax, [edx + 1]
mov dword [esp + 0xc], eax
xor edx, edx
mov eax, 1
shl eax, cl
mov dword [esp + 8], eax
push esi
xor esi, esi
lea ebx, [eax - 1]
mov eax, ecx
xor ecx, ecx
mov dword [esp + 0x14], 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 0x401581
jb 0x401314
cmp eax, dword [ebp + 0x14]
ja 0x401581
cmp dword [ebp + 8], 0xff
ja 0x401581
mov ecx, dword [ebp + 0xc]
cmp ecx, 0xc
jbe 0x401335
mov eax, 0xffffffd4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [esp + 0x14]
mov eax, 1
mov word [esp + 0x24], cx
xor edx, edx
dec ecx
mov word [esp + 0x26], ax
shl ax, cl
movzx eax, ax
mov dword [esp + 0x2c], eax
test esi, esi
je 0x4013b1
mov esi, dword [esp + 0x1c]
mov ebx, dword [esp + 0x28]
add esi, 6
mov ecx, dword [ebp + 0x10]
sub ebx, ecx
lea esi, [esi + edi*4]
nop dword [eax]
movzx eax, word [ebx + ecx]
cmp ax, 0xffff
jne 0x401387
mov byte [esi], dl
dec edi
sub esi, 4
mov eax, 1
jmp 0x40139c
cmp ax, word [esp + 0x2c]
jl 0x401399
xor eax, eax
mov word [esp + 0x26], ax
movzx eax, word [ebx + ecx]
movzx eax, ax
mov word [ecx], ax
inc edx
add ecx, 2
cmp edx, dword [esp + 0x14]
jb 0x401370
mov ebx, dword [esp + 0x18]
mov esi, dword [esp + 0x14]
mov ecx, dword [esp + 0x1c]
mov eax, dword [esp + 0x24]
mov dword [ecx], eax
cmp edi, ebx
jne 0x4014af
mov edi, dword [esp + 0x10]
xor esi, esi
mov eax, edi
mov dword [esp + 0x24], esi
shr eax, 1
mov ecx, edi
add eax, 3
shr ecx, 3
add eax, ecx
xorps xmm0, xmm0
mov dword [esp + 0x2c], eax
xor eax, eax
movlpd qword [esp + 0x30], xmm0
cmp dword [esp + 0x14], eax
jbe 0x401461
mov edx, dword [esp + 0x34]
mov ebx, dword [esp + 0x30]
mov edi, dword [esp + 0x20]
nop dword [eax]
mov ecx, dword [esp + 0x28]
mov dword [edi + esi], ebx
mov dword [edi + esi + 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 + 0x24]
mov edi, dword [esp + 0x20]
add esi, ecx
inc eax
add ebx, 0x1010101
mov dword [esp + 0x24], esi
adc edx, 0x1010101
cmp eax, dword [esp + 0x14]
jb 0x401400
mov ebx, dword [esp + 0x18]
mov edi, dword [esp + 0x10]
xor edx, edx
xor esi, esi
test edi, edi
je 0x401578
nop dword [eax]
mov eax, dword [esp + 0x20]
mov ecx, edx
mov edi, dword [esp + 0x1c]
and ecx, ebx
movzx eax, byte [eax + esi]
mov byte [edi + ecx*4 + 6], al
mov ecx, dword [esp + 0x2c]
mov eax, dword [esp + 0x20]
add ecx, edx
and ecx, ebx
movzx eax, byte [eax + esi + 1]
add esi, 2
mov byte [edi + ecx*4 + 6], al
mov eax, dword [esp + 0x2c]
mov edi, dword [esp + 0x10]
lea edx, [edx + eax*2]
and edx, ebx
cmp esi, edi
jb 0x401470
jmp 0x401528
mov eax, dword [esp + 0x10]
xor edx, edx
mov ecx, eax
mov dword [esp + 0x24], edx
shr eax, 1
add eax, 3
shr ecx, 3
add ecx, eax
xor eax, eax
test esi, esi
je 0x401520
nop dword [eax + eax]
mov ebx, dword [esp + 0x28]
movsx edx, word [ebx + edx*2]
test edx, edx
jle 0x401505
mov esi, dword [esp + 0x1c]
mov ebx, dword [esp + 0x24]
mov byte [esi + eax*4 + 6], bl
add eax, ecx
mov ebx, dword [esp + 0x18]
and eax, ebx
cmp eax, edi
jbe 0x4014fc
add eax, ecx
and eax, ebx
cmp eax, edi
ja 0x4014f4
sub edx, 1
jne 0x4014e0
mov esi, dword [esp + 0x14]
mov edx, dword [esp + 0x24]
inc edx
mov dword [esp + 0x24], edx
cmp edx, esi
jb 0x4014d0
test eax, eax
je 0x401520
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [esp + 0x10]
test edi, edi
je 0x401578
movzx ebx, di
mov edi, dword [esp + 0x1c]
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 [ebp + 0xc]
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 + 0x10], 1
mov word [edi - 7], si
jne 0x401532
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