Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Tutorial for C++ and reading Pointers

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Draconix
How do I cheat?
Reputation: 0

Joined: 29 Dec 2009
Posts: 1

PostPosted: Tue Dec 29, 2009 10:45 am    Post subject: Tutorial for C++ and reading Pointers Reply with quote

Hi there,

excuse my very bad english Very Happy

I have a pointer for a ram position, but i dont know how to read it with C++ or with Visual Basic.

I don't wont to change the value at this position. I only need to read it.

Can anybody help me :/

many thx!!!
Back to top
View user's profile Send private message
Xenico
Advanced Cheater
Reputation: 0

Joined: 27 Dec 2009
Posts: 94

PostPosted: Tue Dec 29, 2009 10:52 am    Post subject: Reply with quote

Use the ReadProcessMemory() function
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Tue Dec 29, 2009 10:53 am    Post subject: Reply with quote

ReadProcessMemory()

Or if you're already in that virtual memory space, typecast your address as a pointer to that particular datatype then dereference it
Back to top
View user's profile Send private message
iPromise
Grandmaster Cheater
Reputation: -1

Joined: 27 Jun 2009
Posts: 529
Location: Canada

PostPosted: Tue Dec 29, 2009 11:27 pm    Post subject: Reply with quote

ReadProcessMemory()

Code:

HWND Target_HWND = FindWindow(ClassName, WindowTitle);
DWORD PID;

GetWindowThreadProcessId(Target_HWND, &PID);

HANDLE hTarget = OpenProcess(PROCESS_ALL_ACCESS, false, &PID);

int Value = YourValue;
LPCVOID Address = (LPCVOID) Address;
DWORD BytesRead;

ReadProcessMemory(hTarget, Address, &Value, 2, &BytesRead);
Back to top
View user's profile Send private message MSN Messenger
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Wed Dec 30, 2009 8:52 am    Post subject: Reply with quote

iPromise wrote:
ReadProcessMemory()

Code:

HWND Target_HWND = FindWindow(ClassName, WindowTitle);
DWORD PID;

GetWindowThreadProcessId(Target_HWND, &PID);

HANDLE hTarget = OpenProcess(PROCESS_ALL_ACCESS, false, &PID);

int Value = YourValue;
LPCVOID Address = (LPCVOID) Address;
DWORD BytesRead;

ReadProcessMemory(hTarget, Address, &Value, 2, &BytesRead);

GetProcessHandleFromHwnd()
Also don't OpenProcess with PROCESS_ALL_ACCESS.
And close your handles. And that is a messed up way of typecasting.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites