  We study the exact entropy of four-dimensional $\mathcal{N}=2$ black holes in
M-theory both from the brane and supergravity points of view. On the
microscopic side the degeneracy is given by a Fourier coefficient of the
elliptic genus of the dual two-dimensional $\mathcal{N}=(0,4)$ SCFT and can be
extracted via a Rademacher expansion. We show how this expansion is mapped to a
modified OSV formula derived by Denef and Moore. On the macroscopic side the
degeneracy is computed by applying localization techniques to Sen's quantum
entropy functional reducing it to a finite number of integrals. The measure for
this finite dimensional integral is determined using a connection with
Chern-Simons theory on AdS$_2 \times$S$^1$. The leading answer is a Bessel
function in agreement with the microscopic answer. Other subleading corrections
can be explained in terms of instanton contributions.
