Function at 0x5b5770
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x2c
mov eax, dword [ebp + 8]
mov dword [esp + 0xc], ecx
mov ecx, dword [ebp + 0x10]
mov dword [esp + 0x1c], edx
mov edx, 1
push ebx
push esi
lea ecx, [ecx + eax*2]
xor esi, esi
add ecx, 2
mov dword [esp + 0x20], ecx
lea ecx, [eax + 1]
mov dword [esp + 0xc], ecx
mov ecx, dword [ebp + 0xc]
mov eax, ecx
shl edx, cl
xor ecx, ecx
bts ecx, eax
mov dword [esp + 0x18], edx
push edi
lea ebx, [edx - 1]
xor edx, edx
cmp eax, 0x20
mov dword [esp + 0x14], ebx
mov edi, ebx
mov ebx, dword [ebp + 8]
cmovae edx, ecx
xor ecx, edx
cmp eax, 0x40
cmovae edx, ecx
lea eax, [ebx*2 + 2]
add eax, ecx
mov ebx, edi
adc esi, edx
add eax, 8
adc esi, 0
test esi, esi
jb 0x5b57f8
ja 0x5b57ec
cmp eax, dword [ebp + 0x14]
jbe 0x5b57f8
mov eax, 0xffffffd2
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
cmp dword [ebp + 8], 0xff
ja 0x5b57ec
mov eax, dword [ebp + 0xc]
cmp eax, 0xc
jbe 0x5b5815
mov eax, 0xffffffd4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov esi, dword [esp + 0x10]
lea ecx, [eax - 1]
mov word [esp + 0x20], ax
mov edx, 1
mov eax, edx
mov word [esp + 0x22], dx
shl ax, cl
xor ecx, ecx
movzx eax, ax
mov dword [esp + 0x30], eax
test esi, esi
je 0x5b5894
mov esi, dword [esp + 0x18]
mov edx, dword [ebp + 0x10]
add esi, 6
mov eax, dword [esp + 0x28]
sub edx, eax
mov dword [esp + 0x2c], edx
mov ebx, edx
lea esi, [esi + edi*4]
movzx edx, word [eax]
cmp dx, 0xffff
jne 0x5b586c
mov byte [esi], cl
dec edi
sub esi, 4
mov edx, 1
jmp 0x5b587e
cmp dx, word [esp + 0x30]
jl 0x5b587e
xor ebx, ebx
mov word [esp + 0x22], bx
mov ebx, dword [esp + 0x2c]
mov word [ebx + eax], dx
inc ecx
add eax, 2
cmp ecx, dword [esp + 0x10]
jb 0x5b5856
mov ebx, dword [esp + 0x14]
mov esi, dword [esp + 0x10]
mov ecx, dword [esp + 0x18]
mov eax, dword [esp + 0x20]
mov dword [ecx], eax
mov eax, dword [esp + 0x1c]
mov ecx, eax
shr eax, 1
shr ecx, 3
add eax, 3
cmp edi, ebx
jne 0x5b59e4
add eax, ecx
xor esi, esi
mov dword [esp + 0x20], eax
xorps xmm0, xmm0
xor eax, eax
mov dword [esp + 0x2c], esi
movlpd qword [esp + 0x30], xmm0
cmp dword [esp + 0x10], eax
jbe 0x5b593d
mov edx, dword [esp + 0x34]
mov ebx, dword [esp + 0x30]
mov edi, dword [esp + 0x24]
lea ecx, [ecx]
mov ecx, dword [esp + 0x28]
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 0x5b5920
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 + 0x2c]
mov edi, dword [esp + 0x24]
add esi, ecx
inc eax
add ebx, 0x1010101
mov dword [esp + 0x2c], esi
adc edx, 0x1010101
cmp eax, dword [esp + 0x10]
jb 0x5b58e0
mov ebx, dword [esp + 0x14]
xor edx, edx
cmp dword [esp + 0x1c], edx
jbe 0x5b5985
mov esi, dword [esp + 0x24]
mov edi, ebx
shr edi, 1
inc esi
inc edi
mov dword [esp + 0x2c], edi
mov edi, dword [esp + 0x18]
lea esi, [esi + 2]
movzx eax, byte [esi - 3]
mov ecx, edx
and ecx, ebx
mov byte [edi + ecx*4 + 6], al
mov ecx, dword [esp + 0x20]
movzx eax, byte [esi - 2]
add ecx, edx
and ecx, ebx
mov byte [edi + ecx*4 + 6], al
mov eax, dword [esp + 0x20]
lea edx, [edx + eax*2]
and edx, ebx
dec dword [esp + 0x2c]
jne 0x5b5953
mov ebx, dword [esp + 0x1c]
test ebx, ebx
je 0x5b59db
mov esi, dword [esp + 0x18]
mov edi, ebx
add esi, 7
movzx eax, byte [esi - 1]
lea esi, [esi + 4]
mov ecx, dword [ebp + 0x10]
mov dword [esp + 0x2c], 0
lea ecx, [ecx + eax*2]
movzx eax, word [ecx]
mov edx, eax
inc eax
mov word [ecx], ax
mov cl, byte [ebp + 0xc]
bsr eax, edx
mov dword [esp + 0x2c], eax
setne al
neg al
sbb al, al
and al, byte [esp + 0x2c]
sub cl, al
shl dx, cl
sub dx, bx
mov byte [esi - 4], cl
mov word [esi - 7], dx
dec edi
jne 0x5b5996
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
add ecx, eax
xor edx, edx
xor eax, eax
mov dword [esp + 0x24], edx
test esi, esi
je 0x5b5985
mov ebx, dword [esp + 0x28]
movsx edx, word [ebx + edx*2]
test edx, edx
jle 0x5b5a25
mov esi, dword [esp + 0x18]
mov ebx, dword [esp + 0x24]
mov byte [esi + eax*4 + 6], bl
add eax, ecx
mov ebx, dword [esp + 0x14]
and eax, ebx
cmp eax, edi
jbe 0x5b5a1e
add eax, ecx
and eax, ebx
cmp eax, edi
ja 0x5b5a16
dec edx
jne 0x5b5a02
mov esi, dword [esp + 0x10]
mov edx, dword [esp + 0x24]
inc edx
mov dword [esp + 0x24], edx
cmp edx, esi
jb 0x5b59f2
test eax, eax
je 0x5b5985
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret