8. In a square $A B C D$ with side length 8, $M$ is the midpoint of $B C$, and $N$ is a point on side $D A$ such that $D N=3 N A$. If for a constant $m$, there are exactly 6 different points $P$ on the perimeter of square $A B C D$ such that $\overrightarrow{P M} \cdot \overrightarrow{P N}=m$, then the range of the real number $m$ is ( )
A: $(-8,8)$
B: $(-1,24)$
C: $(-1,8)$
D: $\quad(0,8)$
Answer $\mathrm{C}$.
Analysis As shown in the figure, establish a rectangular coordinate system, $A(0,0), M(8,4), N(0,2), P(x, y)$, according to the problem, we have:
$$
\begin{aligned}
\overrightarrow{P M} \cdot \overrightarrow{P N} & =(8-x, 4-y) \cdot(-x, 2-y)=x^{2}-8 x+y^{2}-6 y+8=m \\
& \Leftrightarrow(x-4)^{2}+(y-3)^{2}=m+17
\end{aligned}
$$

That is, a circle with $(4,3)$ as the center and $\sqrt{m+17}$ as the radius intersects the four sides of the square at exactly 6 different points. It is easy to see from the graph that
$$
4<\sqrt{m+17}<5 \Rightarrow m \in(-1,0)
$$