Git Product home page Git Product logo

mouclassinputinjection's Introduction

MouClassInputInjection

MouClassInputInjection implements a kernel interface for injecting mouse input data packets into the input data stream of HID USB mouse devices.

Packets injected using this technique are indistinguishable from packets generated by a physical mouse device. For example, mouse events for injected packets are not marked with the LLMHF_INJECTED or LLMHF_LOWER_IL_INJECTED flags.

Projects

MouClassInputInjection

The core driver project which implements the injection interface.

MouiiCL

A command line MouClassInputInjection client which allows users to inject mouse button data and mouse movement data via text commands.

Mouse Device Stacks

A HID USB mouse device has one or more HID USB mouse device stacks in the device tree. These device stacks implement the device interface for reading button data and movement data from the physical mouse device. The number of device stacks required for a mouse device depends on the presence of third party mouse filter drivers. The following image depicts the mouse device stacks for Windows 7 SP1 x64 when no third party filter drivers are active:

There is one HID USB mouse device stack for button data and movement data. All input packets from the physical mouse device are transferred to the data queue contained in the \Device\PointerClass0 device object.

In contrast, the following image depicts the mouse device stacks for Windows 7 SP1 x64 when the VMware vmusbmouse filter driver is active:

There are two HID USB mouse device stacks. The \Device\PointerClass2 device stack receives movement data packets, and the \Device\PointerClass3 device stack receives button data packets. The 'VMware Tools' package installs the vmusbmouse filter driver to smooth mouse movement. This filter driver hooks into the input data stream by modifying the CONNECT_DATA object sent down the mouse movement device stack during device initialization.

Interface

The MouClass Input Injection module defines an interface for injecting mouse button data, mouse movement data, and raw mouse input data packets in a specified process context.

Implementation

The MouClass Input Injection module injects input by invoking a mouse class service callback to copy synthesized packets to the mouse class data queue in the target HID USB mouse device stack. This module uses the MouHid Hook Manager module from the MouHidInputHook project to dynamically resolve the connect data objects for the button device stack and the movement device stack. These objects are contained in a 'device stack context' which must be initialized before the injection interface can be used.

The MouClass Input Injection module registers a PnP notification callback for mouse device interface changes. Each mouse device interface event invalidates the device stack context. This convention ensures that synthesized packets are always injected into the correct data queues using the correct service callbacks.

Related Projects

MouHidInputHook

https://github.com/changeofpace/MouHidInputHook

MouHidInputHook enables users to filter, modify, and inject mouse input data packets into the input data stream of HID USB mouse devices without modifying the mouse device stacks.

Limitations

  • The mouse cursor does not visually update to reflect injected packets for absolute movement when the vmusbmouse filter driver is active.
  • The MouClassInputInjection driver will fail to initialize if the MouHidMonitor logging feature of the MouHidInputHook driver is active.

Notes

  • The MouClassInputInjection project was developed for Windows 7 SP1 x64. Support for other platforms is unknown.
  • The injection strategy is PatchGuard safe.

mouclassinputinjection's People

Contributors

changeofpace avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.