Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


strange problem with readprocess memory

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
redhead
Cheater
Reputation: 0

Joined: 21 Mar 2007
Posts: 47

PostPosted: Tue May 15, 2007 8:42 am    Post subject: strange problem with readprocess memory Reply with quote

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
View user's profile Send private message
UnLmtD
Grandmaster Cheater
Reputation: 0

Joined: 13 Mar 2007
Posts: 894
Location: Canada

PostPosted: Tue May 15, 2007 10:06 am    Post subject: Reply with quote

Probably your trying on a protected game.
_________________
Back to top
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Tue May 15, 2007 10:21 am    Post subject: Reply with quote

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
View user's profile Send private message
redhead
Cheater
Reputation: 0

Joined: 21 Mar 2007
Posts: 47

PostPosted: Tue May 15, 2007 11:13 am    Post subject: Reply with quote

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
View user's profile Send private message
UnLmtD
Grandmaster Cheater
Reputation: 0

Joined: 13 Mar 2007
Posts: 894
Location: Canada

PostPosted: Tue May 15, 2007 2:14 pm    Post subject: Reply with quote

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
View user's profile Send private message
appalsap
Moderator
Reputation: 0

Joined: 27 Apr 2006
Posts: 6753
Location: Pakistan

PostPosted: Tue May 15, 2007 2:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
redhead
Cheater
Reputation: 0

Joined: 21 Mar 2007
Posts: 47

PostPosted: Wed May 16, 2007 5:15 am    Post subject: Reply with quote

appalsap wrote:
I bettered your code in a lot of ways: http://www.pastebin.ca/490141
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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites