Anti-Cheat Measures

In an effort to build a healthy community, bellow we present mandatory anti-cheat measures that are required to counter some of the most common exploits in mobile gaming.

Memory tampering through cheat engines

Currently the most widespread technique to exploit mobile videogames is memory tampering. Fraudsters will use cheat engines in order to find specific memory addresses where, for instance, the score is stored, and change it for their desired value.
To mitigate this attack vector we present techniques that have been adopted in the mobile gaming world:

  • Score value should be stored in 2 different addresses. This way if a fraudster tampers with the variable score, by comparing it to an additional variable where this value is also stored, one can assess the validity of that score/ play.

  • Masking score in memory. Each of these values (score and scoreCheck) should also be masked in a way that their true value is not visible in memory. We advise you choose two different values for scoreMask and scoreCheckMask, and use them to mask the real value anytime there is a change.

private long score;
private long scoreCheck;

private int scoreMask = 11111;
private int scoreCheckMask = 22222;

private void initScore(){
	score = 0;
  score ^= scoreMask;
  scoreCheck = 0;
  scoreCheck ^= scoreCheckMask;
}

private void setScore(long value){
    score ^= scoreMask;
    score += value;
    score ^= scoreMask;
    scoreCheck ^= scoreCheckMask;
    scoreCheck += value;
    scoreCheck ^= scoreCheckMask;
  }

public long getScore(){
    return score^scoreMask ;
 }

private boolean checkScoreValidity() {
    return (score ^ scoreMask) == (scoreCheck ^ scoreCheckMask);
  }