Function at 0x408380
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
push ebx
push edi
push esi
and esp, 0xfffffff0
sub esp, 0x40
mov eax, dword [ecx + 0x30]
mov edi, edx
movzx edx, byte [ecx + 0x80]
mov ebx, dword [ebp + 8]
mov dword [esp + 8], ecx
test edx, edx
not eax
je 0x408467
mov ecx, 0x40
mov dword [esp + 4], edx
sub ecx, edx
mov edx, ebx
sub edx, ecx
jbe 0x4083d0
mov esi, edx
shr edx, 6
and esi, 0x3f
cmp esi, 1
sbb edx, 0xffffffff
cmp edx, eax
ja 0x408484
mov edx, dword [esp + 8]
mov eax, dword [esp + 4]
mov esi, edx
lea eax, [edx + eax + 0x40]
mov edx, ebx
sub edx, ecx
mov dword [esp + 0xc], edx
jae 0x40849f
test ebx, ebx
je 0x40845c
xor ecx, ecx
cmp ebx, 0x10
jb 0x408450
mov edx, dword [esp + 4]
mov ecx, ebx
and ecx, 0xfffffff0
lea esi, [edx + esi + 0x48]
xor edx, edx
nop word cs:[eax + eax]
movq xmm0, qword [edi + edx]
movq xmm2, qword [esi + edx - 8]
movq xmm1, qword [edi + edx + 8]
movq xmm3, qword [esi + edx]
pxor xmm2, xmm0
pxor xmm3, xmm1
movq qword [edi + edx], xmm2
movq qword [edi + edx + 8], xmm3
add edx, 0x10
cmp ecx, edx
jne 0x408410
mov esi, dword [esp + 8]
cmp ecx, ebx
je 0x40845c
nop dword [eax + eax]
movzx edx, byte [eax + ecx]
xor byte [edi + ecx], dl
inc ecx
cmp ebx, ecx
jne 0x408450
add bl, byte [esp + 4]
mov edx, ebx
jmp 0x40852f
mov ecx, ebx
xor edx, edx
and ecx, 0x3f
mov dword [esp + 4], ecx
mov ecx, ebx
setne dl
shr ecx, 6
add edx, ecx
cmp edx, eax
jbe 0x408551
lea eax, [esp + 0x13]
push 0x57a8c0
push 0x57a804
push eax
push 0x2b
push 0x57a7d8
call fcn.004dafa0
mov edx, dword [esp + 4]
xor ebx, ebx
cmp dl, 0x38
ja 0x408784
xor ebx, ebx
cmp dl, 0x20
ja 0x4084fd
mov ebx, ecx
lea edx, [edx + esi + 0x50]
xor esi, esi
and ebx, 0xffffffe0
movdqu xmm0, xmmword [edi + esi]
movdqu xmm2, xmmword [edx + esi - 0x10]
movdqu xmm1, xmmword [edi + esi + 0x10]
movdqu xmm3, xmmword [edx + esi]
pxor xmm2, xmm0
pxor xmm3, xmm1
movdqu xmmword [edi + esi], xmm2
movdqu xmmword [edi + esi + 0x10], xmm3
add esi, 0x20
cmp ebx, esi
jne 0x4084c0
cmp ecx, ebx
je 0x40853d
test cl, 0x18
je 0x408784
mov edx, ebx
mov ebx, ecx
and ebx, 0xfffffff8
nop word cs:[eax + eax]
nop
movq xmm0, qword [edi + edx]
movq xmm1, qword [eax + edx]
pxor xmm1, xmm0
movq qword [edi + edx], xmm1
add edx, 8
cmp ebx, edx
jne 0x408510
jmp 0x40877c
mov byte [esi + 0x80], dl
lea esp, [ebp - 0xc]
pop esi
pop edi
pop ebx
pop ebp
ret
mov ebx, dword [esp + 0xc]
add edi, ecx
mov ecx, ebx
mov eax, ebx
shr ecx, 6
and eax, 0x3f
mov dword [esp + 4], eax
lea eax, [esp + 0x14]
mov dword [esp + 0x14], edi
mov dword [esp + 0x18], edi
mov dword [esp + 0x1c], ecx
push eax
mov esi, dword [esp + 0xc]
push esi
call fcn.004051c0
add esp, 8
mov edx, dword [esp + 4]
test edx, edx
je 0x40852f
mov eax, dword [0x5000b0]
and ebx, 0xffffffc0
mov dword [esp + 0xc], ebx
lea ebx, [esi + 0x40]
movzx eax, byte [eax]
cmp al, 1
jne 0x4085b2
mov ecx, esi
mov esi, edx
mov edx, ebx
call fcn.004053d0
mov edx, esi
mov esi, dword [esp + 8]
add edi, dword [esp + 0xc]
xor eax, eax
cmp edx, 8
jae 0x408712
jmp 0x408796
movdqu xmm4, xmmword [esi]
movdqu xmm2, xmmword [esi + 0x10]
movdqu xmm0, xmmword [esi + 0x30]
movdqu xmm7, xmmword [esi + 0x20]
mov eax, 0xa
movdqa xmm6, xmm4
movdqa xmm3, xmm2
movdqa xmm5, xmm0
movdqa xmmword [esp + 0x20], xmm7
nop dword [eax]
paddd xmm6, xmm3
dec eax
pxor xmm5, xmm6
movdqa xmm1, xmm5
pslld xmm5, 0x10
psrld xmm1, 0x10
por xmm5, xmm1
paddd xmm7, xmm5
pxor xmm3, xmm7
movdqa xmm1, xmm3
pslld xmm3, 0xc
psrld xmm1, 0x14
por xmm3, xmm1
paddd xmm6, xmm3
pxor xmm5, xmm6
pshufd xmm6, xmm6, 0x93
movdqa xmm1, xmm5
pslld xmm5, 8
psrld xmm1, 0x18
por xmm5, xmm1
paddd xmm7, xmm5
pshufd xmm5, xmm5, 0x4e
pxor xmm3, xmm7
pshufd xmm7, xmm7, 0x39
movdqa xmm1, xmm3
pslld xmm3, 7
psrld xmm1, 0x19
por xmm3, xmm1
paddd xmm6, xmm3
pxor xmm5, xmm6
movdqa xmm1, xmm5
pslld xmm5, 0x10
psrld xmm1, 0x10
por xmm5, xmm1
paddd xmm7, xmm5
pxor xmm3, xmm7
movdqa xmm1, xmm3
pslld xmm3, 0xc
psrld xmm1, 0x14
por xmm3, xmm1
paddd xmm6, xmm3
pxor xmm5, xmm6
pshufd xmm6, xmm6, 0x39
movdqa xmm1, xmm5
pslld xmm5, 8
psrld xmm1, 0x18
por xmm5, xmm1
paddd xmm7, xmm5
pshufd xmm5, xmm5, 0x4e
pxor xmm3, xmm7
pshufd xmm7, xmm7, 0x93
movdqa xmm1, xmm3
pslld xmm3, 7
psrld xmm1, 0x19
por xmm3, xmm1
jne 0x4085e0
paddd xmm7, xmmword [esp + 0x20]
movd eax, xmm0
paddd xmm6, xmm4
paddd xmm3, xmm2
paddd xmm5, xmm0
inc eax
movdqu xmmword [esi + 0x40], xmm6
movdqu xmmword [esi + 0x50], xmm3
movdqu xmmword [esi + 0x60], xmm7
movdqu xmmword [esi + 0x70], xmm5
mov dword [esi + 0x30], eax
add edi, dword [esp + 0xc]
xor eax, eax
cmp edx, 8
jb 0x408796
xor eax, eax
cmp edx, 0x20
jb 0x40874f
movdqu xmm0, xmmword [edi]
movdqu xmm2, xmmword [esi + 0x40]
movdqu xmm1, xmmword [edi + 0x10]
movdqu xmm3, xmmword [esi + 0x50]
mov eax, edx
and eax, 0xffffffe0
cmp edx, eax
pxor xmm2, xmm0
pxor xmm3, xmm1
movdqu xmmword [edi], xmm2
movdqu xmmword [edi + 0x10], xmm3
je 0x40852f
test dl, 0x18
je 0x408796
mov ecx, eax
mov eax, edx
and eax, 0xfffffff8
nop word cs:[eax + eax]
movq xmm0, qword [edi + ecx]
movq xmm1, qword [ebx + ecx]
pxor xmm1, xmm0
movq qword [edi + ecx], xmm1
add ecx, 8
cmp eax, ecx
jne 0x408760
jmp 0x40878e
cmp ecx, ebx
je 0x40853d
movzx edx, byte [eax + ebx]
xor byte [edi + ebx], dl
inc ebx
jmp 0x40877c
cmp edx, eax
je 0x40852f
movzx ecx, byte [ebx + eax]
xor byte [edi + eax], cl
inc eax
jmp 0x40878e