Function at 0x401280
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 + 4], 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 + 4], eax
xor edx, edx
mov eax, 1
shl eax, cl
mov dword [esp + 0xc], 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 0x401562
jb 0x401308
cmp eax, dword [ebp + 0x14]
ja 0x401562
cmp dword [ebp + 8], 0xff
ja 0x401562
mov ecx, dword [esp + 0x2c]
cmp ecx, 0xc
jbe 0x40132a
mov eax, 0xffffffd4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [esp + 0xc]
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 0x4013a2
mov esi, dword [esp + 0x10]
mov ebx, dword [esp + 0x24]
add esi, 6
mov ecx, dword [ebp + 0x10]
sub ebx, ecx
lea esi, [esi + edi*4]
movzx eax, word [ecx + ebx]
cmp ax, 0xffff
jne 0x401378
mov byte [esi], dl
dec edi
sub esi, 4
mov eax, 1
jmp 0x40138d
cmp ax, word [esp + 0x28]
jl 0x40138a
xor eax, eax
mov word [esp + 0x22], ax
movzx eax, word [ecx + ebx]
movzx eax, ax
mov word [ecx], ax
inc edx
add ecx, 2
cmp edx, dword [esp + 0xc]
jb 0x401361
mov ebx, dword [esp + 0x1c]
mov esi, dword [esp + 0xc]
mov ecx, dword [esp + 0x10]
mov eax, dword [esp + 0x20]
mov dword [ecx], eax
mov eax, dword [esp + 0x14]
mov ecx, eax
shr eax, 1
shr ecx, 3
add eax, 3
cmp edi, ebx
jne 0x4014a3
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 + 0xc], eax
jbe 0x40144d
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 0x401430
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 + 0xc]
jb 0x4013f0
mov ebx, dword [esp + 0x1c]
xor edx, edx
xor esi, esi
cmp dword [esp + 0x14], edx
jbe 0x401559
mov edi, dword [esp + 0x18]
nop
movzx eax, byte [esi + edi]
mov ecx, edx
mov edi, dword [esp + 0x10]
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 + 0x10]
mov byte [edi + ecx*4 + 6], al
mov eax, dword [esp + 0x28]
mov edi, dword [esp + 0x18]
lea edx, [edx + eax*2]
mov eax, dword [esp + 0x14]
and edx, ebx
cmp esi, eax
jb 0x401460
jmp 0x401509
add ecx, eax
xor edx, edx
xor eax, eax
mov dword [esp + 0x20], edx
test esi, esi
je 0x401501
mov ebx, dword [esp + 0x24]
movsx edx, word [ebx + edx*2]
test edx, edx
jle 0x4014e6
mov esi, dword [esp + 0x10]
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 0x4014dd
add eax, ecx
and eax, ebx
cmp eax, edi
ja 0x4014d5
sub edx, 1
jne 0x4014c1
mov esi, dword [esp + 0xc]
mov edx, dword [esp + 0x20]
inc edx
mov dword [esp + 0x20], edx
cmp edx, esi
jb 0x4014b1
test eax, eax
je 0x401501
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x14]
test eax, eax
je 0x401559
mov edi, dword [esp + 0x10]
mov ebx, eax
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, word [esp + 0x14]
mov byte [edi - 4], cl
mov word [edi - 7], si
sub ebx, 1
jne 0x401512
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