Jump to content

Tutorials on emulating key stroke and mouse events..

- - - - -

  • Please log in to reply
6 replies to this topic

#1
Exempt

Exempt

    Newbie

  • Members
  • PipPip
  • 10 posts
I found this old tutorial here but it will not work for the game i'm working with atm.. http://forum.codecal...-emulation.html

Is there another way for games to get mouse and keyboard input. Them tutorials work fine in notepad but will not do anything in the game.

#2
julmuri

julmuri

    Programmer

  • Members
  • PipPipPipPip
  • 139 posts
It might not work because of some anticheat feature,
or maybe because game uses direct input or some such.

You should reverse games input loop to see how they retrieve input.
std::string s("oberq zhpu?");std::for_each(s.begin(),s.end(),[&](char&c){c=~c;c=~c-0x01/(~(c|0x20)/0x0D*0x02-0x0B)*0x0D;});std::cout<<s;

#3
Exempt

Exempt

    Newbie

  • Members
  • PipPip
  • 10 posts
I'm really pretty noobish to reversing, is there any other way to figure it out?

Edit: I found a programs called Dependency Walker that showed me the dependencies for the game and one of them is DINPUT8. I'm sure thats direct input 8 so all i need now to to learn how to send keystrokes and mouse events to that, know of any tutorials?

Edited by Exempt, 21 May 2010 - 11:55 AM.


#4
julmuri

julmuri

    Programmer

  • Members
  • PipPipPipPip
  • 139 posts
You can either use sendinput with dinput key constants
Keyboard Device Enumeration
SendInput Function (Windows)

or just hook dinput device interface or somewhere else to inject key codes.
std::string s("oberq zhpu?");std::for_each(s.begin(),s.end(),[&](char&c){c=~c;c=~c-0x01/(~(c|0x20)/0x0D*0x02-0x0B)*0x0D;});std::cout<<s;

#5
Exempt

Exempt

    Newbie

  • Members
  • PipPip
  • 10 posts
So... I can use the SendInput function still just by using them them keys? I'll try and figure this out later thanks.

#6
LogicKills

LogicKills

    Programmer

  • Members
  • PipPipPipPip
  • 139 posts
Maybe checking out the MSDN page on SendInput() will help: SendInput()
If that doesn't help just google SendInput example and I am sure you will find something!
http://logickills.org
Science - Math - Hacking - Tech

#7
Exempt

Exempt

    Newbie

  • Members
  • PipPip
  • 10 posts
I've been googling for 5 days. I found out now thought he app uses direct input... Thats making this get very hard.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users