Function at 0x10021790
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
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 [0x1004400c]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
mov edi, dword [ebx + 0xc]
mov esi, ecx
mov dword [ebp - 0x30], esi
cmp edi, 3
jl 0x10021b31
test byte [esi + 0x24], 2
mov eax, dword [esi + 0x28]
movss xmm0, dword [eax]
movss dword [ebp - 0x28], xmm0
movss xmm0, dword [eax + 4]
movss dword [ebp - 0x18], xmm0
je 0x10021a98
mov eax, dword [ebx + 0x10]
and eax, 0xffffff
mov dword [ebp - 0x34], eax
lea eax, [edi + edi]
push eax
mov dword [ebp - 0x3c], eax
lea eax, [edi*8 - 6]
add eax, edi
push eax
call fcn.10020a40
mov eax, dword [esi + 0x34]
movzx edx, ax
mov dword [ebp - 0x20], edx
lea ecx, [eax + 1]
movzx eax, dx
mov dword [ebp - 0x14], ecx
mov ecx, 2
mov dword [ebp - 0xc], ecx
mov dword [ebp - 0x10], eax
mov eax, dword [esi + 0x3c]
mov word [eax], dx
lea edx, [edx + ecx*2]
mov eax, dword [esi + 0x3c]
lea ecx, [edx - 2]
mov word [eax + 2], cx
mov eax, dword [esi + 0x3c]
mov ecx, dword [ebp - 0xc]
inc ecx
mov dword [ebp - 0xc], ecx
mov word [eax + 4], dx
add dword [esi + 0x3c], 6
mov edx, dword [ebp - 0x20]
cmp ecx, edi
jl 0x10021824
mov eax, dword [ebp - 0x10]
movzx eax, ax
mov dword [ebp - 0x38], eax
lea eax, [edi*8]
call fcn.10036800
movss xmm4, dword [0x1004174c]
lea eax, [edi - 1]
mov edx, dword [ebx + 8]
xor ecx, ecx
mov dword [ebp - 0x1c], eax
xorps xmm5, xmm5
shl eax, 3
mov dword [ebp - 0x20], ecx
mov dword [ebp - 8], eax
nop dword [eax]
nop dword [eax + eax]
movss xmm0, dword [edx + ecx*8]
lea edi, [edx + 4]
movss xmm2, dword [edx + ecx*8 + 4]
lea esi, [ecx*8]
subss xmm0, dword [eax + edx]
subss xmm2, dword [eax + edx + 4]
mov dword [ebp - 0x10], edi
movaps xmm1, xmm0
movss dword [ebp - 0x2c], xmm0
movaps xmm3, xmm2
mulss xmm1, xmm0
mulss xmm3, xmm2
movss dword [ebp - 0x24], xmm2
addss xmm3, xmm1
comiss xmm3, xmm5
jbe 0x10021908
movaps xmm0, xmm3
call fcn.10001350
movss xmm4, dword [0x1004174c]
xorps xmm5, xmm5
movaps xmm1, xmm4
movss xmm2, dword [ebp - 0x24]
divss xmm1, xmm0
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0x20]
mov edx, dword [ebx + 8]
movaps xmm0, xmm1
mulss xmm2, xmm1
mulss xmm0, dword [ebp - 0x2c]
xorps xmm0, xmmword [0x10041c60]
mov edi, esp
inc ecx
mov dword [ebp - 0x20], ecx
movss dword [eax + edi], xmm2
movss dword [eax + edi + 4], xmm0
mov eax, esi
mov dword [ebp - 8], eax
cmp ecx, dword [ebx + 0xc]
jl 0x10021890
movss xmm5, dword [0x10041720]
xor eax, eax
mov esi, dword [ebp - 0x30]
mov dword [ebp - 8], eax
mov eax, edi
mov ecx, eax
sub ecx, edx
xor edx, edx
mov dword [ebp - 0x24], ecx
mov ecx, dword [ebp - 0x10]
nop dword [eax]
movss xmm2, dword [eax + edx*8]
mov edi, dword [ebp - 0x1c]
addss xmm2, dword [eax + edi*8]
mov edi, dword [ebp - 0x24]
movss xmm3, dword [edi + ecx]
mov edi, dword [ebp - 0x1c]
mulss xmm2, xmm5
addss xmm3, dword [eax + edi*8 + 4]
movaps xmm0, xmm2
mov eax, dword [esi + 0x38]
mulss xmm0, xmm2
mov edi, dword [ebx + 0x10]
mulss xmm3, xmm5
movaps xmm1, xmm3
mulss xmm1, xmm3
addss xmm1, xmm0
movaps xmm0, xmm5
maxss xmm0, xmm1
divss xmm4, xmm0
movss xmm0, dword [ecx - 4]
movaps xmm1, xmm4
mulss xmm4, xmm3
mulss xmm1, xmm2
movss xmm2, dword [ebp - 0x18]
mulss xmm4, xmm5
mulss xmm1, xmm5
subss xmm0, xmm1
movss dword [eax], xmm0
movss xmm0, dword [ecx]
mov eax, dword [esi + 0x38]
subss xmm0, xmm4
movss dword [eax + 4], xmm0
mov eax, dword [esi + 0x38]
movss xmm0, dword [ebp - 0x28]
movss dword [eax + 8], xmm0
movss dword [eax + 0xc], xmm2
mov eax, dword [esi + 0x38]
mov dword [eax + 0x10], edi
addss xmm1, dword [ecx - 4]
mov eax, dword [esi + 0x38]
mov edi, dword [ebp - 0x1c]
movss dword [eax + 0x14], xmm1
addss xmm4, dword [ecx]
mov eax, dword [esi + 0x38]
mov ecx, dword [ebp - 0x34]
movss dword [eax + 0x18], xmm4
mov eax, dword [esi + 0x38]
movss dword [eax + 0x1c], xmm0
movss dword [eax + 0x20], xmm2
mov eax, dword [esi + 0x38]
mov dword [eax + 0x24], ecx
mov eax, dword [esi + 0x3c]
mov ecx, dword [ebp - 0x38]
add dword [esi + 0x38], 0x28
lea edx, [ecx + edx*2]
mov word [eax], dx
lea ecx, [ecx + edi*2]
mov eax, dword [esi + 0x3c]
mov word [eax + 2], cx
mov ecx, dword [ebp - 0x14]
movzx eax, cx
lea ecx, [eax + edi*2]
mov eax, dword [esi + 0x3c]
mov edi, dword [ebp - 0x14]
mov word [eax + 4], cx
mov eax, dword [esi + 0x3c]
mov word [eax + 6], cx
mov eax, dword [ebp - 8]
movzx ecx, di
lea ecx, [ecx + eax*2]
mov eax, dword [esi + 0x3c]
mov word [eax + 8], cx
mov eax, dword [esi + 0x3c]
mov ecx, dword [ebp - 0x10]
mov word [eax + 0xa], dx
mov edx, dword [ebp - 8]
add dword [esi + 0x3c], 0xc
mov dword [ebp - 0x1c], edx
inc edx
mov dword [ebp - 8], edx
add ecx, 8
mov eax, esp
movss xmm4, dword [0x1004174c]
mov dword [ebp - 0x10], ecx
cmp edx, dword [ebx + 0xc]
jl 0x10021950
mov eax, dword [ebp - 0x3c]
movzx eax, ax
jmp 0x10021b2e
lea eax, [edi - 2]
push edi
lea eax, [eax + eax*2]
push eax
call fcn.10020a40
movss xmm0, dword [ebp - 0x28]
movss xmm1, dword [ebp - 0x18]
mov dword [ebp - 0x14], edi
mov edi, dword [ebx + 8]
mov eax, dword [esi + 0x38]
lea edi, [edi + 8]
mov ecx, dword [edi - 8]
mov edx, dword [edi - 4]
mov dword [eax], ecx
mov ecx, dword [ebx + 0x10]
mov dword [eax + 4], edx
mov eax, dword [esi + 0x38]
movss dword [eax + 8], xmm0
movss dword [eax + 0xc], xmm1
mov eax, dword [esi + 0x38]
mov dword [eax + 0x10], ecx
add dword [esi + 0x38], 0x14
sub dword [ebp - 0x14], 1
jne 0x10021ab5
mov edi, dword [ebx + 0xc]
mov edx, 2
mov dword [ebp - 0x18], edx
mov ecx, dword [esi + 0x3c]
mov ax, word [esi + 0x34]
movzx edx, dx
mov word [ecx], ax
movzx ecx, word [esi + 0x34]
mov eax, dword [esi + 0x3c]
dec cx
add cx, dx
mov word [eax + 2], cx
movzx ecx, word [esi + 0x34]
mov eax, dword [esi + 0x3c]
add cx, dx
mov edx, dword [ebp - 0x18]
inc edx
mov dword [ebp - 0x18], edx
mov word [eax + 4], cx
add dword [esi + 0x3c], 6
cmp edx, edi
jl 0x10021af1
movzx eax, di
add dword [esi + 0x34], eax
lea esp, [ebp - 0x48]
pop edi
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.1003568d
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret 0xc