Function at 0x517fb0
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [ebp + 8]
inc eax
mov dword [ebp - 0x10], ecx
mov ecx, dword [ebp + 0xc]
mov dword [ebp - 0xc], eax
mov eax, 1
shl eax, cl
push ebx
mov dword [ebp - 0x14], eax
push esi
lea ebx, [eax - 1]
mov dword [ebp - 4], edx
mov eax, ecx
mov dword [ebp - 8], ebx
xor ecx, ecx
xor esi, esi
bts ecx, eax
xor edx, edx
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 0x518284
jb 0x51801d
cmp eax, dword [ebp + 0x14]
ja 0x518284
cmp dword [ebp + 8], 0xff
ja 0x518284
mov ecx, dword [ebp + 0xc]
cmp ecx, 0xc
jbe 0x51803e
mov eax, 0xffffffd4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, 1
mov word [ebp + 0x14], cx
dec ecx
mov word [ebp + 0x16], ax
shl ax, cl
xor ecx, ecx
movzx eax, ax
mov dword [ebp - 0x28], eax
cmp dword [ebp - 0xc], ecx
jbe 0x5180b0
mov ebx, dword [ebp - 0x10]
mov eax, dword [ebp - 4]
add ebx, 6
mov edx, dword [ebp + 0x10]
sub eax, edx
mov dword [ebp - 0x1c], eax
lea ebx, [ebx + edi*4]
movzx eax, word [edx + eax]
mov esi, eax
mov dword [ebp - 0x24], esi
cmp ax, 0xffff
jne 0x51808c
mov byte [ebx], cl
dec edi
sub ebx, 4
mov eax, 1
jmp 0x51809e
cmp ax, word [ebp - 0x28]
jl 0x518098
xor eax, eax
mov word [ebp + 0x16], ax
mov eax, dword [ebp - 0x24]
movzx eax, ax
mov word [edx], ax
inc ecx
mov eax, dword [ebp - 0x1c]
add edx, 2
cmp ecx, dword [ebp - 0xc]
jb 0x518070
mov ebx, dword [ebp - 8]
mov ecx, dword [ebp - 0x10]
mov eax, dword [ebp + 0x14]
mov esi, dword [ebp - 4]
mov dword [ecx], eax
mov eax, dword [ebp - 0x14]
mov ecx, eax
shr eax, 1
shr ecx, 3
lea edx, [eax + 3]
xor eax, eax
add edx, ecx
mov dword [ebp + 0x14], edx
cmp edi, ebx
jne 0x5181cd
xor edi, edi
mov dword [ebp - 0x24], eax
xorps xmm0, xmm0
mov dword [ebp - 0x28], edi
movlpd qword [ebp - 0x20], xmm0
cmp dword [ebp - 0xc], eax
jbe 0x51816a
mov ebx, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x20]
movsx ecx, word [esi + eax*2]
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x1c], ecx
mov ecx, dword [ebp + 8]
lea esi, [eax + ecx*2]
mov ecx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
mov dword [esi + edi + 2], edx
mov dword [esi + edi + 6], ebx
mov esi, dword [ebp - 4]
cmp ecx, 8
jle 0x51814d
mov ecx, dword [ebp + 8]
mov eax, dword [ebp + 0x10]
inc ecx
lea esi, [eax + ecx*2]
mov ecx, dword [ebp - 0x1c]
mov eax, dword [ebp - 0x24]
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 esi, dword [ebp - 4]
mov ecx, dword [ebp - 0x1c]
mov edi, dword [ebp - 0x28]
add edi, ecx
inc eax
add edx, 0x1010101
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x24], eax
adc ebx, 0x1010101
cmp eax, dword [ebp - 0xc]
jb 0x5180f2
mov ebx, dword [ebp - 8]
mov eax, dword [ebp - 0x14]
xor esi, esi
xor edi, edi
test eax, eax
je 0x518236
nop dword [eax]
mov edx, dword [ebp + 8]
mov ecx, esi
and ecx, ebx
mov ebx, dword [ebp + 0x10]
lea eax, [ebx + edx*2]
mov edx, dword [ebp - 0x10]
movzx eax, byte [eax + edi + 2]
mov ebx, dword [ebp + 8]
mov byte [edx + ecx*4 + 6], al
mov edx, dword [ebp + 0x10]
mov ecx, dword [ebp + 0x14]
add ecx, esi
and ecx, dword [ebp - 8]
lea eax, [edx + ebx*2]
mov ebx, dword [ebp - 0x10]
mov edx, dword [ebp + 0x14]
movzx eax, byte [eax + edi + 3]
add edi, 2
mov byte [ebx + ecx*4 + 6], al
mov ebx, dword [ebp - 8]
lea esi, [esi + edx*2]
and esi, ebx
cmp edi, dword [ebp - 0x14]
jb 0x518180
xor ebx, ebx
jmp 0x51823c
xor ecx, ecx
mov dword [ebp + 8], ecx
cmp dword [ebp - 0xc], eax
jbe 0x518233
mov ecx, dword [ebp - 4]
xor edx, edx
xor esi, esi
cmp dx, word [ecx]
mov edx, dword [ebp + 0x14]
mov ecx, dword [ebp + 8]
jge 0x518218
nop dword [eax]
mov ebx, dword [ebp - 0x10]
mov byte [ebx + eax*4 + 6], cl
add eax, edx
mov ebx, dword [ebp - 8]
and eax, ebx
cmp eax, edi
jbe 0x51820a
add eax, edx
and eax, ebx
cmp eax, edi
ja 0x518202
mov ecx, dword [ebp - 4]
inc esi
movsx ecx, word [ecx]
cmp esi, ecx
mov ecx, dword [ebp + 8]
jl 0x5181f0
add dword [ebp - 4], 2
inc ecx
mov dword [ebp + 8], ecx
cmp ecx, dword [ebp - 0xc]
jb 0x5181d7
test eax, eax
je 0x518233
or eax, 0xffffffff
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x14]
xor ebx, ebx
test eax, eax
je 0x51827b
mov edi, dword [ebp - 0x10]
add edi, 7
movzx eax, byte [edi - 1]
lea edi, [edi + 4]
mov ecx, dword [ebp + 0x10]
inc ebx
movzx esi, word [ecx + eax*2]
lea edx, [ecx + eax*2]
mov ecx, esi
lea eax, [esi + 1]
mov word [edx], ax
bsr eax, ecx
mov cl, byte [ebp + 0xc]
sub cl, al
shl si, cl
mov byte [edi - 4], cl
mov ecx, dword [ebp - 0x14]
movzx eax, cx
sub si, ax
mov word [edi - 7], si
cmp ebx, ecx
jb 0x518242
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