Function at 0x519360
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x24
push ebx
push ebp
mov ebp, dword [esp + 0x3c]
mov edx, 1
mov ecx, ebp
shl edx, cl
mov ecx, dword [esp + 0x30]
push esi
mov esi, 1
mov dword [esp + 0x10], edx
lea ebx, [edx - 1]
lea eax, [ecx + 4]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x24], eax
mov eax, edx
shr eax, 1
test ebp, ebp
mov ebp, edx
cmove eax, esi
shr ebp, 3
xor esi, esi
push edi
mov edi, ebx
lea eax, [ecx + eax*4]
mov dword [esp + 0x20], edi
mov dword [esp + 0x30], eax
mov ecx, edx
mov eax, dword [esp + 0x40]
xor edx, edx
shr ecx, 1
inc eax
add ecx, 3
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x44]
add ebp, ecx
xor ecx, ecx
mov dword [esp + 0x10], ebp
bts ecx, eax
cmp eax, 0x20
cmovae edx, ecx
xor ecx, edx
cmp eax, 0x40
mov eax, dword [esp + 0x40]
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 0x519412
ja 0x519405
cmp eax, dword [esp + 0x4c]
jbe 0x519412
pop edi
pop esi
pop ebp
mov eax, 0xffffffd4
pop ebx
add esp, 0x24
ret
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x44]
mov esi, dword [esp + 0x1c]
mov word [eax], cx
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x40]
mov word [eax - 2], cx
xor ecx, ecx
mov eax, dword [esp + 0x48]
lea edx, [ecx + 1]
mov word [eax], cx
cmp esi, edx
jb 0x51949f
mov ebp, dword [esp + 0x3c]
mov ecx, eax
sub ebp, eax
mov ebx, esi
mov dword [esp + 0x4c], ebp
nop dword [eax + eax]
movzx esi, word [ecx + ebp]
movzx eax, word [ecx]
add ecx, 2
mov dword [esp + 0x38], ecx
cmp si, 0xffff
jne 0x519489
mov ebp, dword [esp + 0x4c]
inc eax
mov word [ecx], ax
lea eax, [edx - 1]
mov ecx, dword [esp + 0x40]
lea esi, [ecx*2]
mov ecx, dword [esp + 0x38]
add esi, dword [esp + 0x48]
mov byte [edi + esi + 4], al
dec edi
jmp 0x51948e
add eax, esi
mov word [ecx], ax
inc edx
cmp edx, ebx
jbe 0x519450
mov ebx, dword [esp + 0x18]
mov esi, dword [esp + 0x1c]
mov dword [esp + 0x20], edi
mov ecx, dword [esp + 0x14]
movzx eax, cx
mov ecx, dword [esp + 0x40]
mov dword [esp + 0x2c], eax
inc eax
lea edx, [ecx*2 + 2]
mov ecx, dword [esp + 0x14]
add edx, dword [esp + 0x48]
mov word [edx], ax
cmp edi, ebx
jne 0x5195b7
lea edi, [ecx + 2]
xorps xmm0, xmm0
add edi, edx
movlpd qword [esp + 0x20], xmm0
xor eax, eax
mov dword [esp + 0x38], edi
test esi, esi
je 0x51954b
mov edx, dword [esp + 0x24]
xor ebx, ebx
mov ebp, dword [esp + 0x20]
nop dword [eax + eax]
mov ecx, dword [esp + 0x3c]
movsx ecx, word [ecx + eax*2]
mov dword [esp + 0x4c], ecx
mov dword [ebx + edi], ebp
mov dword [ebx + edi + 4], edx
cmp ecx, 8
jle 0x519530
add edi, ebx
add ecx, 0xfffffff7
shr ecx, 2
and ecx, 0x3ffffffe
mov dword [edi + 8], ebp
lea esi, [edi + 8]
mov dword [edi + 0xc], edx
add edi, 0x10
rep movsd dword es:[edi], dword [esi]
mov ecx, dword [esp + 0x4c]
mov edi, dword [esp + 0x38]
mov esi, dword [esp + 0x1c]
add ebx, ecx
inc eax
add ebp, 0x1010101
adc edx, 0x1010101
cmp eax, esi
jb 0x5194f0
mov ebx, dword [esp + 0x18]
mov ecx, dword [esp + 0x14]
xor edx, edx
xor esi, esi
test ecx, ecx
je 0x519609
nop word [eax + eax]
movzx eax, byte [esi + edi]
mov ecx, edx
mov edi, dword [esp + 0x40]
and ecx, ebx
mov ebx, dword [esp + 0x48]
lea ebp, [ebx + edi*2]
mov edi, dword [esp + 0x38]
mov byte [ecx + ebp + 4], al
mov ebp, dword [esp + 0x40]
mov ecx, dword [esp + 0x10]
movzx eax, byte [esi + edi + 1]
add ecx, edx
and ecx, dword [esp + 0x18]
add esi, 2
lea edi, [ebx + ebp*2]
mov ebp, dword [esp + 0x10]
mov ebx, dword [esp + 0x18]
mov byte [ecx + edi + 4], al
mov edi, dword [esp + 0x38]
lea edx, [edx + ebp*2]
and edx, ebx
cmp esi, dword [esp + 0x14]
jb 0x519560
mov ebp, dword [esp + 0x14]
xor esi, esi
jmp 0x519613
xor eax, eax
xor edx, edx
test esi, esi
je 0x519609
nop
mov ecx, dword [esp + 0x3c]
movsx ecx, word [ecx + edx*2]
test ecx, ecx
jle 0x519604
nop dword [eax]
mov edi, dword [esp + 0x40]
mov ebp, dword [esp + 0x10]
lea ebx, [edi*2]
mov edi, dword [esp + 0x20]
add ebx, dword [esp + 0x48]
mov byte [eax + ebx + 4], dl
add eax, ebp
mov ebx, dword [esp + 0x18]
and eax, ebx
cmp eax, edi
jbe 0x5195ff
add eax, ebp
and eax, ebx
cmp eax, edi
ja 0x5195f7
sub ecx, 1
jne 0x5195d0
inc edx
cmp edx, esi
jb 0x5195c0
mov ebp, dword [esp + 0x14]
xor esi, esi
test ebp, ebp
je 0x519645
mov edi, dword [esp + 0x2c]
mov ebx, dword [esp + 0x28]
nop dword [eax + eax]
mov ecx, dword [esp + 0x48]
mov edx, dword [esp + 0x40]
lea eax, [ecx + edx*2]
movzx eax, byte [esi + eax + 4]
lea edx, [ecx + eax*2]
movzx eax, word [edx]
lea ecx, [edi + esi]
inc esi
mov word [ebx + eax*2], cx
inc word [edx]
cmp esi, ebp
jb 0x519620
mov esi, dword [esp + 0x30]
xor edi, edi
mov edx, dword [esp + 0x3c]
xor ebx, ebx
add esi, 8
movsx edx, word [edx + ebx*2]
cmp edx, 0xffffffff
je 0x5196a0
test edx, edx
je 0x519692
cmp edx, 1
je 0x5196a0
mov ecx, dword [esp + 0x44]
lea eax, [edx - 1]
bsr eax, eax
sub ecx, eax
shl edx, cl
shl ecx, 0x10
sub ecx, edx
mov edx, dword [esp + 0x3c]
mov dword [esi], ecx
mov ecx, edi
movsx eax, word [edx + ebx*2]
sub ecx, eax
mov dword [esi - 4], ecx
movsx eax, word [edx + ebx*2]
add edi, eax
jmp 0x5196b6
mov eax, dword [esp + 0x44]
inc eax
shl eax, 0x10
sub eax, ebp
mov dword [esi], eax
jmp 0x5196b2
mov eax, dword [esp + 0x44]
shl eax, 0x10
sub eax, ebp
mov dword [esi], eax
lea eax, [edi - 1]
mov dword [esi - 4], eax
inc edi
mov edx, dword [esp + 0x3c]
inc ebx
add esi, 8
cmp ebx, dword [esp + 0x40]
jbe 0x519654
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x24
ret