Giter VIP home page Giter VIP logo

diy-mouse's Introduction

Arduino Leonardo Mouse Spoofing Tutorial

Today, I’ll share a method to spoof your Arduino to act like a real mouse. Let’s get started!

Tools and Preparations

  1. USB Device Tree Viewer: Download from here.
  2. Arduino Board Modification: Follow the steps or use this Python script to automate the process.

Important: Make these changes on a PC without Valorant installed. Fully reset Windows afterward to remove any traces left by drivers or files.

Step-by-Step Instructions

1. Identify Mouse Information

  • Use this website to find details about your mouse. Enter your VID and PID.
  • For example, if you have a Logitech mouse, copy "Logitech, Inc."

2. Edit boards.txt

  • Go to your boards.txt file and add the following lines at the end:

    leonardo.build.core=arduino
    leonardo.build.variant=leonardo
    leonardo.build.extra_flags={build.usb_flags}
    leonardo.build.usb_manufacturer="Logitech, Inc."
  • Save and re-upload your script.

3. Modify USB Descriptors

  • Navigate to:

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino
  • Open USBcore.cpp with Notepad++ and go to line 44. Update it to match your mouse’s VID and manufacturer:

    // Example update

4. Change Serial Number (Optional)

  • In USBcore.cpp at line 71, update it if your mouse has specific serial values:

    0xEF = Device class
    0x02 = Device subclass
    0x01 = Device protocol
    0x100 = Version number (bcdDevice)
    Iserial = serial number

5. Adjust Power Consumption

  • Open USBcore.h at line 101 and modify the power consumption to match your real mouse:

    // Example adjustment

6. Use External Power Supply

So your pc turning on routine will be like this

Connect adapter to Arduino => power on the adapter => wait 10 seconds => connect Arduino via USB to pc => turn on your pc but keep both the usb and adapter connected all the time => you're good to go but to trigger the bootloader you will have to use the button on Arduino```

7. Secure Your Script

  • If distributing, send a hex file instead of the sketch file for security.
  • Use a hash changer for your .exe to enhance security.

Fully Disable COM Port and Use HID Mouse

Requirements

  • Brain
  • Arduino Leonardo
  • USB Host Shield
  • Notepad++
  • Backup system restore

Steps

  1. Backup Your System: Create a system restore point.

  2. Open USBCore.cpp in Notepad++: Navigate to:

    C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino
  3. Modify ClassInterfaceRequest:

    • Around line 373, comment out the CDC_ACM_INTERFACE check:

      // if (CDC_ACM_INTERFACE == i)
      //     return CDC_Setup(setup);
  4. Modify SendInterfaces:

    • Around line 65, comment out the CDC_GetInterface line:

      // CDC_GetInterface(&interfaces);
  5. Save Changes: Save USBCore.cpp.

  6. Update boards.txt:

    • Add the following line at the end of the section for the Leonardo board:

      leonardo.build.extra_flags={build.usb_flags} -DCDC_DISABLED
  7. Configure Arduino IDE:

    • Open Arduino IDE (version 1.8.9).
    • Go to File > Preferences.
    • Check "Show verbose output during: compilation" and "upload".
  8. Upload .hex File:

    • Place the necessary library file in:

      C:\Program Files (x86)\Arduino\hardware\tools\avr\bin
    • Open Command Prompt as administrator and run:

      cd C:\Program Files (x86)\Arduino\hardware\tools\avr\bin
    • Select and upload the .hex file. If you see "avrdude.exe done. thank you.", everything went smoothly.


Conclusion

If you have any questions, feel free to ask. I can also show you how to use HID and fully turn off your COM port. Have a great day!

diy-mouse's People

Contributors

jpshag avatar

Stargazers

 avatar  avatar

Watchers

 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.