Function at 0x4012b0
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 + 0xc], 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 + 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 0x401594
jb 0x401334
cmp eax, dword [ebp + 0x14]
ja 0x401594
cmp dword [ebp + 8], 0xff
ja 0x401594
mov ecx, dword [ebp + 0xc]
cmp ecx, 0xc
jbe 0x401355
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 0x4013d1
mov esi, dword [esp + 0x18]
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 [ecx + ebx]
cmp ax, 0xffff
jne 0x4013a7
mov byte [esi], dl
dec edi
sub esi, 4
mov eax, 1
jmp 0x4013bc
cmp ax, word [esp + 0x2c]
jl 0x4013b9
xor eax, eax
mov word [esp + 0x26], ax
movzx eax, word [ecx + ebx]
movzx eax, ax
mov word [ecx], ax
inc edx
add ecx, 2
cmp edx, dword [esp + 0x14]
jb 0x401390
mov ebx, dword [esp + 0x1c]
mov esi, dword [esp + 0x14]
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x24]
mov dword [ecx], eax
mov eax, dword [esp + 0x10]
mov ecx, eax
shr eax, 1
shr ecx, 3
lea edx, [eax + 3]
xor eax, eax
add edx, ecx
mov dword [esp + 0x24], edx
cmp edi, ebx
jne 0x4014d6
xor esi, esi
xorps xmm0, xmm0
mov dword [esp + 0x2c], esi
movlpd qword [esp + 0x30], xmm0
cmp dword [esp + 0x14], eax
jbe 0x40147d
mov ebx, dword [esp + 0x34]
mov edx, dword [esp + 0x30]
mov edi, dword [esp + 0x20]
nop word [eax + eax]
mov ecx, dword [esp + 0x28]
mov dword [edi + esi], edx
mov dword [edi + esi + 4], ebx
movsx ecx, word [ecx + eax*2]
mov dword [esp + 0x30], ecx
cmp ecx, 8
jle 0x401460
add edi, esi
add ecx, 0xfffffff7
shr ecx, 2
and ecx, 0x3ffffffe
mov dword [edi + 8], edx
lea esi, [edi + 8]
mov dword [edi + 0xc], ebx
add edi, 0x10
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x30]
mov esi, dword [esp + 0x2c]
mov edi, dword [esp + 0x20]
add esi, ecx
inc eax
add edx, 0x1010101
mov dword [esp + 0x2c], esi
adc ebx, 0x1010101
cmp eax, dword [esp + 0x14]
jb 0x401420
mov ebx, dword [esp + 0x1c]
xor esi, esi
xor edi, edi
cmp dword [esp + 0x10], esi
jbe 0x401534
nop dword [eax + eax]
mov eax, dword [esp + 0x20]
mov ecx, esi
mov edx, dword [esp + 0x18]
and ecx, ebx
movzx eax, byte [eax + edi]
mov byte [edx + ecx*4 + 6], al
mov edx, dword [esp + 0x24]
mov eax, dword [esp + 0x20]
lea ecx, [esi + edx]
movzx eax, byte [eax + edi + 1]
lea esi, [esi + edx*2]
and ecx, ebx
add edi, 2
mov ebx, dword [esp + 0x18]
mov byte [ebx + ecx*4 + 6], al
mov ebx, dword [esp + 0x1c]
and esi, ebx
cmp edi, dword [esp + 0x10]
jb 0x401490
mov edx, dword [esp + 0x10]
jmp 0x40153c
xor ecx, ecx
mov dword [esp + 0x20], ecx
test esi, esi
je 0x401534
mov edx, dword [esp + 0x28]
movsx ecx, word [edx + ecx*2]
mov edx, dword [esp + 0x24]
test ecx, ecx
jle 0x401519
mov esi, dword [esp + 0x18]
mov ebx, dword [esp + 0x20]
mov byte [esi + eax*4 + 6], bl
add eax, edx
mov ebx, dword [esp + 0x1c]
and eax, ebx
cmp eax, edi
jbe 0x401510
add eax, edx
and eax, ebx
cmp eax, edi
ja 0x401508
sub ecx, 1
jne 0x4014f4
mov esi, dword [esp + 0x14]
mov ecx, dword [esp + 0x20]
inc ecx
mov dword [esp + 0x20], ecx
cmp ecx, esi
jb 0x4014e0
test eax, eax
je 0x401534
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [esp + 0x10]
test edx, edx
je 0x40158b
mov edi, dword [esp + 0x18]
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 [ebp + 0xc]
bsr eax, edx
mov edx, 0
cmovne edx, eax
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 0x401546
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