12. (1) According to the problem, we have
$$
O A=m, O B=n, O C=t \text {. }
$$

From $\angle A C B=90^{\circ}, O C \perp A B$, we get
$$
O A \cdot O B=O C^{2} \Rightarrow m n=t^{2} \text {. }
$$

From the given equation, we have
$$
\begin{array}{l}
m^{2}+n^{2}+t^{2}=13(m+n-t) . \\
\text { Also, } m^{2}+n^{2}+t^{2} \\
=(m+n+t)^{2}-2(m n+n t+t m) \\
=(m+n+t)(m+n-t),
\end{array}
$$
$$
\text { Therefore, }(m+n+t)(m+n-t)=13(m+n-t) \text {. }
$$

From the given, $m+n-t \neq 0$, thus,
$$
m+n+t=13 \text {. }
$$
(2) From $m n=t^{2}, m+n=13-t(m0 \\
\Rightarrow(3 t-13)(t+13)<0 \\
\Rightarrow-13<t<\frac{13}{3} .
\end{array}
$$

Since $t$ is a positive integer, we have $t=1,2,3,4$.
When $t=1,2,4$, we get the equations respectively
$$
\begin{array}{l}
x^{2}-12 x+1=0, \\
x^{2}-11 x+4=0, \\
x^{2}-9 x+16=0,
\end{array}
$$

None of the above equations have integer solutions;
When $t=3$, we get the equation
$$
x_{1}^{2}-10 x+9=0 \text {, }
$$

Solving it, we get $m=1, n=9$.
Thus, $t=3, m=1, n=9$.
Therefore, the points are $A(-1,0), B(9,0), C(0,3)$.
Assume the quadratic function is
$$
y=a(x+1)(x-9) \text {. }
$$

Substituting the coordinates of point $C(0,3)$ into the above equation, we get
$$
a=-\frac{1}{3} \text {. }
$$

Hence, $y=-\frac{1}{3}(x+1)(x-9)$
$$
\Rightarrow y=-\frac{1}{3} x^{2}+\frac{8}{3} x+3 \text {. }
$$
12. Given that $m, n, t (m<n)$ are all positive integers, points $A(-m, 0), B(n, 0), C(0, t)$, and $O$ is the origin. Suppose $\angle A C B=90^{\circ}$, and
$$
O A^{2}+O B^{2}+O C^{2}=13(O A+O B-O C) \text {. }
$$
(1) Find the value of $m+n+t$;
(2) If the graph of a quadratic function passes through points $A, B, C$, find the expression of this quadratic function.