Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > C/C++
You last visited: Today at 10:42

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

Advertisement



[C++ DLL] ReadProcessMemory

Discussion on [C++ DLL] ReadProcessMemory within the C/C++ forum part of the Coders Den category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2011
Posts: 367
Received Thanks: 199
[C++ DLL] ReadProcessMemory

OK I HAVE SOLVED, THANK TO ALL
Kingrap is offline  
Old 03/11/2013, 22:45   #2

 
snow's Avatar
 
elite*gold: 724
Join Date: Mar 2011
Posts: 10,479
Received Thanks: 3,318
Well, I guess your DLL is injected into the target process? Then you don't need to get a handle for the process or use OpenProcess.

One way would be memcpy(address, value, sizeof(value)), another way:

DWORD *ptr = 0x004DE898;
DWORD *secondptr = *ptr + 20; /* sure that it's 20 or is it 0x20? */
value = *secondptr;

Don't know which way is better. ¯\_(ツ)_/¯
snow is offline  
Old 03/11/2013, 23:33   #3
 
elite*gold: 0
Join Date: Dec 2011
Posts: 367
Received Thanks: 199
Quote:
Originally Posted by snow911 View Post
Well, I guess your DLL is injected into the target process? Then you don't need to get a handle for the process or use OpenProcess.

One way would be memcpy(address, value, sizeof(value)), another way:

DWORD *ptr = 0x004DE898;
DWORD *secondptr = *ptr + 20; /* sure that it's 20 or is it 0x20? */
value = *secondptr;

Don't know which way is better. ¯\_(ツ)_/¯
yes 0x20

This is correct?

Code:
private: System::Void button17_Click(System::Object^  sender, System::EventArgs^  e) {

			 HANDLE phandle; 
                         DWORD *ptr = 0x004DE898;
                         DWORD *s_ptr = *ptr + 0x20;
                         int value = *s_ptr;

				ReadProcessMemory(phandle, (LPVOID)value, &value, 4, 0);

				label14->Text = System::Convert::ToString(value);
			 }

			 
		 }
Kingrap is offline  
Old 03/11/2013, 23:44   #4

 
snow's Avatar
 
elite*gold: 724
Join Date: Mar 2011
Posts: 10,479
Received Thanks: 3,318
I'm sorry, but I'm not sure if I understand exactly what you want:
What do you mean with DLL? Do you want to write a DLL that gets injected into a process? If yes: The way I showed above should work.

If not: This is, as far as I know, some Microsoft-Styled C++, right? If that's within your application and you want to read the value of another process, you'll have to use that ReadProcessMemory Function.
Don't forget that you'll have to add the base module address to your Pointer, you can either add it as a constant value which should be 0x40000 in most cases or you can get the address dynamically via GetModuleHandle("NAMEOFYOURGAME")
snow is offline  
Old 03/12/2013, 09:12   #5
 
Mi4uric3's Avatar
 
elite*gold: 405
Join Date: Dec 2007
Posts: 6,615
Received Thanks: 6,358
Quote:
Originally Posted by Kingrap View Post
yes 0x20
Well then you need to write 0x20, not 20 if it is 0x20.

Quote:
Originally Posted by Kingrap View Post
ReadProcessMemory(phandle, (LPVOID)(value+0x20), &value, 4, 0);
But first of all. Like snow911 already said. Do you inject your dll into the game-process which contains the code you posted above, or is this an external hack which uses Read- / WriteProcessMemory()?
Mi4uric3 is offline  
Old 03/12/2013, 15:58   #6
 
elite*gold: 0
Join Date: Dec 2011
Posts: 367
Received Thanks: 199
Ehm, i inject DLL in game process, i need read from memory the value of pointer ( 0x004DE898 + 0x20 )
Kingrap is offline  
Old 03/12/2013, 16:11   #7
 
elite*gold: 0
Join Date: Sep 2006
Posts: 774
Received Thanks: 8,580
Quote:
Originally Posted by Kingrap View Post
Ehm, i inject DLL in game process, i need read from memory the value of pointer ( 0x004DE898 + 0x20 )
You need to go back to reading programming books and get a clue before attempting to make hacks.
phize is offline  
Old 03/12/2013, 16:39   #8
 
elite*gold: 0
Join Date: Dec 2011
Posts: 367
Received Thanks: 199
OK I HAVE SOLVED, THANK TO ALL
Kingrap is offline  
Old 03/15/2013, 12:13   #9
 
Mi4uric3's Avatar
 
elite*gold: 405
Join Date: Dec 2007
Posts: 6,615
Received Thanks: 6,358
Quote:
Originally Posted by Kingrap View Post
Ehm, i inject DLL in game process, i need read from memory the value of pointer ( 0x004DE898 + 0x20 )
Why would you use ReadProcessMemory to read in the own addressspace [IMG]http://www.*************.me/forum/images/smilies/jackie.gif[/IMG]

PHP Code:
DWORD value = *(DWORD*)(*(DWORD*)0x4DE898 0x20); 
would do the job
Mi4uric3 is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
ReadProcessMemory Lib "kernel32" Alias "ReadProcessMemory" Problem
03/06/2012 - .NET Languages - 9 Replies
Deleted
how to use ReadProcessMemory to get char name with vb????
06/18/2011 - Perfect World - 2 Replies
:handsdown::handsdown::handsdown::handsdown: I've got an offset but do not know how to use it to read type string,i know just to read type integer. this my function Public Shared Sub PointerRead(ByVal Offset As Integer(), ByRef Buffer As Integer) Try Dim b As Integer = Nothing Dim t As Integer = _PerfectWorldBaseAddress
ReadProcessMemory
04/29/2011 - General Coding - 2 Replies
Habe ein gutes beispiel für pointer und offsets um internet gefunden doch leider klappt es nur bei dem programm was auch im video war ich wollte es jetzt mal bei 4story ausprobieren nur leider geht es nicht ( private server ) hier mal das programm #include <iostream> #include <windows.h> using namespace std; //--------------------------------- //Offsets
ReadProcessMemory From Lineage II
03/03/2011 - Lin2 Exploits, Hacks, Bots, Tools & Macros - 8 Replies
Hello, This is my second thread, and I hope someone can have some benefit from it. Why do this? well maybe make an status bar to display health,mana, etc or maybe you want to write data to the process, But in this article I show how to read. First of all you need to inculde some files: #include <Tlhelp32.h> to have access to:
[C++] ReadProcessMemory Text?
09/12/2010 - C/C++ - 5 Replies
die frage kommt den pros hier vllt etwas dumm vor, aber ich befasse mich ja erst seit 2 wochen mit c++: ich habe folgenden code: ReadProcessMemory(handle,(LPVOID)address,&text ,sizeof(long),&numBytesRead); cout << hex << text << "\n"; cout << char(text) << "\n"; ich will in einem spiel einen text auslesen. der erste wert in der konsole entspricht dem 4 bytes wert in CE.



All times are GMT +1. The time now is 10:43.


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.