Function at 0x10049391
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebx
mov ebx, esp
push ecx
push ecx
and esp, 0xfffffff8
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
sub esp, 0x40
mov eax, dword [0x1005f040]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, ecx
push edi
mov dword [ebp - 0x34], esi
test byte [esi + 0x24], 2
mov eax, dword [esi + 0x28]
mov ecx, dword [eax]
mov eax, dword [eax + 4]
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 0x20], eax
je 0x1004969a
mov eax, dword [ebx + 0x10]
and eax, 0xffffff
mov dword [ebp - 0x3c], eax
mov eax, dword [ebx + 0xc]
lea ecx, [eax + eax]
imul eax, eax, 9
push ecx
mov dword [ebp - 0x40], ecx
mov ecx, esi
sub eax, 6
push eax
call fcn.100485f2
mov eax, dword [esi + 0x30]
push 2
pop edi
mov dword [ebp - 0x24], eax
lea ecx, [eax + 1]
mov dword [ebp - 0x28], ecx
cmp dword [ebx + 0xc], edi
jle 0x10049436
movzx ecx, ax
mov dword [ebp - 0xc], ecx
mov eax, dword [esi + 0x38]
lea edx, [ecx + edi*2]
mov word [eax], cx
lea ecx, [edx - 2]
mov eax, dword [esi + 0x38]
mov word [eax + 2], cx
mov eax, dword [esi + 0x38]
mov ecx, dword [ebp - 0xc]
mov word [eax + 4], dx
add dword [esi + 0x38], 6
inc edi
cmp edi, dword [ebx + 0xc]
jl 0x1004940f
mov edi, dword [ebx + 0xc]
mov eax, edi
shl eax, 3
call fcn.100508b0
xor edx, edx
lea eax, [edi - 1]
mov dword [ebp - 0x18], eax
mov ecx, esp
mov dword [ebp - 0x14], edx
mov dword [ebp - 0x10], edx
test edi, edi
jle 0x10049692
movss xmm4, dword [0x1005974c]
mov edx, eax
mov eax, dword [ebx + 8]
mov esi, dword [ebp - 0x10]
shl edx, 3
mov dword [ebp - 8], edx
movss xmm1, dword [eax + esi*8]
mov edi, esi
movss xmm2, dword [eax + esi*8 + 4]
subss xmm1, dword [edx + eax]
subss xmm2, dword [edx + eax + 4]
shl edi, 3
movaps xmm0, xmm1
movss dword [ebp - 0x10], xmm1
movaps xmm3, xmm2
mulss xmm0, xmm1
mulss xmm3, xmm2
movss dword [ebp - 0x2c], xmm2
addss xmm3, xmm0
comiss xmm3, dword [0x100596a0]
jbe 0x100494e0
cvtps2pd xmm0, xmm3
call sub.api_ms_win_crt_math_l1_1_0.dll__libm_sse2_sqrt_precise
movss xmm4, dword [0x1005974c]
mov ecx, esp
movss xmm1, dword [ebp - 0x10]
movaps xmm3, xmm4
movss xmm2, dword [ebp - 0x2c]
mov eax, dword [ebx + 8]
mov edx, dword [ebp - 8]
cvtsd2ss xmm0, xmm0
divss xmm3, xmm0
jmp 0x100494e3
movaps xmm3, xmm4
mulss xmm1, xmm3
inc esi
mulss xmm2, xmm3
xorps xmm1, xmmword [0x1005ab20]
movss dword [edx + ecx + 4], xmm1
movss dword [edx + ecx], xmm2
mov edx, edi
mov edi, dword [ebx + 0xc]
mov dword [ebp - 8], edx
cmp esi, edi
jl 0x10049471
mov edx, dword [ebp - 0x24]
movss xmm5, dword [0x10059720]
mov esi, dword [ebp - 0x34]
movzx edx, dx
mov dword [ebp - 0x24], edx
mov edx, dword [ebp - 0x28]
movzx edx, dx
mov dword [ebp - 0x10], edx
lea edx, [eax + 4]
mov dword [ebp - 8], edx
mov edx, ecx
sub edx, eax
lea eax, [edi - 1]
mov dword [ebp - 0x28], edx
mov edi, dword [ebp - 0x14]
movss xmm2, dword [ecx + edi*8]
mov edi, dword [ebp - 8]
addss xmm2, dword [ecx + eax*8]
movss xmm3, dword [edx + edi]
addss xmm3, dword [ecx + eax*8 + 4]
mov edi, dword [ebx + 0xc]
mulss xmm2, xmm5
mulss xmm3, xmm5
movaps xmm0, xmm2
mulss xmm0, xmm2
movaps xmm1, xmm3
mulss xmm1, xmm3
addss xmm1, xmm0
comiss xmm1, dword [0x100596b8]
jbe 0x1004959a
movaps xmm0, xmm4
divss xmm0, xmm1
movss xmm1, dword [0x10059844]
minss xmm1, xmm0
movaps xmm0, xmm1
mulss xmm3, xmm1
mulss xmm2, xmm0
mov eax, dword [ebp - 8]
mulss xmm2, xmm5
mulss xmm3, xmm5
movss xmm0, dword [eax - 4]
subss xmm0, xmm2
movss dword [ebp - 0x38], xmm0
movss xmm0, dword [eax]
mov eax, dword [esi + 0x34]
subss xmm0, xmm3
mov ecx, dword [ebp - 0x38]
mov dword [eax], ecx
mov ecx, dword [ebp - 0x1c]
movss dword [ebp - 0x34], xmm0
mov edx, dword [ebp - 0x34]
mov dword [eax + 4], edx
mov eax, dword [esi + 0x34]
mov dword [eax + 8], ecx
mov ecx, dword [ebp - 0x20]
mov dword [eax + 0xc], ecx
mov eax, dword [esi + 0x34]
mov ecx, dword [ebx + 0x10]
mov dword [eax + 0x10], ecx
mov eax, dword [ebp - 8]
add dword [ebp - 8], 8
addss xmm2, dword [eax - 4]
addss xmm3, dword [eax]
mov eax, dword [esi + 0x34]
movss dword [ebp - 0x30], xmm2
mov ecx, dword [ebp - 0x30]
mov dword [eax + 0x14], ecx
mov ecx, dword [ebp - 0x1c]
movss dword [ebp - 0x2c], xmm3
mov edx, dword [ebp - 0x2c]
mov dword [eax + 0x18], edx
mov eax, dword [esi + 0x34]
mov dword [eax + 0x1c], ecx
mov ecx, dword [ebp - 0x20]
mov dword [eax + 0x20], ecx
mov eax, dword [esi + 0x34]
mov ecx, dword [ebp - 0x3c]
mov dword [eax + 0x24], ecx
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x24]
add dword [esi + 0x34], 0x28
lea edx, [ecx + eax*2]
mov eax, dword [esi + 0x38]
mov word [eax], dx
mov eax, dword [ebp - 0x18]
lea ecx, [ecx + eax*2]
mov eax, dword [esi + 0x38]
mov word [eax + 2], cx
mov eax, dword [ebp - 0x18]
mov ecx, dword [ebp - 0x10]
lea ecx, [ecx + eax*2]
mov eax, dword [esi + 0x38]
mov word [eax + 4], cx
mov eax, dword [esi + 0x38]
mov word [eax + 6], cx
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0x10]
lea ecx, [ecx + eax*2]
mov eax, dword [esi + 0x38]
mov word [eax + 8], cx
mov eax, dword [esi + 0x38]
mov ecx, dword [ebp - 0x14]
mov word [eax + 0xa], dx
mov eax, ecx
add dword [esi + 0x38], 0xc
inc ecx
mov edx, dword [ebp - 0x28]
cmp ecx, edi
mov dword [ebp - 0x14], ecx
mov ecx, esp
mov dword [ebp - 0x18], eax
jl 0x1004953b
mov eax, dword [ebp - 0x40]
jmp 0x10049729
mov edi, dword [ebx + 0xc]
mov ecx, esi
push edi
lea eax, [edi - 2]
imul eax, eax, 3
push eax
call fcn.100485f2
test edi, edi
jle 0x100496e8
mov dword [ebp - 0xc], edi
mov edi, dword [ebx + 8]
mov eax, dword [esi + 0x34]
mov ecx, dword [edi]
lea edi, [edi + 8]
mov edx, dword [edi - 4]
mov dword [eax], ecx
mov ecx, dword [ebp - 0x1c]
mov dword [eax + 4], edx
mov eax, dword [esi + 0x34]
mov dword [eax + 8], ecx
mov ecx, dword [ebp - 0x20]
mov dword [eax + 0xc], ecx
mov eax, dword [esi + 0x34]
mov ecx, dword [ebx + 0x10]
mov dword [eax + 0x10], ecx
add dword [esi + 0x34], 0x14
sub dword [ebp - 0xc], 1
jne 0x100496b6
mov eax, dword [ebx + 0xc]
push 2
pop edi
cmp eax, edi
jle 0x10049729
mov ecx, dword [esi + 0x38]
mov ax, word [esi + 0x30]
movzx edx, di
mov word [ecx], ax
mov cx, word [esi + 0x30]
mov eax, dword [esi + 0x38]
dec cx
add cx, dx
mov word [eax + 2], cx
mov eax, dword [esi + 0x38]
mov cx, word [esi + 0x30]
add cx, dx
mov word [eax + 4], cx
add dword [esi + 0x38], 6
inc edi
mov eax, dword [ebx + 0xc]
cmp edi, eax
jl 0x100496f2
movzx eax, ax
add dword [esi + 0x30], eax
lea esp, [ebp - 0x48]
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1004caf7
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret 0xc