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 


understanding GetAsyncKeyState

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
pox911
Grandmaster Cheater
Reputation: 28

Joined: 29 Nov 2008
Posts: 918

PostPosted: Wed May 29, 2013 11:56 pm    Post subject: understanding GetAsyncKeyState Reply with quote

I have an asm script where i want the effect to only take place when a key is held down. From what i understand you use a push before the GetAsyncKeyState to set up the key used but im not sure where to go after that.

i have this for when i hit control.
push 17
call GetAsyncKeyState


Im not sure what is needed afterward to make the compare work. I'm probably missing something really simple.
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 471

Joined: 09 May 2003
Posts: 25819
Location: The netherlands

PostPosted: Thu May 30, 2013 3:53 am    Post subject: Reply with quote

The AX register will hold the result
If bit 0 is 1 that means the key is down at this moment
If bit 15 is 1 that means it has been down since last time this thread called getAsyncKeyState (might already be up)

Check http://cheatengine.org/keypresstut.php

_________________
Do not ask me about online cheats. I don't know any and wont help finding them.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
pox911
Grandmaster Cheater
Reputation: 28

Joined: 29 Nov 2008
Posts: 918

PostPosted: Thu May 30, 2013 1:26 pm    Post subject: Reply with quote

Thank you.don't know how i missed the tutorial on the main site
Back to top
View user's profile Send private message
darquan0
How do I cheat?
Reputation: 0

Joined: 27 Nov 2012
Posts: 5
Location: so far north

PostPosted: Wed Feb 05, 2014 1:08 pm    Post subject: sorry about necromancy... Reply with quote

I have windows XP x64 SP2.
Cheat engine (v6.3) says:
"Error in line ## (call GetAsyncKeyState):This instruction can't be compiled"
wherever "call GetAsyncKeyState" is present.

maybe someone knows what to do with it?

_________________
I know nothing, for there is so much still left to learn...
Back to top
View user's profile Send private message
mgr.inz.Player
I post too much
Reputation: 222

Joined: 07 Nov 2008
Posts: 4438
Location: W kraju nad Wisla. UTC+01:00

PostPosted: Wed Feb 05, 2014 1:40 pm    Post subject: Reply with quote

It will work only after you attach to process. (and if process imports that function)
_________________
Back to top
View user's profile Send private message MSN Messenger
darquan0
How do I cheat?
Reputation: 0

Joined: 27 Nov 2012
Posts: 5
Location: so far north

PostPosted: Wed Feb 05, 2014 3:02 pm    Post subject: Reply with quote

mgr.inz.Player wrote:
(and if process imports that function)
hmmm. That looks like it may be the cause...
But. I first encountered such a mistake on user-submitted table for "Remember Me" game.
So I think the game is expected to import it.

I have googled and found out that "GetAsyncKeyState" uses different return values on x32 and x64 systems. But all solutions found are for C# and java.
And this is no java Sad

...and yes, of course CE is attached to the process. To the correct process. I double-checked. Several times Razz

_________________
I know nothing, for there is so much still left to learn...
Back to top
View user's profile Send private message
Geri
Moderator
Reputation: 111

Joined: 05 Feb 2010
Posts: 5627

PostPosted: Wed Feb 05, 2014 7:05 pm    Post subject: Reply with quote

darquan0 wrote:
mgr.inz.Player wrote:
(and if process imports that function)
hmmm. That looks like it may be the cause...

I have googled and found out that "GetAsyncKeyState" uses different return values on x32 and x64 systems. But all solutions found are for C# and java.
And this is no java Sad


This is probably irrelevant for now. In your case, CE has problem to recognize the GetAsyncKeyState instruction which means that it has probably not found the API. You have to check that CE was able to find the API. If you use "Go to address" and give GetAsyncKeyState as destination, CE will jump to it. If not, then something is wrong.

_________________
My trainers can be found here: http://www.szemelyesintegracio.hu/cheats

If you are interested in any of my crappy articles/tutorials about CE and game hacking, you can find them here:
http://www.szemelyesintegracio.hu/cheats/41-game-hacking-articles

Don't request cheats or updates.
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