| View previous topic :: View next topic |
| Author |
Message |
redhead Cheater
Reputation: 0
Joined: 21 Mar 2007 Posts: 47
|
Posted: Tue May 15, 2007 8:42 am Post subject: strange problem with readprocess memory |
|
|
With Cheatengine I found an Adress.. no problem, but trying to read this Address with ReadProcessMemory doesn`t work?At many programms I can read the Address with ReadProcessMemory no problem but there is 1 Programm, I can easylie read with Cheatengine, but with ReadProcessMemory I cant.Why?
My Code..
| Code: | #include "windows.h"
int main()
{
unsigned long PID;
char Buffer;
int a;
HWND hWindow = FindWindow(NULL, "game");
if (!hWindow){
MessageBox(0, "Game not found!", 0, MB_ICONERROR);
return 1; }
GetWindowThreadProcessId(hWindow, &PID);
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, TRUE, PID);
a = ReadProcessMemory(hProcess, (LPVOID)0x0AB96B4C, &Buffer, 9, 0);
if (a!=0)
{
MessageBox(0, &Buffer , 0, MB_ICONERROR);
CloseHandle(hProcess);
}
else
{
MessageBox(0, "adress not found!", 0, MB_ICONERROR);
}
return 0;
} |
(it says "adress not found!")
|
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Tue May 15, 2007 10:06 am Post subject: |
|
|
Probably your trying on a protected game.
_________________
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Tue May 15, 2007 10:21 am Post subject: |
|
|
1) you're reading 9 bytes, you cannot fit that into a char.
2) you're using & where you shouldn't, do you know what it means?
3) Messagebox will give you annoying ascii gibberish if anything, use itoa.
|
|
| Back to top |
|
 |
redhead Cheater
Reputation: 0
Joined: 21 Mar 2007 Posts: 47
|
Posted: Tue May 15, 2007 11:13 am Post subject: |
|
|
| zomgiownyou wrote: | | Probably your trying on a protected game. |
I think yes,but why can I see the value with CE?
1) you're reading 9 bytes, you cannot fit that into a char. --> I also tryed with DWORD and String.Not Working.In my Code there is writtn char, becous it worked fine with an another Game. (9 Bytes, too)
2) you're using & where you shouldn't, do you know what it means? --> pointer?I think you mean in the Messagebox?I tried before without & : invalid conversion from 'char` to 'const CHAR*`.Dunno why but with & it worked fine with another Game.
3) Messagebox will give you annoying ascii gibberish if anything, use itoa. -->
didn't understand, sry.
btw:It's a text I would like to read.Maybe It doesn't work becouse of text?
|
|
| Back to top |
|
 |
UnLmtD Grandmaster Cheater
Reputation: 0
Joined: 13 Mar 2007 Posts: 894 Location: Canada
|
Posted: Tue May 15, 2007 2:14 pm Post subject: |
|
|
| redhead wrote: | | zomgiownyou wrote: | | Probably your trying on a protected game. |
I think yes,but why can I see the value with CE?
|
Because CE is "like a rootkit" it uses a kernel driver that enables you to read/write memory on protected game. (Sorry for the bad explanation, ask someone else that know more about the subject)
_________________
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Tue May 15, 2007 2:37 pm Post subject: |
|
|
I bettered your code in a lot of ways: http://www.pastebin.ca/490141
Also, don't try this on a protected game, you'll need to do a whole lot of other stuff for that. @zomgiownyou, no.
|
|
| Back to top |
|
 |
redhead Cheater
Reputation: 0
Joined: 21 Mar 2007 Posts: 47
|
Posted: Wed May 16, 2007 5:15 am Post subject: |
|
|
Thx
| appalsap wrote: | | Also, don't try this on a protected game, you'll need to do a whole lot of other stuff for that. @zomgiownyou, no. |
May got some links or something?I'm trying to learn, I've got time and needn't the hack done in 1Day...
|
|
| Back to top |
|
 |
|