Solved

More about how to prevent 'ReadProcessMemory()' and 'WriteProcessMemory()' in C++?

Posted on 2009-05-10
2
1,412 Views
Last Modified: 2012-08-14
Basicly, I've been working on preventing these from viewing the memory/editing the memory on the fly in my game, for example.

And yes, I do understand the difficulty or doing this, and yes, it is a client/server, and I do understand the only real solution is to add checks to the server side too. Right now unfortunatly, theres more work then needed, for example, the server/client lag coding needs alot of work, thus it can get laggy at times if you send too much stuff at once. More or less this would cause an issue, and the game is more based on how CS or Continuum is, like stated before.

However, jkr did point out some interesting things, at http://www.codeproject.com/KB/security/AntiReverseEngineering.aspx?fid=1529949&fr=51&df=90&mpp=25&noise=3&sort=Position&view=Quick#BpMem ... Which prevents some things. Currently I do have most debuggers stopped using some coding w/ page guards..

However, I believe basic memory editors (not debuggers) are still going through using 'ReadProcessMemory()' and 'WriteProcessMemory()'  .. It uses a different way to 'attach to the process' is what I am guessing. More or less I just want to hinder them from writing in the end, but if it can hinder reading or attaching too, that would be great.

Using Page Guard for example, I haven't been able to find a proper solution, and I am not sure how to 'prevent' memory editing from occuring.

I am not trying to make it 100% proof, more or less I know that is impossible. I wish to however, hinder the basic 'cheater' as this would proabbly hinder at least 90% of people. Most likely.

Could I get more assistance on this? I apologize for the second question, but I am myself learning C++, as I have just gotten into it a couple months ago.

Thanks!
0
Comment
Question by:Valleriani
2 Comments
 
LVL 7

Author Comment

by:Valleriani
ID: 24349845
The problem with letting the server track the variables right now 100% wise is that normally the server isn't 100% lag proof, thus lag occurs, and if we allowed it server side, ships would likely be blowing up left and right. This is a more 'fast paced' action game, with bullets flying all over the place.. The server would have to be almost right on accurate with bullets, maybe even some way to 'predict' movement so this doesn't occur. So it is not a solution at the moment.

Using a memory guard would be great against it, and I do know it just hinders the experienced cheater, but it will stop the basic people using cheats. Most of the players who would do it are normally very young. I'd say a program only gets hacked when it has a large playerbase, which I do not yet. ;)
0
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
ID: 24356562
Well, th eonly bullet-proof way I could think of would be to hook these calls to intercept them, then identify the calling application and decide whether it's OK. Yet that's quite an advanced subject, see http://www.codeproject.com/KB/system/hooksys.aspx ("API hooking revealed").
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
returning a dereferenced pts in C++ 10 141
Third Party On Screen Keyboard, numeric only. 9 53
Safe conversion? 4 57
object oriented programming comparison 5 52
Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

914 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now