Function at 0x489600
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
sub esp, 0x1c
mov eax, dword [ebp + 0xc]
mov edi, dword [ebp + 0x14]
xor ecx, ecx
mov esi, dword [eax]
test edi, edi
je 0x4896c8
cmp edi, 8
mov eax, 0
jb 0x4896ad
mov ecx, dword [ebp + 0x10]
mov eax, edi
pxor xmm0, xmm0
pxor xmm1, xmm1
and eax, 0xfffffff8
mov edx, eax
add ecx, 0x38
nop
movd xmm2, dword [ecx - 0x20]
movd xmm3, dword [ecx - 0x28]
movd xmm4, dword [ecx - 0x38]
movd xmm6, dword [ecx - 8]
movd xmm5, dword [ecx - 0x10]
punpckldq xmm3, xmm2
movd xmm2, dword [ecx - 0x30]
punpckldq xmm4, xmm2
movd xmm2, dword [ecx]
punpcklqdq xmm4, xmm3
paddd xmm0, xmm4
movd xmm4, dword [ecx - 0x18]
add ecx, 0x40
add edx, 0xfffffff8
punpckldq xmm6, xmm2
punpckldq xmm4, xmm5
punpcklqdq xmm4, xmm6
paddd xmm1, xmm4
jne 0x489640
paddd xmm1, xmm0
cmp eax, edi
pshufd xmm0, xmm1, 0xee
paddd xmm0, xmm1
pshufd xmm1, xmm0, 0x55
paddd xmm1, xmm0
movd ecx, xmm1
je 0x4896c8
mov ebx, dword [ebp + 0x10]
mov edx, edi
sub edx, eax
lea eax, [ebx + eax*8]
nop word [eax + eax]
add ecx, dword [eax]
add eax, 8
dec edx
jne 0x4896c0
mov eax, dword [esi + 0xc]
mov edx, dword [esi + 0x10]
mov ebx, dword [esi + 8]
mov dword [ebp - 0x1c], esi
cmp eax, edx
jne 0x489715
cmp ecx, ebx
jb 0x489715
mov esi, dword [ebp - 0x1c]
mov ebx, dword [ebp + 0x10]
shl edi, 3
mov dword [esi + 0xc], 0
mov dword [esi + 0x10], 0
add esi, 0x18
nop word cs:[eax + eax]
test edi, edi
je 0x48976e
mov eax, dword [ebx]
add ebx, 8
add edi, 0xfffffff8
test eax, eax
je 0x489700
mov ecx, dword [ebx - 4]
jmp 0x489775
mov ecx, dword [ebp - 0x1c]
cmp eax, edx
mov esi, dword [ecx + 4]
jb 0x4897e3
mov eax, dword [ecx + 0x14]
lea edi, [ecx + 0x18]
mov ecx, ebx
sub ecx, eax
add eax, esi
push ecx
push 0
push eax
call sub.msvcrt.dll_memset
add esp, 0xc
lea eax, [ebp - 0x18]
push ebx
mov dword [ebp - 0x10], esi
push esi
push edi
push eax
call fcn.004a83d0
add esp, 0x10
movzx eax, byte [ebp - 0x18]
cmp eax, 4
jne 0x4897b6
mov edx, dword [ebp - 0x14]
cmp edx, ebx
jbe 0x4897cb
push 0x583df4
push 0x29
push 0x583dca
call fcn.004dab10
mov ecx, 1
xor eax, eax
lea edx, [ebp - 0x18]
push eax
push ecx
push esi
push edx
call fcn.004a83d0
add esp, 0x10
movzx eax, byte [ebp - 0x18]
cmp al, 4
jne 0x48979d
movq xmm0, qword [ebp - 0x18]
mov eax, dword [ebp + 8]
movq qword [eax], xmm0
jmp 0x489872
test al, al
jne 0x48978c
cmp dword [ebp - 0x14], 6
jne 0x48978c
mov eax, dword [ebp + 8]
mov dword [eax + 4], 0
jmp 0x48986f
mov ecx, dword [ebp - 0x14]
mov edx, ecx
xor edx, 6
or edx, eax
mov edx, 0
jne 0x48987a
mov eax, dword [ebp - 0x1c]
mov edi, dword [ebp + 0x14]
mov esi, dword [ebp - 0x10]
mov dword [eax + 0xc], 0
mov dword [eax + 0x10], edx
mov dword [eax + 0x14], ebx
xor eax, eax
sub edx, eax
add esi, eax
shl edi, 3
xor ebx, ebx
mov dword [ebp - 0x10], edx
mov edx, dword [ebp + 0x10]
mov ecx, esi
jmp 0x489825
mov esi, ecx
movzx ecx, byte [ecx]
mov byte [eax], cl
mov ecx, dword [ebp - 0x10]
add esi, edi
add ebx, edi
add edx, 8
mov eax, ecx
sub eax, edi
mov edi, dword [ebp - 0x28]
mov dword [ebp - 0x10], eax
add edi, 0xfffffff8
cmp ecx, dword [ebp - 0x24]
mov ecx, esi
jbe 0x489856
test edi, edi
je 0x489856
mov dword [ebp - 0x28], edi
mov esi, dword [edx]
mov edi, dword [ebp - 0x10]
mov eax, dword [edx + 4]
cmp esi, edi
mov dword [ebp - 0x24], esi
cmovb edi, esi
cmp edi, 1
je 0x489800
push edi
push ecx
push eax
mov dword [ebp - 0x20], edx
mov esi, ecx
call sub.msvcrt.dll_memcpy
mov edx, dword [ebp - 0x20]
add esp, 0xc
jmp 0x489807
mov edx, dword [ebp - 0x1c]
mov eax, dword [edx + 0xc]
mov ecx, dword [edx + 0x10]
add eax, ebx
cmp eax, ecx
cmovae eax, ecx
mov dword [edx + 0xc], eax
mov eax, dword [ebp + 8]
mov dword [eax + 4], ebx
mov byte [eax], 4
add esp, 0x1c
pop esi
pop edi
pop ebx
pop ebp
ret
movzx edx, byte [ebp - 0x15]
movzx esi, word [ebp - 0x17]
shl edx, 0x10
or esi, edx
shl esi, 8
or esi, eax
mov eax, dword [ebp + 8]
mov dword [eax], esi
mov dword [eax + 4], ecx
jmp 0x489872