Function at 0x10018460
Capabilities:
Encrypt data using rc4 prga

Disassembly:
sub esp, 0x30
push esi
mov esi, dword [esp + 0x3c]
push edi
mov edi, ecx
mov dword [esp + 0x18], edi
cmp esi, 3
jl 0x100187e6
mov ecx, dword [esp + 0x44]
test ecx, 0xff000000
je 0x100187e6
test byte [edi + 0x24], 4
mov eax, dword [edi + 0x2c]
mov edx, dword [eax]
mov eax, dword [eax + 4]
mov dword [esp + 0x2c], edx
mov dword [esp + 0x28], eax
je 0x1001874c
movss xmm0, dword [edi + 0x8c]
lea eax, [esi + esi]
push eax
mov dword [esp + 0xc], eax
and ecx, 0xffffff
imul eax, esi, 9
mov dword [esp + 0x18], ecx
mov ecx, edi
movss dword [esp + 0x20], xmm0
sub eax, 6
push eax
call fcn.1001d1e0
mov eax, dword [edi + 0x28]
push 2
pop edx
mov dword [esp + 0x24], eax
lea ecx, [eax + 1]
mov dword [esp + 0x30], edx
mov dword [esp + 0x10], ecx
movzx ecx, ax
mov eax, dword [edi + 0x38]
lea edx, [ecx + edx*2]
mov word [eax], cx
lea ecx, [edx - 2]
mov eax, dword [edi + 0x38]
mov word [eax + 2], cx
mov eax, dword [edi + 0x38]
mov word [eax + 4], dx
mov edx, dword [esp + 0x30]
add dword [edi + 0x38], 6
inc edx
mov eax, dword [esp + 0x24]
mov dword [esp + 0x30], edx
cmp edx, esi
jl 0x100184e5
mov ecx, dword [edi + 0x2c]
push esi
add ecx, 0x2c
call fcn.1001ee48
mov eax, dword [edi + 0x2c]
xor edx, edx
mov dword [esp + 0x20], edx
mov edi, dword [esp + 0x20]
mov dword [esp + 0x34], edx
mov ecx, dword [eax + 0x34]
lea eax, [esi - 1]
mov edx, dword [esp + 0x3c]
mov dword [esp + 0x30], eax
mov dword [esp + 0xc], ecx
shl eax, 3
movss xmm2, dword [edx + edi*8]
mov esi, edi
subss xmm2, dword [eax + edx]
shl esi, 3
mov dword [esp + 0x20], esi
lea esi, [edx + 4]
movss xmm3, dword [esi + edi*8]
subss xmm3, dword [eax + edx + 4]
movaps xmm0, xmm2
mov dword [esp + 0x3c], esi
mov esi, dword [esp + 0x40]
mulss xmm0, xmm2
movaps xmm1, xmm3
mulss xmm1, xmm3
addss xmm1, xmm0
comiss xmm1, dword [0x1006d0d0]
jbe 0x1001859c
rsqrtss xmm1, xmm1
movaps xmm0, xmm1
mulss xmm3, xmm1
mulss xmm2, xmm0
xorps xmm2, xmmword [0x1006d240]
inc edi
movss dword [eax + ecx], xmm3
movss dword [eax + ecx + 4], xmm2
mov eax, dword [esp + 0x20]
cmp edi, esi
jl 0x10018549
movss xmm6, dword [esp + 0x1c]
mov eax, ecx
movss xmm5, dword [0x1006d0fc]
sub eax, edx
mov edi, dword [esp + 0x18]
xor esi, esi
mov edx, dword [esp + 0x30]
mulss xmm6, xmm5
mov dword [esp + 0x1c], eax
movss xmm0, dword [ecx + esi*8]
mov esi, dword [esp + 0x3c]
addss xmm0, dword [ecx + edx*8]
movss xmm2, dword [eax + esi]
addss xmm2, dword [ecx + edx*8 + 4]
mov esi, dword [esp + 0x34]
movaps xmm3, xmm0
mulss xmm0, xmm0
mulss xmm3, xmm5
movaps xmm4, xmm2
mulss xmm2, xmm2
mulss xmm4, xmm5
addss xmm2, xmm0
mulss xmm2, dword [0x1006d0f0]
comiss xmm2, dword [0x1007289c]
jbe 0x10018642
movss xmm1, dword [0x1006d124]
divss xmm1, xmm2
minss xmm1, dword [0x1006d174]
movaps xmm0, xmm1
mulss xmm4, xmm1
mulss xmm3, xmm0
mov eax, dword [edi + 0x34]
movaps xmm1, xmm6
mov ecx, dword [esp + 0x3c]
movaps xmm2, xmm6
mulss xmm1, xmm3
mulss xmm2, xmm4
movss xmm0, dword [ecx - 4]
subss xmm0, xmm1
movss dword [eax], xmm0
movss xmm0, dword [ecx]
mov eax, dword [edi + 0x34]
subss xmm0, xmm2
mov ecx, dword [esp + 0x2c]
movss dword [eax + 4], xmm0
mov eax, dword [edi + 0x34]
mov dword [eax + 8], ecx
mov ecx, dword [esp + 0x28]
mov dword [eax + 0xc], ecx
mov eax, dword [edi + 0x34]
mov ecx, dword [esp + 0x44]
mov dword [eax + 0x10], ecx
mov eax, dword [edi + 0x34]
mov ecx, dword [esp + 0x3c]
add dword [esp + 0x3c], 8
addss xmm1, dword [ecx - 4]
movss dword [eax + 0x14], xmm1
addss xmm2, dword [ecx]
mov eax, dword [edi + 0x34]
mov ecx, dword [esp + 0x2c]
movss dword [eax + 0x18], xmm2
mov eax, dword [edi + 0x34]
mov dword [eax + 0x1c], ecx
mov ecx, dword [esp + 0x28]
mov dword [eax + 0x20], ecx
mov eax, dword [edi + 0x34]
mov ecx, dword [esp + 0x14]
mov dword [eax + 0x24], ecx
mov eax, dword [esp + 0x24]
add dword [edi + 0x34], 0x28
movzx ecx, ax
mov eax, dword [edi + 0x38]
lea esi, [ecx + esi*2]
mov word [eax], si
lea ecx, [ecx + edx*2]
mov eax, dword [edi + 0x38]
mov word [eax + 2], cx
mov eax, dword [esp + 0x10]
movzx edx, ax
mov eax, dword [esp + 0x30]
lea ecx, [edx + eax*2]
mov eax, dword [edi + 0x38]
mov word [eax + 4], cx
mov eax, dword [edi + 0x38]
mov word [eax + 6], cx
mov eax, dword [esp + 0x34]
lea ecx, [edx + eax*2]
mov eax, dword [edi + 0x38]
mov word [eax + 8], cx
mov eax, dword [edi + 0x38]
mov ecx, dword [esp + 0xc]
mov word [eax + 0xa], si
mov esi, dword [esp + 0x34]
mov edx, esi
add dword [edi + 0x38], 0xc
inc esi
mov eax, dword [esp + 0x1c]
mov dword [esp + 0x30], edx
mov dword [esp + 0x34], esi
cmp esi, dword [esp + 0x40]
jl 0x100185db
mov eax, dword [esp + 8]
movzx eax, ax
jmp 0x100187e3
lea eax, [esi - 2]
mov ecx, edi
imul eax, eax, 3
push esi
push eax
call fcn.1001d1e0
mov dword [esp + 0x24], esi
mov esi, dword [esp + 0x3c]
mov eax, dword [edi + 0x34]
mov ecx, dword [esi]
lea esi, [esi + 8]
mov edx, dword [esi - 4]
mov dword [eax], ecx
mov ecx, dword [esp + 0x2c]
mov dword [eax + 4], edx
mov eax, dword [edi + 0x34]
mov dword [eax + 8], ecx
mov ecx, dword [esp + 0x28]
mov dword [eax + 0xc], ecx
mov eax, dword [edi + 0x34]
mov ecx, dword [esp + 0x44]
mov dword [eax + 0x10], ecx
add dword [edi + 0x34], 0x14
sub dword [esp + 0x24], 1
jne 0x10018763
mov esi, dword [esp + 0x40]
push 2
pop edx
mov dword [esp + 0x44], edx
mov ecx, dword [edi + 0x38]
mov ax, word [edi + 0x28]
movzx edx, dx
mov word [ecx], ax
mov cx, word [edi + 0x28]
mov eax, dword [edi + 0x38]
dec cx
add cx, dx
mov word [eax + 2], cx
mov eax, dword [edi + 0x38]
mov cx, word [edi + 0x28]
add cx, dx
mov edx, dword [esp + 0x44]
mov word [eax + 4], cx
add dword [edi + 0x38], 6
inc edx
mov dword [esp + 0x44], edx
cmp edx, esi
jl 0x100187a4
movzx eax, si
add dword [edi + 0x28], eax
pop edi
pop esi
add esp, 0x30
ret 0xc