Function at 0x490c90
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x1c
mov ebp, dword [esp + 0x34]
mov eax, dword [ebp]
cmp eax, 6
ja case.0x490cb0.29
mov esi, ecx
mov edi, dword [esp + 0x30]
mov dword [esp], edx
jmp dword [eax*4 + 0x5eb5a8]
mov eax, dword [ebp + 4]
cmp eax, 8
je 0x4910d0
cmp eax, 0x10
jne 0x4910ed
test edx, edx
je case.0x490cb0.29
mov eax, dword [ebp + 0x10]
xor ecx, ecx
jmp 0x490d00
shl edx, 8
movzx ebx, byte [edi + ecx*2 + 1]
or ebx, edx
cmp ebx, dword [ebp + 0x14]
sete dl
dec dl
mov byte [esi + ecx*4 + 3], dl
inc ecx
cmp dword [esp], ecx
je case.0x490cb0.29
movzx edx, byte [edi + ecx*2]
mov byte [esi + ecx*4 + 2], dl
mov byte [esi + ecx*4 + 1], dl
mov byte [esi + ecx*4], dl
test eax, eax
jne 0x490ce0
xor edx, edx
jmp 0x490cf0
cmp dword [ebp + 4], 8
jne 0x490e1a
test edx, edx
je case.0x490cb0.29
xor ebx, ebx
nop dword [eax + eax]
lea eax, [ebx + ebx*2]
add eax, edi
push 3
push eax
push esi
call fcn.004af000
mov ecx, dword [esp + 0xc]
add esp, 0xc
mov byte [esi + 3], 0xff
inc ebx
add esi, 4
cmp ebx, ecx
jne 0x490d30
cmp dword [ebp + 0x10], 0
je case.0x490cb0.29
test ecx, ecx
je case.0x490cb0.29
neg ecx
jmp 0x490d77
inc ecx
je case.0x490cb0.29
movzx eax, byte [esi + ecx*4]
cmp dword [ebp + 0x14], eax
jne 0x490d70
movzx eax, byte [esi + ecx*4 + 1]
cmp dword [ebp + 0x18], eax
jne 0x490d70
movzx eax, byte [esi + ecx*4 + 2]
cmp dword [ebp + 0x1c], eax
jne 0x490d70
mov byte [esi + ecx*4 + 3], 0
jmp 0x490d70
cmp dword [ebp + 4], 8
jne 0x490eb7
test edx, edx
je case.0x490cb0.29
xor ebx, ebx
nop
movzx eax, byte [edi + ebx]
shl eax, 2
add eax, dword [ebp + 8]
push 4
push eax
push esi
call fcn.004af000
add esp, 0xc
inc ebx
add esi, 4
cmp dword [esp], ebx
jne 0x490db0
jmp case.0x490cb0.29
cmp dword [ebp + 4], 8
jne 0x490fb7
test edx, edx
je case.0x490cb0.29
mov eax, edx
and eax, 3
xor ecx, ecx
cmp edx, 4
jae 0x49121f
mov ebx, edi
jmp 0x4912a8
cmp dword [ebp + 4], 8
jne 0x491030
shl edx, 2
push edx
push edi
push esi
call fcn.004af000
add esp, 0x28
jmp 0x491397
test edx, edx
je case.0x490cb0.29
mov eax, dword [ebp + 0x10]
mov dword [esp + 4], eax
add edi, 5
xor ecx, ecx
jmp 0x490e4d
xor eax, eax
mov ebx, dword [esp]
mov edi, edx
mov ebp, dword [esp + 0x34]
dec al
mov byte [esi + ecx*4 + 3], al
inc ecx
add edi, 6
cmp ebx, ecx
je case.0x490cb0.29
movzx eax, byte [edi - 5]
mov byte [esi + ecx*4], al
movzx ebx, byte [edi - 3]
mov byte [esi + ecx*4 + 1], bl
movzx edx, byte [edi - 1]
mov byte [esi + ecx*4 + 2], dl
cmp dword [esp + 4], 0
je 0x490eb0
mov dword [esp + 8], edx
shl eax, 8
mov edx, edi
movzx edi, byte [edi - 4]
or edi, eax
cmp edi, dword [ebp + 0x14]
jne 0x490e30
shl ebx, 8
movzx eax, byte [edx - 2]
or eax, ebx
mov ebp, dword [esp + 0x34]
cmp eax, dword [ebp + 0x18]
mov edi, edx
jne 0x490eb0
mov edx, dword [esp + 8]
shl edx, 8
movzx eax, byte [edi]
or eax, edx
cmp eax, dword [ebp + 0x1c]
sete al
jmp 0x490eb2
xor eax, eax
mov ebx, dword [esp]
jmp 0x490e3b
test edx, edx
je case.0x490cb0.29
xor ebx, ebx
mov dword [esp + 8], 0
jmp 0x490efb
add dword [esp + 8], ecx
mov ebp, dword [esp + 0x34]
mov ebx, dword [esp + 0xc]
shl edx, 2
add edx, dword [ebp + 8]
push 4
push edx
push esi
call fcn.004af000
add esp, 0xc
inc ebx
add esi, 4
cmp ebx, dword [esp]
je case.0x490cb0.29
mov ecx, dword [ebp + 4]
test ecx, ecx
je 0x490fb0
mov dword [esp + 0xc], ebx
xor edx, edx
mov eax, dword [esp + 8]
mov dword [esp + 4], ecx
cmp ecx, 1
je 0x490f78
mov ebp, dword [esp + 4]
and ebp, 0xfffffffe
xor edx, edx
mov eax, dword [esp + 8]
nop word cs:[eax + eax]
mov ecx, eax
shr ecx, 3
movzx ebx, byte [edi + ecx]
mov ecx, eax
not cl
and cl, 7
shr ebx, cl
lea ecx, [eax + 1]
and ebx, 1
add ebx, ebx
lea ebx, [ebx + edx*4]
mov edx, ecx
shr edx, 3
mov edi, dword [esp + 0x30]
movzx edi, byte [edi + edx]
not cl
movzx ecx, cl
and ecx, 7
xor edx, edx
bt edi, ecx
mov edi, dword [esp + 0x30]
setb dl
or edx, ebx
add eax, 2
add ebp, 0xfffffffe
jne 0x490f30
mov ecx, dword [esp + 4]
test cl, 1
je 0x490ed0
mov ecx, eax
shr ecx, 3
movzx ecx, byte [edi + ecx]
not al
movzx eax, al
and eax, 7
xor ebx, ebx
bt ecx, eax
mov ecx, dword [esp + 4]
setb bl
lea edx, [ebx + edx*2]
jmp 0x490ed0
xor edx, edx
jmp 0x490edc
test edx, edx
je case.0x490cb0.29
xor eax, eax
cmp edx, 1
je 0x491013
mov ecx, edx
and ecx, 0xfffffffe
xor eax, eax
xor edx, edx
nop
movzx ebx, byte [edi + edx*4]
mov byte [esi + edx*4 + 2], bl
mov byte [esi + edx*4 + 1], bl
mov byte [esi + edx*4], bl
movzx ebx, byte [edi + edx*4 + 2]
mov byte [esi + edx*4 + 3], bl
movzx ebx, byte [edi + edx*4 + 4]
mov byte [esi + edx*4 + 6], bl
mov byte [esi + edx*4 + 5], bl
mov byte [esi + edx*4 + 4], bl
movzx ebx, byte [edi + edx*4 + 6]
mov byte [esi + edx*4 + 7], bl
add edx, 2
add eax, 0xfffffff8
cmp ecx, edx
jne 0x490fd0
sub esi, eax
neg eax
mov edx, dword [esp]
test dl, 1
je case.0x490cb0.29
movzx ecx, byte [edi + eax]
mov byte [esi + 2], cl
mov byte [esi + 1], cl
mov byte [esi], cl
or eax, 2
jmp 0x4910c4
test edx, edx
je case.0x490cb0.29
xor eax, eax
cmp edx, 1
je 0x491099
mov ecx, edx
and ecx, 0xfffffffe
xor eax, eax
nop word cs:[eax + eax]
movzx edx, byte [edi + eax]
mov byte [esi], dl
movzx edx, byte [edi + eax + 2]
mov byte [esi + 1], dl
movzx edx, byte [edi + eax + 4]
mov byte [esi + 2], dl
movzx edx, byte [edi + eax + 6]
mov byte [esi + 3], dl
movzx edx, byte [edi + eax + 8]
mov byte [esi + 4], dl
movzx edx, byte [edi + eax + 0xa]
mov byte [esi + 5], dl
movzx edx, byte [edi + eax + 0xc]
mov byte [esi + 6], dl
movzx edx, byte [edi + eax + 0xe]
mov byte [esi + 7], dl
add esi, 8
add eax, 0x10
add ecx, 0xfffffffe
jne 0x491050
test byte [esp], 1
je case.0x490cb0.29
movzx ecx, byte [edi + eax]
mov byte [esi], cl
mov ecx, eax
or ecx, 2
movzx ecx, byte [edi + ecx]
mov byte [esi + 1], cl
mov ecx, eax
or ecx, 4
movzx ecx, byte [edi + ecx]
mov byte [esi + 2], cl
or eax, 6
movzx eax, byte [edi + eax]
mov byte [esi + 3], al
jmp case.0x490cb0.29
test edx, edx
je case.0x490cb0.29
mov eax, edx
and eax, 3
cmp edx, 4
jae 0x4912e4
xor ecx, ecx
jmp 0x491340
mov ebx, 0xffffffff
mov dword [esp + 4], eax
mov ecx, dword [esp + 4]
shl ebx, cl
mov dword [esp + 0x10], ebx
mov ecx, dword [esp + 4]
test edx, edx
je case.0x490cb0.29
not dword [esp + 0x10]
mov eax, dword [ebp + 0x10]
mov dword [esp + 0x18], eax
mov eax, ecx
and eax, 0xfffffffe
mov dword [esp + 0x14], eax
xor edx, edx
mov dword [esp + 0xc], 0
jmp 0x49114c
mov eax, dword [esp]
mov edx, dword [esp + 8]
dec cl
mov byte [esi + 3], cl
inc edx
add esi, 4
cmp edx, eax
mov ecx, dword [esp + 4]
je case.0x490cb0.29
mov dword [esp + 8], edx
test ecx, ecx
je 0x4911f0
mov eax, dword [esp + 0xc]
mov ebx, 0
cmp ecx, 1
je 0x4911b9
xor ebx, ebx
mov edx, dword [esp + 0x14]
mov eax, dword [esp + 0xc]
mov ecx, eax
shr ecx, 3
movzx ebp, byte [edi + ecx]
mov ecx, eax
not cl
and cl, 7
shr ebp, cl
lea ecx, [eax + 1]
and ebp, 1
add ebp, ebp
lea ebp, [ebp + ebx*4]
mov ebx, ecx
shr ebx, 3
mov edi, dword [esp + 0x30]
movzx edi, byte [edi + ebx]
not cl
movzx ecx, cl
and ecx, 7
xor ebx, ebx
bt edi, ecx
mov edi, dword [esp + 0x30]
setb bl
or ebx, ebp
add eax, 2
add edx, 0xfffffffe
jne 0x491170
mov ecx, dword [esp + 4]
test cl, 1
je 0x4911e2
mov ecx, eax
shr ecx, 3
movzx ecx, byte [edi + ecx]
not al
movzx eax, al
and eax, 7
xor edx, edx
bt ecx, eax
mov ecx, dword [esp + 4]
setb dl
lea ebx, [edx + ebx*2]
add dword [esp + 0xc], ecx
mov ebp, dword [esp + 0x34]
jmp 0x4911f2
mov ebx, ecx
mov eax, ebx
shl eax, 8
sub eax, ebx
xor ecx, ecx
xor edx, edx
div dword [esp + 0x10]
mov byte [esi + 2], al
mov byte [esi + 1], al
mov byte [esi], al
cmp dword [esp + 0x18], 0
je 0x491130
cmp ebx, dword [ebp + 0x14]
sete cl
jmp 0x491130
and edx, 0xfffffffc
xor ecx, ecx
pxor xmm0, xmm0
mov ebx, edi
nop word [eax + eax]
mov edi, edx
movzx edx, word [ebx + ecx*2]
movd xmm1, edx
punpcklbw xmm1, xmm0
pshuflw xmm1, xmm1, 0x40
packuswb xmm1, xmm1
movd dword [esi], xmm1
movzx edx, word [ebx + ecx*2 + 2]
movd xmm1, edx
punpcklbw xmm1, xmm0
pshuflw xmm1, xmm1, 0x40
packuswb xmm1, xmm1
movd dword [esi + 4], xmm1
movzx edx, word [ebx + ecx*2 + 4]
movd xmm1, edx
punpcklbw xmm1, xmm0
pshuflw xmm1, xmm1, 0x40
packuswb xmm1, xmm1
movd dword [esi + 8], xmm1
movzx edx, word [ebx + ecx*2 + 6]
movd xmm1, edx
mov edx, edi
punpcklbw xmm1, xmm0
pshuflw xmm1, xmm1, 0x40
packuswb xmm1, xmm1
movd dword [esi + 0xc], xmm1
add ecx, 4
add esi, 0x10
cmp edi, ecx
jne 0x491230
test eax, eax
je case.0x490cb0.29
lea ecx, [ebx + ecx*2]
xor edx, edx
pxor xmm0, xmm0
nop dword [eax]
movzx edi, word [ecx + edx*2]
movd xmm1, edi
punpcklbw xmm1, xmm0
pshuflw xmm1, xmm1, 0x40
packuswb xmm1, xmm1
movd dword [esi + edx*4], xmm1
inc edx
cmp eax, edx
jne 0x4912c0
jmp case.0x490cb0.29
and edx, 0xfffffffc
xor ecx, ecx
nop dword [eax]
movzx ebx, byte [edi + ecx]
mov byte [esi + 2], bl
mov byte [esi + 1], bl
mov byte [esi], bl
mov byte [esi + 3], 0xff
movzx ebx, byte [edi + ecx + 1]
mov byte [esi + 6], bl
mov byte [esi + 5], bl
mov byte [esi + 4], bl
mov byte [esi + 7], 0xff
movzx ebx, byte [edi + ecx + 2]
mov byte [esi + 0xa], bl
mov byte [esi + 9], bl
mov byte [esi + 8], bl
mov byte [esi + 0xb], 0xff
movzx ebx, byte [edi + ecx + 3]
mov byte [esi + 0xe], bl
mov byte [esi + 0xd], bl
mov byte [esi + 0xc], bl
mov byte [esi + 0xf], 0xff
add ecx, 4
add esi, 0x10
cmp edx, ecx
jne 0x4912f0
test eax, eax
je 0x491368
add edi, ecx
xor ecx, ecx
nop dword [eax + eax]
movzx edx, byte [edi + ecx]
mov byte [esi + 2], dl
mov byte [esi + 1], dl
mov byte [esi], dl
mov byte [esi + 3], 0xff
add esi, 4
inc ecx
cmp eax, ecx
jne 0x491350
cmp dword [ebp + 0x10], 0
mov edx, dword [esp]
je case.0x490cb0.29
test edx, edx
je case.0x490cb0.29
lea eax, [edx*4]
sub esi, eax
cmp edx, 1
jne 0x49139c
test dl, 1
je case.0x490cb0.29
movzx eax, byte [esi]
cmp dword [ebp + 0x14], eax
jne case.0x490cb0.29
mov byte [esi + 3], 0
add esp, 0x1c
pop esi
pop edi
pop ebx
pop ebp
ret
mov eax, edx
and eax, 0xfffffffe
jmp 0x4913b8
add esi, 8
add eax, 0xfffffffe
je 0x491383
movzx ecx, byte [esi]
cmp dword [ebp + 0x14], ecx
jne 0x4913c4
mov byte [esi + 3], 0
movzx ecx, byte [esi + 4]
cmp dword [ebp + 0x14], ecx
jne 0x4913b0
mov byte [esi + 7], 0
jmp 0x4913b0