Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

using readprocessmemory correctly

Status
Not open for further replies.

hexmare

Technical User
Mar 9, 2003
2
US
I am currently trying to get an anti-cheat program together for one of the popular games out on the market. I have all the memory addresses that I have to monitor , and what data to monitor them for. and I have the basic structure of the program done too. However I Am having issues getting the monitoring module to work.

here is a snippet of code that I am using for detection , and I only have one address scanned for right now until I can get the rest of this to work.

bool cheat = false; // declare test variable for cheat
char szText;

do {
ReadProcessMemory(hProcess, (LPCVOID)0x8D2CB2, &szText, 2, (LPDWORD)2);
if(szText == '1')
cheat = true;

}while(cheat !=true);
MessageBox(0, "CHEAT DETECTED","CHEAT", MB_OK);


Now this as I said is only scanning one address , and after I get it to work with one , I will just add in the other adresses.

The particular address that I am scanning is 0x8D2CB2 , and I am looking for a value of 01,

one fo the others that I will be scanning is 0x646DCF , looking for 89 41 08 , all at that address.


Right now the entire code will compile , however when it runs , it gives me an error stating that it ran into a problem. and offers to debug, and or send the information to Microsoft. Any Help on this would be GREATLY appreciated.

Thanks
Rp
 
>> it gives me an error stating that it ran into a problem.
>> and offers to debug,

Are you not running in debug mode already? You must to determine what the actual problem is, we certainly cannot tell from your post.

-pete
 
I figured out what I was doing wrong late last night.

I had some of the variables declared wrong.

( I Am new to windows programming , making the jump from the BS console programs that my cosci classes are having me do , straight into windows programs aint easy. Especially when I ask my instructors questions here and there , and they tell me to concentrate on the course work, even though I am carrying a 98% in the calss )
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top