Memory Scanner

Hello, I am very new to C++ (Been learning it for about 4 days now), but I'm not a total beginner to programming (I've used other languages before). I'm trying to write a simple memory scanner/editor. Here is the main body of my program in C++:

1
2
3
4
5
for (ULONGINT i = 134512640; i < 268435455; i ++) {
	if (GetMatch(valueToFind, i)) {
		cout << i;
	}
}


and GetMatch is:

1
2
3
4
5
6
7
8
9
bool GetMatch(SSHORTINT value, ULONGINT address) {
	ULONGINT * addressToCheck = (ULONGINT *) address;
	if (* addressToCheck == value) {
		return true;
	}
	else {
		return false;
	}
}


But when I run the program I get an AccessViolation exception, which I kind of expected. But my question is, how can I get the value stored at an address that dosent belong to my program? Thankyou for your time.
I recommend that you google up the term "vitual address space" to understand why under normal circumstances you cannot do what you want.

In a nutshell, a process cannot access the memory of another process.

Having said that, in Windows you can use ReadProcessMemory(), provided that you have the appropriate access rights to the process you are trying to scan. I am ignorant as to what tools/functions may be availabe for MAC or *nix.
Topic archived. No new replies allowed.