  Let $E \subset \mathbb{Z}^N$ be a set of positive upper Banach density and
let $\Gamma < \operatorname{GL}_N(\mathbb{Z})$ be a finitely generated,
strongly irreducible subgroup whose Zariski closure in
$\operatorname{GL}_N(\mathbb{R})$ is a Zariski connected semisimple group with
no compact factors. Let $Y$ be any set and suppose that $\Psi : \mathbb{Z}^N
\rightarrow Y$ is a $\Gamma$-invariant function. We prove that for every
positive integer $m$, there exists a positive integer $k$ with the property
that for every finite set $F \subset \mathbb{Z}^N$ with $|F| = m$, we have \[
\Psi(kF) \subset \Psi(E-b) \quad \textrm{for some $b \in E$}. \] Furthermore,
if $E$ is an aperiodic Bohr$_o$-set, we can choose $k = 1$ and $b = 0$. As one
of many applications of this result, we show that if $E_o \subset \mathbb{Z}$
has positive upper Banach density, then, for any integer $m$, there exists an
integer $k$ with the property for \emph{every} finite set $F \subset
\mathbb{Z}$, we can find $x,y,z \in E_o$ such that \[ k^2 F \subset \big\{
(u-x)^2 + (v-y)^2 - (w-z)^2 \, : \, u,v,w \in E_o \big\}. \] In particular, if
$E_o \subset \mathbb{Z}$ is an aperiodic Bohr$_o$-set, then every integer can
be written on the form $u^2 + v^2 - w^2$ for some $u,v,w \in E_o$. Our
techniques use recent results by Benoist-Quint and
Bourgain-Furman-Lindenstrauss-Mozes on equidistribution of random walks on
automorphism groups of tori.
