Function at 0x10170280
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x44
push ebx
push esi
push edi
mov ecx, dword [ebp + 0xc]
mov ax, 1
pxor mm0, mm0
movd mm1, eax
movzx ax, byte [ebp + 0x18]
movq mm2, mm1
punpcklwd mm2, mm1
movq mm1, mm2
punpcklwd mm2, mm1
movq mm1, mm2
movd mm2, eax
movq mm3, mm2
punpcklwd mm3, mm2
movq mm2, mm3
punpcklwd mm3, mm2
neg eax
movq mm2, mm3
movd mm3, eax
mov ax, word [ebp + 0x14]
test ax, ax
mov bx, word [ebp + 0x10]
movq mm4, mm3
punpcklwd mm4, mm3
movq mm3, mm4
punpcklwd mm4, mm3
mov dword [esp + 0x14], ecx
movq mm3, mm4
jle 0x101704b7
mov edx, dword [ebp + 8]
movsx esi, bx
add esi, 0xfffffff0
sub edx, ecx
lea edi, [ecx + 8]
movzx ecx, ax
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], ecx
xor ecx, ecx
test esi, esi
lea eax, [edx + edi]
jle 0x101704a3
mov edx, edi
movq mm4, qword [eax - 1]
movq mm5, qword [eax]
movq mm6, qword [eax + 1]
movq qword [esp + 0x20], mm6
movq mm6, mm4
movq mm7, mm0
punpckhbw mm6, mm7
movq qword [esp + 0x18], mm6
movq mm6, mm0
punpcklbw mm4, mm6
movq qword [esp + 0x28], mm4
movq mm4, mm5
punpckhbw mm4, mm6
movq mm6, mm4
movq qword [esp + 0x40], mm6
movq mm4, mm0
punpcklbw mm5, mm4
movq qword [esp + 0x30], mm5
movq mm4, qword [esp + 0x20]
movq mm5, mm4
punpckhbw mm5, mm7
punpcklbw mm4, mm7
movq qword [esp + 0x38], mm4
movq mm4, qword [esp + 0x18]
movq mm7, mm6
psubw mm4, mm7
movq qword [esp + 0x48], mm5
psubw mm5, mm6
movq mm6, mm4
movq mm7, mm3
pcmpgtw mm6, mm7
movq mm7, mm2
pcmpgtw mm7, mm4
pand mm6, mm7
movq mm4, mm6
movq mm6, mm5
movq mm7, mm3
pcmpgtw mm6, mm7
movq mm7, mm2
pcmpgtw mm7, mm5
pand mm6, mm7
movq mm5, mm6
pand mm4, mm5
movq mm5, qword [esp + 0x18]
movq mm6, mm4
pand mm5, mm6
movq mm6, mm5
movq mm5, qword [esp + 0x40]
movq mm7, mm5
paddw mm7, mm5
paddw mm6, mm7
movq mm5, mm6
movq mm6, qword [esp + 0x48]
pand mm6, mm4
movq qword [esp + 0x20], mm4
movq mm4, mm6
paddw mm5, mm4
psraw mm5, 2
movq qword [esp + 0x18], mm5
movq mm4, qword [esp + 0x28]
movq mm5, qword [esp + 0x30]
movq mm6, mm5
psubw mm4, mm6
movq mm6, qword [esp + 0x38]
psubw mm6, mm5
movq mm5, mm6
movq mm6, mm4
movq mm7, mm3
pcmpgtw mm6, mm7
movq mm7, mm2
pcmpgtw mm7, mm4
pand mm6, mm7
movq mm4, mm6
movq mm6, mm5
movq mm7, mm3
pcmpgtw mm6, mm7
movq mm7, mm2
pcmpgtw mm7, mm5
pand mm6, mm7
movq mm5, mm6
pand mm4, mm5
movq mm5, qword [esp + 0x28]
movq mm6, mm4
pand mm5, mm6
movq mm6, mm5
movq mm5, qword [esp + 0x30]
movq mm7, mm5
paddw mm7, mm5
paddw mm6, mm7
movq mm5, mm6
movq mm6, qword [esp + 0x38]
movq mm7, mm4
pand mm6, mm7
paddw mm5, mm6
psraw mm5, 2
movq mm6, mm1
pand mm4, mm6
pxor mm4, mm6
paddw mm4, mm6
pmullw mm5, mm4
movq mm4, qword [esp + 0x18]
movq mm6, qword [esp + 0x20]
movq mm7, mm1
pand mm6, mm7
add ecx, 8
pxor mm6, mm7
paddw mm6, mm7
pmullw mm4, mm6
movsx ebx, cx
packuswb mm5, mm4
movq qword [edx], mm5
add eax, 8
add edx, 8
cmp ebx, esi
jl 0x10170310
mov edx, dword [esp + 0x10]
mov bx, word [ebp + 0x10]
movsx eax, bx
add edi, eax
sub dword [esp + 0xc], 1
jne 0x10170301
mov ax, word [ebp + 0x14]
mov ecx, 1
movsx esi, ax
sub esi, ecx
cmp esi, ecx
mov dword [esp + 0xc], ecx
mov dword [esp + 0x10], esi
jle 0x101706a2
movsx edx, bx
mov eax, edx
imul eax, ecx
mov ecx, dword [esp + 0x14]
add eax, ecx
test bx, bx
jle 0x1017068c
mov di, bx
sub di, 1
mov ecx, eax
shr di, 3
sub ecx, edx
add di, 1
mov esi, eax
movzx edi, di
movq mm4, qword [ecx]
movq mm5, qword [eax]
movq mm6, qword [edx + eax]
movq qword [esp + 0x20], mm6
movq mm6, mm4
movq mm7, mm0
punpckhbw mm6, mm7
movq qword [esp + 0x18], mm6
movq mm6, mm0
punpcklbw mm4, mm6
movq qword [esp + 0x28], mm4
movq mm4, mm5
punpckhbw mm4, mm6
movq mm6, mm4
movq qword [esp + 0x40], mm6
movq mm4, mm0
punpcklbw mm5, mm4
movq qword [esp + 0x30], mm5
movq mm4, qword [esp + 0x20]
movq mm5, mm4
punpckhbw mm5, mm7
punpcklbw mm4, mm7
movq qword [esp + 0x38], mm4
movq mm4, qword [esp + 0x18]
movq mm7, mm6
psubw mm4, mm7
movq qword [esp + 0x48], mm5
psubw mm5, mm6
movq mm6, mm4
movq mm7, mm3
pcmpgtw mm6, mm7
movq mm7, mm2
pcmpgtw mm7, mm4
pand mm6, mm7
movq mm4, mm6
movq mm6, mm5
movq mm7, mm3
pcmpgtw mm6, mm7
movq mm7, mm2
pcmpgtw mm7, mm5
pand mm6, mm7
movq mm5, mm6
pand mm4, mm5
movq mm5, qword [esp + 0x18]
movq mm6, mm4
pand mm5, mm6
movq mm6, mm5
movq mm5, qword [esp + 0x40]
movq mm7, mm5
paddw mm7, mm5
paddw mm6, mm7
movq mm5, mm6
movq mm6, qword [esp + 0x48]
pand mm6, mm4
movq qword [esp + 0x20], mm4
movq mm4, mm6
paddw mm5, mm4
psraw mm5, 2
movq qword [esp + 0x18], mm5
movq mm4, qword [esp + 0x28]
movq mm5, qword [esp + 0x30]
movq mm6, mm5
psubw mm4, mm6
movq mm6, qword [esp + 0x38]
psubw mm6, mm5
movq mm5, mm6
movq mm6, mm4
movq mm7, mm3
pcmpgtw mm6, mm7
movq mm7, mm2
pcmpgtw mm7, mm4
pand mm6, mm7
movq mm4, mm6
movq mm6, mm5
movq mm7, mm3
pcmpgtw mm6, mm7
movq mm7, mm2
pcmpgtw mm7, mm5
pand mm6, mm7
movq mm5, mm6
pand mm4, mm5
movq mm5, qword [esp + 0x28]
movq mm6, mm4
pand mm5, mm6
movq mm6, mm5
movq mm5, qword [esp + 0x30]
movq mm7, mm5
paddw mm7, mm5
paddw mm6, mm7
movq mm5, mm6
movq mm6, qword [esp + 0x38]
movq mm7, mm4
pand mm6, mm7
paddw mm5, mm6
psraw mm5, 2
movq mm6, mm1
pand mm4, mm6
pxor mm4, mm6
paddw mm4, mm6
pmullw mm5, mm4
movq mm4, qword [esp + 0x18]
movq mm6, qword [esp + 0x20]
movq mm7, mm1
pand mm6, mm7
pxor mm6, mm7
paddw mm6, mm7
pmullw mm4, mm6
packuswb mm5, mm4
movq qword [esi], mm5
add eax, 8
add ecx, 8
add esi, 8
sub edi, 1
jne 0x10170500
mov esi, dword [esp + 0x10]
mov eax, dword [esp + 0xc]
add eax, 1
movsx ecx, ax
cmp ecx, esi
mov dword [esp + 0xc], eax
jl 0x101704d4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret