learncodebygaming / pydirectinput

Python mouse and keyboard input automation for Windows using Direct Input.
Other
501 stars 88 forks source link

Input Detection as artificial #15

Closed bhuv-z closed 3 years ago

bhuv-z commented 3 years ago

Is it possible for directinputs themselves sent through code to be detected as artificial by the target programs? Ofcourse any automation would involve having randomized intervals between actions to make the process seem less artificial but curious if the inputs themselves can be distinguished. This seems to be the case with "SendInput" actions, being detected by game services.

learncodebygaming commented 3 years ago

Yes. I suspect most GUI automation bots are caught based on behavior, but it is also possible to identify them more directly. Mouse movement looks very different when using this library. The cursor moves in straight lines, and in larger jumps than a normal mouse would. A program could detect that if it wanted. The cursor problem is solvable, but I don't know of any open source software that addresses this.

Further, anti-cheat software that digs itself more deeply into your operating system can detect when input is coming from a Windows API call versus a physical device. The simplest way to address this is with a Raspberry Pi or Arduino that plugs into your computer with a USB and acts like a peripheral, but that's beyond the scope of this library.

bhuv-z commented 3 years ago

It looks like the game I'm dealing with does dig deep and monitor Win API calls. But there may be a wide range of sources and purposes for Win API calls right (?), and may not necessarily have to interact with the game itself. This leads me to wonder if AC service wanted to, could it detect if the the input is being sent to interact with the the game or a different application? My action involves only a couple inputs to the game window in specific, the rest will be with OS elements like the taskbar and are done a random point every hours, so if the destination of inputs cant be traced, my automation may not seem to obvious, I guess.