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 


tried to change virtual key, does not work

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General Gamehacking
View previous topic :: View next topic  
Author Message
weisbrot
Newbie cheater
Reputation: 0

Joined: 06 Feb 2017
Posts: 19

PostPosted: Mon Feb 06, 2017 2:03 am    Post subject: tried to change virtual key, does not work Reply with quote

Hell! just found a piece of code that I want to change:

Code:
isenabled:
//mouse trigger
push rcx
push rdx
xor rdx,rdx
cmp [LeftTrigger],1
jne isnext
mov rcx,1 //left mouse
call getasynckeystate
or rdx,rax
isnext:
cmp [RightTrigger],1
jne isnext1
mov rcx,2 //right mouse
call getasynckeystate
or rdx,rax
isnext1:
cmp [WhileTrigger],1
jne isnext2
mov rcx,4 //middle mouse
call getasynckeystate
isnext2:
or rdx,rax
xor rax,rax
and rdx,8000
test rdx,rdx
pop rdx
pop rcx
je disabled
inc rax
disabled:
ret


i tried to change mov rcx,4 to mov rcx,69 so that I can press the E button instead of the middle mouse button, but that does not work. Can anyone help me? Thanks
Back to top
View user's profile Send private message
SunBeam
I post too much
Reputation: 65

Joined: 25 Feb 2005
Posts: 4023
Location: Romania

PostPosted: Mon Feb 06, 2017 4:09 am    Post subject: Reply with quote

According to MSDN, the virtual keycode for 'E' is 0x45. 0x69 is VK_NUMPAD9.
Back to top
View user's profile Send private message
weisbrot
Newbie cheater
Reputation: 0

Joined: 06 Feb 2017
Posts: 19

PostPosted: Mon Feb 06, 2017 5:04 am    Post subject: Reply with quote

SunBeam wrote:
According to MSDN, the virtual keycode for 'E' is 0x45. 0x69 is VK_NUMPAD9.


thanks for your answer, but this does not work either, the program does not give out an error, but it also does not work anymore.
Back to top
View user's profile Send private message
SunBeam
I post too much
Reputation: 65

Joined: 25 Feb 2005
Posts: 4023
Location: Romania

PostPosted: Mon Feb 06, 2017 6:26 am    Post subject: Reply with quote

Alright, let's do it this way:

- is the code working as intended with the Mouse keys?
- can you share the program? (if uncertain, do PM me)

Bottom line is I'm using a similar handler in some x64 scripts for various games and the combination of GetAsyncKeyState with wanted key hexa does work.

Example:

Code:
KeyHandlerThread:
sub rsp,28

KeyHandlerThread_loop:
mov rcx,A
call Sleep

cmp [KeyHandlerOff],1
je ExitKeyHandler

  mov rcx,6F // NUM_DIVIDE
  call GetAsyncKeyState
  test ax,ax
  jne short ToggleText

      jmp short KeyHandlerThread_loop

  ToggleText:
  xor r9d,r9d // MB_OK
  mov r8,szCaption
  mov rdx,szText
  xor rcx,rcx // hWnd
  call MessageBoxA
  mov rcx,C8
  call Sleep
  jmp KeyHandlerThread_loop

ExitKeyHandler:
add rsp,28
mov [KeyHandlerOff],2
ret

Might as well want to try applying some Sleep in your code, as it's probably looping too fast?

BR,
Sun
Back to top
View user's profile Send private message
weisbrot
Newbie cheater
Reputation: 0

Joined: 06 Feb 2017
Posts: 19

PostPosted: Mon Feb 06, 2017 6:38 am    Post subject: Reply with quote

SunBeam wrote:
Alright, let's do it this way:

- is the code working as intended with the Mouse keys?
- can you share the program? (if uncertain, do PM me)

Bottom line is I'm using a similar handler in some x64 scripts for various games and the combination of GetAsyncKeyState with wanted key hexa does work.

Example:

Code:
KeyHandlerThread:
sub rsp,28

KeyHandlerThread_loop:
mov rcx,A
call Sleep

cmp [KeyHandlerOff],1
je ExitKeyHandler

  mov rcx,6F // NUM_DIVIDE
  call GetAsyncKeyState
  test ax,ax
  jne short ToggleText

      jmp short KeyHandlerThread_loop

  ToggleText:
  xor r9d,r9d // MB_OK
  mov r8,szCaption
  mov rdx,szText
  xor rcx,rcx // hWnd
  call MessageBoxA
  mov rcx,C8
  call Sleep
  jmp KeyHandlerThread_loop

ExitKeyHandler:
add rsp,28
mov [KeyHandlerOff],2
ret

Might as well want to try applying some Sleep in your code, as it's probably looping too fast?

BR,
Sun


soll replace the code from isenabledh: (the first line) on?
so ill keep the first line?
Back to top
View user's profile Send private message
SunBeam
I post too much
Reputation: 65

Joined: 25 Feb 2005
Posts: 4023
Location: Romania

PostPosted: Mon Feb 06, 2017 6:45 am    Post subject: Reply with quote

As you seem not to know what you're doing, please post the whole code or mention the app's name and the hook you want to apply integrally.
Back to top
View user's profile Send private message
weisbrot
Newbie cheater
Reputation: 0

Joined: 06 Feb 2017
Posts: 19

PostPosted: Mon Feb 06, 2017 7:43 am    Post subject: Reply with quote

SunBeam wrote:
As you seem not to know what you're doing, please post the whole code or mention the app's name and the hook you want to apply integrally.


pmed you Smile
Back to top
View user's profile Send private message
SunBeam
I post too much
Reputation: 65

Joined: 25 Feb 2005
Posts: 4023
Location: Romania

PostPosted: Mon Feb 06, 2017 8:04 am    Post subject: Reply with quote

Haven't received any PMs. Not sure you're allowed till a higher post count?
Back to top
View user's profile Send private message
weisbrot
Newbie cheater
Reputation: 0

Joined: 06 Feb 2017
Posts: 19

PostPosted: Mon Feb 06, 2017 8:09 am    Post subject: Reply with quote

SunBeam wrote:
Haven't received any PMs. Not sure you're allowed till a higher post count?


do you have skype or discord?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 470

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

PostPosted: Mon Feb 06, 2017 9:20 am    Post subject: Reply with quote

SunBeam wrote:
Haven't received any PMs. Not sure you're allowed till a higher post count?

he can't pm you unless you PM him first

_________________
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
weisbrot
Newbie cheater
Reputation: 0

Joined: 06 Feb 2017
Posts: 19

PostPosted: Mon Feb 06, 2017 10:11 am    Post subject: Reply with quote

Dark Byte wrote:
SunBeam wrote:
Haven't received any PMs. Not sure you're allowed till a higher post count?

he can't pm you unless you PM him first


thanks Smile
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