Galaxy/(sub)Halo finder for N-body simulations