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 


[?] check if multiple keys are down with getasynckeystate

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

Joined: 03 Sep 2014
Posts: 106

PostPosted: Wed Mar 10, 2021 3:11 am    Post subject: [?] check if multiple keys are down with getasynckeystate Reply with quote

hi all

how can I check for example "ctrl+X" or "shift+X" with getasynckeystate in auto assembler?
Back to top
View user's profile Send private message
sbryzl
Master Cheater
Reputation: 6

Joined: 25 Jul 2016
Posts: 252

PostPosted: Wed Mar 10, 2021 11:40 am    Post subject: Reply with quote

Is it 32 or 64 bit and doing injection or createthread?
Back to top
View user's profile Send private message
reverser69
Expert Cheater
Reputation: 0

Joined: 03 Sep 2014
Posts: 106

PostPosted: Thu Mar 11, 2021 5:01 am    Post subject: Reply with quote

currently, it's createthread but I'd love to know both approaches. I know how to implement one key but for two keys, I wonder do I have to call getasynckeystate twice or once with extra parameters.
Back to top
View user's profile Send private message
sbryzl
Master Cheater
Reputation: 6

Joined: 25 Jul 2016
Posts: 252

PostPosted: Thu Mar 11, 2021 6:43 am    Post subject: This post has 1 review(s) Reply with quote

It takes 1 parameter and returns 1 value so you need to do it twice then bitwise and the values together.


Code:
mov rcx,10          // shift key
call checkeyst
mov rcx,11          // ctrl key
call checkeyst
jmp // to original code or do other custom code

checkeyst:
sub rsp,20
call GetAsyncKeyState
mov [keyUDtst],rax
mov rcx,58           // x key
call GetAsyncKeyState
and rax,[keyUDtst]
add rsp,20
test rax,8000
jnz bthkeydown
ret
bthkeydown:
//both keys are down, Go
lea rax,[rax]       // insert custom code
ret

align 8
keyUDtst:
Back to top
View user's profile Send private message
reverser69
Expert Cheater
Reputation: 0

Joined: 03 Sep 2014
Posts: 106

PostPosted: Thu Mar 11, 2021 7:50 am    Post subject: Reply with quote

thx
+1
Back to top
View user's profile Send private message
angelbabie
How do I cheat?
Reputation: 0

Joined: 11 Mar 2021
Posts: 2

PostPosted: Thu Mar 11, 2021 9:59 pm    Post subject: Reply with quote

thanks.. helpful, so amazing.
play 2 player games with your kids. 2player.co
Back to top
View user's profile Send private message Yahoo Messenger
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