Function at 0x404690
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, 0x50c68
call fcn.00407f30
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
xor eax, eax
mov dword [ebp - 0x50c20], 0
push eax
push eax
push eax
mov word [ebp - 0x50c0c], ax
lea eax, [ebp - 0x50c1c]
push eax
push 0xffffffffffffffff
lea eax, [ebp - 0x50c20]
mov dword [ebp - 0x50c1c], 0x10001
push eax
mov dword [ebp - 0x50c18], 0x2b11
mov dword [ebp - 0x50c14], 0x2b11
mov dword [ebp - 0x50c10], 0x80001
call dword [sym.imp.WINMM.dll_waveOutOpen]
push 0x50bfe
lea eax, [ebp - 0x50c08]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
xor esi, esi
cmp dword [0x40a3c8], 5
jl 0x404884
movaps xmm0, xmmword [0x4084a0]
lea eax, [esi + 4]
movaps xmm7, xmmword [0x408360]
movaps xmm6, xmmword [0x4084f0]
movups xmm5, xmmword [0x408350]
movaps xmmword [ebp - 0x50c60], xmm0
mov ecx, dword [ebp - 0x50c60]
movd xmm0, esi
add esi, 8
pshufd xmm4, xmm0, 0
paddd xmm4, xmm7
movaps xmm2, xmm4
psrld xmm2, 2
movaps xmm1, xmm2
movaps xmm0, xmm2
punpckhdq xmm0, xmm2
movaps xmm3, xmm2
punpckldq xmm1, xmm2
pmuludq xmm0, xmm6
pmuludq xmm1, xmm6
shufps xmm1, xmm0, 0xdd
psrld xmm1, 6
movd xmm0, ecx
pmulld xmm1, xmmword [0x4083c0]
psubd xmm3, xmm1
movaps xmm1, xmm2
pshufb xmm1, xmm5
pshufb xmm3, xmm5
xorps xmm1, xmm0
movaps xmm0, xmm2
paddd xmm0, xmm4
orps xmm3, xmm1
paddd xmm0, xmmword [0x408390]
vpsrlvd xmm0, xmm2, xmm0
psrld xmm0, 2
pshufb xmm0, xmm5
xorps xmm3, xmm0
movd xmm0, eax
movd dword [ebp + eax - 0x50c0c], xmm3
pshufd xmm3, xmm0, 0
paddd xmm3, xmm7
movaps xmm2, xmm3
psrld xmm2, 2
movaps xmm1, xmm2
movaps xmm0, xmm2
punpckhdq xmm0, xmm2
movaps xmm4, xmm2
punpckldq xmm1, xmm2
pmuludq xmm0, xmm6
pmuludq xmm1, xmm6
shufps xmm1, xmm0, 0xdd
psrld xmm1, 6
movd xmm0, ecx
pmulld xmm1, xmmword [0x4083c0]
psubd xmm4, xmm1
movaps xmm1, xmm2
pshufb xmm1, xmm5
pshufb xmm4, xmm5
xorps xmm1, xmm0
movaps xmm0, xmm2
paddd xmm0, xmm3
orps xmm4, xmm1
paddd xmm0, xmmword [0x408390]
vpsrlvd xmm0, xmm2, xmm0
psrld xmm0, 2
pshufb xmm0, xmm5
xorps xmm4, xmm0
movd dword [ebp + eax - 0x50c08], xmm4
add eax, 8
cmp eax, 0x50bfc
jb 0x404761
cmp esi, 0x50bfe
jae 0x4048d5
mov edi, 0x63
nop dword [eax]
mov edx, esi
lea ecx, [esi + 8]
shr edx, 2
add ecx, edx
mov dword [ebp - 0x50c24], edx
mov eax, edx
shr eax, cl
shr eax, 2
mov dword [ebp - 0x50c28], eax
mov eax, edx
xor edx, edx
div edi
mov eax, dword [ebp - 0x50c24]
xor al, 0x32
or dl, al
mov eax, dword [ebp - 0x50c28]
xor al, dl
mov byte [ebp + esi - 0x50c08], al
inc esi
cmp esi, 0x50bfe
jb 0x404890
lea eax, [ebp - 0x50c08]
mov dword [ebp - 0x50c44], 0x50bfe
mov dword [ebp - 0x50c48], eax
lea eax, [ebp - 0x50c48]
push 0x20
push eax
push dword [ebp - 0x50c20]
mov dword [ebp - 0x50c40], 0
mov dword [ebp - 0x50c3c], 0
mov dword [ebp - 0x50c38], 0
mov dword [ebp - 0x50c34], 0
mov dword [ebp - 0x50c30], 0
mov dword [ebp - 0x50c2c], 0
call dword [sym.imp.WINMM.dll_waveOutPrepareHeader]
push 0x20
lea eax, [ebp - 0x50c48]
push eax
push dword [ebp - 0x50c20]
call dword [sym.imp.WINMM.dll_waveOutWrite]
push 0x20
lea eax, [ebp - 0x50c48]
push eax
push dword [ebp - 0x50c20]
call dword [sym.imp.WINMM.dll_waveOutUnprepareHeader]
push dword [ebp - 0x50c20]
call dword [sym.imp.WINMM.dll_waveOutClose]
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.004070e1
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret