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 


assembly code to send a keystroke

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

Joined: 27 Apr 2018
Posts: 33
Location: pakistan

PostPosted: Mon Jan 18, 2021 11:24 am    Post subject: assembly code to send a keystroke Reply with quote

I want my AA script to send a keystroke to the game(selected process), I tried to find out but couldn't, any help will be appreciated.
thanks
Back to top
View user's profile Send private message
Thunder_Bird
Cheater
Reputation: 0

Joined: 27 Apr 2018
Posts: 33
Location: pakistan

PostPosted: Fri Feb 19, 2021 1:54 pm    Post subject: Reply with quote

bump.
Back to top
View user's profile Send private message
sbryzl
Master Cheater
Reputation: 6

Joined: 25 Jul 2016
Posts: 252

PostPosted: Fri Feb 19, 2021 2:48 pm    Post subject: Reply with quote

There are a number of functions that can be used to send keystrokes, send, sendkeys, sendwait, sendmessage, sendnotifymessage, postmessage, postnotifymessage, dispatchmessage. You just have to try some out and see what works best for you.
Back to top
View user's profile Send private message
Thunder_Bird
Cheater
Reputation: 0

Joined: 27 Apr 2018
Posts: 33
Location: pakistan

PostPosted: Sat Feb 20, 2021 12:48 am    Post subject: Reply with quote

sbryzl wrote:
There are a number of functions that can be used to send keystrokes, send, sendkeys, sendwait, sendmessage, sendnotifymessage, postmessage, postnotifymessage, dispatchmessage. You just have to try some out and see what works best for you.
you miss understood maybe, I said AA script not LUA script xd
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Sat Feb 20, 2021 3:46 am    Post subject: Reply with quote

that's not Lua
_________________
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
MMM-304
Expert Cheater
Reputation: 0

Joined: 17 Aug 2020
Posts: 170
Location: Milkey Way

PostPosted: Sat Feb 20, 2021 7:14 am    Post subject: Reply with quote

For 32bit Assembler:
Code:

push 1C  //;int  cbSize-->size of input memory needs to be 28bytes (min requirment of **input**)
push input //;LPINPUT pInputs,--> pushing the address of input
push 1  //;UINT  cInputs -->The number of structures in the pInputs array.
call SendInput

input:
dd 01 //;hardware type (Mouse:0,KeyBoard:1)
  dw 41 //;Virtual Key Code
  dw 00 //;ki.wScan -->hardware scan code for key
  dd 00 //;dwFlag --> 0:Press
  dq CCCCCCCCCCCCCCCC  //;Reserved 8bytes(includes 4bytes for **ki.time** and 4bytes for **ki.dwExtraInfo**)
  dq CCCCCCCCCCCCCCCC  //;+8bytes         [[Total 28bytes for input]]

For 64-bit Assembler:
Code:

mov eax,41  //;use eax NOT RAX for VK
mov r8d,28  //;int  cbSize-->size of input memory needs to be 40bytes (min requirment of **input**)
lea rdx,[input] //;LPINPUT pInputs,--> pushing the address of input
mov ecx,1  //;UINT  cInputs -->The number of structures in the pInputs array.
call SendInput

input:
  dq 01 //;hardware type (Mouse:0,KeyBoard:1)
  dd 41 //;Virtual Key Code(Must be same as eax)
  dd 00 //;dwFlag --> 0:Press
  dq CCCCCCCCCCCCCCCC  //;Reserved 8bytes [[Total 20bytes]]
  dq CCCCCCCCCCCCCCCC  //;+8bytes         [[Total 28bytes]]
  dq CCCCCCCCCCCCCCCC  //;+8bytes         [[Total 36bytes]]
  dd CCCCCCCC  //;+4bytes         [[Total 40bytes]]


Same as doKeyPress() in lua
Back to top
View user's profile Send private message
Thunder_Bird
Cheater
Reputation: 0

Joined: 27 Apr 2018
Posts: 33
Location: pakistan

PostPosted: Sat Feb 20, 2021 9:07 am    Post subject: Reply with quote

Dark Byte wrote:
that's not Lua

I thought those were high level lua functions.
MMM-304 wrote:
For 32bit Assembler:
Code:

push 1C  //;int  cbSize-->size of input memory needs to be 28bytes (min requirment of **input**)
push input //;LPINPUT pInputs,--> pushing the address of input
push 1  //;UINT  cInputs -->The number of structures in the pInputs array.
call SendInput

input:
dd 01 //;hardware type (Mouse:0,KeyBoard:1)
  dw 41 //;Virtual Key Code
  dw 00 //;ki.wScan -->hardware scan code for key
  dd 00 //;dwFlag --> 0:Press
  dq CCCCCCCCCCCCCCCC  //;Reserved 8bytes(includes 4bytes for **ki.time** and 4bytes for **ki.dwExtraInfo**)
  dq CCCCCCCCCCCCCCCC  //;+8bytes         [[Total 28bytes for input]]

For 64-bit Assembler:
Code:

mov eax,41  //;use eax NOT RAX for VK
mov r8d,28  //;int  cbSize-->size of input memory needs to be 40bytes (min requirment of **input**)
lea rdx,[input] //;LPINPUT pInputs,--> pushing the address of input
mov ecx,1  //;UINT  cInputs -->The number of structures in the pInputs array.
call SendInput

input:
  dq 01 //;hardware type (Mouse:0,KeyBoard:1)
  dd 41 //;Virtual Key Code(Must be same as eax)
  dd 00 //;dwFlag --> 0:Press
  dq CCCCCCCCCCCCCCCC  //;Reserved 8bytes [[Total 20bytes]]
  dq CCCCCCCCCCCCCCCC  //;+8bytes         [[Total 28bytes]]
  dq CCCCCCCCCCCCCCCC  //;+8bytes         [[Total 36bytes]]
  dd CCCCCCCC  //;+4bytes         [[Total 40bytes]]


Same as doKeyPress() in lua
thanks, just what I wanted.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine 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