Function at 0x490a4d
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1018
call fcn.006021b0
mov eax, dword [0x6b55d0]
push ebx
push esi
push edi
mov ebx, 0x400
push ebx
mov dword [ebp - 4], eax
lea eax, [ebp - 0x404]
push 0
push eax
call fcn.006007e0
movzx esi, byte [ebp + 0x10]
movzx eax, word [ebp + 0xe]
add esp, 0xc
xor edx, edx
mov ecx, edx
shl ecx, 2
inc edx
cmp edx, 0xff
mov byte [ebp + ecx - 0x804], 0
mov byte [ebp + ecx - 0x803], 0
mov byte [ebp + ecx - 0x802], 0
mov byte [ebp + ecx - 0x801], 0xff
jl 0x490a86
imul eax, esi
push 8
pop ecx
cdq
idiv ecx
push eax
lea eax, [ebp - 0x804]
push eax
push dword [ebp + 0x1c]
call fcn.005a6990
add esp, 0xc
cmp esi, 0x18
jne 0x490b14
mov esi, 0xff
lea ecx, [ebp - 0x506]
mov dl, byte [ecx - 1]
mov eax, esi
shl eax, 2
mov byte [ebp + eax - 0x404], dl
mov dl, byte [ecx]
mov byte [ebp + eax - 0x403], dl
mov dl, byte [ecx + 1]
dec esi
sub ecx, 3
test esi, esi
mov byte [ebp + eax - 0x402], dl
mov byte [ebp + eax - 0x401], 0xff
jge 0x490ae0
jmp 0x490b2b
push ebx
lea eax, [ebp - 0x804]
push eax
lea eax, [ebp - 0x404]
push eax
call fcn.006004a0
add esp, 0xc
movzx eax, word [ebp + 0x18]
movzx edi, word [ebp + 0x16]
imul edi, eax
push edi
call fcn.0042392e
xor esi, esi
test edi, edi
pop ecx
mov dword [ebp - 0xc14], eax
jle 0x490bfc
mov ebx, 0x80
push 1
lea eax, [ebp - 0xc0c]
push eax
push dword [ebp + 0x1c]
call fcn.005a6990
add esp, 0xc
test byte [ebp - 0xc0c], bl
je 0x490bc7
push 1
lea eax, [ebp - 0xc0b]
push eax
push dword [ebp + 0x1c]
call fcn.005a6990
movzx eax, byte [ebp - 0xc0c]
cdq
mov ecx, ebx
idiv ecx
and dword [ebp - 0xc08], 0
add esp, 0xc
inc edx
test edx, edx
jle 0x490bef
mov al, byte [ebp - 0xc0b]
mov ecx, dword [ebp - 0xc14]
mov byte [ecx + esi], al
movzx eax, byte [ebp - 0xc0c]
cdq
mov ecx, ebx
idiv ecx
inc esi
inc dword [ebp - 0xc08]
inc edx
cmp dword [ebp - 0xc08], edx
jl 0x490b9a
jmp 0x490bef
movzx eax, byte [ebp - 0xc0c]
inc eax
push eax
mov eax, dword [ebp - 0xc14]
add eax, esi
push eax
push dword [ebp + 0x1c]
call fcn.005a6990
movzx eax, byte [ebp - 0xc0c]
add esp, 0xc
lea esi, [esi + eax + 1]
cmp esi, edi
jl 0x490b52
mov ebx, 0x400
test byte [ebp + 0x1b], 0x20
jne 0x490c70
movzx eax, word [ebp + 0x18]
mov esi, eax
shr esi, 1
test esi, esi
jle 0x490c70
movzx edx, word [ebp + 0x16]
mov ecx, dword [ebp - 0xc14]
mov dword [ebp - 0xc08], ecx
mov ecx, edx
neg ecx
dec eax
imul eax, edx
add eax, dword [ebp - 0xc14]
mov dword [ebp - 0xc18], esi
test edx, edx
jle 0x490c5c
mov esi, dword [ebp - 0xc08]
mov edi, eax
mov dword [ebp - 0xc10], edx
movzx edx, byte [esi]
mov bl, byte [edi]
mov byte [esi], bl
inc esi
mov byte [edi], dl
inc edi
dec dword [ebp - 0xc10]
jne 0x490c44
mov ebx, 0x400
movzx edx, word [ebp + 0x16]
add dword [ebp - 0xc08], edx
add eax, ecx
dec dword [ebp - 0xc18]
jne 0x490c32
push ebx
lea eax, [ebp - 0xc04]
push 0
push eax
mov dword [ebp - 0xc10], 8
call fcn.006007e0
or eax, 0xffffffff
mov ecx, 0x100
lea edi, [ebp - 0x1018]
rep stosd dword es:[edi], eax
movzx eax, word [ebp + 0x18]
add esp, 0xc
xor esi, esi
test eax, eax
jle 0x490d3b
mov ecx, dword [ebp - 0xc14]
mov dword [ebp - 0xc08], ecx
mov dword [ebp - 0xc18], eax
movzx eax, word [ebp + 0x16]
xor edi, edi
test eax, eax
jle 0x490d28
mov eax, dword [ebp - 0xc08]
movzx eax, byte [eax + edi]
shl eax, 2
lea ecx, [ebp + eax - 0x1018]
cmp dword [ecx], 0xffffffff
jne 0x490d1f
mov dl, byte [ebp + eax - 0x404]
mov dword [ecx], esi
mov ecx, esi
shl ecx, 2
mov byte [ebp + ecx - 0xc04], dl
mov dl, byte [ebp + eax - 0x403]
mov byte [ebp + ecx - 0xc03], dl
mov dl, byte [ebp + eax - 0x402]
mov al, byte [ebp + eax - 0x401]
mov byte [ebp + ecx - 0xc02], dl
mov byte [ebp + ecx - 0xc01], al
inc esi
movzx eax, word [ebp + 0x16]
inc edi
cmp edi, eax
jl 0x490cc6
add dword [ebp - 0xc08], eax
dec dword [ebp - 0xc18]
jne 0x490cbc
cmp esi, 0x10
jg 0x490d8f
push ebx
lea eax, [ebp - 0xc04]
push eax
lea eax, [ebp - 0x404]
push eax
mov dword [ebp - 0xc10], 4
call fcn.006004a0
movzx eax, word [ebp + 0x18]
add esp, 0xc
test eax, eax
jle 0x490d8f
mov esi, dword [ebp - 0xc14]
mov edi, eax
movzx edx, word [ebp + 0x16]
test edx, edx
jle 0x490d86
mov ecx, esi
movzx eax, byte [ecx]
mov al, byte [ebp + eax*4 - 0x1018]
mov byte [ecx], al
inc ecx
dec edx
jne 0x490d76
movzx ecx, word [ebp + 0x16]
add esi, ecx
dec edi
jne 0x490d6c
movzx eax, word [ebp + 0x18]
push dword [ebp - 0xc10]
push eax
movzx eax, word [ebp + 0x16]
push eax
call fcn.0059e590
mov esi, eax
push esi
call fcn.0059e650
mov ecx, dword [esi + 0x18]
add esp, 0x10
cmp dword [ebp - 0xc10], 4
mov ebx, 0x100
jne 0x490dc3
push 0x10
pop ebx
and dword [ebp - 0xc08], 0
test ebx, ebx
jle 0x490e1d
lea edx, [ebp - 0x404]
lea edi, [ebp - 0x403]
sub edx, ecx
lea eax, [ecx + 2]
sub edi, ecx
mov cl, byte [edx + eax]
mov byte [eax - 2], cl
mov ecx, dword [ebp - 0xc08]
mov cl, byte [ebp + ecx*4 - 0x403]
mov byte [eax - 1], cl
mov ecx, dword [ebp - 0xc08]
mov cl, byte [ebp + ecx*4 - 0x404]
inc dword [ebp - 0xc08]
mov byte [eax], cl
mov cl, byte [edi + eax]
mov byte [eax + 1], cl
add eax, 4
cmp dword [ebp - 0xc08], ebx
jl 0x490de1
mov eax, dword [esi + 0x10]
mov ecx, dword [esi + 0x14]
mov dword [ebp - 0xc08], eax
movzx eax, word [ebp + 0x18]
test eax, eax
jle 0x490e6d
mov ebx, dword [ebp - 0xc14]
mov dword [ebp - 0xc10], ecx
mov dword [ebp - 0xc18], eax
movzx edi, word [ebp + 0x16]
push edi
push ebx
push dword [ebp - 0xc10]
call fcn.006004a0
mov eax, dword [ebp - 0xc08]
add dword [ebp - 0xc10], eax
add esp, 0xc
add ebx, edi
dec dword [ebp - 0xc18]
jne 0x490e43
cmp dword [ebp - 0xc14], 0
je 0x490e82
push dword [ebp - 0xc14]
call fcn.0042396e
pop ecx
mov ecx, dword [ebp - 4]
pop edi
mov eax, esi
pop esi
pop ebx
call fcn.006009d4
leave
ret