Function at 0x408640
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0xc
lea esi, [ecx + 3]
xor edi, edi
and esi, 0xfffffffc
mov eax, esi
sub eax, ecx
sub edx, eax
mov eax, edx
mov dword [esp], edx
mov edx, esi
and eax, 3
cmp esi, ecx
mov esi, 0
je 0x40867e
mov ebp, ecx
xor esi, esi
sub ebp, edx
nop
xor ebx, ebx
cmp byte [ecx], 0xc0
setge bl
inc ecx
add esi, ebx
inc ebp
jne 0x408670
test eax, eax
je 0x40869e
mov ecx, dword [esp]
xor edi, edi
and ecx, 0xfffffffc
add ecx, edx
nop dword [eax]
xor ebx, ebx
cmp byte [ecx], 0xc0
setge bl
inc ecx
add edi, ebx
dec eax
jne 0x408690
mov ecx, dword [esp]
movdqa xmm2, xmmword [0x443280]
add edi, esi
pcmpeqd xmm7, xmm7
mov ebx, edx
shr ecx, 2
jmp 0x4086f4
mov ecx, eax
shr eax, 8
lea ebx, [ebp + esi*4]
and ecx, 0xff00ff
and eax, 0xff00ff
add eax, ecx
mov ecx, edx
mov edi, eax
sub ecx, esi
shl edi, 0x10
add edi, eax
mov eax, esi
shr edi, 0x10
and eax, 3
add edi, dword [esp]
test eax, eax
jne 0x4088b2
mov eax, edi
test ecx, ecx
je 0x40890c
cmp ecx, 0xc0
mov esi, 0xc0
mov ebp, ebx
mov dword [esp], eax
mov edx, ecx
cmovb esi, ecx
xor eax, eax
cmp ecx, 4
jb 0x4086c0
mov edi, esi
xor eax, eax
mov ebx, ebp
shr edi, 2
lea ecx, [edi - 1]
and ecx, 0xfffffff
cmp ecx, 3
jb 0x408867
inc ecx
pxor xmm4, xmm4
mov eax, ecx
mov dword [esp + 8], ecx
mov ecx, ebp
and eax, 0xfffffffc
mov ebx, eax
mov dword [esp + 4], eax
shl ebx, 4
nop
movdqu xmm2, xmmword [ecx]
movdqu xmm1, xmmword [ecx + 0x20]
movdqu xmm0, xmmword [ecx + 0x30]
movdqu xmm5, xmmword [ecx + 0x10]
add ecx, 0x40
add eax, 0xfffffffc
movdqa xmm6, xmm2
pshufd xmm3, xmm2, 0x55
movdqa xmm7, xmm1
punpckhdq xmm2, xmm5
punpckldq xmm6, xmm5
punpckldq xmm7, xmm0
pblendw xmm3, xmm5, 0xc
pshufd xmm5, xmm0, 0xaa
pblendw xmm5, xmm1, 0x3f
punpcklqdq xmm6, xmm7
punpckhdq xmm1, xmm0
pblendw xmm3, xmm7, 0xf0
pcmpeqd xmm7, xmm7
movdqa xmm0, xmm6
pblendw xmm5, xmm2, 0xf
punpckhqdq xmm2, xmm1
movdqa xmm1, xmmword [0x443280]
psrld xmm6, 6
pxor xmm0, xmm7
psrld xmm0, 7
por xmm6, xmm0
pand xmm6, xmm1
paddd xmm6, xmm4
movdqa xmm4, xmm3
psrld xmm3, 6
pxor xmm4, xmm7
psrld xmm4, 7
por xmm3, xmm4
movdqa xmm4, xmm2
psrld xmm2, 6
pand xmm3, xmm1
pxor xmm4, xmm7
paddd xmm3, xmm6
movdqa xmm6, xmm5
psrld xmm4, 7
psrld xmm5, 6
pxor xmm6, xmm7
por xmm2, xmm4
psrld xmm6, 7
pand xmm2, xmm1
por xmm5, xmm6
pand xmm5, xmm1
paddd xmm2, xmm5
movdqa xmm4, xmm2
paddd xmm4, xmm3
jne 0x408750
mov ecx, dword [esp + 4]
pshufd xmm0, xmm4, 0xee
movdqa xmm2, xmmword [0x443280]
paddd xmm0, xmm4
pshufd xmm1, xmm0, 0x55
paddd xmm1, xmm0
cmp dword [esp + 8], ecx
movd eax, xmm1
je 0x4086c0
add ebx, ebp
shl edi, 4
add edi, ebp
nop dword [eax]
movdqu xmm0, xmmword [ebx]
add ebx, 0x10
movdqa xmm1, xmm0
psrld xmm0, 6
pxor xmm1, xmm7
psrld xmm1, 7
por xmm0, xmm1
pand xmm0, xmm2
pshufd xmm1, xmm0, 0xee
paddd xmm1, xmm0
pshufd xmm0, xmm1, 0x55
paddd xmm0, xmm1
movd ecx, xmm0
add eax, ecx
cmp ebx, edi
jne 0x408870
jmp 0x4086c0
and esi, 0xfc
shl eax, 2
xor ecx, ecx
lea edx, [ebp + esi*4]
nop word cs:[eax + eax]
nop dword [eax + eax]
mov esi, dword [edx]
add edx, 4
mov ebx, esi
shr esi, 6
not ebx
shr ebx, 7
or esi, ebx
and esi, 0x1010101
add ecx, esi
add eax, 0xfffffffc
jne 0x4088d0
mov eax, ecx
shr ecx, 8
and eax, 0xff00ff
and ecx, 0xff00ff
add ecx, eax
mov eax, ecx
shl eax, 0x10
add eax, ecx
shr eax, 0x10
add eax, edi
add esp, 0xc
pop esi
pop edi
pop ebx
pop ebp
ret