Function at 0x50ec70
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
push esi
mov dword [ebp - 8], edx
mov esi, 1
mov edx, dword [ebp + 0xc]
push edi
mov edi, ecx
mov ecx, edx
shl esi, cl
mov ecx, esi
mov dword [ebp - 4], esi
shr ecx, 1
test edx, edx
lea eax, [edi + 4]
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x28], eax
lea ebx, [esi - 1]
mov eax, 1
mov dword [ebp - 0x10], ebx
cmovne eax, ecx
mov ecx, esi
shr ecx, 3
add ecx, 3
lea eax, [edi + eax*4]
mov edi, ebx
mov dword [ebp - 0x2c], eax
mov eax, esi
shr eax, 1
xor esi, esi
add eax, ecx
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp + 8]
inc eax
mov dword [ebp - 0x1c], eax
lea eax, [ecx + eax*2]
xor ecx, ecx
mov dword [ebp - 0xc], eax
mov eax, edx
bts ecx, eax
xor edx, edx
cmp eax, 0x20
cmovae edx, ecx
xor ecx, edx
cmp eax, 0x40
mov eax, dword [ebp + 8]
cmovae edx, ecx
add eax, 2
add eax, ecx
adc esi, edx
shrd eax, esi, 1
shr esi, 1
add eax, 2
adc esi, 0
shld esi, eax, 2
shl eax, 2
test esi, esi
jb 0x50ed20
ja 0x50ed14
cmp eax, dword [ebp + 0x14]
jbe 0x50ed20
mov eax, 0xffffffd4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 0x18]
mov eax, dword [ebp + 0xc]
mov edx, dword [ebp + 8]
mov word [ecx], ax
mov eax, dword [ebp + 0x10]
mov word [ecx + 2], dx
lea esi, [edx + 1]
xor ecx, ecx
mov word [eax], cx
mov ecx, 1
cmp esi, ecx
jb 0x50ed92
mov edx, dword [ebp - 8]
sub eax, edx
mov ebx, eax
nop dword [eax + eax]
movzx eax, word [edx]
movzx esi, word [ebx + edx]
mov dword [ebp + 0x14], eax
cmp ax, 0xffff
jne 0x50ed77
lea eax, [esi + 1]
mov esi, dword [ebp + 0x10]
mov word [esi + ecx*2], ax
lea eax, [ecx - 1]
mov esi, dword [ebp - 0xc]
mov byte [edi + esi + 2], al
dec edi
jmp 0x50ed83
mov eax, dword [ebp + 0x14]
add eax, esi
mov esi, dword [ebp + 0x10]
mov word [esi + ecx*2], ax
mov esi, dword [ebp + 8]
inc ecx
inc esi
add edx, 2
cmp ecx, esi
jbe 0x50ed50
mov ebx, dword [ebp - 0x10]
mov ecx, dword [ebp - 4]
movzx eax, cx
mov edx, eax
inc eax
mov dword [ebp - 0x24], edx
mov edx, dword [ebp - 0xc]
mov word [edx], ax
xor eax, eax
cmp edi, ebx
jne 0x50ee75
lea edi, [edx + 2]
xor esi, esi
mov edx, dword [ebp + 8]
add edi, ecx
mov dword [ebp + 0x14], edi
xorps xmm0, xmm0
mov dword [ebp - 0x18], esi
movlpd qword [ebp - 0x20], xmm0
add edx, 1
je 0x50ee2c
mov edx, dword [ebp - 0x1c]
mov ebx, dword [ebp - 0x20]
mov ecx, dword [ebp - 8]
movsx ecx, word [ecx + eax*2]
mov dword [ebp - 0x1c], ecx
mov dword [edi + esi], ebx
mov dword [edi + esi + 4], edx
cmp ecx, 8
jle 0x50ee09
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 [ebp - 0x1c]
mov esi, dword [ebp - 0x18]
mov edi, dword [ebp + 0x14]
add esi, ecx
mov ecx, dword [ebp + 8]
inc eax
add ebx, 0x1010101
mov dword [ebp - 0x18], esi
adc edx, 0x1010101
inc ecx
cmp eax, ecx
jb 0x50edd1
mov ebx, dword [ebp - 0x10]
mov ecx, dword [ebp - 4]
xor esi, esi
xor edi, edi
test ecx, ecx
je 0x50eec0
mov eax, dword [ebp + 0x14]
mov ecx, esi
mov edx, dword [ebp - 0xc]
and ecx, ebx
movzx eax, byte [eax + edi]
mov byte [ecx + edx + 2], al
mov edx, dword [ebp - 0x14]
mov eax, dword [ebp + 0x14]
lea ecx, [esi + edx]
movzx eax, byte [eax + edi + 1]
lea esi, [esi + edx*2]
and ecx, ebx
add edi, 2
mov ebx, dword [ebp - 0xc]
mov byte [ecx + ebx + 2], al
mov ebx, dword [ebp - 0x10]
and esi, ebx
cmp edi, dword [ebp - 4]
jb 0x50ee38
xor esi, esi
jmp 0x50eec6
xor ecx, ecx
mov dword [ebp + 0x14], ecx
test esi, esi
je 0x50eebd
nop
mov edx, dword [ebp - 8]
movsx edx, word [edx + ecx*2]
test edx, edx
jle 0x50eeb5
mov esi, dword [ebp - 0xc]
nop
mov ecx, dword [ebp + 0x14]
mov byte [eax + esi + 2], cl
mov ecx, dword [ebp - 0x14]
add eax, ecx
and eax, ebx
cmp eax, edi
jbe 0x50eeaa
add eax, ecx
and eax, ebx
cmp eax, edi
ja 0x50eea2
sub edx, 1
jne 0x50ee90
mov ecx, dword [ebp + 0x14]
mov esi, dword [ebp - 0x1c]
inc ecx
mov dword [ebp + 0x14], ecx
cmp ecx, esi
jb 0x50ee80
mov ecx, dword [ebp - 4]
xor esi, esi
test ecx, ecx
je 0x50eef3
mov eax, dword [ebp - 0x24]
mov ebx, dword [ebp - 0x28]
movzx edi, ax
nop
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp + 0x10]
movzx eax, byte [eax + esi + 2]
lea edx, [ecx + eax*2]
movzx eax, word [edx]
lea ecx, [edi + esi]
inc esi
mov word [ebx + eax*2], cx
inc word [edx]
mov ecx, dword [ebp - 4]
cmp esi, ecx
jb 0x50eed0
mov edx, dword [ebp - 0x2c]
xor edi, edi
mov esi, dword [ebp - 8]
xor ebx, ebx
add edx, 8
movsx esi, word [esi + ebx*2]
cmp esi, 0xffffffff
je 0x50ef4c
test esi, esi
je 0x50ef3f
cmp esi, 1
je 0x50ef4c
mov ecx, dword [ebp + 0xc]
lea eax, [esi - 1]
bsr eax, eax
sub ecx, eax
shl esi, cl
shl ecx, 0x10
sub ecx, esi
mov esi, dword [ebp - 8]
mov dword [edx], ecx
mov ecx, edi
movsx eax, word [esi + ebx*2]
sub ecx, eax
mov dword [edx - 4], ecx
movsx eax, word [esi + ebx*2]
mov ecx, dword [ebp - 4]
add edi, eax
jmp 0x50ef60
mov eax, dword [ebp + 0xc]
inc eax
shl eax, 0x10
sub eax, ecx
mov dword [edx], eax
jmp 0x50ef5d
mov eax, dword [ebp + 0xc]
shl eax, 0x10
sub eax, ecx
mov dword [edx], eax
lea eax, [edi - 1]
mov dword [edx - 4], eax
inc edi
mov esi, dword [ebp - 8]
inc ebx
add edx, 8
cmp ebx, dword [ebp + 8]
jbe 0x50ef00
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret