Register for your free account! | Forgot your password?

You last visited: Today at 23:26

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



ReadMemory C++

Discussion on ReadMemory C++ within the Dekaron Private Server forum part of the Dekaron category.

Reply
 
Old   #1
 
LogLife's Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 260
Received Thanks: 17
Arrow ReadMemory C++

i got everthing working please delete this thread thank you for all.
LogLife is offline  
Old 07/20/2012, 14:25   #2
 
HellSpider's Avatar
 
elite*gold: 20
Join Date: Aug 2008
Posts: 2,763
Received Thanks: 4,397
Quote:
Originally Posted by LogLife View Post
Code:
void ReadMem(char *window, LPCVOID dAddr)
{	int cout;
	int tbuf;
	HWND hWnd = FindWindow(0, window);
	DWORD proc_id; 
	GetWindowThreadProcessId(hWnd, &proc_id); 
	HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proc_id); 
	ReadProcessMemory(hProcess, dAddr, &tbuf, 4, NULL);
	cout=tbuf;
}

Code:
int main()
{
	
	ReadMem("iexplorer", (LPCVOID)0x100579C);
MessageBoxA(NULL,ReadMem, "Notice", MB_OK | MB_ICONSTOP); 
	system("PAUSE");
}
if i want to show memory values from "ReadMem" function for show on messagebox how to show it , the above code in main() it's right ?
Change the ReadMem function to uint instead of void (to return a value).

Code:
[B]uint[/B] ReadMem(char *window, LPCVOID dAddr)
{	[B]uint value;[/B]
	HWND hWnd = FindWindow(0, window);
	DWORD proc_id; 
	GetWindowThreadProcessId(hWnd, &proc_id); 
	HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, proc_id); 
	ReadProcessMemory(hProcess, dAddr, &value, 4, NULL);
	CloseHandle(hProcess);
	[B]return value;[/B]
}
Code:
int main()
{
	[B]char buffer [20];[/B]
	
	[B]sprintf(&buffer,"%04X",(ReadMem("iexplorer", (LPCVOID)0x100579C)));[/B]
	MessageBoxA(NULL,[B]&buffer[/B], "Notice", MB_OK | MB_ICONSTOP); 
	system("PAUSE");
}
There might pop up some errors as I haven't written anything in C++ since 2009.

Btw, you don't need to write in a huge font, if people can't read the default font they need to get their eyes checked.
HellSpider is offline  
Thanks
1 User
Old 07/20/2012, 15:11   #3
 
LogLife's Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 260
Received Thanks: 17
When complie got this error:

Quote:
antihack.cpp
C:\Program Files\Microsoft Visual Studio\MyProjects\antihack\antihack.cpp(248) : error C2146: syntax error : missing ';' before identifier 'ReadMem'
C:\Program Files\Microsoft Visual Studio\MyProjects\antihack\antihack.cpp(248) : error C2501: 'uint' : missing storage-class or type specifiers
C:\Program Files\Microsoft Visual Studio\MyProjects\antihack\antihack.cpp(248) : fatal error C1004: unexpected end of file found
i'm using VC++ 6.0
LogLife is offline  
Old 07/20/2012, 15:30   #4
 
freeskier4lif3's Avatar
 
elite*gold: 0
Join Date: Sep 2008
Posts: 231
Received Thanks: 151
uint is not a default typename in c++. use: unsigned int

and find your missing semi-colon to fix the other error.
freeskier4lif3 is offline  
Thanks
1 User
Old 07/20/2012, 16:41   #5
 
LogLife's Avatar
 
elite*gold: 0
Join Date: Aug 2010
Posts: 260
Received Thanks: 17
i got everthing working please delete this thread thank you for all.
LogLife is offline  
Reply


Similar Threads Similar Threads
C++ ReadMemory in dll
04/01/2012 - C/C++ - 9 Replies
Ja hallo zsm :D Undzwar hab ich ne kleine dll geschrieben mit der ich ein spiel hacke sozusagen. Das Value schreiben funktioniert an sich perfekt nur das value auslesen nicht. Hab auch schon ein bisschen gegooglet aber nichts hilfreiches gefunden dafür. Ich weiß, ich kan ReadProcessMemory benutzten, jedoch wird rpm leider erkannt und somit funktioniert das ganze nichtmehr. Ich muss wie z.B memcpy fürs schreiben eine funktion fürs lesen herbekommen und da dachte ich das vllt ein paar...
[Help]C# ReadMemory Function
04/21/2010 - .NET Languages - 1 Replies
Hi! I am a newbie and trying to learn the C# ReadProcessMemory function! As a training I am trying to read the HP value in "Conquer Online" so please tell me is this code right or wrong and will it cause me problems? note: this is a console application the program should read the HP address then it shows the value of the address! using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; using System.Text.RegularExpressions;



All times are GMT +1. The time now is 23:27.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.