To include the full non-Gaussian information about cosmology and the large-scale structure from measurements of weak gravitational lensing, one needs to go beyond the second-order shear power spectrum. In my talk I will then focus on weak-lensing peak counts, an indirect probe of the halo mass function. I present a new fast and flexible model of peak counts. This model allows us to use new statistical inference methods that do not require assumptions about the functional form of the likelihood of the observables, e.g. Gaussianity. In particular, I will present results using Approximate Bayesian Computation (ABC), a new technique that has recently gained momentum in the astrophysics community. I will show some results and forecasts how peak counts can constrain dark energy and f(R) models.