Function at 0x4f8cd0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
mov eax, dword [0x6360e8]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ecx]
mov edx, dword [ebp + 8]
push ebx
mov ebx, dword [ebp + 0xc]
test eax, eax
je 0x4f8f3f
push esi
mov esi, dword [ebp + 0x14]
push edi
mov edi, dword [eax + 0x14]
mov ecx, edi
mov eax, dword [eax + 0x1c]
imul ecx, edx
xor edx, edx
shr esi, 3
lea ecx, [eax + ecx*4]
mov eax, dword [ebp + 0x10]
div esi
mov edx, dword [ebp + 0x14]
cmp edi, eax
cmovbe eax, edi
mov dword [ebp - 0x28], eax
cmp edx, 0x20
jne 0x4f8d3f
shl eax, 2
push eax
push ebx
push ecx
call fcn.00578ab0
add esp, 0xc
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00577025
mov esp, ebp
pop ebp
ret 0x10
cmp edx, 0x18
jne 0x4f8d83
lea edx, [ecx + eax*4]
cmp ecx, edx
je 0x4f8f3d
add ebx, 2
movzx eax, byte [ebx - 2]
lea ebx, [ebx + 3]
mov byte [ecx + 2], al
movzx eax, byte [ebx - 4]
mov byte [ecx + 1], al
movzx eax, byte [ebx - 3]
mov byte [ecx], al
add ecx, 4
cmp ecx, edx
jne 0x4f8d52
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00577025
mov esp, ebp
pop ebp
ret 0x10
cmp edx, 0x10
jne 0x4f8f12
xor edi, edi
xor esi, esi
cmp dword [0x65c24c], 2
jl 0x4f8e90
movaps xmm4, xmmword [0x6052e0]
mov edx, 1
movaps xmm7, xmmword [0x605340]
movaps xmm3, xmmword [0x605370]
movd xmm5, edx
mov edx, 4
movd xmm6, edx
movd xmm0, esi
add esi, 8
pshufd xmm2, xmm0, 0
paddd xmm2, xmm4
pmulld xmm2, xmm7
movaps xmm1, xmm2
movaps xmm0, xmm2
punpckhdq xmm0, xmm2
punpckldq xmm1, xmm2
pmuludq xmm0, xmm3
pmuludq xmm1, xmm3
shufps xmm1, xmm0, 0xdd
psubd xmm2, xmm1
psrld xmm2, xmm5
paddd xmm2, xmm1
psrld xmm2, xmm6
pshuflw xmm0, xmm2, 0xd8
pshufhw xmm0, xmm0, 0xd8
pshufd xmm0, xmm0, 0xd8
andps xmm0, xmmword [0x605350]
packuswb xmm0, xmm0
movd dword [ebp + edx - 0x28], xmm0
movd xmm0, edx
pshufd xmm2, xmm0, 0
paddd xmm2, xmm4
pmulld xmm2, xmm7
movaps xmm1, xmm2
movaps xmm0, xmm2
punpckhdq xmm0, xmm2
punpckldq xmm1, xmm2
pmuludq xmm0, xmm3
pmuludq xmm1, xmm3
shufps xmm1, xmm0, 0xdd
psubd xmm2, xmm1
psrld xmm2, xmm5
paddd xmm2, xmm1
psrld xmm2, xmm6
pshuflw xmm0, xmm2, 0xd8
pshufhw xmm0, xmm0, 0xd8
pshufd xmm0, xmm0, 0xd8
andps xmm0, xmmword [0x605350]
packuswb xmm0, xmm0
movd dword [ebp + edx - 0x24], xmm0
add edx, 8
cmp edx, 0x24
jb 0x4f8dc4
jmp 0x4f8eba
mov eax, 0x8421085
lea edi, [edi + 1]
mul esi
mov eax, esi
add esi, 0xff
sub eax, edx
shr eax, 1
add eax, edx
shr eax, 4
mov byte [ebp + edi - 0x25], al
cmp esi, 0x1fe0
jb 0x4f8e90
mov eax, dword [ebp - 0x28]
lea edx, [ecx + eax*4]
cmp ecx, edx
je 0x4f8f3d
movzx eax, word [ebx]
lea ebx, [ebx + 2]
shr eax, 0xb
movzx eax, byte [ebp + eax - 0x24]
mov byte [ecx + 2], al
movzx eax, word [ebx - 2]
shr eax, 6
and eax, 0x1f
movzx eax, byte [ebp + eax - 0x24]
mov byte [ecx + 1], al
movzx eax, word [ebx - 2]
shr eax, 1
and eax, 0x1f
movzx eax, byte [ebp + eax - 0x24]
mov byte [ecx], al
add ecx, 4
cmp ecx, edx
jne 0x4f8ec5
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00577025
mov esp, ebp
pop ebp
ret 0x10
cmp edx, 8
jne 0x4f8f3d
lea edx, [ecx + eax*4]
cmp ecx, edx
je 0x4f8f3d
nop
movzx eax, byte [ebx]
lea ebx, [ebx + 1]
mov byte [ecx + 2], al
movzx eax, byte [ebx - 1]
mov byte [ecx + 1], al
movzx eax, byte [ebx - 1]
mov byte [ecx], al
add ecx, 4
cmp ecx, edx
jne 0x4f8f20
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop ebx
call fcn.00577025
mov esp, ebp
pop ebp
ret 0x10