View previous topic :: View next topic |
Author |
Message |
vegito616 Expert Cheater
Reputation: 0
Joined: 08 Jan 2006 Posts: 109
|
Posted: Wed Dec 05, 2007 6:21 pm Post subject: [HELP]How to read value of Address in C++ |
|
|
How would I obtain the value of a certain address of a process like CE would?
|
|
Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Wed Dec 05, 2007 6:26 pm Post subject: |
|
|
ReadProcessMemory
|
|
Back to top |
|
 |
vegito616 Expert Cheater
Reputation: 0
Joined: 08 Jan 2006 Posts: 109
|
Posted: Thu Dec 06, 2007 2:05 pm Post subject: |
|
|
Could someone provide an example of how to read the value of 006F6D59 (random address) and retrieve an int value.
|
|
Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Thu Dec 06, 2007 3:19 pm Post subject: |
|
|
Code: | #include <iostream>
#include <windows.h>
using namespace std;
DWORD pid;
HWND gameWindow;
HANDLE gameProcess;
DWORD dongs;
int main(void)
{
gameWindow = FindWindow(NULL, TEXT("Minesweeper"));
if (gameWindow == NULL){
std::cout << "Oh god.\n";
}
GetWindowThreadProcessId(gameWindow, &pid);
gameProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, pid);
ReadProcessMemory (gameProcess, (void*)0x0100579C, &dongs, sizeof dongs, NULL);
std::cout << dongs << "\nDone.\n";
return 0;
} |
bored. quick example, reads your time in minesweeper. modify as you see fit.
|
|
Back to top |
|
 |
rump Expert Cheater
Reputation: 0
Joined: 03 Oct 2007 Posts: 169
|
Posted: Fri Dec 07, 2007 3:12 am Post subject: |
|
|
I assume the readprocess/writeprocess memory method works somewhat the same in C#?
_________________
C# boot camp, PM me if you want a simple application made and I'll give it a try! |
|
Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
|
Back to top |
|
 |
rump Expert Cheater
Reputation: 0
Joined: 03 Oct 2007 Posts: 169
|
|
Back to top |
|
 |
hcavolsdsadgadsg I'm a spammer
Reputation: 26
Joined: 11 Jun 2007 Posts: 5801
|
Posted: Fri Dec 07, 2007 10:32 am Post subject: |
|
|
pinvoke.net is your (read: lazy way out) friend when it comes to using API's in C#.
|
|
Back to top |
|
 |
|