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 


how does a game read keyboard command ?

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

Joined: 06 Aug 2009
Posts: 61

PostPosted: Wed Oct 28, 2009 8:13 am    Post subject: how does a game read keyboard command ? Reply with quote

if i want to change the default key in a game, like use key M to replace key N, how can find the ASM code for keyboard command ?
there are other ways to change key command, such as 3rd party keyremapper, but i like to directly change the codes of the game, more efficient and better response.
Back to top
View user's profile Send private message
Guy
Expert Cheater
Reputation: 0

Joined: 30 May 2009
Posts: 187

PostPosted: Wed Oct 28, 2009 9:21 am    Post subject: Re: how does a game read keyboard command ? Reply with quote

mlracing wrote:
if i want to change the default key in a game, like use key M to replace key N, how can find the ASM code for keyboard command ?
there are other ways to change key command, such as 3rd party keyremapper, but i like to directly change the codes of the game, more efficient and better response.


It depends on how the game detects keyboard input; common functions may deal with DirectX input, the GetAsyncKeyState function, etc.

Either way, you'll have to hook the get keyboard input function, check for the 'M' key being pressed, then replace it with the 'N' key.

_________________
Has anyone seen Hitler around..? If so, PM me!
Back to top
View user's profile Send private message
supercharger
Advanced Cheater
Reputation: 0

Joined: 06 Aug 2009
Posts: 61

PostPosted: Wed Oct 28, 2009 9:31 am    Post subject: Reply with quote

thanks
but , specificly, how do i make the hook ?
Back to top
View user's profile Send private message
p99
Master Cheater
Reputation: 0

Joined: 21 Jan 2007
Posts: 271

PostPosted: Wed Oct 28, 2009 9:40 am    Post subject: Reply with quote

http://www.gamedev.net/community/forums/topic.asp?topic_id=371104

If you don't understand it, don't bother trying. You won't even come close.
Back to top
View user's profile Send private message
supercharger
Advanced Cheater
Reputation: 0

Joined: 06 Aug 2009
Posts: 61

PostPosted: Wed Oct 28, 2009 9:55 am    Post subject: Reply with quote

right, this way is out of my range, i would prefer to do it in other ways.
Back to top
View user's profile Send private message
AIva1110
Advanced Cheater
Reputation: 0

Joined: 16 Sep 2009
Posts: 56
Location: The Void

PostPosted: Wed Oct 28, 2009 11:48 am    Post subject: Reply with quote

you can also patch it, all messages program processes are just constant numbers that are assigned IDs.

For example M key might have internal value 0x100 and N might have 0x200, when you find where it processes the input just change the values and that's it. Not going to get into all the details just explaining the concepts.

_________________



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 Gamehacking 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