Function at 0x4f7900
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff0
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
sub esp, 0x68
push esi
mov esi, dword [ebx + 0x14]
mov eax, 0xffff8001
mov dword [ebp - 0x10], eax
mov eax, esi
imul eax, dword [ebx + 0x18]
push edi
mov edi, 0x7fff
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0xc], edi
lea eax, [eax*2 + 0x100]
push eax
call fcn.00593e38
mov edx, eax
add esp, 4
mov dword [ebp - 0x18], edx
test edx, edx
jne 0x4f7960
lea eax, [edx + 1]
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret
mov ecx, dword [ebx + 0x18]
test ecx, ecx
jle 0x4f7ba0
movdqa xmm1, xmmword [0x5eda40]
mov edi, edx
movdqa xmm0, xmm1
movdqa xmmword [ebp - 0x50], xmm1
movdqa xmm1, xmmword [0x5eda50]
movdqa xmmword [ebp - 0x60], xmm0
movdqa xmm0, xmm1
movdqa xmmword [ebp - 0x30], xmm1
movdqa xmmword [ebp - 0x40], xmm0
mov dword [ebp - 8], edi
mov dword [ebp - 0x14], ecx
nop
push dword [ebx + 8]
call fcn.0045d210
cwde
lea ecx, [esi + esi]
add esp, 4
cmp eax, ecx
jne 0x4f79de
mov dword [ebp - 8], 0
test esi, esi
jle 0x4f7a53
push dword [ebx + 8]
call fcn.0045d210
mov ecx, dword [ebp - 8]
add esp, 4
mov word [edi + ecx*2], ax
inc ecx
mov dword [ebp - 8], ecx
cmp ecx, esi
jl 0x4f79c2
jmp 0x4f7a53
push dword [ebx + 8]
call fcn.0045d210
mov word [edi], ax
add esp, 4
mov edi, 1
movzx eax, ax
mov dword [ebp - 4], eax
cmp esi, edi
jle 0x4f7a50
mov word [ebp - 2], ax
nop
mov eax, dword [ebx + 8]
push dword [eax]
call fcn.00597fff
mov dl, al
add esp, 4
cmp dl, 0xff
je 0x4f7a2f
mov eax, dword [ebp - 8]
mov cx, word [ebp - 2]
mov word [eax + edi*2], cx
movzx eax, dl
sub ax, 0x7f
add cx, ax
mov word [ebp - 2], cx
jmp 0x4f7a4b
push dword [ebx + 8]
call fcn.0045d210
mov ecx, dword [ebp - 8]
add esp, 4
movzx eax, ax
mov dword [ebp - 4], eax
mov word [ebp - 2], ax
mov word [ecx + edi*2], ax
inc edi
cmp edi, esi
jl 0x4f7a00
mov edi, dword [ebp - 8]
xor eax, eax
test esi, esi
jle 0x4f7aec
cmp esi, 0x10
jb 0x4f7ac7
mov ecx, esi
and ecx, 0x8000000f
jns 0x4f7a71
dec ecx
or ecx, 0xfffffff0
inc ecx
movdqa xmm1, xmmword [ebp - 0x30]
mov edx, esi
movdqa xmm2, xmmword [ebp - 0x50]
sub edx, ecx
movdqa xmm3, xmmword [ebp - 0x60]
mov ecx, edi
movdqa xmm4, xmmword [ebp - 0x40]
jmp 0x4f7a90
movdqu xmm0, xmmword [ecx]
add eax, 0x10
lea ecx, [ecx + 0x20]
pmaxsw xmm1, xmm0
pminsw xmm2, xmm0
movdqu xmm0, xmmword [ecx - 0x10]
pmaxsw xmm4, xmm0
pminsw xmm3, xmm0
cmp eax, edx
jl 0x4f7a90
movdqa xmmword [ebp - 0x40], xmm4
movdqa xmmword [ebp - 0x60], xmm3
movdqa xmmword [ebp - 0x50], xmm2
movdqa xmmword [ebp - 0x30], xmm1
cmp eax, esi
jge 0x4f7aec
mov edx, dword [ebp - 0x10]
mov edi, edi
movzx ecx, word [edi + eax*2]
cmp cx, dx
jle 0x4f7adb
mov edx, ecx
cmp cx, word [ebp - 0xc]
jge 0x4f7ae4
mov dword [ebp - 0xc], ecx
inc eax
cmp eax, esi
jl 0x4f7ad0
mov dword [ebp - 0x10], edx
dec dword [ebp - 0x14]
lea edi, [edi + esi*2]
mov dword [ebp - 8], edi
jne 0x4f79a0
mov eax, dword [ebp - 0x10]
movdqa xmm1, xmmword [ebp - 0x30]
cwde
mov ecx, dword [ebx + 0x18]
movd xmm0, eax
punpcklwd xmm0, xmm0
pshufd xmm0, xmm0, 0
pmaxsw xmm1, xmm0
pmaxsw xmm1, xmmword [ebp - 0x40]
movdqa xmm0, xmm1
psrldq xmm0, 8
pmaxsw xmm1, xmm0
movdqa xmm0, xmm1
psrldq xmm0, 4
pmaxsw xmm1, xmm0
movdqa xmm0, xmm1
psrldq xmm0, 2
pmaxsw xmm1, xmm0
movd eax, xmm1
movdqa xmm1, xmmword [ebp - 0x50]
movzx edx, ax
mov eax, dword [ebp - 0xc]
cwde
mov dword [ebp - 0x10], edx
movd xmm0, eax
punpcklwd xmm0, xmm0
pshufd xmm0, xmm0, 0
pminsw xmm1, xmm0
pminsw xmm1, xmmword [ebp - 0x60]
movdqa xmm0, xmm1
psrldq xmm0, 8
pminsw xmm1, xmm0
movdqa xmm0, xmm1
psrldq xmm0, 4
pminsw xmm1, xmm0
movdqa xmm0, xmm1
psrldq xmm0, 2
pminsw xmm1, xmm0
movd eax, xmm1
movzx edi, ax
mov dword [ebp - 0xc], edi
jmp 0x4f7ba5
mov edx, 0xffff8001
mov dword [ebp - 4], 0
test ecx, ecx
jle 0x4f7c29
mov eax, dword [ebp - 0x18]
mov dword [ebp - 8], eax
xor ecx, ecx
test esi, esi
jle 0x4f7bf1
movsx edi, di
mov dword [ebp - 0x14], edi
movsx edi, dx
mov edx, dword [ebp - 0x14]
sub edi, edx
lea ebx, [ebx]
movsx eax, word [eax + ecx*2]
sub eax, edx
xor edx, edx
imul eax, eax, 0xff
div edi
mov edx, dword [ebx + 0xc]
mov byte [ecx + edx], al
inc ecx
mov eax, dword [ebp - 8]
mov edx, dword [ebp - 0x14]
cmp ecx, esi
jl 0x4f7bd0
push 1
push 0xffffffffffffffff
push dword [ebx + 0x10]
push dword [ebx + 0x1c]
call fcn.004585b0
movzx eax, ax
add esp, 0x10
mov dword [ebp - 0x1c], eax
test ax, ax
jne 0x4f7c29
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 4]
mov edi, dword [ebp - 0xc]
inc ecx
mov edx, dword [ebp - 0x10]
lea eax, [eax + esi*2]
mov dword [ebp - 4], ecx
mov dword [ebp - 8], eax
cmp ecx, dword [ebx + 0x18]
jl 0x4f7bb6
push dword [ebp - 0x18]
call fcn.00592c4b
mov ax, word [ebp - 0x1c]
add esp, 4
pop edi
pop esi
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret