We help IT Professionals succeed at work.

How to prevent memory hacking in game's score?

melwong asked
Last Modified: 2013-12-26

I'm building a java mobile game and i need to prevent people from hacking the score via the memory. I thought of maybe like this,

-Instead of using numbers in the score's main variable, we use Alphabets like 1=AG, 2=RE
-So the canvas or display just reads the score's alphabets and translate it to a number.

Will this work? If no, do you any better idea?

Watch Question

Most Valuable Expert 2013

It would work but it is usually possible to look at two instances of the game and see which code has changed so spot the incrementing score.

If you are going to go along this line maybe put a checksum in there as well.  The best disincentive is to have a system check that looks for a change which doesn't match the checksum and permanently disables the game requiring a reinstall.  Then the effort invoved in testing the hack is outweighed by the effort of reinstalling.

Bear in mind though that most gamers are not programmers.  Because games programmers do both they can easily get caught building in defences against hacking which only a minority of players will be capable of.



We're building a game that can upload scores to a remote server and giving cash to top scorers. Thus, we really NEED to ensure almost hack-proof in our games.

You said,
"It would work but it is usually possible to look at two instances of the game and see which code has changed so spot the incrementing score."

Do you have an example how a hacker can perform the above? Are you still referring to mem hacking or something else?
Most Valuable Expert 2013

It will depend on how much the hacking will recover in cash compared with time taken to "fix" the score.
If I was trying to hack it I guess I would look at trying to dump the memory into a file at two points.  Ideally before and after getting some points without anything else changing.  Is the game launched from the server, played independently and then the score uploaded back to the server so that you can give each session a unique identity of does it run entirely independent of the server and you simply send in your scores?


the user would download the game into the phone. then play it on the phone, get the score and upload to server. when you said session, what kinda session you're referring to? There's no session at this moment.
Most Valuable Expert 2013
This one is on us!
(Get your first solution completely free - no credit card required)


I think you're quite right. The game is just casual Tetris like games. Any special insights on dev on this type of game? It's on J2ME MIDP 1

Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.