Reputation: 13608
I'm trying to find an int
value inside another program's memory (my own little c++
that only holds that variable). The value is 1234, but I can't seem to find it.
This is what I'm doing:
for (uint adr = 0x00000000; adr <= 0x7FFFFFFF; adr += 1)
{
// we want status...
uint progress = (adr*100) / 0x7FFFFFFF;
Console.WriteLine("Progress: {0} %", progress);
// look for the int
IntPtr bytes;
byte[] buffer = new byte[4];
ReadProcessMemory(process, adr, buffer, 4, out bytes);
if (BitConverter.ToInt32(buffer, 0) == 1234)
{
// we found it...
}
}
There are several errors:
Thanks
Upvotes: 0
Views: 143
Reputation: 3659
You can compare results from your program with output of some advanced memory scanner, such as cheatengine.
Upvotes: 0
Reputation: 16636
1234
is saved in
2
byte value not 4
byte.Upvotes: 2