The authors propose a simulation tool (ST) able to test real-time hybrid GNSS/terrestrial and cooperative positioning algorithms that fuse both pseudorange measurements from satellites and terrestrial range measurements based on radio frequency communication performed between nodes of a wireless network. In particular, the ST simulates devices belonging to a peer-to-peer (P2P) wireless network where peers, equipped also with a GNSS receiver, cooperate among them by exchanging aiding data in order to improve both positioning accuracy and availability. Furthermore, the authors propose a method to increase the robustness of cooperative algorithms based on the estimated position covariance matrix. In particular, the proposed approach assures a faster estimation convergence and improved accuracy while lowering computational complexity and network traffic. Finally, the authors tested the sensitivity of the implemented positioning algorithms through the ST in two different scenarios, first in presence of high level of pseudorange noise and then in presence of a malicious peer in the P2P network.