Function at 0x402570
Capabilities:
Encode data using xor

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff0
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
mov eax, 0x3a9e0
call fcn.00405970
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
xor eax, eax
mov dword [ebp - 0x3a9a0], 0
push eax
push eax
push eax
mov word [ebp - 0x3a98c], ax
lea eax, [ebp - 0x3a99c]
push eax
push 0xffffffffffffffff
lea eax, [ebp - 0x3a9a0]
mov dword [ebp - 0x3a99c], 0x10001
push eax
mov dword [ebp - 0x3a998], 0x1f40
mov dword [ebp - 0x3a994], 0x1f40
mov dword [ebp - 0x3a990], 0x80001
call dword [sym.imp.WINMM.dll_waveOutOpen]
push 0x3a980
lea eax, [ebp - 0x3a988]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
xor ecx, ecx
cmp dword [0x4103c8], 6
jl 0x402750
movaps xmm0, xmmword [0x40e5b0]
lea eax, [ecx + 4]
movaps xmm7, xmmword [0x40e520]
movaps xmm6, xmmword [0x40e600]
movups xmm5, xmmword [0x40e500]
movaps xmmword [ebp - 0x3a9e0], xmm0
mov edx, dword [ebp - 0x3a9e0]
nop
movd xmm0, ecx
add ecx, 8
pshufd xmm4, xmm0, 0
paddd xmm4, xmm7
movd xmm0, edx
movaps xmm3, xmm4
movaps xmm2, xmm4
andnps xmm2, xmmword [0x40e620]
pshufb xmm3, xmm5
vpmovzxbw ymm0, xmm0
vpmovzxbw ymm1, xmm3
vpmullw ymm0, ymm1, ymm0
movaps xmm1, xmm2
psrld xmm4, 5
punpckldq xmm1, xmm2
pmuludq xmm1, xmm6
punpckhdq xmm2, xmm2
pmuludq xmm2, xmm6
pshufb xmm4, xmm5
vpmovzxwd zmm0, ymm0
shufps xmm1, xmm2, 0xdd
psrld xmm1, 5
vpmovdb xmm0, zmm0
pshufb xmm1, xmm5
andps xmm4, xmm0
orps xmm1, xmm0
andps xmm4, xmm3
xorps xmm1, xmm4
movd xmm0, eax
pshufd xmm4, xmm0, 0
paddd xmm4, xmm7
movd dword [ebp + eax - 0x3a98c], xmm1
movaps xmm3, xmm4
movd xmm0, edx
pshufb xmm3, xmm5
movaps xmm2, xmm4
psrld xmm4, 5
andnps xmm2, xmmword [0x40e620]
vpmovzxbw ymm0, xmm0
vpmovzxbw ymm1, xmm3
vpmullw ymm0, ymm1, ymm0
movaps xmm1, xmm2
punpckldq xmm1, xmm2
pmuludq xmm1, xmm6
punpckhdq xmm2, xmm2
pmuludq xmm2, xmm6
pshufb xmm4, xmm5
vpmovzxwd zmm0, ymm0
shufps xmm1, xmm2, 0xdd
psrld xmm1, 5
vpmovdb xmm0, zmm0
pshufb xmm1, xmm5
andps xmm4, xmm0
orps xmm1, xmm0
andps xmm4, xmm3
xorps xmm1, xmm4
movd dword [ebp + eax - 0x3a988], xmm1
add eax, 8
cmp eax, 0x3a984
jb 0x402640
jmp 0x402798
mov al, cl
add al, al
lea edx, [eax + ecx]
mov eax, ecx
shr eax, 5
and al, dl
mov byte [ebp - 0x3a9c1], dl
and al, cl
mov edx, ecx
mov dword [ebp - 0x3a9c8], eax
not edx
mov eax, 0x51eb851f
mul edx
mov eax, dword [ebp - 0x3a9c8]
shr edx, 5
or dl, byte [ebp - 0x3a9c1]
xor al, dl
mov byte [ebp + ecx - 0x3a988], al
inc ecx
cmp ecx, 0x3a980
jb 0x402750
lea eax, [ebp - 0x3a988]
mov dword [ebp - 0x3a9bc], 0x3a980
mov dword [ebp - 0x3a9c0], eax
lea eax, [ebp - 0x3a9c0]
push 0x20
push eax
push dword [ebp - 0x3a9a0]
mov dword [ebp - 0x3a9b8], 0
mov dword [ebp - 0x3a9b4], 0
mov dword [ebp - 0x3a9b0], 0
mov dword [ebp - 0x3a9ac], 0
mov dword [ebp - 0x3a9a8], 0
mov dword [ebp - 0x3a9a4], 0
call dword [sym.imp.WINMM.dll_waveOutPrepareHeader]
push 0x20
lea eax, [ebp - 0x3a9c0]
push eax
push dword [ebp - 0x3a9a0]
call dword [sym.imp.WINMM.dll_waveOutWrite]
push 0x20
lea eax, [ebp - 0x3a9c0]
push eax
push dword [ebp - 0x3a9a0]
call dword [sym.imp.WINMM.dll_waveOutUnprepareHeader]
push dword [ebp - 0x3a9a0]
call dword [sym.imp.WINMM.dll_waveOutClose]
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00404b68
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret