Function at 0x10218230
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push ebp
mov ebp, esp
and esp, 0xffffffc0
mov eax, 0x1034
call fcn.102b1730
mov eax, dword [0x1036900c]
xor eax, esp
mov dword [esp + 0x1030], eax
push ebx
push esi
mov esi, ecx
cvttss2si ecx, xmm1
push edi
mov dword [esp + 0x34], esi
mov dword [esi], ecx
test ecx, ecx
jg 0x10218281
mov eax, SysStringLen
imul ecx
add edx, ecx
sar edx, 0x1e
mov eax, edx
shr eax, 0x1f
add eax, edx
imul eax, eax, 0x7ffffffe
sub eax, ecx
lea ecx, [eax + 1]
mov dword [esi], ecx
cmp ecx, 0x7ffffffe
jle 0x1021828f
mov dword [esi], SysReAllocString
lea eax, [esi + 0x104]
mov dword [esp + 0x18], 4
lea edi, [esi + 4]
mov dword [esp + 0x20], eax
mov dword [esp + 0x28], edi
mov ebx, eax
nop word [eax + eax]
xor eax, eax
mov dword [esp + 0x1c], eax
mov byte [edi + eax], al
mov ecx, 0x1f31d
mov eax, dword [esi]
cdq
idiv ecx
imul eax, eax, 0xb14
imul ecx, edx, 0x41a7
sub ecx, eax
test ecx, ecx
lea eax, [ecx + 0x7fffffff]
cmovg eax, ecx
mov dword [esi], eax
and eax, 0x800001ff
jns 0x102182ec
dec eax
or eax, 0xfffffe00
inc eax
mov word [ebx], ax
mov ecx, 0x1f31d
mov eax, dword [esi]
cdq
idiv ecx
imul eax, eax, 0xb14
imul ecx, edx, 0x41a7
sub ecx, eax
test ecx, ecx
lea eax, [ecx + 0x7fffffff]
cmovg eax, ecx
mov dword [esi], eax
and eax, 0x800001ff
jns 0x10218322
dec eax
or eax, 0xfffffe00
inc eax
mov word [ebx + 2], ax
add ebx, 4
mov eax, dword [esp + 0x1c]
inc eax
mov dword [esp + 0x1c], eax
cmp eax, 0x100
jl 0x102182b6
sub dword [esp + 0x18], 1
jne 0x102182b0
lea ecx, [esi + 0x103]
mov dword [esp + 0x1c], 0xff
mov dword [esp + 0x18], ecx
nop word [eax + eax]
mov bl, byte [ecx]
mov ecx, 0x1f31d
mov eax, dword [esi]
cdq
idiv ecx
imul ecx, edx, 0x41a7
imul eax, eax, 0xb14
sub ecx, eax
test ecx, ecx
lea edx, [ecx + 0x7fffffff]
cmovg edx, ecx
mov dword [esi], edx
and edx, 0x800000ff
jns 0x10218397
dec edx
or edx, 0xffffff00
inc edx
mov ecx, dword [esp + 0x18]
mov al, byte [edi + edx]
mov byte [ecx], al
dec ecx
sub dword [esp + 0x1c], 1
mov byte [edi + edx], bl
mov dword [esp + 0x18], ecx
jne 0x10218360
lea eax, [esp + 0x334]
xor edx, edx
sub eax, esi
lea ecx, [esi + 0x504]
mov dword [esp + 0x18], eax
lea eax, [esp + 0x336]
mov ebx, dword [esp + 0x18]
sub eax, esi
mov dword [esp + 0x1c], eax
lea eax, [esp + 0x734]
mov edi, dword [esp + 0x1c]
sub eax, esi
mov dword [esp + 0x2c], eax
lea eax, [esp + 0x736]
sub eax, esi
mov esi, dword [esp + 0x2c]
mov dword [esp + 0x30], eax
nop word [eax + eax]
movzx eax, word [ecx - 0x400]
lea ecx, [ecx + 4]
mov word [esp + edx*4 + 0x38], ax
movzx eax, word [ecx - 0x402]
mov word [esp + edx*4 + 0x3a], ax
movzx eax, word [ecx - 4]
mov word [esp + edx*4 + 0x438], ax
movzx eax, word [ecx - 2]
mov word [esp + edx*4 + 0x43a], ax
inc edx
movzx eax, word [ecx + 0x3fc]
mov word [ebx + ecx - 4], ax
movzx eax, word [ecx + 0x3fe]
mov ebx, dword [esp + 0x30]
mov word [edi + ecx - 4], ax
movzx eax, word [ecx + 0x7fc]
mov word [esi + ecx - 4], ax
movzx eax, word [ecx + 0x7fe]
mov word [ebx + ecx - 4], ax
mov ebx, dword [esp + 0x18]
cmp edx, 0x100
jl 0x10218400
mov esi, dword [esp + 0x34]
xor ecx, ecx
mov edi, dword [esp + 0x28]
mov edx, 0x100
movzx eax, byte [edi]
lea edi, [edi + 1]
lea ecx, [ecx + 4]
movzx eax, word [esp + eax*4 + 0x38]
mov word [ecx + esi + 0x100], ax
movzx eax, byte [edi - 1]
movzx eax, word [esp + eax*4 + 0x3a]
mov word [ecx + esi + 0x102], ax
movzx eax, byte [edi - 1]
movzx eax, word [esp + eax*4 + 0x438]
mov word [ecx + esi + 0x500], ax
movzx eax, byte [edi - 1]
movzx eax, word [esp + eax*4 + 0x43a]
mov word [ecx + esi + 0x502], ax
movzx eax, byte [edi - 1]
movzx eax, word [esp + eax*4 + 0x838]
mov word [ecx + esi + 0x900], ax
movzx eax, byte [edi - 1]
movzx eax, word [esp + eax*4 + 0x83a]
mov word [ecx + esi + 0x902], ax
movzx eax, byte [edi - 1]
movzx eax, word [esp + eax*4 + 0xc38]
mov word [ecx + esi + 0xd00], ax
movzx eax, byte [edi - 1]
movzx eax, word [esp + eax*4 + 0xc3a]
mov word [ecx + esi + 0xd02], ax
sub edx, 1
jne 0x10218483
movss xmm0, dword [0x102fefac]
add esi, 0x1104
mov ebx, dword [esp + 0x20]
xorps xmm4, xmm4
mov dword [esp + 0x18], 4
nop dword [eax + eax]
mov edi, 0x100
nop word [eax + eax]
movzx eax, word [ebx]
sub eax, 0x100
movd xmm1, eax
movzx eax, word [ebx + 2]
sub eax, 0x100
cvtdq2ps xmm1, xmm1
movd xmm2, eax
cvtdq2ps xmm2, xmm2
mulss xmm1, xmm0
mulss xmm2, xmm0
movaps xmm0, xmm1
movss dword [esp + 0x28], xmm1
mulss xmm0, xmm1
movaps xmm3, xmm2
movss dword [esp + 0x20], xmm2
mulss xmm3, xmm2
addss xmm3, xmm0
movss xmm0, dword [0x102fef78]
comiss xmm0, xmm3
jb 0x102185c2
movss xmm3, dword [0x102ff0b0]
xorps xmm1, xmm1
xorps xmm0, xmm0
jmp 0x10218632
movaps xmm0, xmm3
mulss xmm0, xmm4
ucomiss xmm0, xmm0
lahf
test ah, 0x44
jp 0x102185ef
cvtps2pd xmm0, xmm3
call sub.api_ms_win_crt_math_l1_1_0.dll__libm_sse2_sqrt_precise
movss xmm3, dword [0x102ff0b0]
cvtsd2ss xmm0, xmm0
movaps xmm2, xmm3
divss xmm2, xmm0
jmp 0x1021861e
cvtps2pd xmm1, xmm1
cvtps2pd xmm0, xmm2
mulsd xmm1, xmm1
mulsd xmm0, xmm0
addsd xmm0, xmm1
call sub.api_ms_win_crt_math_l1_1_0.dll__libm_sse2_sqrt_precise
movsd xmm1, qword [0x102ff180]
divsd xmm1, xmm0
movss xmm3, dword [0x102ff0b0]
cvtpd2ps xmm2, xmm1
movss xmm1, dword [esp + 0x20]
movss xmm0, dword [esp + 0x28]
mulss xmm1, xmm2
mulss xmm0, xmm2
movss dword [esi], xmm0
sub esp, 8
addss xmm0, xmm3
movss dword [esi + 4], xmm1
mulss xmm0, dword [0x102ff390]
addss xmm0, dword [0x102ff070]
cvtps2pd xmm0, xmm0
movsd qword [esp + 0x28], xmm0
fld qword [esp + 0x28]
fstp qword [esp]
call sub.api_ms_win_crt_math_l1_1_0.dll_floor
fstp qword [esp + 0x28]
movsd xmm0, qword [esp + 0x28]
cvtpd2ps xmm0, xmm0
cvttss2si eax, xmm0
mov word [ebx], ax
movss xmm0, dword [esi + 4]
addss xmm0, dword [0x102ff0b0]
mulss xmm0, dword [0x102ff390]
addss xmm0, dword [0x102ff070]
cvtps2pd xmm0, xmm0
movsd qword [esp + 0x28], xmm0
fld qword [esp + 0x28]
fstp qword [esp]
call sub.api_ms_win_crt_math_l1_1_0.dll_floor
fstp qword [esp + 0x28]
movsd xmm0, qword [esp + 0x28]
add esp, 8
cvtpd2ps xmm0, xmm0
add esi, 8
xorps xmm4, xmm4
cvttss2si eax, xmm0
movss xmm0, dword [0x102fefac]
mov word [ebx + 2], ax
add ebx, 4
sub edi, 1
jne 0x10218560
sub dword [esp + 0x18], 1
jne 0x10218550
mov ecx, dword [esp + 0x103c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.102af895
mov esp, ebp
pop ebp
ret