Function at 0x580e5d
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
push ecx
push ecx
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
mov edi, ecx
mov eax, dword [edi + 0x24]
mov eax, dword [eax + 0x28]
test dword [edi + 0xc], eax
mov dword [ebp - 4], edi
jne 0x580e87
push ebx
call fcn.00580c42
mov eax, dword [edi + 0x24]
mov ecx, dword [edi + 0xc]
or dword [eax + 0x28], ecx
mov eax, dword [edi + 0x28]
mov ecx, dword [eax + 4]
mov esi, dword [ebx]
mov eax, esi
shr eax, 0x16
movsx eax, word [ecx + eax*2]
test eax, eax
mov dword [ebp - 8], ecx
mov dword [ebp + 8], eax
jl 0x580f14
mov ecx, eax
and ecx, 0xf
shl dword [ebx], cl
sub dword [ebx + 4], ecx
mov edx, dword [ebx + 4]
jns 0x580f0b
mov eax, dword [ebx + 8]
mov ecx, dword [ebx + 0xc]
cmp eax, ecx
jae 0x580edb
movzx esi, byte [eax]
movzx ecx, byte [eax + 1]
shl esi, 8
add esi, ecx
mov ecx, edx
neg ecx
shl esi, cl
add esi, dword [ebx]
inc eax
inc eax
add edx, 0x10
mov dword [ebx], esi
mov dword [ebx + 4], edx
jmp 0x580f08
jne 0x580eef
movzx esi, byte [eax]
push 8
pop ecx
sub ecx, edx
shl esi, cl
add esi, dword [ebx]
inc eax
add edx, 8
jmp 0x580ed4
cmp edx, 0xfffffff0
jge 0x580f08
cmp dword [ebx + 0x10], 0
jne 0x580f01
mov dword [ebx + 0x10], 2
mov dword [ebx + 4], 0x7f
mov dword [ebx + 8], eax
sar dword [ebp + 8], 4
jmp 0x581006
shl esi, 0xa
add dword [ebx + 4], 0xfffffff6
mov edx, dword [ebx + 4]
mov dword [ebx], esi
jns 0x580f82
mov eax, dword [ebx + 8]
mov edi, dword [ebx + 0xc]
cmp eax, edi
jae 0x580f47
movzx edi, byte [eax]
movzx ecx, byte [eax + 1]
shl edi, 8
add edi, ecx
mov ecx, edx
neg ecx
shl edi, cl
add edi, esi
inc eax
inc eax
add edx, 0x10
jmp 0x580f59
jne 0x580f63
movzx edi, byte [eax]
push 8
pop ecx
sub ecx, edx
shl edi, cl
add edi, esi
inc eax
add edx, 8
mov ecx, dword [ebp - 8]
mov dword [ebx], edi
mov dword [ebx + 4], edx
jmp 0x580f7c
cmp edx, 0xfffffff0
jge 0x580f7c
cmp dword [ebx + 0x10], 0
jne 0x580f75
mov dword [ebx + 0x10], 2
mov dword [ebx + 4], 0x7f
mov edi, dword [ebp - 4]
mov dword [ebx + 8], eax
xor esi, esi
jmp 0x580f89
dec dword [ebx + 4]
xor eax, eax
cmp dword [ebx], esi
setl al
add eax, dword [ebp + 8]
movsx eax, word [ecx + eax*2 + 0x10000]
shl dword [ebx], 1
cmp eax, esi
mov dword [ebp + 8], eax
jl 0x580f86
dec dword [ebx + 4]
mov edx, dword [ebx + 4]
jns 0x581006
mov eax, dword [ebx + 8]
mov ecx, dword [ebx + 0xc]
cmp eax, ecx
jae 0x580fd6
movzx esi, byte [eax]
movzx ecx, byte [eax + 1]
shl esi, 8
add esi, ecx
mov ecx, edx
neg ecx
shl esi, cl
add esi, dword [ebx]
inc eax
inc eax
add edx, 0x10
mov dword [ebx], esi
mov dword [ebx + 4], edx
jmp 0x581003
jne 0x580fea
movzx esi, byte [eax]
push 8
pop ecx
sub ecx, edx
shl esi, cl
add esi, dword [ebx]
inc eax
add edx, 8
jmp 0x580fcf
cmp edx, 0xfffffff0
jge 0x581003
cmp dword [ebx + 0x10], 0
jne 0x580ffc
mov dword [ebx + 0x10], 2
mov dword [ebx + 4], 0x7f
mov dword [ebx + 8], eax
mov eax, dword [edi + 4]
mov ecx, dword [ebp + 8]
movzx eax, byte [eax + ecx]
mov esi, dword [0x57e140]
add eax, esi
push eax
mov ecx, ebx
call fcn.005751da
push dword [edi + 0x1c]
mov edi, dword [ebp + 0x14]
push dword [ebp + 8]
mov edx, dword [ebp + 0xc]
mov ecx, esi
mov esi, dword [ebp + 0x10]
mov dword [ebp - 8], eax
sar eax, cl
call fcn.00580cfa
mov eax, dword [esi]
mov ecx, dword [0x57e140]
shl eax, cl
and ecx, dword [ebp - 8]
push 1
lea eax, [eax + ecx + 1]
mov ecx, ebx
mov dword [esi], eax
call fcn.0057514d
mov ecx, dword [esi]
neg eax
xor ecx, eax
sub ecx, eax
pop edi
mov dword [esi], ecx
pop esi
xor eax, eax
pop ebx
leave
ret 0x10