Function at 0x403c40
Capabilities:
Encode data using xor

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0xc
mov ebp, dword [esp + 0x20]
mov edx, dword [esp + 0x24]
lea ecx, [ebp + 3]
mov eax, edx
and ecx, 0xfffffffc
mov esi, ecx
sub esi, ebp
sub eax, esi
jb 0x403c68
cmp eax, 4
jae 0x403d24
xor ebx, ebx
test edx, edx
je 0x40400c
cmp edx, 8
mov esi, 0
jb 0x403d0b
movdqa xmm2, xmmword [0x7026f0]
movdqa xmm3, xmmword [0x702700]
mov esi, edx
lea eax, [ebp + 4]
pxor xmm0, xmm0
pxor xmm1, xmm1
and esi, 0xfffffff8
mov edi, esi
nop word cs:[eax + eax]
nop dword [eax]
movd xmm5, dword [eax - 4]
movd xmm4, dword [eax]
add eax, 8
add edi, 0xfffffff8
pcmpgtb xmm5, xmm2
pcmpgtb xmm4, xmm2
punpcklbw xmm5, xmm5
punpcklwd xmm5, xmm5
pand xmm5, xmm3
paddd xmm0, xmm5
punpcklbw xmm4, xmm4
punpcklwd xmm4, xmm4
pand xmm4, xmm3
paddd xmm1, xmm4
jne 0x403cb0
paddd xmm1, xmm0
cmp esi, edx
pshufd xmm0, xmm1, 0xee
paddd xmm0, xmm1
pshufd xmm1, xmm0, 0x55
paddd xmm1, xmm0
movd ebx, xmm1
je 0x40400c
sub edx, esi
add ebp, esi
nop
xor eax, eax
cmp byte [ebp], 0xc0
setge al
inc ebp
add ebx, eax
dec edx
jne 0x403d10
jmp 0x40400c
mov edx, eax
mov dword [esp + 4], esi
xor edi, edi
mov esi, 0
and edx, 3
cmp ecx, ebp
mov dword [esp], edx
je 0x403d5e
mov ebx, ebp
xor esi, esi
sub ebx, ecx
mov ecx, ebp
nop word cs:[eax + eax]
nop dword [eax]
xor edx, edx
cmp byte [ecx], 0xc0
setge dl
inc ecx
add esi, edx
inc ebx
jne 0x403d50
mov edx, dword [esp]
add ebp, dword [esp + 4]
mov ebx, esi
test edx, edx
je 0x403d8e
mov esi, eax
xor edi, edi
and esi, 0xfffffffc
add esi, ebp
nop word cs:[eax + eax]
nop
xor ecx, ecx
cmp byte [esi], 0xc0
setge cl
inc esi
add edi, ecx
dec edx
jne 0x403d80
movdqa xmm2, xmmword [0x7026e0]
add edi, ebx
shr eax, 2
pcmpeqd xmm7, xmm7
jmp 0x403de6
mov eax, esi
shr esi, 8
mov ecx, ebp
and eax, 0xff00ff
and esi, 0xff00ff
add esi, eax
mov eax, dword [esp]
mov edi, esi
shl edi, 0x10
add edi, esi
shr edi, 0x10
lea ebp, [ebp + eax*4]
add edi, ebx
mov ebx, eax
mov eax, edx
sub eax, ebx
test bl, 3
jne 0x403fa2
mov ebx, edi
test eax, eax
je 0x40400c
mov edx, eax
cmp eax, 0xc0
mov ecx, 0xc0
cmovb ecx, edx
xor esi, esi
cmp edx, 4
mov dword [esp], ecx
jb 0x403db0
mov ecx, dword [esp]
xor esi, esi
mov edi, ebp
shr ecx, 2
lea eax, [ecx - 1]
and eax, 0xfffffff
cmp eax, 3
jb 0x403f55
inc eax
mov esi, ebp
pxor xmm3, xmm3
mov dword [esp + 4], eax
and eax, 0xfffffffc
mov edi, eax
mov dword [esp + 8], eax
shl edi, 4
add edi, ebp
mov ebp, eax
mov eax, esi
nop word cs:[eax + eax]
nop dword [eax + eax]
movdqu xmm2, xmmword [esi]
movdqu xmm1, xmmword [esi + 0x20]
movdqu xmm4, xmmword [esi + 0x10]
movdqu xmm7, xmmword [esi + 0x30]
add esi, 0x40
add ebp, 0xfffffffc
movdqa xmm5, xmm2
movdqa xmm0, xmm1
punpckhdq xmm1, xmm7
punpckhdq xmm2, xmm4
punpckldq xmm5, xmm4
punpckldq xmm0, xmm7
pcmpeqd xmm7, xmm7
movdqa xmm4, xmm2
punpckhqdq xmm2, xmm1
movdqa xmm6, xmm5
punpckhqdq xmm5, xmm0
punpcklqdq xmm4, xmm1
movdqa xmm1, xmmword [0x7026e0]
punpcklqdq xmm6, xmm0
movdqa xmm0, xmm6
psrld xmm6, 6
pxor xmm0, xmm7
psrld xmm0, 7
por xmm6, xmm0
movdqa xmm0, xmm5
psrld xmm5, 6
pxor xmm0, xmm7
pand xmm6, xmm1
psrld xmm0, 7
paddd xmm6, xmm3
movdqa xmm3, xmm2
psrld xmm2, 6
por xmm5, xmm0
movdqa xmm0, xmm4
pxor xmm3, xmm7
psrld xmm4, 6
pxor xmm0, xmm7
psrld xmm3, 7
pand xmm5, xmm1
psrld xmm0, 7
por xmm2, xmm3
por xmm4, xmm0
pand xmm2, xmm1
pand xmm4, xmm1
movdqa xmm3, xmm2
paddd xmm4, xmm5
paddd xmm4, xmm6
paddd xmm3, xmm4
jne 0x403e50
mov ebp, dword [esp + 8]
pshufd xmm0, xmm3, 0xee
movdqa xmm2, xmmword [0x7026e0]
paddd xmm0, xmm3
pshufd xmm1, xmm0, 0x55
paddd xmm1, xmm0
cmp dword [esp + 4], ebp
movd esi, xmm1
mov ebp, eax
je 0x403db0
shl ecx, 4
add ecx, ebp
nop word [eax + eax]
movdqu xmm0, xmmword [edi]
add edi, 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 eax, xmm0
add esi, eax
cmp edi, ecx
jne 0x403f60
jmp 0x403db0
and ebx, 0xfc
cmp edx, 0xc0
mov esi, 0xc0
cmovb esi, edx
lea eax, [ecx + ebx*4]
xor ecx, ecx
and esi, 3
shl esi, 2
nop word cs:[eax + eax]
nop dword [eax + eax]
mov edx, dword [eax]
add eax, 4
mov ebx, edx
shr edx, 6
not ebx
shr ebx, 7
or edx, ebx
and edx, 0x1010101
add ecx, edx
add esi, 0xfffffffc
jne 0x403fd0
mov eax, ecx
shr ecx, 8
and eax, 0xff00ff
and ecx, 0xff00ff
add ecx, eax
mov ebx, ecx
shl ebx, 0x10
add ebx, ecx
shr ebx, 0x10
add ebx, edi
mov eax, ebx
add esp, 0xc
pop esi
pop edi
pop ebx
pop ebp
ret