Function at 0x10058790
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x10
push ebx
push ebp
mov ebp, dword [esp + 0x1c]
mov eax, dword [ebp + 0x20]
mov ebx, eax
push esi
shr eax, 0xb
push edi
mov edi, dword [ebp + 0x24]
and eax, 0x1f
push eax
movzx eax, byte [ebp + 0x22]
shr ebx, 8
push eax
add edi, 8
and ebx, 7
lea esi, [esp + 0x24]
mov eax, ebp
mov dword [esp + 0x1c], 0
call fcn.100572e0
test eax, eax
jne 0x100587d9
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret 0x14
mov ebx, dword [ebp + 0x20]
movzx ecx, byte [ebp + 0x22]
mov edx, dword [esp + 0x28]
mov esi, dword [ebp + 0x24]
mov edi, ebx
shl edx, 0x1c
push ecx
shr edi, 8
shr ebx, 0xb
or edx, 0x8000000
add esi, 8
and edi, 7
and ebx, 0x1f
push ebp
call fcn.10057280
test eax, eax
je 0x100589d0
mov edx, dword [esp + 0x2c]
mov ebx, dword [ebp + 0x20]
movzx eax, byte [ebp + 0x22]
mov esi, dword [ebp + 0x24]
and edx, 7
or edx, 0xffffff80
shl edx, 8
or edx, dword [esp + 0x30]
mov edi, ebx
push eax
shr edi, 8
shr ebx, 0xb
shl edx, 0x10
add esi, 4
and edi, 7
and ebx, 0x1f
push ebp
call fcn.10057280
test eax, eax
je 0x100589d0
mov dword [esp + 0x24], 0x186a0
mov eax, dword [ebp + 0x20]
movzx ecx, byte [ebp + 0x22]
mov edi, dword [ebp + 0x24]
mov ebx, eax
shr eax, 0xb
and eax, 0x1f
push eax
shr ebx, 8
and ebx, 7
push ecx
lea esi, [esp + 0x18]
mov eax, ebp
call fcn.100572e0
test eax, eax
je 0x100589d0
mov eax, dword [esp + 0x10]
test eax, 0x10000000
jne 0x10058895
test eax, 0xa0000000
jne 0x1005889c
sub dword [esp + 0x24], 1
jns 0x10058856
mov edx, eax
and edx, 0xa0000000
cmp edx, 0x80000000
je 0x100589b2
mov dword [esp + 0x24], 0x3e8
mov eax, dword [ebp + 0x20]
mov edi, dword [ebp + 0x24]
mov ebx, eax
shr eax, 0xb
and eax, 0x1f
push eax
movzx eax, byte [ebp + 0x22]
shr ebx, 8
push eax
add edi, 8
and ebx, 7
lea esi, [esp + 0x20]
mov eax, ebp
call fcn.100572e0
test eax, eax
je 0x100589d0
mov ebx, dword [ebp + 0x20]
movzx ecx, byte [ebp + 0x22]
mov edx, dword [esp + 0x18]
mov esi, dword [ebp + 0x24]
mov edi, ebx
push ecx
shr edi, 8
shr ebx, 0xb
xor edx, 0x8000000
add esi, 8
and edi, 7
and ebx, 0x1f
push ebp
call fcn.10057280
test eax, eax
je 0x100589d0
mov eax, dword [ebp + 0x20]
movzx edx, byte [ebp + 0x22]
mov edi, dword [ebp + 0x24]
mov ebx, eax
shr eax, 0xb
and eax, 0x1f
push eax
shr ebx, 8
and ebx, 7
push edx
lea esi, [esp + 0x18]
mov eax, ebp
call fcn.100572e0
test eax, eax
je 0x100589d0
mov eax, dword [esp + 0x10]
and eax, 0xb0000000
cmp eax, 0x10000000
je 0x10058964
sub dword [esp + 0x24], 1
jns 0x100588b8
mov dword [esp + 0x24], 0x3e8
lea esp, [esp]
mov eax, dword [ebp + 0x20]
movzx ecx, byte [ebp + 0x22]
mov edi, dword [ebp + 0x24]
mov ebx, eax
shr eax, 0xb
and eax, 0x1f
push eax
shr ebx, 8
and ebx, 7
push ecx
lea esi, [esp + 0x18]
mov eax, ebp
call fcn.100572e0
test eax, eax
je 0x100589d0
mov eax, dword [esp + 0x10]
test eax, 0x10000000
jne 0x100589ab
test eax, 0xa0000000
jne 0x100589b2
sub dword [esp + 0x24], 1
jns 0x10058970
mov edx, eax
and edx, 0xa0000000
cmp edx, 0x80000000
jne 0x100589d0
mov ecx, dword [esp + 0x34]
mov byte [ecx], al
mov dword [esp + 0x14], 1
mov ebx, dword [ebp + 0x20]
movzx edx, byte [ebp + 0x22]
mov esi, dword [ebp + 0x24]
mov edi, ebx
push edx
mov edx, dword [esp + 0x20]
shr edi, 8
shr ebx, 0xb
add esi, 8
and edi, 7
and ebx, 0x1f
push ebp
call fcn.10057280
mov eax, dword [esp + 0x14]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret 0x14