Consider, as example, the following function $\mathbf{M}: \mathbb{R}^3 \rightarrow \mathbb{R}^3$:
\begin{equation} \mathbf{M}(\mathbf{r}) = \begin{cases} [0,0,1], & \text{if $\mathbf{r} \in \Omega$ } \\ [0,0,0], & \text{if $\mathbf{r} \in (\mathbb{R}^3-\Omega)$} \end{cases} \end{equation}
where $\Omega$ is a domain: $\Omega \in \mathbb{R}^3$. For example $\Omega$ is a sphere with radius 1 and center in the origin $[0,0,0]$.
The problem is how to evaluate the following integral:
\begin{equation} I=\int_{\mathbb{R}^3} \nabla \times \mathbf{M}(\mathbf{r})d\mathbf{r}. \end{equation}
I know that:
\begin{equation} \nabla \times \mathbf{M}(\mathbf{r}) = \begin{cases} [0,0,0], & \text{if $\mathbf{r} \in \mathbb{R}^3-\Gamma$ } \\ ?, & \text{if $\mathbf{r} \in \Gamma$} \end{cases} \end{equation}
where $\Gamma$ is the boundary of $\Omega$.
I think that the solution is $I=\int_{\Gamma} \mathbf{M}(\mathbf{r})\times \mathbf{n}(\mathbf{r}) d\mathbf{r}$, where $\mathbf{n}$ is the unit outgoing norm of the surface $\Gamma$, but I'm not sure and I don't know how to show it.