Function at 0x4fea40
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
mov eax, dword [0x6510e8]
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 0x4fecaf
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 0x4feaaf
shl eax, 2
push eax
push ebx
push ecx
call fcn.00582dc0
add esp, 0xc
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00581335
mov esp, ebp
pop ebp
ret 0x10
cmp edx, 0x18
jne 0x4feaf3
lea edx, [ecx + eax*4]
cmp ecx, edx
je 0x4fecad
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 0x4feac2
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00581335
mov esp, ebp
pop ebp
ret 0x10
cmp edx, 0x10
jne 0x4fec82
xor edi, edi
xor esi, esi
cmp dword [0x67b8e4], 2
jl 0x4fec00
movaps xmm4, xmmword [0x61e880]
mov edx, 1
movaps xmm7, xmmword [0x61e8e0]
movaps xmm3, xmmword [0x61e910]
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 [0x61e8f0]
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 [0x61e8f0]
packuswb xmm0, xmm0
movd dword [ebp + edx - 0x24], xmm0
add edx, 8
cmp edx, 0x24
jb 0x4feb34
jmp 0x4fec2a
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 0x4fec00
mov eax, dword [ebp - 0x28]
lea edx, [ecx + eax*4]
cmp ecx, edx
je 0x4fecad
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 0x4fec35
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00581335
mov esp, ebp
pop ebp
ret 0x10
cmp edx, 8
jne 0x4fecad
lea edx, [ecx + eax*4]
cmp ecx, edx
je 0x4fecad
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 0x4fec90
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop ebx
call fcn.00581335
mov esp, ebp
pop ebp
ret 0x10